summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-09-26 20:17:12 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-07 09:09:52 -0400
commitbe301cc2566d694d1860b3f23ab5532675c8bbf1 (patch)
tree1fd28e0041eaffde8fb17cce96228c6a8be64c08 /lib/if.c
parent0878c8d423a7e53ac08a73bb47819dc4c9268a31 (diff)
lib: use qobj for vty->index context position
Prepares the library CLI functions for concurrent config access. Note the vty->index pointer is still kept functional for the daemons to use. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/if.c b/lib/if.c
index 2add03d67c..6ae8500291 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -683,12 +683,11 @@ DEFUN (interface_desc,
"Interface specific description\n"
"Characters describing this interface\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT (interface, ifp);
if (argc == 0)
return CMD_SUCCESS;
- ifp = vty->index;
if (ifp->desc)
XFREE (MTYPE_TMP, ifp->desc);
ifp->desc = argv_concat(argv, argc, 0);
@@ -702,9 +701,8 @@ DEFUN (no_interface_desc,
NO_STR
"Interface specific description\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT (interface, ifp);
- ifp = vty->index;
if (ifp->desc)
XFREE (MTYPE_TMP, ifp->desc);
ifp->desc = NULL;
@@ -788,8 +786,7 @@ DEFUN (interface,
vty_out (vty, "%% interface %s not in %s%s", argv[0], argv[1], VTY_NEWLINE);
return CMD_WARNING;
}
- vty->index = ifp;
- vty->node = INTERFACE_NODE;
+ VTY_PUSH_CONTEXT_COMPAT (INTERFACE_NODE, ifp);
return CMD_SUCCESS;
}
@@ -862,8 +859,7 @@ DEFUN (vrf,
vrfp = vrf_get (VRF_UNKNOWN, argv[0]);
- vty->index = vrfp;
- vty->node = VRF_NODE;
+ VTY_PUSH_CONTEXT_COMPAT (VRF_NODE, vrfp);
return CMD_SUCCESS;
}