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

Method AddRejectIPv4Rule

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

Source from the content-addressed store, hash-verified

143}
144
145func (this *Chain) AddRejectIPv4Rule(ip []byte, userData []byte) (*Rule, error) {
146 return this.AddRule(&RuleOptions{
147 Exprs: []expr.Any{
148 &expr.Payload{
149 DestRegister: 1,
150 Base: expr.PayloadBaseNetworkHeader,
151 Offset: 12,
152 Len: 4,
153 },
154 &expr.Cmp{
155 Op: expr.CmpOpEq,
156 Register: 1,
157 Data: ip,
158 },
159 &expr.Reject{},
160 },
161 UserData: userData,
162 })
163}
164
165func (this *Chain) AddRejectIPv6Rule(ip []byte, userData []byte) (*Rule, error) {
166 return this.AddRule(&RuleOptions{

Callers

nothing calls this directly

Calls 1

AddRuleMethod · 0.95

Tested by

no test coverage detected