Merge pull request #2833 from opensourcerouting/assorted-fixes

Assorted fixes (pre-northbound)
This commit is contained in:
Donald Sharp 2018-08-13 20:24:57 -04:00 committed by GitHub
commit 067d5028c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 132 additions and 104 deletions

View File

@ -196,9 +196,6 @@ main(int argc, char **argv)
/* this replace kernel_setup && kernel_setup_socket */ /* this replace kernel_setup && kernel_setup_socket */
babelz_zebra_init (); babelz_zebra_init ();
/* Get zebra configuration file. */
vty_read_config (babeld_di.config_file, babel_config_default);
/* init buffer */ /* init buffer */
rc = resize_receive_buffer(1500); rc = resize_receive_buffer(1500);
if(rc < 0) if(rc < 0)

View File

@ -29,7 +29,7 @@
#include "ldpd/ldp_vty_cmds_clippy.c" #include "ldpd/ldp_vty_cmds_clippy.c"
#endif #endif
DEFUN_NOSH(ldp_mpls_ldp, DEFPY_NOSH(ldp_mpls_ldp,
ldp_mpls_ldp_cmd, ldp_mpls_ldp_cmd,
"mpls ldp", "mpls ldp",
"Global MPLS configuration subcommands\n" "Global MPLS configuration subcommands\n"
@ -48,21 +48,15 @@ DEFPY (no_ldp_mpls_ldp,
return (ldp_vty_mpls_ldp(vty, "no")); return (ldp_vty_mpls_ldp(vty, "no"));
} }
DEFUN_NOSH(ldp_l2vpn, DEFPY_NOSH(ldp_l2vpn,
ldp_l2vpn_cmd, ldp_l2vpn_cmd,
"l2vpn WORD type vpls", "l2vpn WORD$l2vpn_name type vpls",
"Configure l2vpn commands\n" "Configure l2vpn commands\n"
"L2VPN name\n" "L2VPN name\n"
"L2VPN type\n" "L2VPN type\n"
"Virtual Private LAN Service\n") "Virtual Private LAN Service\n")
{ {
int idx = 0; return (ldp_vty_l2vpn(vty, NULL, l2vpn_name));
const char *name;
argv_find(argv, argc, "WORD", &idx);
name = argv[idx]->arg;
return (ldp_vty_l2vpn(vty, 0, name));
} }
DEFPY (no_ldp_l2vpn, DEFPY (no_ldp_l2vpn,
@ -77,20 +71,14 @@ DEFPY (no_ldp_l2vpn,
return (ldp_vty_l2vpn(vty, "no", l2vpn_name)); return (ldp_vty_l2vpn(vty, "no", l2vpn_name));
} }
DEFUN_NOSH(ldp_address_family, DEFPY_NOSH(ldp_address_family,
ldp_address_family_cmd, ldp_address_family_cmd,
"address-family <ipv4|ipv6>", "address-family <ipv4|ipv6>$af",
"Configure Address Family and its parameters\n" "Configure Address Family and its parameters\n"
"IPv4\n" "IPv4\n"
"IPv6\n") "IPv6\n")
{ {
int idx = 0; return (ldp_vty_address_family(vty, NULL, af));
const char *af;
argv_find(argv, argc, "address-family", &idx);
af = argv[idx + 1]->text;
return (ldp_vty_address_family(vty, 0, af));
} }
DEFPY (no_ldp_address_family, DEFPY (no_ldp_address_family,
@ -104,7 +92,7 @@ DEFPY (no_ldp_address_family,
return (ldp_vty_address_family(vty, "no", af)); return (ldp_vty_address_family(vty, "no", af));
} }
DEFUN_NOSH(ldp_exit_address_family, DEFPY_NOSH(ldp_exit_address_family,
ldp_exit_address_family_cmd, ldp_exit_address_family_cmd,
"exit-address-family", "exit-address-family",
"Exit from Address Family configuration mode\n") "Exit from Address Family configuration mode\n")
@ -361,19 +349,13 @@ DEFPY (ldp_session_holdtime,
return (ldp_vty_af_session_holdtime(vty, no, holdtime)); return (ldp_vty_af_session_holdtime(vty, no, holdtime));
} }
DEFUN_NOSH(ldp_interface, DEFPY_NOSH(ldp_interface,
ldp_interface_cmd, ldp_interface_cmd,
"interface IFNAME", "interface IFNAME$ifname",
"Enable LDP on an interface and enter interface submode\n" "Enable LDP on an interface and enter interface submode\n"
"Interface's name\n") "Interface's name\n")
{ {
int idx = 0; return (ldp_vty_interface(vty, NULL, ifname));
const char *ifname;
argv_find(argv, argc, "IFNAME", &idx);
ifname = argv[idx]->arg;
return (ldp_vty_interface(vty, 0, ifname));
} }
DEFPY (no_ldp_interface, DEFPY (no_ldp_interface,
@ -439,20 +421,14 @@ DEFPY (ldp_member_interface,
return (ldp_vty_l2vpn_interface(vty, no, ifname)); return (ldp_vty_l2vpn_interface(vty, no, ifname));
} }
DEFUN_NOSH(ldp_member_pseudowire, DEFPY_NOSH(ldp_member_pseudowire,
ldp_member_pseudowire_cmd, ldp_member_pseudowire_cmd,
"member pseudowire IFNAME", "member pseudowire IFNAME$ifname",
"L2VPN member configuration\n" "L2VPN member configuration\n"
"Pseudowire interface\n" "Pseudowire interface\n"
"Interface's name\n") "Interface's name\n")
{ {
int idx = 0; return (ldp_vty_l2vpn_pseudowire(vty, NULL, ifname));
const char *ifname;
argv_find(argv, argc, "IFNAME", &idx);
ifname = argv[idx]->arg;
return (ldp_vty_l2vpn_pseudowire(vty, 0, ifname));
} }
DEFPY (no_ldp_member_pseudowire, DEFPY (no_ldp_member_pseudowire,
@ -759,7 +735,7 @@ DEFPY (ldp_show_l2vpn_atom_vc,
return (ldp_vty_show_atom_vc(vty, peer_str, ifname, vcid_str, json)); return (ldp_vty_show_atom_vc(vty, peer_str, ifname, vcid_str, json));
} }
DEFUN_NOSH (ldp_show_debugging_mpls_ldp, DEFPY_NOSH (ldp_show_debugging_mpls_ldp,
ldp_show_debugging_mpls_ldp_cmd, ldp_show_debugging_mpls_ldp_cmd,
"show debugging [mpls ldp]", "show debugging [mpls ldp]",
"Show running system information\n" "Show running system information\n"

View File

@ -220,6 +220,9 @@ struct cmd_node {
DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, 0, 0) \ DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, 0, 0) \
funcdecl_##funcname funcdecl_##funcname
#define DEFPY_NOSH(funcname, cmdname, cmdstr, helpstr) \
DEFPY(funcname, cmdname, cmdstr, helpstr)
#define DEFPY_ATTR(funcname, cmdname, cmdstr, helpstr, attr) \ #define DEFPY_ATTR(funcname, cmdname, cmdstr, helpstr, attr) \
DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, attr, 0) \ DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, attr, 0) \
funcdecl_##funcname funcdecl_##funcname
@ -302,6 +305,9 @@ struct cmd_node {
#define DEFPY(funcname, cmdname, cmdstr, helpstr) \ #define DEFPY(funcname, cmdname, cmdstr, helpstr) \
DEFUN(funcname, cmdname, cmdstr, helpstr) DEFUN(funcname, cmdname, cmdstr, helpstr)
#define DEFPY_NOSH(funcname, cmdname, cmdstr, helpstr) \
DEFUN_NOSH(funcname, cmdname, cmdstr, helpstr)
#define DEFPY_ATTR(funcname, cmdname, cmdstr, helpstr, attr) \ #define DEFPY_ATTR(funcname, cmdname, cmdstr, helpstr, attr) \
DEFUN_ATTR(funcname, cmdname, cmdstr, helpstr, attr) DEFUN_ATTR(funcname, cmdname, cmdstr, helpstr, attr)
#endif /* VTYSH_EXTRACT_PL */ #endif /* VTYSH_EXTRACT_PL */

View File

@ -132,6 +132,7 @@ SPECIAL [(),]
"DEFUN_NOSH" value = strdup(yytext); return DEFUNNY; "DEFUN_NOSH" value = strdup(yytext); return DEFUNNY;
"DEFUN_HIDDEN" value = strdup(yytext); return DEFUNNY; "DEFUN_HIDDEN" value = strdup(yytext); return DEFUNNY;
"DEFPY" value = strdup(yytext); return DEFUNNY; "DEFPY" value = strdup(yytext); return DEFUNNY;
"DEFPY_NOSH" value = strdup(yytext); return DEFUNNY;
"DEFPY_ATTR" value = strdup(yytext); return DEFUNNY; "DEFPY_ATTR" value = strdup(yytext); return DEFUNNY;
"DEFPY_HIDDEN" value = strdup(yytext); return DEFUNNY; "DEFPY_HIDDEN" value = strdup(yytext); return DEFUNNY;
"ALIAS" value = strdup(yytext); return DEFUNNY; "ALIAS" value = strdup(yytext); return DEFUNNY;

View File

@ -626,7 +626,7 @@ static struct interface *if_sunwzebra_get(char *name, vrf_id_t vrf_id)
} }
#endif /* SUNOS_5 */ #endif /* SUNOS_5 */
DEFUN (interface, DEFUN_NOSH (interface,
interface_cmd, interface_cmd,
"interface IFNAME [vrf NAME]", "interface IFNAME [vrf NAME]",
"Select an interface to configure\n" "Select an interface to configure\n"
@ -669,13 +669,13 @@ DEFUN (interface,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN_NOSH (no_interface, DEFUN (no_interface,
no_interface_cmd, no_interface_cmd,
"no interface IFNAME [vrf NAME]", "no interface IFNAME [vrf NAME]",
NO_STR NO_STR
"Delete a pseudo interface's configuration\n" "Delete a pseudo interface's configuration\n"
"Interface's name\n" "Interface's name\n"
VRF_CMD_HELP_STR) VRF_CMD_HELP_STR)
{ {
int idx_vrf = 4; int idx_vrf = 4;
const char *ifname = argv[2]->arg; const char *ifname = argv[2]->arg;

View File

@ -70,6 +70,26 @@ void listnode_add(struct list *list, void *val)
list->count++; list->count++;
} }
void listnode_add_head(struct list *list, void *val)
{
struct listnode *node;
assert(val != NULL);
node = listnode_new();
node->next = list->head;
node->data = val;
if (list->head == NULL)
list->head = node;
else
list->head->prev = node;
list->head = node;
list->count++;
}
void listnode_add_sort(struct list *list, void *val) void listnode_add_sort(struct list *list, void *val)
{ {
struct listnode *n; struct listnode *n;

View File

@ -82,6 +82,19 @@ extern struct list *list_new(void);
*/ */
extern void listnode_add(struct list *list, void *data); extern void listnode_add(struct list *list, void *data);
/*
* Add a new element to the beginning of a list.
*
* Runtime is O(1).
*
* list
* list to operate on
*
* data
* element to add
*/
extern void listnode_add_head(struct list *list, void *data);
/* /*
* Insert a new element into a list with insertion sort. * Insert a new element into a list with insertion sort.
* *

View File

@ -711,12 +711,12 @@ DEFUN_NOSH (vrf,
return vrf_handler_create(vty, vrfname, NULL); return vrf_handler_create(vty, vrfname, NULL);
} }
DEFUN_NOSH (no_vrf, DEFUN (no_vrf,
no_vrf_cmd, no_vrf_cmd,
"no vrf NAME", "no vrf NAME",
NO_STR NO_STR
"Delete a pseudo VRF's configuration\n" "Delete a pseudo VRF's configuration\n"
"VRF's name\n") "VRF's name\n")
{ {
const char *vrfname = argv[2]->arg; const char *vrfname = argv[2]->arg;
@ -744,7 +744,7 @@ DEFUN_NOSH (no_vrf,
struct cmd_node vrf_node = {VRF_NODE, "%s(config-vrf)# ", 1}; struct cmd_node vrf_node = {VRF_NODE, "%s(config-vrf)# ", 1};
DEFUN (vrf_netns, DEFUN_NOSH (vrf_netns,
vrf_netns_cmd, vrf_netns_cmd,
"netns NAME", "netns NAME",
"Attach VRF to a Namespace\n" "Attach VRF to a Namespace\n"
@ -771,7 +771,7 @@ DEFUN (vrf_netns,
return ret; return ret;
} }
DEFUN (no_vrf_netns, DEFUN_NOSH (no_vrf_netns,
no_vrf_netns_cmd, no_vrf_netns_cmd,
"no netns [NAME]", "no netns [NAME]",
NO_STR NO_STR

View File

@ -580,6 +580,9 @@ static int pbr_interface_config_write(struct vty *vty)
vty_frame(vty, "interface %s vrf %s\n", vty_frame(vty, "interface %s vrf %s\n",
ifp->name, vrf->name); ifp->name, vrf->name);
if (ifp->desc)
vty_out(vty, " description %s\n", ifp->desc);
pbr_map_write_interfaces(vty, ifp); pbr_map_write_interfaces(vty, ifp);
vty_endframe(vty, "!\n"); vty_endframe(vty, "!\n");

View File

@ -258,6 +258,11 @@ int pim_interface_config_write(struct vty *vty)
ifp->name, vrf->name); ifp->name, vrf->name);
++writes; ++writes;
if (ifp->desc) {
vty_out(vty, " description %s\n", ifp->desc);
++writes;
}
if (ifp->info) { if (ifp->info) {
struct pim_interface *pim_ifp = ifp->info; struct pim_interface *pim_ifp = ifp->info;

View File

@ -154,7 +154,7 @@ vtysh_cmd_FILES = $(vtysh_scan) \
$(top_srcdir)/lib/keychain.c $(top_srcdir)/lib/routemap.c \ $(top_srcdir)/lib/keychain.c $(top_srcdir)/lib/routemap.c \
$(top_srcdir)/lib/filter.c $(top_srcdir)/lib/plist.c \ $(top_srcdir)/lib/filter.c $(top_srcdir)/lib/plist.c \
$(top_srcdir)/lib/distribute.c $(top_srcdir)/lib/if_rmap.c \ $(top_srcdir)/lib/distribute.c $(top_srcdir)/lib/if_rmap.c \
$(top_srcdir)/lib/vrf.c \ $(top_srcdir)/lib/vrf.c $(top_srcdir)/lib/if.c \
$(top_srcdir)/lib/vty.c $(top_srcdir)/zebra/debug.c \ $(top_srcdir)/lib/vty.c $(top_srcdir)/zebra/debug.c \
$(top_srcdir)/lib/logicalrouter.c \ $(top_srcdir)/lib/logicalrouter.c \
$(top_srcdir)/lib/nexthop_group.c \ $(top_srcdir)/lib/nexthop_group.c \

View File

@ -85,7 +85,10 @@ foreach (@ARGV) {
$protocol = "VTYSH_RMAP"; $protocol = "VTYSH_RMAP";
} }
elsif ($file =~ /lib\/vrf\.c$/) { elsif ($file =~ /lib\/vrf\.c$/) {
$protocol = "VTYSH_ALL"; $protocol = "VTYSH_VRF";
}
elsif ($file =~ /lib\/if\.c$/) {
$protocol = "VTYSH_INTERFACE";
} }
elsif ($file =~ /lib\/logicalrouter\.c$/) { elsif ($file =~ /lib\/logicalrouter\.c$/) {
$protocol = "VTYSH_ALL"; $protocol = "VTYSH_ALL";

View File

@ -2018,18 +2018,6 @@ DEFUNSH(VTYSH_ZEBRA, vtysh_pseudowire, vtysh_pseudowire_cmd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
/* TODO Implement "no interface command in isisd. */
DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D
| VTYSH_EIGRPD,
vtysh_no_interface_cmd, "no interface IFNAME", NO_STR
"Delete a pseudo interface's configuration\n"
"Interface's name\n")
DEFSH(VTYSH_ZEBRA, vtysh_no_interface_vrf_cmd, "no interface IFNAME vrf NAME",
NO_STR
"Delete a pseudo interface's configuration\n"
"Interface's name\n" VRF_CMD_HELP_STR)
DEFUNSH(VTYSH_ZEBRA, vtysh_logicalrouter, vtysh_logicalrouter_cmd, DEFUNSH(VTYSH_ZEBRA, vtysh_logicalrouter, vtysh_logicalrouter_cmd,
"logical-router (1-65535) ns NAME", "logical-router (1-65535) ns NAME",
"Enable a logical-router\n" "Enable a logical-router\n"
@ -2070,9 +2058,16 @@ DEFUNSH(VTYSH_VRF, vtysh_vrf, vtysh_vrf_cmd, "vrf NAME",
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_cmd, "no vrf NAME", NO_STR DEFSH(VTYSH_ZEBRA, vtysh_vrf_netns_cmd,
"Delete a pseudo vrf's configuration\n" "netns NAME",
"VRF's name\n") "Attach VRF to a Namespace\n"
"The file name in " NS_RUN_DIR ", or a full pathname\n")
DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_netns_cmd,
"no netns [NAME]",
NO_STR
"Detach VRF from a Namespace\n"
"The file name in " NS_RUN_DIR ", or a full pathname\n")
DEFUNSH(VTYSH_NS, vtysh_exit_logicalrouter, DEFUNSH(VTYSH_NS, vtysh_exit_logicalrouter,
vtysh_exit_logicalrouter_cmd, "exit", vtysh_exit_logicalrouter_cmd, "exit",
@ -2112,19 +2107,6 @@ DEFUNSH(VTYSH_VRF, vtysh_quit_nexthop_group, vtysh_quit_nexthop_group_cmd,
return vtysh_exit_nexthop_group(self, vty, argc, argv); return vtysh_exit_nexthop_group(self, vty, argc, argv);
} }
/*
* TODO Implement interface description commands in ripngd, ospf6d
* and isisd.
*/
DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_OSPFD | VTYSH_EIGRPD,
vtysh_interface_desc_cmd, "description LINE...",
"Interface specific description\n"
"Characters describing this interface\n")
DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_OSPFD | VTYSH_EIGRPD,
vtysh_no_interface_desc_cmd, "no description",
NO_STR "Interface specific description\n")
DEFUNSH(VTYSH_INTERFACE, vtysh_exit_interface, vtysh_exit_interface_cmd, "exit", DEFUNSH(VTYSH_INTERFACE, vtysh_exit_interface, vtysh_exit_interface_cmd, "exit",
"Exit current mode and down to previous mode\n") "Exit current mode and down to previous mode\n")
{ {
@ -3577,8 +3559,6 @@ void vtysh_init_vty(void)
install_element(PBRMAP_NODE, &vtysh_end_all_cmd); install_element(PBRMAP_NODE, &vtysh_end_all_cmd);
install_element(VTY_NODE, &vtysh_end_all_cmd); install_element(VTY_NODE, &vtysh_end_all_cmd);
install_element(INTERFACE_NODE, &vtysh_interface_desc_cmd);
install_element(INTERFACE_NODE, &vtysh_no_interface_desc_cmd);
install_element(INTERFACE_NODE, &vtysh_end_all_cmd); install_element(INTERFACE_NODE, &vtysh_end_all_cmd);
install_element(INTERFACE_NODE, &vtysh_exit_interface_cmd); install_element(INTERFACE_NODE, &vtysh_exit_interface_cmd);
install_element(LINK_PARAMS_NODE, &exit_link_params_cmd); install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
@ -3682,17 +3662,16 @@ void vtysh_init_vty(void)
install_element(KEYCHAIN_NODE, &key_chain_cmd); install_element(KEYCHAIN_NODE, &key_chain_cmd);
install_element(KEYCHAIN_KEY_NODE, &key_chain_cmd); install_element(KEYCHAIN_KEY_NODE, &key_chain_cmd);
install_element(CONFIG_NODE, &vtysh_interface_cmd); 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(CONFIG_NODE, &vtysh_pseudowire_cmd);
install_element(INTERFACE_NODE, &vtysh_link_params_cmd); install_element(INTERFACE_NODE, &vtysh_link_params_cmd);
install_element(ENABLE_NODE, &vtysh_show_running_config_cmd); install_element(ENABLE_NODE, &vtysh_show_running_config_cmd);
install_element(ENABLE_NODE, &vtysh_copy_running_config_cmd); install_element(ENABLE_NODE, &vtysh_copy_running_config_cmd);
install_element(CONFIG_NODE, &vtysh_vrf_cmd);
install_element(VRF_NODE, &vtysh_vrf_netns_cmd);
install_element(VRF_NODE, &vtysh_no_vrf_netns_cmd);
install_element(VRF_NODE, &exit_vrf_config_cmd); install_element(VRF_NODE, &exit_vrf_config_cmd);
install_element(CONFIG_NODE, &vtysh_vrf_cmd);
install_element(CONFIG_NODE, &vtysh_no_vrf_cmd);
install_element(CONFIG_NODE, &vtysh_no_nexthop_group_cmd); install_element(CONFIG_NODE, &vtysh_no_nexthop_group_cmd);
/* "write terminal" command. */ /* "write terminal" command. */

View File

@ -308,15 +308,14 @@ void zebra_pw_exit(struct zebra_vrf *zvrf)
DEFUN_NOSH (pseudowire_if, DEFUN_NOSH (pseudowire_if,
pseudowire_if_cmd, pseudowire_if_cmd,
"[no] pseudowire IFNAME", "pseudowire IFNAME",
NO_STR
"Static pseudowire configuration\n" "Static pseudowire configuration\n"
"Pseudowire name\n") "Pseudowire name\n")
{ {
struct zebra_vrf *zvrf; struct zebra_vrf *zvrf;
struct zebra_pw *pw; struct zebra_pw *pw;
int idx = 0;
const char *ifname; const char *ifname;
int idx = 0;
zvrf = vrf_info_lookup(VRF_DEFAULT); zvrf = vrf_info_lookup(VRF_DEFAULT);
if (!zvrf) if (!zvrf)
@ -324,19 +323,13 @@ DEFUN_NOSH (pseudowire_if,
argv_find(argv, argc, "IFNAME", &idx); argv_find(argv, argc, "IFNAME", &idx);
ifname = argv[idx]->arg; ifname = argv[idx]->arg;
pw = zebra_pw_find(zvrf, ifname); pw = zebra_pw_find(zvrf, ifname);
if (pw && pw->protocol != ZEBRA_ROUTE_STATIC) { if (pw && pw->protocol != ZEBRA_ROUTE_STATIC) {
vty_out(vty, "%% Pseudowire is not static\n"); vty_out(vty, "%% Pseudowire is not static\n");
return CMD_WARNING; return CMD_WARNING;
} }
if (argv_find(argv, argc, "no", &idx)) {
if (!pw)
return CMD_SUCCESS;
zebra_pw_del(zvrf, pw);
return CMD_SUCCESS;
}
if (!pw) if (!pw)
pw = zebra_pw_add(zvrf, ifname, ZEBRA_ROUTE_STATIC, NULL); pw = zebra_pw_add(zvrf, ifname, ZEBRA_ROUTE_STATIC, NULL);
VTY_PUSH_CONTEXT(PW_NODE, pw); VTY_PUSH_CONTEXT(PW_NODE, pw);
@ -344,6 +337,37 @@ DEFUN_NOSH (pseudowire_if,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN (no_pseudowire_if,
no_pseudowire_if_cmd,
"no pseudowire IFNAME",
NO_STR
"Static pseudowire configuration\n"
"Pseudowire name\n")
{
struct zebra_vrf *zvrf;
struct zebra_pw *pw;
const char *ifname;
int idx = 0;
zvrf = vrf_info_lookup(VRF_DEFAULT);
if (!zvrf)
return CMD_WARNING;
argv_find(argv, argc, "IFNAME", &idx);
ifname = argv[idx]->arg;
pw = zebra_pw_find(zvrf, ifname);
if (pw) {
if (pw->protocol != ZEBRA_ROUTE_STATIC) {
vty_out(vty, "%% Pseudowire is not static\n");
return CMD_WARNING;
}
zebra_pw_del(zvrf, pw);
}
return CMD_SUCCESS;
}
DEFUN (pseudowire_labels, DEFUN (pseudowire_labels,
pseudowire_labels_cmd, pseudowire_labels_cmd,
"[no] mpls label local (16-1048575) remote (16-1048575)", "[no] mpls label local (16-1048575) remote (16-1048575)",
@ -531,6 +555,7 @@ void zebra_pw_vty_init(void)
install_default(PW_NODE); install_default(PW_NODE);
install_element(CONFIG_NODE, &pseudowire_if_cmd); install_element(CONFIG_NODE, &pseudowire_if_cmd);
install_element(CONFIG_NODE, &no_pseudowire_if_cmd);
install_element(PW_NODE, &pseudowire_labels_cmd); install_element(PW_NODE, &pseudowire_labels_cmd);
install_element(PW_NODE, &pseudowire_neighbor_cmd); install_element(PW_NODE, &pseudowire_neighbor_cmd);
install_element(PW_NODE, &pseudowire_control_word_cmd); install_element(PW_NODE, &pseudowire_control_word_cmd);