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 /ripd | |
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 'ripd')
-rw-r--r-- | ripd/rip_routemap.c | 93 |
1 files changed, 62 insertions, 31 deletions
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c index 459188fef..4e848766d 100644 --- a/ripd/rip_routemap.c +++ b/ripd/rip_routemap.c @@ -88,9 +88,12 @@ static void route_match_metric_free(void *rule) } /* Route map commands for metric matching. */ -struct route_map_rule_cmd route_match_metric_cmd = { - "metric", route_match_metric, route_match_metric_compile, - route_match_metric_free}; +static const struct route_map_rule_cmd route_match_metric_cmd = { + "metric", + route_match_metric, + route_match_metric_compile, + route_match_metric_free +}; /* `match interface IFNAME' */ /* Match function return 1 if match is success else return zero. */ @@ -134,9 +137,12 @@ static void route_match_interface_free(void *rule) } /* Route map commands for interface 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 ip next-hop IP_ACCESS_LIST' */ @@ -181,9 +187,12 @@ static void route_match_ip_next_hop_free(void *rule) } /* Route map commands for ip next-hop matching. */ -static struct route_map_rule_cmd route_match_ip_next_hop_cmd = { - "ip next-hop", route_match_ip_next_hop, route_match_ip_next_hop_compile, - route_match_ip_next_hop_free}; +static const struct route_map_rule_cmd route_match_ip_next_hop_cmd = { + "ip next-hop", + route_match_ip_next_hop, + route_match_ip_next_hop_compile, + route_match_ip_next_hop_free +}; /* `match ip next-hop prefix-list PREFIX_LIST' */ @@ -223,10 +232,13 @@ static void route_match_ip_next_hop_prefix_list_free(void *rule) XFREE(MTYPE_ROUTE_MAP_COMPILED, rule); } -static 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>' */ @@ -257,10 +269,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' */ @@ -298,9 +313,12 @@ static void route_match_ip_address_free(void *rule) } /* Route map commands for ip address matching. */ -static 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' */ @@ -332,10 +350,13 @@ static void route_match_ip_address_prefix_list_free(void *rule) XFREE(MTYPE_ROUTE_MAP_COMPILED, rule); } -static 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 tag TAG' */ /* Match function return 1 if match is success else return zero. */ @@ -362,8 +383,10 @@ route_match_tag(void *rule, const struct prefix *p, route_map_object_t type, } /* 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, }; @@ -460,8 +483,10 @@ static void route_set_metric_free(void *rule) } /* Set metric rule structure. */ -static 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, }; @@ -514,9 +539,12 @@ static void route_set_ip_nexthop_free(void *rule) } /* Route map commands for ip nexthop set. */ -static struct route_map_rule_cmd route_set_ip_nexthop_cmd = { - "ip next-hop", route_set_ip_nexthop, route_set_ip_nexthop_compile, - route_set_ip_nexthop_free}; +static const struct route_map_rule_cmd route_set_ip_nexthop_cmd = { + "ip next-hop", + route_set_ip_nexthop, + route_set_ip_nexthop_compile, + route_set_ip_nexthop_free +}; /* `set tag TAG' */ @@ -541,9 +569,12 @@ 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, - route_map_rule_tag_free}; +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 +}; #define MATCH_STR "Match values from routing table\n" #define SET_STR "Set values in destination routing protocol\n" |