summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-14 05:38:14 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-05-14 05:38:14 +0200
commita616ea5f24374e412b34d88bdd51e5d0165e329b (patch)
tree536610609111282a877909fb47742b8a4ed76a81 /vtysh
parentripngd: Cleanup missing newlines (diff)
downloadfrr-a616ea5f24374e412b34d88bdd51e5d0165e329b.tar.xz
frr-a616ea5f24374e412b34d88bdd51e5d0165e329b.zip
lib, vtysh: Add bits and pieces to allow vtysh to understand babel
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'vtysh')
-rwxr-xr-xvtysh/extract.pl.in6
-rw-r--r--vtysh/vtysh.c42
-rw-r--r--vtysh/vtysh_config.c2
3 files changed, 47 insertions, 3 deletions
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 0ca1451ff..316ea598e 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -85,7 +85,7 @@ foreach (@ARGV) {
$protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_PIMD|VTYSH_EIGRPD";
}
elsif ($file =~ /lib\/vrf\.c$/) {
- $protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_EIGRPD";
+ $protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_EIGRPD|VTYSH_BABELD";
}
elsif ($file =~ /lib\/filter\.c$/) {
$protocol = "VTYSH_ALL";
@@ -98,9 +98,9 @@ foreach (@ARGV) {
}
elsif ($file =~ /lib\/plist\.c$/) {
if ($defun_array[1] =~ m/ipv6/) {
- $protocol = "VTYSH_RIPNGD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";
+ $protocol = "VTYSH_RIPNGD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_BABELD";
} else {
- $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_PIMD|VTYSH_EIGRPD";
+ $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_PIMD|VTYSH_EIGRPD|VTYSH_BABELD";
}
}
elsif ($file =~ /lib\/distribute\.c$/) {
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 3967cfc93..239cacf49 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1014,6 +1014,12 @@ static struct cmd_node eigrp_node =
"%s(config-router)# "
};
+static struct cmd_node babel_node =
+{
+ BABEL_NODE,
+ "%s(config-router)# "
+};
+
static struct cmd_node ripng_node =
{
RIPNG_NODE,
@@ -1404,6 +1410,17 @@ DEFUNSH (VTYSH_EIGRPD,
return CMD_SUCCESS;
}
+DEFUNSH (VTYSH_BABELD,
+ router_babel,
+ router_babel_cmd,
+ "router babel",
+ "Enable a routing process\n"
+ "Make Babel instance command\n")
+{
+ vty->node = BABEL_NODE;
+ return CMD_SUCCESS;
+}
+
DEFUNSH (VTYSH_OSPF6D,
router_ospf6,
router_ospf6_cmd,
@@ -1588,6 +1605,7 @@ vtysh_exit (struct vty *vty)
case OSPF_NODE:
case OSPF6_NODE:
case EIGRP_NODE:
+ case BABEL_NODE:
case LDP_NODE:
case LDP_L2VPN_NODE:
case ISIS_NODE:
@@ -1811,6 +1829,24 @@ DEFUNSH (VTYSH_EIGRPD,
return vtysh_exit (vty);
}
+DEFUNSH (VTYSH_EIGRPD,
+ vtysh_exit_babeld,
+ vtysh_exit_babeld_cmd,
+ "exit",
+ "Exit current mode and down to previous mode\n")
+{
+ return vtysh_exit (vty);
+}
+
+DEFUNSH (VTYSH_BABELD,
+ vtysh_quit_babeld,
+ vtysh_quit_babeld_cmd,
+ "quit",
+ "Exit current mode and down to previous mode\n")
+{
+ return vtysh_exit (vty);
+}
+
DEFUNSH (VTYSH_OSPF6D,
vtysh_exit_ospf6d,
vtysh_exit_ospf6d_cmd,
@@ -3230,6 +3266,7 @@ vtysh_init_vty (void)
install_node (&bgp_vnc_l2_group_node, NULL);
install_node (&ospf_node, NULL);
install_node (&eigrp_node, NULL);
+ install_node (&babel_node, NULL);
install_node (&ripng_node, NULL);
install_node (&ospf6_node, NULL);
install_node (&ldp_node, NULL);
@@ -3273,6 +3310,7 @@ vtysh_init_vty (void)
#endif
vtysh_install_default (OSPF_NODE);
vtysh_install_default (EIGRP_NODE);
+ vtysh_install_default (BABEL_NODE);
vtysh_install_default (RIPNG_NODE);
vtysh_install_default (OSPF6_NODE);
vtysh_install_default (LDP_NODE);
@@ -3304,6 +3342,8 @@ vtysh_init_vty (void)
install_element (OSPF_NODE, &vtysh_quit_ospfd_cmd);
install_element (EIGRP_NODE, &vtysh_exit_eigrpd_cmd);
install_element (EIGRP_NODE, &vtysh_quit_eigrpd_cmd);
+ install_element (BABEL_NODE, &vtysh_exit_babeld_cmd);
+ install_element (BABEL_NODE, &vtysh_quit_babeld_cmd);
install_element (OSPF6_NODE, &vtysh_exit_ospf6d_cmd);
install_element (OSPF6_NODE, &vtysh_quit_ospf6d_cmd);
#if defined (HAVE_LDPD)
@@ -3373,6 +3413,7 @@ vtysh_init_vty (void)
install_element (RIPNG_NODE, &vtysh_end_all_cmd);
install_element (OSPF_NODE, &vtysh_end_all_cmd);
install_element (EIGRP_NODE, &vtysh_end_all_cmd);
+ install_element (BABEL_NODE, &vtysh_end_all_cmd);
install_element (OSPF6_NODE, &vtysh_end_all_cmd);
install_element (LDP_NODE, &vtysh_end_all_cmd);
install_element (LDP_IPV4_NODE, &vtysh_end_all_cmd);
@@ -3423,6 +3464,7 @@ vtysh_init_vty (void)
install_element (VRF_NODE, &vtysh_quit_vrf_cmd);
install_element (CONFIG_NODE, &router_eigrp_cmd);
+ install_element (CONFIG_NODE, &router_babel_cmd);
install_element (CONFIG_NODE, &router_rip_cmd);
install_element (CONFIG_NODE, &router_ripng_cmd);
install_element (CONFIG_NODE, &router_ospf_cmd);
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 2a84847aa..a51d42415 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -208,6 +208,8 @@ vtysh_config_parse_line (const char *line)
config = config_get (RIPNG_NODE, line);
else if (strncmp (line, "router eigrp", strlen ("router eigrp")) == 0)
config = config_get (EIGRP_NODE, line);
+ else if (strncmp (line, "router babel", strlen ("router babel")) == 0)
+ config = config_get (BABEL_NODE, line);
else if (strncmp (line, "router ospf", strlen ("router ospf")) == 0)
config = config_get (OSPF_NODE, line);
else if (strncmp (line, "router ospf6", strlen ("router ospf6")) == 0)