-
Notifications
You must be signed in to change notification settings - Fork 11
/
nftables_conn_api.go
29 lines (27 loc) · 988 Bytes
/
nftables_conn_api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package nftableslib
import (
"github.com/google/nftables"
)
// NetNS defines interface needed to nf tables
type NetNS interface {
Flush() error
FlushRuleset()
AddTable(*nftables.Table) *nftables.Table
DelTable(*nftables.Table)
ListTables() ([]*nftables.Table, error)
AddChain(*nftables.Chain) *nftables.Chain
DelChain(*nftables.Chain)
ListChains() ([]*nftables.Chain, error)
AddRule(*nftables.Rule) *nftables.Rule
InsertRule(*nftables.Rule) *nftables.Rule
ReplaceRule(*nftables.Rule) *nftables.Rule
DelRule(*nftables.Rule) error
GetRule(*nftables.Table, *nftables.Chain) ([]*nftables.Rule, error)
AddSet(*nftables.Set, []nftables.SetElement) error
DelSet(*nftables.Set)
GetSets(*nftables.Table) ([]*nftables.Set, error)
GetSetByName(*nftables.Table, string) (*nftables.Set, error)
GetSetElements(*nftables.Set) ([]nftables.SetElement, error)
SetAddElements(*nftables.Set, []nftables.SetElement) error
SetDeleteElements(*nftables.Set, []nftables.SetElement) error
}