Documentation ¶
Index ¶
- Constants
- Variables
- func IsNotFound(err error) bool
- func NftExePath() string
- type Chain
- func (this *Chain) AddAcceptIPv4Rule(ip []byte, userData []byte) (*Rule, error)
- func (this *Chain) AddAcceptIPv4SetRule(setName string, userData []byte) (*Rule, error)
- func (this *Chain) AddAcceptIPv6Rule(ip []byte, userData []byte) (*Rule, error)
- func (this *Chain) AddAcceptIPv6SetRule(setName string, userData []byte) (*Rule, error)
- func (this *Chain) AddAcceptInterfaceRule(interfaceName string, userData []byte) (*Rule, error)
- func (this *Chain) AddDropIPv4Rule(ip []byte, userData []byte) (*Rule, error)
- func (this *Chain) AddDropIPv4SetRule(setName string, userData []byte) (*Rule, error)
- func (this *Chain) AddDropIPv6Rule(ip []byte, userData []byte) (*Rule, error)
- func (this *Chain) AddDropIPv6SetRule(setName string, userData []byte) (*Rule, error)
- func (this *Chain) AddRejectIPv4Rule(ip []byte, userData []byte) (*Rule, error)
- func (this *Chain) AddRejectIPv4SetRule(setName string, userData []byte) (*Rule, error)
- func (this *Chain) AddRejectIPv6Rule(ip []byte, userData []byte) (*Rule, error)
- func (this *Chain) AddRejectIPv6SetRule(setName string, userData []byte) (*Rule, error)
- func (this *Chain) AddRule(options *RuleOptions) (*Rule, error)
- func (this *Chain) DeleteRule(rule *Rule) error
- func (this *Chain) Flush() error
- func (this *Chain) GetRuleWithUserData(userData []byte) (*Rule, error)
- func (this *Chain) GetRules() ([]*Rule, error)
- func (this *Chain) Name() string
- func (this *Chain) Raw() *nft.Chain
- type ChainPolicy
- type Conn
- func (this *Conn) AddIPv4Table(name string) (*Table, error)
- func (this *Conn) AddIPv6Table(name string) (*Table, error)
- func (this *Conn) AddTable(name string, family TableFamily) (*Table, error)
- func (this *Conn) Commit() error
- func (this *Conn) DeleteTable(name string, family TableFamily) error
- func (this *Conn) GetTable(name string, family TableFamily) (*Table, error)
- func (this *Conn) Raw() *nft.Conn
- type Element
- type ElementOptions
- type Expiration
- type Installer
- type Rule
- type RuleOptions
- type Set
- func (this *Set) AddElement(key []byte, options *ElementOptions, overwrite bool) error
- func (this *Set) AddIPElement(ip string, options *ElementOptions, overwrite bool) error
- func (this *Set) Batch() *SetBatch
- func (this *Set) DeleteElement(key []byte) error
- func (this *Set) DeleteIPElement(ip string) error
- func (this *Set) GetIPElements() ([]string, error)
- func (this *Set) Name() string
- func (this *Set) Raw() *nft.Set
- type SetBatch
- type SetDataType
- type SetOptions
- type Table
- func (this *Table) AddAcceptChain(name string) (*Chain, error)
- func (this *Table) AddChain(name string, chainPolicy *ChainPolicy) (*Chain, error)
- func (this *Table) AddDropChain(name string) (*Chain, error)
- func (this *Table) AddSet(name string, options *SetOptions) (*Set, error)
- func (this *Table) DeleteChain(name string) error
- func (this *Table) DeleteSet(name string) error
- func (this *Table) Family() TableFamily
- func (this *Table) Flush() error
- func (this *Table) GetChain(name string) (*Chain, error)
- func (this *Table) GetSet(name string) (*Set, error)
- func (this *Table) Name() string
- func (this *Table) Raw() *nft.Table
- type TableFamily
Constants ¶
View Source
const ( ChainPolicyDrop = nft.ChainPolicyDrop ChainPolicyAccept = nft.ChainPolicyAccept )
Possible ChainPolicy values.
View Source
const MaxChainNameLength = 31
View Source
const MaxSetNameLength = 15
View Source
const MaxTableNameLength = 27
Variables ¶
View Source
var ( TypeInvalid = nft.TypeInvalid TypeVerdict = nft.TypeVerdict TypeNFProto = nft.TypeNFProto TypeBitmask = nft.TypeBitmask TypeInteger = nft.TypeInteger TypeString = nft.TypeString TypeLLAddr = nft.TypeLLAddr TypeIPAddr = nft.TypeIPAddr TypeIP6Addr = nft.TypeIP6Addr TypeEtherAddr = nft.TypeEtherAddr TypeEtherType = nft.TypeEtherType TypeARPOp = nft.TypeARPOp TypeInetProto = nft.TypeInetProto TypeInetService = nft.TypeInetService TypeICMPType = nft.TypeICMPType TypeTCPFlag = nft.TypeTCPFlag TypeDCCPPktType = nft.TypeDCCPPktType TypeMHType = nft.TypeMHType TypeTime = nft.TypeTime TypeMark = nft.TypeMark TypeIFIndex = nft.TypeIFIndex TypeARPHRD = nft.TypeARPHRD TypeRealm = nft.TypeRealm TypeClassID = nft.TypeClassID TypeUID = nft.TypeUID TypeGID = nft.TypeGID TypeCTState = nft.TypeCTState TypeCTDir = nft.TypeCTDir TypeCTStatus = nft.TypeCTStatus TypeICMP6Type = nft.TypeICMP6Type TypeCTLabel = nft.TypeCTLabel TypePktType = nft.TypePktType TypeICMPCode = nft.TypeICMPCode TypeICMPV6Code = nft.TypeICMPV6Code TypeICMPXCode = nft.TypeICMPXCode TypeDevGroup = nft.TypeDevGroup TypeDSCP = nft.TypeDSCP TypeECN = nft.TypeECN TypeFIBAddr = nft.TypeFIBAddr TypeBoolean = nft.TypeBoolean TypeCTEventBit = nft.TypeCTEventBit TypeIFName = nft.TypeIFName TypeIGMPType = nft.TypeIGMPType TypeTimeDate = nft.TypeTimeDate TypeTimeHour = nft.TypeTimeHour TypeTimeDay = nft.TypeTimeDay TypeCGroupV2 = nft.TypeCGroupV2 )
View Source
var ErrChainNotFound = errors.New("chain not found")
View Source
var ErrRuleNotFound = errors.New("rule not found")
View Source
var ErrSetNotFound = errors.New("set not found")
View Source
var ErrTableNotFound = errors.New("table not found")
Functions ¶
func IsNotFound ¶
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain chain object in table
func (*Chain) AddAcceptIPv4Rule ¶
func (*Chain) AddAcceptIPv4SetRule ¶
func (*Chain) AddAcceptIPv6Rule ¶
func (*Chain) AddAcceptIPv6SetRule ¶
func (*Chain) AddAcceptInterfaceRule ¶
func (*Chain) AddDropIPv4Rule ¶
func (*Chain) AddDropIPv4SetRule ¶
func (*Chain) AddDropIPv6Rule ¶
func (*Chain) AddDropIPv6SetRule ¶
func (*Chain) AddRejectIPv4Rule ¶
func (*Chain) AddRejectIPv4SetRule ¶
func (*Chain) AddRejectIPv6Rule ¶
func (*Chain) AddRejectIPv6SetRule ¶
func (*Chain) DeleteRule ¶
func (*Chain) GetRuleWithUserData ¶
type ChainPolicy ¶
type ChainPolicy = nft.ChainPolicy
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) DeleteTable ¶
func (this *Conn) DeleteTable(name string, family TableFamily) error
type ElementOptions ¶
type Expiration ¶ added in v1.0.4
type Expiration struct {
// contains filtered or unexported fields
}
func NewExpiration ¶ added in v1.0.4
func NewExpiration() *Expiration
func (*Expiration) AddUnsafe ¶ added in v1.0.4
func (this *Expiration) AddUnsafe(key []byte, expires time.Time)
func (*Expiration) Contains ¶ added in v1.0.4
func (this *Expiration) Contains(key []byte) bool
func (*Expiration) Remove ¶ added in v1.0.4
func (this *Expiration) Remove(key []byte)
type Installer ¶ added in v0.5.3
type Installer struct { }
func NewInstaller ¶ added in v0.5.3
func NewInstaller() *Installer
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
func (*Rule) LookupSetName ¶
func (*Rule) VerDict ¶
func (this *Rule) VerDict() expr.VerdictKind
type RuleOptions ¶
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
func (*Set) AddElement ¶
func (this *Set) AddElement(key []byte, options *ElementOptions, overwrite bool) error
func (*Set) AddIPElement ¶
func (this *Set) AddIPElement(ip string, options *ElementOptions, overwrite bool) error
func (*Set) DeleteElement ¶
func (*Set) DeleteIPElement ¶
func (*Set) GetIPElements ¶
type SetBatch ¶
type SetBatch struct {
// contains filtered or unexported fields
}
func (*SetBatch) AddElement ¶
func (this *SetBatch) AddElement(key []byte, options *ElementOptions) error
func (*SetBatch) DeleteElement ¶
type SetDataType ¶
type SetDataType = nft.SetDatatype
type SetOptions ¶
type SetOptions struct { Id uint32 HasTimeout bool Timeout time.Duration KeyType SetDataType DataType SetDataType Constant bool Interval bool Anonymous bool IsMap bool }
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) AddChain ¶
func (this *Table) AddChain(name string, chainPolicy *ChainPolicy) (*Chain, error)
func (*Table) DeleteChain ¶
func (*Table) Family ¶
func (this *Table) Family() TableFamily
type TableFamily ¶
type TableFamily = nft.TableFamily
const ( TableFamilyINet TableFamily = nft.TableFamilyINet TableFamilyIPv4 TableFamily = nft.TableFamilyIPv4 TableFamilyIPv6 TableFamily = nft.TableFamilyIPv6 TableFamilyARP TableFamily = nft.TableFamilyARP TableFamilyNetdev TableFamily = nft.TableFamilyNetdev TableFamilyBridge TableFamily = nft.TableFamilyBridge )
Click to show internal directories.
Click to hide internal directories.