add interval flag support to set (#43)

Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
This commit is contained in:
Serguei Bezverkhi 2019-08-08 01:45:20 -04:00 committed by Michael Stapelberg
parent 9907ca3831
commit 26de8f0eaa
1 changed files with 4 additions and 0 deletions

4
set.go
View File

@ -63,6 +63,7 @@ type Set struct {
Name string Name string
Anonymous bool Anonymous bool
Constant bool Constant bool
Interval bool
KeyType SetDatatype KeyType SetDatatype
DataLen int DataLen int
@ -161,6 +162,9 @@ func (cc *Conn) AddSet(s *Set, vals []SetElement) error {
if s.Constant { if s.Constant {
flags |= unix.NFT_SET_CONSTANT flags |= unix.NFT_SET_CONSTANT
} }
if s.Interval {
flags |= unix.NFT_SET_INTERVAL
}
if s.DataLen > 0 { if s.DataLen > 0 {
flags |= unix.NFT_SET_MAP flags |= unix.NFT_SET_MAP
} }