diff options
Diffstat (limited to 'vtysh')
| -rw-r--r-- | vtysh/Makefile.am | 6 | ||||
| -rwxr-xr-x | vtysh/extract.pl.in | 6 | ||||
| -rw-r--r-- | vtysh/vtysh.c | 43 | ||||
| -rw-r--r-- | vtysh/vtysh.h | 5 | ||||
| -rw-r--r-- | vtysh/vtysh_config.c | 2 |
5 files changed, 57 insertions, 5 deletions
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am index 10d51f6ace..587f72c809 100644 --- a/vtysh/Makefile.am +++ b/vtysh/Makefile.am @@ -118,6 +118,12 @@ vtysh_scan += $(top_srcdir)/eigrpd/eigrp_dump.c vtysh_scan += $(top_srcdir)/eigrpd/eigrp_vty.c endif +if BABELD +vtysh_scan += $(top_srcdir)/babeld/babel_interface.c +vtysh_scan += $(top_srcdir)/babeld/babel_zebra.c +vtysh_scan += $(top_srcdir)/babeld/babeld.c +endif + if SNMP vtysh_scan += $(top_srcdir)/lib/agentx.c endif diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in index 0ca1451ff5..316ea598e8 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 ecd0b72e78..137ce11829 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -75,6 +75,7 @@ struct vtysh_client vtysh_client[] = { .fd = -1, .name = "pimd", .flag = VTYSH_PIMD, .next = NULL}, { .fd = -1, .name = "nhrpd", .flag = VTYSH_NHRPD, .next = NULL}, { .fd = -1, .name = "eigrpd", .flag = VTYSH_EIGRPD, .next = NULL}, + { .fd = -1, .name = "babeld", .flag = VTYSH_BABELD, .next = NULL}, { .fd = -1, .name = "watchfrr", .flag = VTYSH_WATCHFRR, .next = NULL}, }; @@ -1024,6 +1025,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, @@ -1389,6 +1396,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, @@ -1573,6 +1591,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: @@ -1792,6 +1811,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, @@ -3244,6 +3281,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); @@ -3285,6 +3323,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); @@ -3316,6 +3355,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) @@ -3381,6 +3422,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); @@ -3429,6 +3471,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.h b/vtysh/vtysh.h index d3c7a4def9..71a0d876fd 100644 --- a/vtysh/vtysh.h +++ b/vtysh/vtysh.h @@ -36,15 +36,16 @@ DECLARE_MGROUP(MVTYSH) #define VTYSH_WATCHFRR 0x400 #define VTYSH_NHRPD 0x800 #define VTYSH_EIGRPD 0x1000 +#define VTYSH_BABELD 0x2000 /* commands in REALLYALL are crucial to correct vtysh operation */ #define VTYSH_REALLYALL ~0U /* watchfrr is not in ALL since library CLI functions should not be * run on it (logging & co. should stay in a fixed/frozen config, and * things like prefix lists are not even initialised) */ -#define VTYSH_ALL VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD|VTYSH_EIGRPD +#define VTYSH_ALL VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD|VTYSH_EIGRPD|VTYSH_BABELD #define VTYSH_RMAP VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_PIMD -#define VTYSH_INTERFACE VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD|VTYSH_EIGRPD +#define VTYSH_INTERFACE VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD|VTYSH_EIGRPD|VTYSH_BABELD #define VTYSH_NS VTYSH_ZEBRA #define VTYSH_VRF VTYSH_ZEBRA diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index f25b5f26f7..7ca74da10b 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -208,6 +208,8 @@ vtysh_config_parse_line (void *arg, 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) |
