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/keychain.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/keychain.c')
-rw-r--r-- | lib/keychain.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/keychain.c b/lib/keychain.c index 85af482e1..ecc274d4f 100644 --- a/lib/keychain.c +++ b/lib/keychain.c @@ -250,8 +250,7 @@ DEFUN (key_chain, struct keychain *keychain; keychain = keychain_get (argv[0]); - vty->index = keychain; - vty->node = KEYCHAIN_NODE; + VTY_PUSH_CONTEXT_COMPAT (KEYCHAIN_NODE, keychain); return CMD_SUCCESS; } @@ -285,12 +284,10 @@ DEFUN (key, "Configure a key\n" "Key identifier number\n") { - struct keychain *keychain; + VTY_DECLVAR_CONTEXT (keychain, keychain); struct key *key; u_int32_t index; - keychain = vty->index; - VTY_GET_INTEGER ("key identifier", index, argv[0]); key = key_get (keychain, index); vty->index_sub = key; @@ -306,11 +303,9 @@ DEFUN (no_key, "Delete a key\n" "Key identifier number\n") { - struct keychain *keychain; + VTY_DECLVAR_CONTEXT (keychain, keychain); struct key *key; u_int32_t index; - - keychain = vty->index; VTY_GET_INTEGER ("key identifier", index, argv[0]); key = key_lookup (keychain, index); |