MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / GetChain

Method GetChain

internal/firewalls/nftables/table.go:37–49  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

35}
36
37func (this *Table) GetChain(name string) (*Chain, error) {
38 rawChains, err := this.conn.Raw().ListChains()
39 if err != nil {
40 return nil, err
41 }
42 for _, rawChain := range rawChains {
43 // must compare table name
44 if rawChain.Name == name && rawChain.Table.Name == this.rawTable.Name {
45 return NewChain(this.conn, this.rawTable, rawChain), nil
46 }
47 }
48 return nil, ErrChainNotFound
49}
50
51func (this *Table) AddChain(name string, chainPolicy *ChainPolicy) (*Chain, error) {
52 if len(name) > MaxChainNameLength {

Callers 5

DeleteChainMethod · 0.95
getRulesMethod · 0.80
initMethod · 0.80
getIPv4ChainFunction · 0.80
TestTable_GetChainFunction · 0.80

Calls 2

NewChainFunction · 0.85
RawMethod · 0.45

Tested by 2

getIPv4ChainFunction · 0.64
TestTable_GetChainFunction · 0.64