int network_verify(Network *network) {
RoutePrefix *route_prefix, *route_prefix_next;
- RoutingPolicyRule *rule;
Neighbor *neighbor, *neighbor_next;
AddressLabel *label, *label_next;
NextHop *nexthop, *nextnop_next;
if (section_is_invalid(route_prefix->section))
route_prefix_free(route_prefix);
- HASHMAP_FOREACH(rule, network->rules_by_section)
- if (routing_policy_rule_section_verify(rule) < 0)
- routing_policy_rule_free(rule);
+ network_verify_routing_policy_rules(network);
bool has_root = false, has_clsact = false;
ORDERED_HASHMAP_FOREACH(tc, network->tc_by_section)
return 0;
}
-int routing_policy_rule_section_verify(RoutingPolicyRule *rule) {
+static int routing_policy_rule_section_verify(RoutingPolicyRule *rule) {
if (section_is_invalid(rule->section))
return -EINVAL;
return 0;
}
+void network_verify_routing_policy_rules(Network *network) {
+ RoutingPolicyRule *rule;
+
+ assert(network);
+
+ HASHMAP_FOREACH(rule, network->rules_by_section)
+ if (routing_policy_rule_section_verify(rule) < 0)
+ routing_policy_rule_free(rule);
+}
+
int routing_policy_serialize_rules(Set *rules, FILE *f) {
RoutingPolicyRule *rule;
int r;
} RoutingPolicyRule;
RoutingPolicyRule *routing_policy_rule_free(RoutingPolicyRule *rule);
-int routing_policy_rule_section_verify(RoutingPolicyRule *rule);
+
+void network_verify_routing_policy_rules(Network *network);
int link_set_routing_policy_rules(Link *link);