| 1022 | } |
| 1023 | |
| 1024 | void |
| 1025 | table_rule_add_bulk(struct table *table, |
| 1026 | struct table_rule_list *list, |
| 1027 | uint32_t n_rules) |
| 1028 | { |
| 1029 | uint32_t i; |
| 1030 | |
| 1031 | for (i = 0; i < n_rules; i++) { |
| 1032 | struct table_rule *existing_rule, *new_rule; |
| 1033 | |
| 1034 | new_rule = TAILQ_FIRST(list); |
| 1035 | if (new_rule == NULL) |
| 1036 | break; |
| 1037 | |
| 1038 | TAILQ_REMOVE(list, new_rule, node); |
| 1039 | |
| 1040 | existing_rule = table_rule_find(table, &new_rule->match); |
| 1041 | if (existing_rule == NULL) |
| 1042 | TAILQ_INSERT_TAIL(&table->rules, new_rule, node); |
| 1043 | else { |
| 1044 | TAILQ_INSERT_AFTER(&table->rules, existing_rule, new_rule, node); |
| 1045 | TAILQ_REMOVE(&table->rules, existing_rule, node); |
| 1046 | free(existing_rule); |
| 1047 | } |
| 1048 | } |
| 1049 | } |
| 1050 | |
| 1051 | void |
| 1052 | table_rule_delete(struct table *table, |
no test coverage detected