summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_routemap.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-11-20 17:20:58 +0100
committerDavid Lamparter <equinox@diac24.net>2019-11-30 00:38:32 +0100
commit364deb0487600073aca8396ed80e35da589f3eca (patch)
treeeac52048c0bea7a698bc16f2410668c2c72cc438 /eigrpd/eigrp_routemap.c
parent154e9ca142bddf748f12a8042519ec6438364625 (diff)
*: make all route_map_rule_cmd const
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'eigrpd/eigrp_routemap.c')
-rw-r--r--eigrpd/eigrp_routemap.c85
1 files changed, 58 insertions, 27 deletions
diff --git a/eigrpd/eigrp_routemap.c b/eigrpd/eigrp_routemap.c
index e7a7cc56aa..df7b9c94ee 100644
--- a/eigrpd/eigrp_routemap.c
+++ b/eigrpd/eigrp_routemap.c
@@ -319,9 +319,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. */
@@ -366,9 +369,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' */
@@ -413,9 +419,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' */
@@ -455,10 +464,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 address IP_ACCESS_LIST' */
@@ -496,9 +508,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' */
@@ -530,10 +545,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. */
@@ -576,8 +594,12 @@ static void route_match_tag_free(void *rule)
}
/* Route map commands for tag matching. */
-struct route_map_rule_cmd route_match_tag_cmd = {
- "tag", route_match_tag, route_match_tag_compile, route_match_tag_free};
+static const struct route_map_rule_cmd route_match_tag_cmd = {
+ "tag",
+ route_match_tag,
+ route_match_tag_compile,
+ route_match_tag_free
+};
/* Set metric to attribute. */
static enum route_map_cmd_result_t
@@ -666,8 +688,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,
};
@@ -722,9 +746,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' */
@@ -768,8 +795,12 @@ static void route_set_tag_free(void *rule)
}
/* Route map commands for tag set. */
-static struct route_map_rule_cmd route_set_tag_cmd = {
- "tag", route_set_tag, route_set_tag_compile, route_set_tag_free};
+static const struct route_map_rule_cmd route_set_tag_cmd = {
+ "tag",
+ route_set_tag,
+ route_set_tag_compile,
+ route_set_tag_free
+};
#define MATCH_STR "Match values from routing table\n"
#define SET_STR "Set values in destination routing protocol\n"