Documentation
¶
Index ¶
- type Action
- type Batch
- func (b *Batch) Add(msg nftnl.Msg)
- func (b *Batch) AddSetElements(setElemL *nftnl.SetElemListAttrs) error
- func (b *Batch) Clear()
- func (b *Batch) DelChain(chain *Chain) error
- func (b *Batch) DelRule(rule *Rule) error
- func (b *Batch) DelTable(table *Table) error
- func (b *Batch) FlushRuleset()
- func (b *Batch) FlushTable(table *Table) error
- func (b *Batch) NewChain(chain *Chain) error
- func (b *Batch) NewID() uint32
- func (b *Batch) NewRule(rule *Rule) error
- func (b *Batch) NewTable(table *Table) error
- type Chain
- type ChainPolicy
- type ChainType
- type Config
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) GetChain(chain *Chain) (*Chain, error)
- func (c *Conn) GetChains(table *Table) ([]*Chain, error)
- func (c *Conn) GetRule(rule *Rule) (*Rule, error)
- func (c *Conn) GetRules(chain *Chain) ([]*Rule, error)
- func (c *Conn) GetTable(table *Table) (*Table, error)
- func (c *Conn) GetTables(family uint8) ([]*Table, error)
- func (c *Conn) SendBatch(b *Batch) error
- type Counter
- type CtMatch
- type CtState
- type Family
- type Hook
- type IPMatch
- type PortMatch
- type Quota
- type Rule
- type Set
- type SetElem
- type Table
- type TableFlags
- type Verdict
- type VerdictCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) AddSetElements ¶
func (b *Batch) AddSetElements(setElemL *nftnl.SetElemListAttrs) error
func (*Batch) FlushRuleset ¶
func (b *Batch) FlushRuleset()
func (*Batch) FlushTable ¶
type ChainPolicy ¶
type ChainPolicy uint8
const ( ChainPolicyAccept ChainPolicy = 0x1 ChainPolicyDrop ChainPolicy = 0x2 ChainPolicyContinue ChainPolicy = 0x3 )
type Config ¶
type Config struct {
// NetNS is the network namespace to operate in. If 0, the current
// network namespace is used.
NetNS int
}
type CtState ¶
type CtState uint32
var ( CtStateInvalid CtState = unixext.NF_CT_STATE_INVALID_BIT CtStateEstablished CtState = CtState(unixext.NfCtStateBit(unixext.IP_CT_ESTABLISHED)) CtStateRelated CtState = CtState(unixext.NfCtStateBit(unixext.IP_CT_RELATED)) CtStateNew CtState = CtState(unixext.NfCtStateBit(unixext.IP_CT_NEW)) CtStateUntracked CtState = unixext.NF_CT_STATE_UNTRACKED_BIT )
type Family ¶
type Family uint8
const ( FamilyUnspec Family = unix.NFPROTO_UNSPEC FamilyIPv4 Family = unix.NFPROTO_IPV4 FamilyIPv6 Family = unix.NFPROTO_IPV6 FamilyInet Family = unix.NFPROTO_INET FamilyARP Family = unix.NFPROTO_ARP FamilyNetdev Family = unix.NFPROTO_NETDEV FamilyBridge Family = unix.NFPROTO_BRIDGE )
type Hook ¶
type Hook uint8
const ( HookPrerouting Hook = unix.NF_INET_PRE_ROUTING HookInput Hook = unix.NF_INET_LOCAL_IN HookForward Hook = unix.NF_INET_FORWARD HookOutput Hook = unix.NF_INET_LOCAL_OUT HookPostrouting Hook = unix.NF_INET_POST_ROUTING HookNumhooks Hook = unix.NF_INET_NUMHOOKS HookIngress Hook = unix.NF_INET_NUMHOOKS )
type Rule ¶
type Rule struct {
Family uint8
ID uint32
Table string
Chain string
ChainID uint32
Handle uint64
L3Proto uint8
L4Proto uint8
IIface string
OIface string
SrcIPv4 *IPMatch
DstIPv4 *IPMatch
SrcIPv6 *IPMatch
DstIPv6 *IPMatch
SrcPort *PortMatch
DstPort *PortMatch
Ct *CtMatch
Counter *Counter
Quota *Quota
Action *Action
}
type TableFlags ¶
type TableFlags uint32
const ( TableFlagDormant TableFlags = unix.NFT_TABLE_F_DORMANT TableFlagOwner TableFlags = unixext.NFT_TABLE_F_OWNER TableFlagPersist TableFlags = unixext.NFT_TABLE_F_PERSIST )
type Verdict ¶
type Verdict struct {
Code VerdictCode
Chain string
ChainID uint32
}
type VerdictCode ¶
type VerdictCode int32
const ( VerdictCodeContinue VerdictCode = unix.NFT_CONTINUE VerdictCodeBreak VerdictCode = unix.NFT_BREAK VerdictCodeJump VerdictCode = unix.NFT_JUMP VerdictCodeGoto VerdictCode = unix.NFT_GOTO VerdictCodeReturn VerdictCode = unix.NFT_RETURN VerdictCodeDrop VerdictCode = unixext.NF_DROP VerdictCodeAccept VerdictCode = unixext.NF_ACCEPT VerdictCodeQueue VerdictCode = unixext.NF_QUEUE VerdictCodeRepeat VerdictCode = unixext.NF_REPEAT )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package nftnl provices a low-level API for interacting with nftables via netlink messages in pure Go.
|
Package nftnl provices a low-level API for interacting with nftables via netlink messages in pure Go. |
|
Package uniext provides Linux-specific extensions to the unix package which are not available in the standard library but are relevant for nftables operations.
|
Package uniext provides Linux-specific extensions to the unix package which are not available in the standard library but are relevant for nftables operations. |
Click to show internal directories.
Click to hide internal directories.