()
| 344 | } |
| 345 | |
| 346 | func (this *Chain) GetRules() ([]*Rule, error) { |
| 347 | rawRules, err := this.conn.Raw().GetRule(this.rawTable, this.rawChain) |
| 348 | if err != nil { |
| 349 | return nil, err |
| 350 | } |
| 351 | var result = []*Rule{} |
| 352 | for _, rawRule := range rawRules { |
| 353 | result = append(result, NewRule(rawRule)) |
| 354 | } |
| 355 | return result, nil |
| 356 | } |
| 357 | |
| 358 | func (this *Chain) DeleteRule(rule *Rule) error { |
| 359 | err := this.conn.Raw().DelRule(rule.Raw()) |