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

Method AddDropIPv6Rule

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

Source from the content-addressed store, hash-verified

121}
122
123func (this *Chain) AddDropIPv6Rule(ip []byte, userData []byte) (*Rule, error) {
124 return this.AddRule(&RuleOptions{
125 Exprs: []expr.Any{
126 &expr.Payload{
127 DestRegister: 1,
128 Base: expr.PayloadBaseNetworkHeader,
129 Offset: 8,
130 Len: 16,
131 },
132 &expr.Cmp{
133 Op: expr.CmpOpEq,
134 Register: 1,
135 Data: ip,
136 },
137 &expr.Verdict{
138 Kind: expr.VerdictDrop,
139 },
140 },
141 UserData: userData,
142 })
143}
144
145func (this *Chain) AddRejectIPv4Rule(ip []byte, userData []byte) (*Rule, error) {
146 return this.AddRule(&RuleOptions{

Callers

nothing calls this directly

Calls 1

AddRuleMethod · 0.95

Tested by

no test coverage detected