Composed set (#78)

This commit is contained in:
Serguei Bezverkhi 2019-12-01 04:10:42 -05:00 committed by Michael Stapelberg
parent 9dee196925
commit 4f16059f2d
1 changed files with 11 additions and 1 deletions

12
set.go
View File

@ -39,9 +39,19 @@ type SetDatatype struct {
nftMagic uint32
}
// GetNFTMagic returns a custom datatype based on user's parameters
func (s *SetDatatype) GetNFTMagic() uint32 {
return s.nftMagic
}
// SetNFTMagic returns a custom datatype based on user's parameters
func (s *SetDatatype) SetNFTMagic(nftMagic uint32) {
s.nftMagic = nftMagic
}
// NFT datatypes. See: https://git.netfilter.org/nftables/tree/src/datatype.c
var (
TypeInvalid = SetDatatype{Name: "invalid", nftMagic: 1}
TypeInvalid = SetDatatype{Name: "invalid", nftMagic: 0}
TypeVerdict = SetDatatype{Name: "verdict", Bytes: 0, nftMagic: 1}
TypeInteger = SetDatatype{Name: "integer", Bytes: 4, nftMagic: 4}
TypeIPAddr = SetDatatype{Name: "ipv4_addr", Bytes: 4, nftMagic: 7}