| 225 | } |
| 226 | |
| 227 | func (this *Chain) AddDropIPv4SetRule(setName string, userData []byte) (*Rule, error) { |
| 228 | return this.AddRule(&RuleOptions{ |
| 229 | Exprs: []expr.Any{ |
| 230 | &expr.Payload{ |
| 231 | DestRegister: 1, |
| 232 | Base: expr.PayloadBaseNetworkHeader, |
| 233 | Offset: 12, |
| 234 | Len: 4, |
| 235 | }, |
| 236 | &expr.Lookup{ |
| 237 | SourceRegister: 1, |
| 238 | SetName: setName, |
| 239 | }, |
| 240 | &expr.Verdict{ |
| 241 | Kind: expr.VerdictDrop, |
| 242 | }, |
| 243 | }, |
| 244 | UserData: userData, |
| 245 | }) |
| 246 | } |
| 247 | |
| 248 | func (this *Chain) AddDropIPv6SetRule(setName string, userData []byte) (*Rule, error) { |
| 249 | return this.AddRule(&RuleOptions{ |