查找所有规则
(filter *nftablesTableDefinition)
| 497 | |
| 498 | // 查找所有规则 |
| 499 | func (this *DDoSProtectionManager) getRules(filter *nftablesTableDefinition) (*nftables.Chain, []*nftables.Rule, error) { |
| 500 | table, err := this.getTable(filter) |
| 501 | if err != nil { |
| 502 | return nil, nil, fmt.Errorf("get table failed: %w", err) |
| 503 | } |
| 504 | chain, err := table.GetChain(nftablesChainName) |
| 505 | if err != nil { |
| 506 | return nil, nil, fmt.Errorf("get chain failed: %w", err) |
| 507 | } |
| 508 | rules, err := chain.GetRules() |
| 509 | return chain, rules, err |
| 510 | } |
| 511 | |
| 512 | // 更新白名单 |
| 513 | func (this *DDoSProtectionManager) updateAllowIPList(allIPList []string) error { |
no test coverage detected