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

Method AddAcceptIPv6Rule

internal/firewalls/nftables/chain.go:79–99  ·  view source on GitHub ↗
(ip []byte, userData []byte)

Source from the content-addressed store, hash-verified

77}
78
79func (this *Chain) AddAcceptIPv6Rule(ip []byte, userData []byte) (*Rule, error) {
80 return this.AddRule(&RuleOptions{
81 Exprs: []expr.Any{
82 &expr.Payload{
83 DestRegister: 1,
84 Base: expr.PayloadBaseNetworkHeader,
85 Offset: 8,
86 Len: 16,
87 },
88 &expr.Cmp{
89 Op: expr.CmpOpEq,
90 Register: 1,
91 Data: ip,
92 },
93 &expr.Verdict{
94 Kind: expr.VerdictAccept,
95 },
96 },
97 UserData: userData,
98 })
99}
100
101func (this *Chain) AddDropIPv4Rule(ip []byte, userData []byte) (*Rule, error) {
102 return this.AddRule(&RuleOptions{

Callers

nothing calls this directly

Calls 1

AddRuleMethod · 0.95

Tested by

no test coverage detected