summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c24
-rw-r--r--lib/nexthop_group.c8
-rw-r--r--lib/vrf.c8
3 files changed, 24 insertions, 16 deletions
diff --git a/lib/if.c b/lib/if.c
index 87d0ea968b..f2b45512da 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1231,7 +1231,7 @@ void if_link_params_free(struct interface *ifp)
*/
DEFPY_NOSH (interface,
interface_cmd,
- "interface IFNAME [vrf NAME$vrfname]",
+ "interface IFNAME [vrf NAME$vrf_name]",
"Select an interface to configure\n"
"Interface's name\n"
VRF_CMD_HELP_STR)
@@ -1241,8 +1241,8 @@ DEFPY_NOSH (interface,
struct interface *ifp;
int ret;
- if (!vrfname)
- vrfname = VRF_DEFAULT_NAME;
+ if (!vrf_name)
+ vrf_name = VRF_DEFAULT_NAME;
/*
* This command requires special handling to maintain backward
@@ -1251,7 +1251,7 @@ DEFPY_NOSH (interface,
* interface is found, then a new one should be created on the default
* VRF.
*/
- VRF_GET_ID(vrf_id, vrfname, false);
+ VRF_GET_ID(vrf_id, vrf_name, false);
ifp = if_lookup_by_name_all_vrf(ifname);
if (ifp && ifp->vrf_id != vrf_id) {
struct vrf *vrf;
@@ -1262,24 +1262,24 @@ DEFPY_NOSH (interface,
*/
if (vrf_id != VRF_DEFAULT) {
vty_out(vty, "%% interface %s not in %s vrf\n", ifname,
- vrfname);
+ vrf_name);
return CMD_WARNING_CONFIG_FAILED;
}
/*
* Special case 2: a VRF name was *not* specified, and the found
* interface is associated to a VRF other than the default one.
- * Update vrf_id and vrfname to account for that.
+ * Update vrf_id and vrf_name to account for that.
*/
vrf = vrf_lookup_by_id(ifp->vrf_id);
assert(vrf);
vrf_id = ifp->vrf_id;
- vrfname = vrf->name;
+ vrf_name = vrf->name;
}
snprintf(xpath_list, sizeof(xpath_list),
"/frr-interface:lib/interface[name='%s'][vrf='%s']", ifname,
- vrfname);
+ vrf_name);
nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL);
ret = nb_cli_apply_changes(vty, xpath_list);
@@ -1302,20 +1302,20 @@ DEFPY_NOSH (interface,
DEFPY (no_interface,
no_interface_cmd,
- "no interface IFNAME [vrf NAME$vrfname]",
+ "no interface IFNAME [vrf NAME$vrf_name]",
NO_STR
"Delete a pseudo interface's configuration\n"
"Interface's name\n"
VRF_CMD_HELP_STR)
{
- if (!vrfname)
- vrfname = VRF_DEFAULT_NAME;
+ if (!vrf_name)
+ vrf_name = VRF_DEFAULT_NAME;
nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
return nb_cli_apply_changes(
vty, "/frr-interface:lib/interface[name='%s'][vrf='%s']",
- ifname, vrfname);
+ ifname, vrf_name);
}
static void cli_show_interface(struct vty *vty, struct lyd_node *dnode,
diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c
index abe2096cec..9564321d38 100644
--- a/lib/nexthop_group.c
+++ b/lib/nexthop_group.c
@@ -475,7 +475,7 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
<A.B.C.D|X:X::X:X>$addr [INTERFACE$intf]\
|INTERFACE$intf\
>\
- [nexthop-vrf NAME$name]",
+ [nexthop-vrf NAME$vrf_name]",
NO_STR
"Specify one of the nexthops in this ECMP group\n"
"v4 Address\n"
@@ -490,7 +490,7 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
struct nexthop *nh;
bool legal;
- legal = nexthop_group_parse_nexthop(&nhop, addr, intf, name);
+ legal = nexthop_group_parse_nexthop(&nhop, addr, intf, vrf_name);
if (nhop.type == NEXTHOP_TYPE_IPV6
&& IN6_IS_ADDR_LINKLOCAL(&nhop.gate.ipv6)) {
@@ -502,7 +502,7 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
nh = nexthop_exists(&nhgc->nhg, &nhop);
if (no) {
- nexthop_group_unsave_nhop(nhgc, name, addr, intf);
+ nexthop_group_unsave_nhop(nhgc, vrf_name, addr, intf);
if (nh) {
_nexthop_del(&nhgc->nhg, nh);
@@ -520,7 +520,7 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
_nexthop_add(&nhgc->nhg.nexthop, nh);
}
- nexthop_group_save_nhop(nhgc, name, addr, intf);
+ nexthop_group_save_nhop(nhgc, vrf_name, addr, intf);
if (legal && nhg_hooks.add_nexthop)
nhg_hooks.add_nexthop(nhgc, nh);
diff --git a/lib/vrf.c b/lib/vrf.c
index 4c6df797ad..2411cc3111 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -472,6 +472,14 @@ static const struct cmd_variable_handler vrf_var_handlers[] = {
.varname = "vrf",
.completions = vrf_autocomplete,
},
+ {
+ .varname = "vrf_name",
+ .completions = vrf_autocomplete,
+ },
+ {
+ .varname = "nexthop_vrf",
+ .completions = vrf_autocomplete,
+ },
{.completions = NULL},
};