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

Method AddRule

internal/firewalls/nftables/chain.go:43–55  ·  view source on GitHub ↗
(options *RuleOptions)

Source from the content-addressed store, hash-verified

41}
42
43func (this *Chain) AddRule(options *RuleOptions) (*Rule, error) {
44 var rawRule = this.conn.Raw().AddRule(&nft.Rule{
45 Table: this.rawTable,
46 Chain: this.rawChain,
47 Exprs: options.Exprs,
48 UserData: options.UserData,
49 })
50 err := this.conn.Commit()
51 if err != nil {
52 return nil, err
53 }
54 return NewRule(rawRule), nil
55}
56
57func (this *Chain) AddAcceptIPv4Rule(ip []byte, userData []byte) (*Rule, error) {
58 return this.AddRule(&RuleOptions{

Callers 13

AddAcceptIPv4RuleMethod · 0.95
AddAcceptIPv6RuleMethod · 0.95
AddDropIPv4RuleMethod · 0.95
AddDropIPv6RuleMethod · 0.95
AddRejectIPv4RuleMethod · 0.95
AddRejectIPv6RuleMethod · 0.95
AddAcceptIPv4SetRuleMethod · 0.95
AddAcceptIPv6SetRuleMethod · 0.95
AddDropIPv4SetRuleMethod · 0.95
AddDropIPv6SetRuleMethod · 0.95
AddRejectIPv4SetRuleMethod · 0.95
AddRejectIPv6SetRuleMethod · 0.95

Calls 3

NewRuleFunction · 0.70
RawMethod · 0.45
CommitMethod · 0.45

Tested by

no test coverage detected