(options *RuleOptions)
| 41 | } |
| 42 | |
| 43 | func (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 | |
| 57 | func (this *Chain) AddAcceptIPv4Rule(ip []byte, userData []byte) (*Rule, error) { |
| 58 | return this.AddRule(&RuleOptions{ |
no test coverage detected