diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2016-09-26 20:17:12 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-10-07 15:09:52 +0200 |
commit | be301cc2566d694d1860b3f23ab5532675c8bbf1 (patch) | |
tree | 1fd28e0041eaffde8fb17cce96228c6a8be64c08 /lib/if.c | |
parent | lib: vty: add infrastructure for qobj ID "index" (diff) | |
download | frr-be301cc2566d694d1860b3f23ab5532675c8bbf1.tar.xz frr-be301cc2566d694d1860b3f23ab5532675c8bbf1.zip |
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.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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; } |