2 * Copyright (C) 2016 by Open Source Routing.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; see the file COPYING; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
24 #include "ldpd/ldp_vty.h"
26 DEFUN_NOSH(ldp_mpls_ldp
,
29 "Negate a command or set its defaults\n"
30 "Global MPLS configuration subcommands\n"
31 "Label Distribution Protocol\n")
36 if (argv_find(argv
, argc
, "no", &idx
))
39 return (ldp_vty_mpls_ldp(vty
, negate
));
44 "[no] l2vpn WORD type vpls",
45 "Negate a command or set its defaults\n"
46 "Configure l2vpn commands\n"
49 "Virtual Private LAN Service\n")
55 if (argv_find(argv
, argc
, "no", &idx
))
57 argv_find(argv
, argc
, "WORD", &idx
);
58 name
= argv
[idx
]->arg
;
60 return (ldp_vty_l2vpn(vty
, negate
, name
));
63 DEFUN_NOSH(ldp_address_family
,
64 ldp_address_family_cmd
,
65 "[no] address-family <ipv4|ipv6>",
66 "Negate a command or set its defaults\n"
67 "Configure Address Family and its parameters\n"
75 if (argv_find(argv
, argc
, "no", &idx
))
77 argv_find(argv
, argc
, "address-family", &idx
);
78 af
= argv
[idx
+ 1]->text
;
80 return (ldp_vty_address_family(vty
, negate
, af
));
83 DEFUN_NOSH(ldp_exit_address_family
,
84 ldp_exit_address_family_cmd
,
85 "exit-address-family",
86 "Exit from Address Family configuration mode\n")
88 if (vty
->node
== LDP_IPV4_NODE
|| vty
->node
== LDP_IPV6_NODE
)
93 DEFUN (ldp_discovery_holdtime
,
94 ldp_discovery_holdtime_cmd
,
95 "[no] discovery <hello|targeted-hello> holdtime (1-65535)",
96 "Negate a command or set its defaults\n"
97 "Configure discovery parameters\n"
99 "LDP Targeted Hellos\n"
101 "Time (seconds) - 65535 implies infinite\n")
105 const char *hello_type
;
106 const char *holdtime
;
108 if (argv_find(argv
, argc
, "no", &idx
))
110 argv_find(argv
, argc
, "discovery", &idx
);
111 hello_type
= argv
[idx
+ 1]->text
;
112 argv_find(argv
, argc
, "(1-65535)", &idx
);
113 holdtime
= argv
[idx
]->arg
;
115 return (ldp_vty_disc_holdtime(vty
, negate
, hello_type
, holdtime
));
118 DEFUN (ldp_discovery_interval
,
119 ldp_discovery_interval_cmd
,
120 "[no] discovery <hello|targeted-hello> interval (1-65535)",
121 "Negate a command or set its defaults\n"
122 "Configure discovery parameters\n"
124 "LDP Targeted Hellos\n"
130 const char *hello_type
;
131 const char *interval
;
133 if (argv_find(argv
, argc
, "no", &idx
))
135 argv_find(argv
, argc
, "discovery", &idx
);
136 hello_type
= argv
[idx
+ 1]->text
;
137 argv_find(argv
, argc
, "(1-65535)", &idx
);
138 interval
= argv
[idx
]->arg
;
140 return (ldp_vty_disc_interval(vty
, negate
, hello_type
, interval
));
143 DEFUN (ldp_dual_stack_transport_connection_prefer_ipv4
,
144 ldp_dual_stack_transport_connection_prefer_ipv4_cmd
,
145 "[no] dual-stack transport-connection prefer ipv4",
146 "Negate a command or set its defaults\n"
147 "Configure dual stack parameters\n"
148 "Configure TCP transport parameters\n"
149 "Configure prefered address family for TCP transport connection with neighbor\n"
155 if (argv_find(argv
, argc
, "no", &idx
))
158 return (ldp_vty_trans_pref_ipv4(vty
, negate
));
161 DEFUN (ldp_dual_stack_cisco_interop
,
162 ldp_dual_stack_cisco_interop_cmd
,
163 "[no] dual-stack cisco-interop",
164 "Negate a command or set its defaults\n"
165 "Configure dual stack parameters\n"
166 "Use Cisco non-compliant format to send and interpret the Dual-Stack capability TLV\n")
171 if (argv_find(argv
, argc
, "no", &idx
))
174 return (ldp_vty_ds_cisco_interop(vty
, negate
));
177 DEFUN (ldp_neighbor_password
,
178 ldp_neighbor_password_cmd
,
179 "[no] neighbor A.B.C.D password WORD",
180 "Negate a command or set its defaults\n"
181 "Configure neighbor parameters\n"
182 "LDP Id of neighbor\n"
183 "Configure password for MD5 authentication\n"
188 const char *neighbor
;
189 const char *password
;
191 if (argv_find(argv
, argc
, "no", &idx
))
193 argv_find(argv
, argc
, "A.B.C.D", &idx
);
194 neighbor
= argv
[idx
]->arg
;
195 argv_find(argv
, argc
, "WORD", &idx
);
196 password
= argv
[idx
]->arg
;
198 return (ldp_vty_neighbor_password(vty
, negate
, neighbor
, password
));
201 DEFUN (ldp_neighbor_session_holdtime
,
202 ldp_neighbor_session_holdtime_cmd
,
203 "[no] neighbor A.B.C.D session holdtime (15-65535)",
204 "Negate a command or set its defaults\n"
205 "Configure neighbor parameters\n"
206 "LDP Id of neighbor\n"
207 "Configure session parameters\n"
208 "Configure session holdtime\n"
213 const char *neighbor
;
214 const char *holdtime
;
216 if (argv_find(argv
, argc
, "no", &idx
))
218 argv_find(argv
, argc
, "A.B.C.D", &idx
);
219 neighbor
= argv
[idx
]->arg
;
220 argv_find(argv
, argc
, "(15-65535)", &idx
);
221 holdtime
= argv
[idx
]->arg
;
223 return (ldp_vty_nbr_session_holdtime(vty
, negate
, neighbor
, holdtime
));
226 DEFUN (ldp_neighbor_ttl_security
,
227 ldp_neighbor_ttl_security_cmd
,
228 "[no] neighbor A.B.C.D ttl-security <disable|hops (1-254)>",
229 "Negate a command or set its defaults\n"
230 "Configure neighbor parameters\n"
231 "LDP Id of neighbor\n"
232 "LDP ttl security check\n"
233 "Disable ttl security\n"
235 "maximum number of hops\n")
239 const char *neighbor
;
240 const char *hops
= NULL
;
242 if (argv_find(argv
, argc
, "no", &idx
))
244 argv_find(argv
, argc
, "A.B.C.D", &idx
);
245 neighbor
= argv
[idx
]->arg
;
246 if (argv_find(argv
, argc
, "(1-254)", &idx
))
247 hops
= argv
[idx
]->arg
;
249 return (ldp_vty_neighbor_ttl_security(vty
, negate
, neighbor
, hops
));
252 DEFUN (ldp_router_id
,
254 "[no] router-id A.B.C.D",
255 "Negate a command or set its defaults\n"
256 "Configure router Id\n"
257 "LSR Id (in form of an IPv4 address)\n")
263 if (argv_find(argv
, argc
, "no", &idx
))
265 argv_find(argv
, argc
, "A.B.C.D", &idx
);
266 address
= argv
[idx
]->arg
;
268 return (ldp_vty_router_id(vty
, negate
, address
));
271 DEFUN (ldp_discovery_targeted_hello_accept
,
272 ldp_discovery_targeted_hello_accept_cmd
,
273 "[no] discovery targeted-hello accept [from <(1-199)|(1300-2699)|WORD>]",
274 "Negate a command or set its defaults\n"
275 "Configure discovery parameters\n"
276 "LDP Targeted Hellos\n"
277 "Accept and respond to targeted hellos\n"
278 "Access list to specify acceptable targeted hello source\n"
279 "IP access-list number\n"
280 "IP access-list number (expanded range)\n"
281 "IP access-list name\n")
285 const char *from_acl
= NULL
;
287 if (argv_find(argv
, argc
, "no", &idx
))
289 if (argv_find(argv
, argc
, "from", &idx
))
290 from_acl
= argv
[idx
+ 1]->arg
;
292 return (ldp_vty_targeted_hello_accept(vty
, negate
, from_acl
));
295 DEFUN (ldp_discovery_transport_address_ipv4
,
296 ldp_discovery_transport_address_ipv4_cmd
,
297 "[no] discovery transport-address A.B.C.D",
298 "Negate a command or set its defaults\n"
299 "Configure discovery parameters\n"
300 "Specify transport address for TCP connection\n"
301 "IP address to be used as transport address\n")
307 if (argv_find(argv
, argc
, "no", &idx
))
309 argv_find(argv
, argc
, "A.B.C.D", &idx
);
310 address
= argv
[idx
]->arg
;
312 return (ldp_vty_trans_addr(vty
, negate
, address
));
315 DEFUN (ldp_discovery_transport_address_ipv6
,
316 ldp_discovery_transport_address_ipv6_cmd
,
317 "[no] discovery transport-address X:X::X:X",
318 "Negate a command or set its defaults\n"
319 "Configure discovery parameters\n"
320 "Specify transport address for TCP connection\n"
321 "IPv6 address to be used as transport address\n")
327 if (argv_find(argv
, argc
, "no", &idx
))
329 argv_find(argv
, argc
, "X:X::X:X", &idx
);
330 address
= argv
[idx
]->arg
;
332 return (ldp_vty_trans_addr(vty
, negate
, address
));
335 DEFUN (ldp_label_local_advertise
,
336 ldp_label_local_advertise_cmd
,
337 "[no] label local advertise [{to <(1-199)|(1300-2699)|WORD>|for <(1-199)|(1300-2699)|WORD>}]",
338 "Negate a command or set its defaults\n"
339 "Configure label control and policies\n"
340 "Configure local label control and policies\n"
341 "Configure outbound label advertisement control\n"
342 "IP Access-list specifying controls on LDP Peers\n"
343 "IP access-list number\n"
344 "IP access-list number (expanded range)\n"
345 "IP access-list name\n"
346 "IP access-list for destination prefixes\n"
347 "IP access-list number\n"
348 "IP access-list number (expanded range)\n"
349 "IP access-list name\n")
353 const char *to_acl
= NULL
;
354 const char *for_acl
= NULL
;
356 if (argv_find(argv
, argc
, "no", &idx
))
359 /* arguments within curly braces may be provided in any order */
360 if (argv_find(argv
, argc
, "to", &idx
))
361 to_acl
= argv
[idx
+ 1]->arg
;
363 if (argv_find(argv
, argc
, "for", &idx
))
364 for_acl
= argv
[idx
+ 1]->arg
;
366 return (ldp_vty_label_advertise(vty
, negate
, to_acl
, for_acl
));
369 DEFUN (ldp_label_local_advertise_explicit_null
,
370 ldp_label_local_advertise_explicit_null_cmd
,
371 "[no] label local advertise explicit-null [for <(1-199)|(1300-2699)|WORD>]",
372 "Negate a command or set its defaults\n"
373 "Configure label control and policies\n"
374 "Configure local label control and policies\n"
375 "Configure outbound label advertisement control\n"
376 "Configure explicit-null advertisement\n"
377 "IP access-list for destination prefixes\n"
378 "IP access-list number\n"
379 "IP access-list number (expanded range)\n"
380 "IP access-list name\n")
384 const char *for_acl
= NULL
;
386 if (argv_find(argv
, argc
, "no", &idx
))
388 if (argv_find(argv
, argc
, "for", &idx
))
389 for_acl
= argv
[idx
+ 1]->arg
;
391 return (ldp_vty_label_expnull(vty
, negate
, for_acl
));
394 DEFUN (ldp_label_local_allocate
,
395 ldp_label_local_allocate_cmd
,
396 "[no] label local allocate <host-routes|for <(1-199)|(1300-2699)|WORD>>",
397 "Negate a command or set its defaults\n"
398 "Configure label control and policies\n"
399 "Configure local label control and policies\n"
400 "Configure label allocation control\n"
401 "allocate local label for host routes only\n"
403 "IP access-list number\n"
404 "IP access-list number (expanded range)\n"
405 "IP access-list name\n")
410 const char *for_acl
= NULL
;
412 if (argv_find(argv
, argc
, "no", &idx
))
415 /* arguments within curly braces may be provided in any order */
416 if (argv_find(argv
, argc
, "host-routes", &idx
))
419 if (argv_find(argv
, argc
, "for", &idx
))
420 for_acl
= argv
[idx
+ 1]->arg
;
422 return (ldp_vty_label_allocate(vty
, negate
, host_routes
, for_acl
));
425 DEFUN (ldp_label_remote_accept
,
426 ldp_label_remote_accept_cmd
,
427 "[no] label remote accept {from <(1-199)|(1300-2699)|WORD>|for <(1-199)|(1300-2699)|WORD>}",
428 "Negate a command or set its defaults\n"
429 "Configure label control and policies\n"
430 "Configure remote/peer label control and policies\n"
431 "Configure inbound label acceptance control\n"
432 "Neighbor from whom to accept label advertisement\n"
433 "IP access-list number\n"
434 "IP access-list number (expanded range)\n"
435 "IP access-list name\n"
436 "IP access-list for destination prefixes\n"
437 "IP access-list number\n"
438 "IP access-list number (expanded range)\n"
439 "IP access-list name\n")
443 const char *from_acl
= NULL
;
444 const char *for_acl
= NULL
;
446 if (argv_find(argv
, argc
, "no", &idx
))
449 /* arguments within curly braces may be provided in any order */
450 if (argv_find(argv
, argc
, "from", &idx
))
451 from_acl
= argv
[idx
+ 1]->arg
;
453 if (argv_find(argv
, argc
, "for", &idx
))
454 for_acl
= argv
[idx
+ 1]->arg
;
456 return (ldp_vty_label_accept(vty
, negate
, from_acl
, for_acl
));
459 DEFUN (ldp_ttl_security_disable
,
460 ldp_ttl_security_disable_cmd
,
461 "[no] ttl-security disable",
462 "Negate a command or set its defaults\n"
463 "LDP ttl security check\n"
464 "Disable ttl security\n")
469 if (argv_find(argv
, argc
, "no", &idx
))
472 return (ldp_vty_ttl_security(vty
, negate
));
475 DEFUN (ldp_session_holdtime
,
476 ldp_session_holdtime_cmd
,
477 "[no] session holdtime (15-65535)",
478 "Negate a command or set its defaults\n"
479 "Configure session parameters\n"
480 "Configure session holdtime\n"
485 const char *holdtime
;
487 if (argv_find(argv
, argc
, "no", &idx
))
489 argv_find(argv
, argc
, "(15-65535)", &idx
);
490 holdtime
= argv
[idx
]->arg
;
492 return (ldp_vty_af_session_holdtime(vty
, negate
, holdtime
));
495 DEFUN_NOSH(ldp_interface
,
497 "[no] interface IFNAME",
498 "Negate a command or set its defaults\n"
499 "Enable LDP on an interface and enter interface submode\n"
500 "Interface's name\n")
506 if (argv_find(argv
, argc
, "no", &idx
))
508 argv_find(argv
, argc
, "IFNAME", &idx
);
509 ifname
= argv
[idx
]->arg
;
511 return (ldp_vty_interface(vty
, negate
, ifname
));
514 DEFUN (ldp_neighbor_ipv4_targeted
,
515 ldp_neighbor_ipv4_targeted_cmd
,
516 "[no] neighbor A.B.C.D targeted",
517 "Negate a command or set its defaults\n"
518 "Configure neighbor parameters\n"
519 "IP address of neighbor\n"
520 "Establish targeted session\n")
526 if (argv_find(argv
, argc
, "no", &idx
))
528 argv_find(argv
, argc
, "A.B.C.D", &idx
);
529 address
= argv
[idx
]->arg
;
531 return (ldp_vty_neighbor_targeted(vty
, negate
, address
));
534 DEFUN (ldp_neighbor_ipv6_targeted
,
535 ldp_neighbor_ipv6_targeted_cmd
,
536 "[no] neighbor X:X::X:X targeted",
537 "Negate a command or set its defaults\n"
538 "Configure neighbor parameters\n"
539 "IPv6 address of neighbor\n"
540 "Establish targeted session\n")
546 if (argv_find(argv
, argc
, "no", &idx
))
548 argv_find(argv
, argc
, "X:X::X:X", &idx
);
549 address
= argv
[idx
]->arg
;
551 return (ldp_vty_neighbor_targeted(vty
, negate
, address
));
556 "[no] bridge IFNAME",
557 "Negate a command or set its defaults\n"
559 "Interface's name\n")
565 if (argv_find(argv
, argc
, "no", &idx
))
567 argv_find(argv
, argc
, "IFNAME", &idx
);
568 ifname
= argv
[idx
]->arg
;
570 return (ldp_vty_l2vpn_bridge(vty
, negate
, ifname
));
575 "[no] mtu (1500-9180)",
576 "Negate a command or set its defaults\n"
577 "Set Maximum Transmission Unit\n"
578 "Maximum Transmission Unit value\n")
584 if (argv_find(argv
, argc
, "no", &idx
))
586 argv_find(argv
, argc
, "(1500-9180)", &idx
);
587 mtu
= argv
[idx
]->arg
;
589 return (ldp_vty_l2vpn_mtu(vty
, negate
, mtu
));
592 DEFUN (ldp_member_interface
,
593 ldp_member_interface_cmd
,
594 "[no] member interface IFNAME",
595 "Negate a command or set its defaults\n"
596 "L2VPN member configuration\n"
598 "Interface's name\n")
604 if (argv_find(argv
, argc
, "no", &idx
))
606 argv_find(argv
, argc
, "IFNAME", &idx
);
607 ifname
= argv
[idx
]->arg
;
609 return (ldp_vty_l2vpn_interface(vty
, negate
, ifname
));
612 DEFUN_NOSH(ldp_member_pseudowire
,
613 ldp_member_pseudowire_cmd
,
614 "[no] member pseudowire IFNAME",
615 "Negate a command or set its defaults\n"
616 "L2VPN member configuration\n"
617 "Pseudowire interface\n"
618 "Interface's name\n")
624 if (argv_find(argv
, argc
, "no", &idx
))
626 argv_find(argv
, argc
, "IFNAME", &idx
);
627 ifname
= argv
[idx
]->arg
;
629 return (ldp_vty_l2vpn_pseudowire(vty
, negate
, ifname
));
634 "[no] vc type <ethernet|ethernet-tagged>",
635 "Negate a command or set its defaults\n"
636 "Virtual Circuit options\n"
637 "Virtual Circuit type to use\n"
638 "Ethernet (type 5)\n"
639 "Ethernet-tagged (type 4)\n")
645 if (argv_find(argv
, argc
, "no", &idx
))
647 argv_find(argv
, argc
, "type", &idx
);
648 vc_type
= argv
[idx
+ 1]->text
;
650 return (ldp_vty_l2vpn_pwtype(vty
, negate
, vc_type
));
653 DEFUN (ldp_control_word
,
654 ldp_control_word_cmd
,
655 "[no] control-word <exclude|include>",
656 "Negate a command or set its defaults\n"
657 "Control-word options\n"
658 "Exclude control-word in pseudowire packets\n"
659 "Include control-word in pseudowire packets\n")
663 const char *preference
;
665 if (argv_find(argv
, argc
, "no", &idx
))
667 argv_find(argv
, argc
, "control-word", &idx
);
668 preference
= argv
[idx
+ 1]->text
;
670 return (ldp_vty_l2vpn_pw_cword(vty
, negate
, preference
));
673 DEFUN (ldp_neighbor_address
,
674 ldp_neighbor_address_cmd
,
675 "[no] neighbor address <A.B.C.D|X:X::X:X>",
676 "Negate a command or set its defaults\n"
677 "Remote endpoint configuration\n"
678 "Specify the IPv4 or IPv6 address of the remote endpoint\n"
686 if (argv_find(argv
, argc
, "no", &idx
))
688 argv_find(argv
, argc
, "address", &idx
);
689 address
= argv
[idx
+ 1]->arg
;
691 return (ldp_vty_l2vpn_pw_nbr_addr(vty
, negate
, address
));
694 DEFUN (ldp_neighbor_lsr_id
,
695 ldp_neighbor_lsr_id_cmd
,
696 "[no] neighbor lsr-id A.B.C.D",
697 "Negate a command or set its defaults\n"
698 "Remote endpoint configuration\n"
699 "Specify the LSR-ID of the remote endpoint\n"
706 if (argv_find(argv
, argc
, "no", &idx
))
708 argv_find(argv
, argc
, "A.B.C.D", &idx
);
709 address
= argv
[idx
]->arg
;
711 return (ldp_vty_l2vpn_pw_nbr_id(vty
, negate
, address
));
716 "[no] pw-id (1-4294967295)",
717 "Negate a command or set its defaults\n"
718 "Set the Virtual Circuit ID\n"
719 "Virtual Circuit ID value\n")
725 if (argv_find(argv
, argc
, "no", &idx
))
727 argv_find(argv
, argc
, "(1-4294967295)", &idx
);
728 pwid
= argv
[idx
]->arg
;
730 return (ldp_vty_l2vpn_pw_pwid(vty
, negate
, pwid
));
733 DEFUN (ldp_pw_status_disable
,
734 ldp_pw_status_disable_cmd
,
735 "[no] pw-status disable",
736 "Negate a command or set its defaults\n"
737 "Configure PW status\n"
738 "Disable PW status\n")
743 if (argv_find(argv
, argc
, "no", &idx
))
746 return (ldp_vty_l2vpn_pw_pwstatus(vty
, negate
));
749 DEFUN (ldp_clear_mpls_ldp_neighbor
,
750 ldp_clear_mpls_ldp_neighbor_cmd
,
751 "clear mpls ldp neighbor [<A.B.C.D|X:X::X:X>]",
753 "Reset MPLS statistical information\n"
755 "Clear LDP neighbor sessions\n"
760 const char *address
= NULL
;
762 if (argv_find(argv
, argc
, "neighbor", &idx
))
763 address
= argv
[idx
+ 1]->arg
;
765 return (ldp_vty_clear_nbr(vty
, address
));
768 DEFUN (ldp_debug_mpls_ldp_discovery_hello
,
769 ldp_debug_mpls_ldp_discovery_hello_cmd
,
770 "[no] debug mpls ldp discovery hello <recv|sent>",
771 "Negate a command or set its defaults\n"
772 "Debugging functions\n"
774 "Label Distribution Protocol\n"
775 "Discovery messages\n"
776 "Discovery hello message\n"
777 "Received messages\n"
784 if (argv_find(argv
, argc
, "no", &idx
))
786 argv_find(argv
, argc
, "hello", &idx
);
787 dir
= argv
[idx
+ 1]->text
;
789 return (ldp_vty_debug(vty
, negate
, "discovery", dir
, 0));
792 DEFUN (ldp_debug_mpls_ldp_type
,
793 ldp_debug_mpls_ldp_type_cmd
,
794 "[no] debug mpls ldp <errors|event|zebra>",
795 "Negate a command or set its defaults\n"
796 "Debugging functions\n"
798 "Label Distribution Protocol\n"
800 "LDP event information\n"
801 "LDP zebra information\n")
807 if (argv_find(argv
, argc
, "no", &idx
))
809 argv_find(argv
, argc
, "ldp", &idx
);
810 type
= argv
[idx
+ 1]->text
;
812 return (ldp_vty_debug(vty
, negate
, type
, NULL
, 0));
815 DEFUN (ldp_debug_mpls_ldp_messages_recv
,
816 ldp_debug_mpls_ldp_messages_recv_cmd
,
817 "[no] debug mpls ldp messages recv [all]",
818 "Negate a command or set its defaults\n"
819 "Debugging functions\n"
821 "Label Distribution Protocol\n"
823 "Received messages, excluding periodic Keep Alives\n"
824 "Received messages, including periodic Keep Alives\n")
830 if (argv_find(argv
, argc
, "no", &idx
))
832 if (argv_find(argv
, argc
, "all", &idx
))
835 return (ldp_vty_debug(vty
, negate
, "messages", "recv", all
));
838 DEFUN (ldp_debug_mpls_ldp_messages_sent
,
839 ldp_debug_mpls_ldp_messages_sent_cmd
,
840 "[no] debug mpls ldp messages sent [all]",
841 "Negate a command or set its defaults\n"
842 "Debugging functions\n"
844 "Label Distribution Protocol\n"
846 "Sent messages, excluding periodic Keep Alives\n"
847 "Sent messages, including periodic Keep Alives\n")
853 if (argv_find(argv
, argc
, "no", &idx
))
855 if (argv_find(argv
, argc
, "all", &idx
))
858 return (ldp_vty_debug(vty
, negate
, "messages", "sent", all
));
861 DEFUN (ldp_show_mpls_ldp_binding
,
862 ldp_show_mpls_ldp_binding_cmd
,
863 "show mpls ldp [<ipv4|ipv6>] binding [detail] [json]",
864 "Show running system information\n"
866 "Label Distribution Protocol\n"
867 "IPv4 Address Family\n"
868 "IPv6 Address Family\n"
869 "Label Information Base (LIB) information\n"
870 "Show detailed information\n"
871 "JavaScript Object Notation\n")
874 const char *af
= NULL
;
878 if (argv_find(argv
, argc
, "ipv4", &idx
) ||
879 argv_find(argv
, argc
, "ipv6", &idx
))
880 af
= argv
[idx
]->text
;
881 if (argv_find(argv
, argc
, "detail", &idx
))
883 if (argv_find(argv
, argc
, "json", &idx
))
886 return (ldp_vty_show_binding(vty
, af
, detail
, json
));
889 DEFUN (ldp_show_mpls_ldp_discovery
,
890 ldp_show_mpls_ldp_discovery_cmd
,
891 "show mpls ldp [<ipv4|ipv6>] discovery [detail] [json]",
892 "Show running system information\n"
894 "Label Distribution Protocol\n"
895 "IPv4 Address Family\n"
896 "IPv6 Address Family\n"
897 "Discovery Hello Information\n"
898 "Show detailed information\n"
899 "JavaScript Object Notation\n")
902 const char *af
= NULL
;
906 if (argv_find(argv
, argc
, "ipv4", &idx
) ||
907 argv_find(argv
, argc
, "ipv6", &idx
))
908 af
= argv
[idx
]->text
;
909 if (argv_find(argv
, argc
, "detail", &idx
))
911 if (argv_find(argv
, argc
, "json", &idx
))
914 return (ldp_vty_show_discovery(vty
, af
, detail
, json
));
917 DEFUN (ldp_show_mpls_ldp_interface
,
918 ldp_show_mpls_ldp_interface_cmd
,
919 "show mpls ldp [<ipv4|ipv6>] interface [json]",
920 "Show running system information\n"
922 "Label Distribution Protocol\n"
923 "IPv4 Address Family\n"
924 "IPv6 Address Family\n"
925 "interface information\n"
926 "JavaScript Object Notation\n")
929 const char *af
= NULL
;
932 if (argv_find(argv
, argc
, "ipv4", &idx
) ||
933 argv_find(argv
, argc
, "ipv6", &idx
))
934 af
= argv
[idx
]->text
;
935 if (argv_find(argv
, argc
, "json", &idx
))
938 return (ldp_vty_show_interface(vty
, af
, json
));
941 DEFUN (ldp_show_mpls_ldp_capabilities
,
942 ldp_show_mpls_ldp_capabilities_cmd
,
943 "show mpls ldp capabilities [json]",
944 "Show running system information\n"
946 "Label Distribution Protocol\n"
947 "Display LDP Capabilities information\n"
948 "JavaScript Object Notation\n")
953 if (argv_find(argv
, argc
, "json", &idx
))
956 return (ldp_vty_show_capabilities(vty
, json
));
959 DEFUN (ldp_show_mpls_ldp_neighbor
,
960 ldp_show_mpls_ldp_neighbor_cmd
,
961 "show mpls ldp neighbor [detail] [json]",
962 "Show running system information\n"
964 "Label Distribution Protocol\n"
965 "Neighbor information\n"
966 "Show detailed information\n"
967 "JavaScript Object Notation\n")
973 if (argv_find(argv
, argc
, "detail", &idx
))
975 if (argv_find(argv
, argc
, "json", &idx
))
978 return (ldp_vty_show_neighbor(vty
, 0, detail
, json
));
981 DEFUN (ldp_show_mpls_ldp_neighbor_capabilities
,
982 ldp_show_mpls_ldp_neighbor_capabilities_cmd
,
983 "show mpls ldp neighbor capabilities [json]",
984 "Show running system information\n"
986 "Label Distribution Protocol\n"
987 "Neighbor information\n"
988 "Display neighbor capability information\n"
989 "JavaScript Object Notation\n")
994 if (argv_find(argv
, argc
, "json", &idx
))
997 return (ldp_vty_show_neighbor(vty
, 1, 0, json
));
1000 DEFUN (ldp_show_l2vpn_atom_binding
,
1001 ldp_show_l2vpn_atom_binding_cmd
,
1002 "show l2vpn atom binding [json]",
1003 "Show running system information\n"
1004 "Show information about Layer2 VPN\n"
1005 "Show Any Transport over MPLS information\n"
1006 "Show AToM label binding information\n"
1007 "JavaScript Object Notation\n")
1012 if (argv_find(argv
, argc
, "json", &idx
))
1015 return (ldp_vty_show_atom_binding(vty
, json
));
1018 DEFUN (ldp_show_l2vpn_atom_vc
,
1019 ldp_show_l2vpn_atom_vc_cmd
,
1020 "show l2vpn atom vc [json]",
1021 "Show running system information\n"
1022 "Show information about Layer2 VPN\n"
1023 "Show Any Transport over MPLS information\n"
1024 "Show AToM virtual circuit information\n"
1025 "JavaScript Object Notation\n")
1030 if (argv_find(argv
, argc
, "json", &idx
))
1033 return (ldp_vty_show_atom_vc(vty
, json
));
1036 DEFUN (ldp_show_debugging_mpls_ldp
,
1037 ldp_show_debugging_mpls_ldp_cmd
,
1038 "show debugging mpls ldp",
1039 "Show running system information\n"
1040 "Debugging functions\n"
1041 "MPLS information\n"
1042 "Label Distribution Protocol\n")
1044 return (ldp_vty_show_debugging(vty
));
1050 install_node(&ldp_node
, ldp_config_write
);
1051 install_node(&ldp_ipv4_node
, NULL
);
1052 install_node(&ldp_ipv6_node
, NULL
);
1053 install_node(&ldp_ipv4_iface_node
, NULL
);
1054 install_node(&ldp_ipv6_iface_node
, NULL
);
1055 install_node(&ldp_l2vpn_node
, ldp_l2vpn_config_write
);
1056 install_node(&ldp_pseudowire_node
, NULL
);
1057 install_node(&ldp_debug_node
, ldp_debug_config_write
);
1058 install_default(LDP_NODE
);
1059 install_default(LDP_IPV4_NODE
);
1060 install_default(LDP_IPV6_NODE
);
1061 install_default(LDP_IPV4_IFACE_NODE
);
1062 install_default(LDP_IPV6_IFACE_NODE
);
1063 install_default(LDP_L2VPN_NODE
);
1064 install_default(LDP_PSEUDOWIRE_NODE
);
1066 install_element(CONFIG_NODE
, &ldp_mpls_ldp_cmd
);
1067 install_element(CONFIG_NODE
, &ldp_l2vpn_cmd
);
1068 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_discovery_hello_cmd
);
1069 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_type_cmd
);
1070 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_messages_recv_cmd
);
1071 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_messages_sent_cmd
);
1073 install_element(LDP_NODE
, &ldp_address_family_cmd
);
1074 install_element(LDP_NODE
, &ldp_discovery_holdtime_cmd
);
1075 install_element(LDP_NODE
, &ldp_discovery_interval_cmd
);
1076 install_element(LDP_NODE
, &ldp_dual_stack_transport_connection_prefer_ipv4_cmd
);
1077 install_element(LDP_NODE
, &ldp_dual_stack_cisco_interop_cmd
);
1078 install_element(LDP_NODE
, &ldp_neighbor_password_cmd
);
1079 install_element(LDP_NODE
, &ldp_neighbor_session_holdtime_cmd
);
1080 install_element(LDP_NODE
, &ldp_neighbor_ttl_security_cmd
);
1081 install_element(LDP_NODE
, &ldp_router_id_cmd
);
1083 install_element(LDP_IPV4_NODE
, &ldp_discovery_holdtime_cmd
);
1084 install_element(LDP_IPV4_NODE
, &ldp_discovery_interval_cmd
);
1085 install_element(LDP_IPV4_NODE
, &ldp_discovery_targeted_hello_accept_cmd
);
1086 install_element(LDP_IPV4_NODE
, &ldp_discovery_transport_address_ipv4_cmd
);
1087 install_element(LDP_IPV4_NODE
, &ldp_label_local_advertise_cmd
);
1088 install_element(LDP_IPV4_NODE
, &ldp_label_local_advertise_explicit_null_cmd
);
1089 install_element(LDP_IPV4_NODE
, &ldp_label_local_allocate_cmd
);
1090 install_element(LDP_IPV4_NODE
, &ldp_label_remote_accept_cmd
);
1091 install_element(LDP_IPV4_NODE
, &ldp_ttl_security_disable_cmd
);
1092 install_element(LDP_IPV4_NODE
, &ldp_interface_cmd
);
1093 install_element(LDP_IPV4_NODE
, &ldp_session_holdtime_cmd
);
1094 install_element(LDP_IPV4_NODE
, &ldp_neighbor_ipv4_targeted_cmd
);
1095 install_element(LDP_IPV4_NODE
, &ldp_exit_address_family_cmd
);
1097 install_element(LDP_IPV6_NODE
, &ldp_discovery_holdtime_cmd
);
1098 install_element(LDP_IPV6_NODE
, &ldp_discovery_interval_cmd
);
1099 install_element(LDP_IPV6_NODE
, &ldp_discovery_targeted_hello_accept_cmd
);
1100 install_element(LDP_IPV6_NODE
, &ldp_discovery_transport_address_ipv6_cmd
);
1101 install_element(LDP_IPV6_NODE
, &ldp_label_local_advertise_cmd
);
1102 install_element(LDP_IPV6_NODE
, &ldp_label_local_advertise_explicit_null_cmd
);
1103 install_element(LDP_IPV6_NODE
, &ldp_label_local_allocate_cmd
);
1104 install_element(LDP_IPV6_NODE
, &ldp_label_remote_accept_cmd
);
1105 install_element(LDP_IPV6_NODE
, &ldp_ttl_security_disable_cmd
);
1106 install_element(LDP_IPV6_NODE
, &ldp_interface_cmd
);
1107 install_element(LDP_IPV6_NODE
, &ldp_session_holdtime_cmd
);
1108 install_element(LDP_IPV6_NODE
, &ldp_neighbor_ipv6_targeted_cmd
);
1109 install_element(LDP_IPV6_NODE
, &ldp_exit_address_family_cmd
);
1111 install_element(LDP_IPV4_IFACE_NODE
, &ldp_discovery_holdtime_cmd
);
1112 install_element(LDP_IPV4_IFACE_NODE
, &ldp_discovery_interval_cmd
);
1114 install_element(LDP_IPV6_IFACE_NODE
, &ldp_discovery_holdtime_cmd
);
1115 install_element(LDP_IPV6_IFACE_NODE
, &ldp_discovery_interval_cmd
);
1117 install_element(LDP_L2VPN_NODE
, &ldp_bridge_cmd
);
1118 install_element(LDP_L2VPN_NODE
, &ldp_mtu_cmd
);
1119 install_element(LDP_L2VPN_NODE
, &ldp_member_interface_cmd
);
1120 install_element(LDP_L2VPN_NODE
, &ldp_member_pseudowire_cmd
);
1121 install_element(LDP_L2VPN_NODE
, &ldp_vc_type_cmd
);
1123 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_control_word_cmd
);
1124 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_neighbor_address_cmd
);
1125 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_neighbor_lsr_id_cmd
);
1126 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_pw_id_cmd
);
1127 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_pw_status_disable_cmd
);
1129 install_element(ENABLE_NODE
, &ldp_clear_mpls_ldp_neighbor_cmd
);
1130 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_discovery_hello_cmd
);
1131 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_type_cmd
);
1132 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_messages_recv_cmd
);
1133 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_messages_sent_cmd
);
1135 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_binding_cmd
);
1136 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_discovery_cmd
);
1137 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_interface_cmd
);
1138 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_capabilities_cmd
);
1139 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_neighbor_cmd
);
1140 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_neighbor_capabilities_cmd
);
1141 install_element(VIEW_NODE
, &ldp_show_l2vpn_atom_binding_cmd
);
1142 install_element(VIEW_NODE
, &ldp_show_l2vpn_atom_vc_cmd
);
1143 install_element(VIEW_NODE
, &ldp_show_debugging_mpls_ldp_cmd
);