summaryrefslogtreecommitdiffstats
path: root/lib/vty.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-03-01 19:31:28 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-09-23 15:31:09 +0200
commiteac6e3f027356c25a8c8fddf921f769b79945fcc (patch)
tree69d5a17fb3f95934bafa22f8a3aee28c92780d62 /lib/vty.c
parentldpd: sun is a reserved word on Solaris (diff)
downloadfrr-eac6e3f027356c25a8c8fddf921f769b79945fcc.tar.xz
frr-eac6e3f027356c25a8c8fddf921f769b79945fcc.zip
ldpd: adapt the code for Quagga
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 48b64a95c..3f1350044 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -754,6 +754,13 @@ vty_end_config (struct vty *vty)
case RMAP_NODE:
case OSPF_NODE:
case OSPF6_NODE:
+ case LDP_NODE:
+ case LDP_IPV4_NODE:
+ case LDP_IPV6_NODE:
+ case LDP_IPV4_IFACE_NODE:
+ case LDP_IPV6_IFACE_NODE:
+ case LDP_L2VPN_NODE:
+ case LDP_PSEUDOWIRE_NODE:
case ISIS_NODE:
case KEYCHAIN_NODE:
case KEYCHAIN_KEY_NODE:
@@ -1158,6 +1165,13 @@ vty_stop_input (struct vty *vty)
case RMAP_NODE:
case OSPF_NODE:
case OSPF6_NODE:
+ case LDP_NODE:
+ case LDP_IPV4_NODE:
+ case LDP_IPV6_NODE:
+ case LDP_IPV4_IFACE_NODE:
+ case LDP_IPV6_IFACE_NODE:
+ case LDP_L2VPN_NODE:
+ case LDP_PSEUDOWIRE_NODE:
case ISIS_NODE:
case KEYCHAIN_NODE:
case KEYCHAIN_KEY_NODE:
@@ -3180,3 +3194,29 @@ vty_terminate (void)
vector_free (Vvty_serv_thread);
}
}
+
+/* Utility functions to get arguments from commands generated
+ by the xml2cli.pl script. */
+const char *
+vty_get_arg_value (struct vty_arg *args[], const char *arg)
+{
+ while (*args)
+ {
+ if (strcmp ((*args)->name, arg) == 0)
+ return (*args)->value;
+ args++;
+ }
+ return NULL;
+}
+
+struct vty_arg *
+vty_get_arg (struct vty_arg *args[], const char *arg)
+{
+ while (*args)
+ {
+ if (strcmp ((*args)->name, arg) == 0)
+ return *args;
+ args++;
+ }
+ return NULL;
+}