summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-08-27 14:04:43 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-09-03 14:19:22 +0200
commitcda7187d27b94ea0abd8b5a395334c4a0afcef42 (patch)
tree746c640d5de31cee27a85237138abfa26fd2a5a8 /ospf6d
parentlib: Cleanup return codes to use enum values (diff)
downloadfrr-cda7187d27b94ea0abd8b5a395334c4a0afcef42.tar.xz
frr-cda7187d27b94ea0abd8b5a395334c4a0afcef42.zip
*: Convert some route map functions to return the enum
Conver these functions: route_map_add_match route_map_delete_match route_map_add_set route_map_delete_set To return the `enum rmap_compile_rets` and ensure all functions that use this code handle all the enumerated possible returns. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_asbr.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 33b9f71b5..4d1c08508 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1581,7 +1581,7 @@ static struct route_map_rule_cmd ospf6_routemap_rule_set_tag_cmd = {
route_map_rule_tag_free,
};
-static int route_map_command_status(struct vty *vty, int ret)
+static int route_map_command_status(struct vty *vty, enum rmap_compile_rets ret)
{
switch (ret) {
case RMAP_RULE_MISSING:
@@ -1593,6 +1593,7 @@ static int route_map_command_status(struct vty *vty, int ret)
return CMD_WARNING_CONFIG_FAILED;
break;
case RMAP_COMPILE_SUCCESS:
+ case RMAP_DUPLICATE_RULE:
break;
}
@@ -1610,8 +1611,10 @@ DEFUN (ospf6_routemap_set_metric_type,
{
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_external = 2;
- int ret = route_map_add_set(route_map_index, "metric-type",
- argv[idx_external]->arg);
+ enum rmap_compile_rets ret = route_map_add_set(route_map_index,
+ "metric-type",
+ argv[idx_external]->arg);
+
return route_map_command_status(vty, ret);
}
@@ -1627,7 +1630,9 @@ DEFUN (ospf6_routemap_no_set_metric_type,
{
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
char *ext = (argc == 4) ? argv[3]->text : NULL;
- int ret = route_map_delete_set(route_map_index, "metric-type", ext);
+ enum rmap_compile_rets ret = route_map_delete_set(route_map_index,
+ "metric-type", ext);
+
return route_map_command_status(vty, ret);
}
@@ -1641,8 +1646,10 @@ DEFUN (ospf6_routemap_set_forwarding,
{
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_ipv6 = 2;
- int ret = route_map_add_set(route_map_index, "forwarding-address",
- argv[idx_ipv6]->arg);
+ enum rmap_compile_rets ret = route_map_add_set(route_map_index,
+ "forwarding-address",
+ argv[idx_ipv6]->arg);
+
return route_map_command_status(vty, ret);
}
@@ -1657,8 +1664,10 @@ DEFUN (ospf6_routemap_no_set_forwarding,
{
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_ipv6 = 3;
- int ret = route_map_delete_set(route_map_index, "forwarding-address",
- argv[idx_ipv6]->arg);
+ enum rmap_compile_rets ret = route_map_delete_set(route_map_index,
+ "forwarding-address",
+ argv[idx_ipv6]->arg);
+
return route_map_command_status(vty, ret);
}