summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-08-02 01:16:28 +0200
committerDavid Lamparter <equinox@diac24.net>2017-08-09 13:03:36 +0200
commit2dd0d726247489dbcc8d99671360915d7332f7c4 (patch)
tree1f51ce8d08bb37ed889ce373abf6ce562fd78e21 /vtysh
parentldpd: fix missing label mappings (diff)
downloadfrr-2dd0d726247489dbcc8d99671360915d7332f7c4.tar.xz
frr-2dd0d726247489dbcc8d99671360915d7332f7c4.zip
zebra: add support for static pseudowires
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/Makefile.am1
-rw-r--r--vtysh/vtysh.c20
-rw-r--r--vtysh/vtysh_config.c2
3 files changed, 23 insertions, 0 deletions
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index 8b66ba256..d179ed1d9 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
@@ -147,6 +147,7 @@ vtysh_cmd_FILES = $(vtysh_scan) \
$(top_srcdir)/zebra/zebra_fpm.c \
$(top_srcdir)/zebra/zebra_ptm.c \
$(top_srcdir)/zebra/zebra_mpls_vty.c \
+ $(top_srcdir)/zebra/zebra_pw.c \
$(top_srcdir)/watchfrr/watchfrr_vty.c \
$(BGP_VNC_RFAPI_SRC) $(BGP_VNC_RFP_SRC)
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 5886d39c1..76c42173d 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -923,6 +923,10 @@ static struct cmd_node interface_node = {
INTERFACE_NODE, "%s(config-if)# ",
};
+static struct cmd_node pw_node = {
+ PW_NODE, "%s(config-pw)# ",
+};
+
static struct cmd_node ns_node = {
NS_NODE, "%s(config-logical-router)# ",
};
@@ -1418,6 +1422,7 @@ static int vtysh_exit(struct vty *vty)
vty->node = ENABLE_NODE;
break;
case INTERFACE_NODE:
+ case PW_NODE:
case NS_NODE:
case VRF_NODE:
case ZEBRA_NODE:
@@ -1671,6 +1676,15 @@ DEFUNSH(VTYSH_INTERFACE, vtysh_interface, vtysh_interface_cmd,
return CMD_SUCCESS;
}
+DEFUNSH(VTYSH_ZEBRA, vtysh_pseudowire, vtysh_pseudowire_cmd,
+ "pseudowire IFNAME",
+ "Static pseudowire configuration\n"
+ "Pseudowire name\n")
+{
+ vty->node = PW_NODE;
+ return CMD_SUCCESS;
+}
+
/* TODO Implement "no interface command in isisd. */
DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D
| VTYSH_EIGRPD,
@@ -2921,6 +2935,7 @@ void vtysh_init_vty(void)
install_node(&bgp_node, NULL);
install_node(&rip_node, NULL);
install_node(&interface_node, NULL);
+ install_node(&pw_node, NULL);
install_node(&link_params_node, NULL);
install_node(&ns_node, NULL);
install_node(&vrf_node, NULL);
@@ -3093,6 +3108,10 @@ void vtysh_init_vty(void)
install_element(LINK_PARAMS_NODE, &vtysh_exit_interface_cmd);
install_element(INTERFACE_NODE, &vtysh_quit_interface_cmd);
+ install_element(PW_NODE, &vtysh_end_all_cmd);
+ install_element(PW_NODE, &vtysh_exit_interface_cmd);
+ install_element(PW_NODE, &vtysh_quit_interface_cmd);
+
install_element(NS_NODE, &vtysh_end_all_cmd);
install_element(CONFIG_NODE, &vtysh_ns_cmd);
@@ -3168,6 +3187,7 @@ void vtysh_init_vty(void)
install_element(CONFIG_NODE, &vtysh_interface_cmd);
install_element(CONFIG_NODE, &vtysh_no_interface_cmd);
install_element(CONFIG_NODE, &vtysh_no_interface_vrf_cmd);
+ install_element(CONFIG_NODE, &vtysh_pseudowire_cmd);
install_element(INTERFACE_NODE, &vtysh_link_params_cmd);
install_element(ENABLE_NODE, &vtysh_show_running_config_cmd);
install_element(ENABLE_NODE, &vtysh_copy_running_config_cmd);
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 74509d1ec..43aff0e3a 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -181,6 +181,8 @@ void vtysh_config_parse_line(void *arg, const char *line)
default:
if (strncmp(line, "interface", strlen("interface")) == 0)
config = config_get(INTERFACE_NODE, line);
+ else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)
+ config = config_get(PW_NODE, line);
else if (strncmp(line, "logical-router", strlen("ns")) == 0)
config = config_get(NS_NODE, line);
else if (strncmp(line, "vrf", strlen("vrf")) == 0)