diff options
author | David Lamparter <equinox@diac24.net> | 2019-11-20 17:20:58 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2019-11-30 00:38:32 +0100 |
commit | 364deb0487600073aca8396ed80e35da589f3eca (patch) | |
tree | eac52048c0bea7a698bc16f2410668c2c72cc438 /ospfd | |
parent | lib: make cmd_element & qobj_type const (diff) | |
download | frr-364deb0487600073aca8396ed80e35da589f3eca.tar.xz frr-364deb0487600073aca8396ed80e35da589f3eca.zip |
*: make all route_map_rule_cmd const
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_routemap.c | 78 |
1 files changed, 52 insertions, 26 deletions
diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c index 1669c817e..c89fd3597 100644 --- a/ospfd/ospf_routemap.c +++ b/ospfd/ospf_routemap.c @@ -164,9 +164,12 @@ static void route_match_ip_nexthop_free(void *rule) } /* Route map commands for metric matching. */ -struct route_map_rule_cmd route_match_ip_nexthop_cmd = { - "ip next-hop", route_match_ip_nexthop, route_match_ip_nexthop_compile, - route_match_ip_nexthop_free}; +static const struct route_map_rule_cmd route_match_ip_nexthop_cmd = { + "ip next-hop", + route_match_ip_nexthop, + route_match_ip_nexthop_compile, + route_match_ip_nexthop_free +}; /* `match ip next-hop prefix-list PREFIX_LIST' */ @@ -204,10 +207,13 @@ static void route_match_ip_next_hop_prefix_list_free(void *rule) XFREE(MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = { - "ip next-hop prefix-list", route_match_ip_next_hop_prefix_list, +static const struct route_map_rule_cmd + route_match_ip_next_hop_prefix_list_cmd = { + "ip next-hop prefix-list", + route_match_ip_next_hop_prefix_list, route_match_ip_next_hop_prefix_list_compile, - route_match_ip_next_hop_prefix_list_free}; + route_match_ip_next_hop_prefix_list_free +}; /* `match ip next-hop type <blackhole>' */ @@ -238,10 +244,13 @@ static void route_match_ip_next_hop_type_free(void *rule) XFREE(MTYPE_ROUTE_MAP_COMPILED, rule); } -static struct route_map_rule_cmd route_match_ip_next_hop_type_cmd = { - "ip next-hop type", route_match_ip_next_hop_type, +static const struct route_map_rule_cmd + route_match_ip_next_hop_type_cmd = { + "ip next-hop type", + route_match_ip_next_hop_type, route_match_ip_next_hop_type_compile, - route_match_ip_next_hop_type_free}; + route_match_ip_next_hop_type_free +}; /* `match ip address IP_ACCESS_LIST' */ /* Match function should return 1 if match is success else return @@ -279,9 +288,12 @@ static void route_match_ip_address_free(void *rule) } /* Route map commands for ip address matching. */ -struct route_map_rule_cmd route_match_ip_address_cmd = { - "ip address", route_match_ip_address, route_match_ip_address_compile, - route_match_ip_address_free}; +static const struct route_map_rule_cmd route_match_ip_address_cmd = { + "ip address", + route_match_ip_address, + route_match_ip_address_compile, + route_match_ip_address_free +}; /* `match ip address prefix-list PREFIX_LIST' */ static enum route_map_cmd_result_t @@ -312,10 +324,13 @@ static void route_match_ip_address_prefix_list_free(void *rule) XFREE(MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = { - "ip address prefix-list", route_match_ip_address_prefix_list, +static const struct route_map_rule_cmd + route_match_ip_address_prefix_list_cmd = { + "ip address prefix-list", + route_match_ip_address_prefix_list, route_match_ip_address_prefix_list_compile, - route_match_ip_address_prefix_list_free}; + route_match_ip_address_prefix_list_free +}; /* `match interface IFNAME' */ /* Match function should return 1 if match is success else return @@ -353,9 +368,12 @@ static void route_match_interface_free(void *rule) } /* Route map commands for ip address matching. */ -struct route_map_rule_cmd route_match_interface_cmd = { - "interface", route_match_interface, route_match_interface_compile, - route_match_interface_free}; +static const struct route_map_rule_cmd route_match_interface_cmd = { + "interface", + route_match_interface, + route_match_interface_compile, + route_match_interface_free +}; /* Match function return 1 if match is success else return zero. */ static enum route_map_cmd_result_t @@ -376,8 +394,10 @@ route_match_tag(void *rule, const struct prefix *prefix, } /* Route map commands for tag matching. */ -static struct route_map_rule_cmd route_match_tag_cmd = { - "tag", route_match_tag, route_map_rule_tag_compile, +static const struct route_map_rule_cmd route_match_tag_cmd = { + "tag", + route_match_tag, + route_map_rule_tag_compile, route_map_rule_tag_free, }; @@ -462,8 +482,10 @@ static void route_set_metric_free(void *rule) } /* Set metric rule structure. */ -struct route_map_rule_cmd route_set_metric_cmd = { - "metric", route_set_metric, route_set_metric_compile, +static const struct route_map_rule_cmd route_set_metric_cmd = { + "metric", + route_set_metric, + route_set_metric_compile, route_set_metric_free, }; @@ -513,8 +535,10 @@ static void route_set_metric_type_free(void *rule) } /* Set metric rule structure. */ -struct route_map_rule_cmd route_set_metric_type_cmd = { - "metric-type", route_set_metric_type, route_set_metric_type_compile, +static const struct route_map_rule_cmd route_set_metric_type_cmd = { + "metric-type", + route_set_metric_type, + route_set_metric_type_compile, route_set_metric_type_free, }; @@ -537,8 +561,10 @@ route_set_tag(void *rule, const struct prefix *prefix, route_map_object_t type, } /* Route map commands for tag set. */ -static struct route_map_rule_cmd route_set_tag_cmd = { - "tag", route_set_tag, route_map_rule_tag_compile, +static const struct route_map_rule_cmd route_set_tag_cmd = { + "tag", + route_set_tag, + route_map_rule_tag_compile, route_map_rule_tag_free, }; |