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 (ldp_discovery_holdtime
,
84 ldp_discovery_holdtime_cmd
,
85 "[no] discovery <hello|targeted-hello> holdtime (1-65535)",
86 "Negate a command or set its defaults\n"
87 "Configure discovery parameters\n"
89 "LDP Targeted Hellos\n"
91 "Time (seconds) - 65535 implies infinite\n")
95 const char *hello_type
;
98 if (argv_find(argv
, argc
, "no", &idx
))
100 argv_find(argv
, argc
, "discovery", &idx
);
101 hello_type
= argv
[idx
+ 1]->text
;
102 argv_find(argv
, argc
, "(1-65535)", &idx
);
103 holdtime
= argv
[idx
]->arg
;
105 return (ldp_vty_disc_holdtime(vty
, negate
, hello_type
, holdtime
));
108 DEFUN (ldp_discovery_interval
,
109 ldp_discovery_interval_cmd
,
110 "[no] discovery <hello|targeted-hello> interval (1-65535)",
111 "Negate a command or set its defaults\n"
112 "Configure discovery parameters\n"
114 "LDP Targeted Hellos\n"
120 const char *hello_type
;
121 const char *interval
;
123 if (argv_find(argv
, argc
, "no", &idx
))
125 argv_find(argv
, argc
, "discovery", &idx
);
126 hello_type
= argv
[idx
+ 1]->text
;
127 argv_find(argv
, argc
, "(1-65535)", &idx
);
128 interval
= argv
[idx
]->arg
;
130 return (ldp_vty_disc_interval(vty
, negate
, hello_type
, interval
));
133 DEFUN (ldp_dual_stack_transport_connection_prefer_ipv4
,
134 ldp_dual_stack_transport_connection_prefer_ipv4_cmd
,
135 "[no] dual-stack transport-connection prefer ipv4",
136 "Negate a command or set its defaults\n"
137 "Configure dual stack parameters\n"
138 "Configure TCP transport parameters\n"
139 "Configure prefered address family for TCP transport connection with neighbor\n"
145 if (argv_find(argv
, argc
, "no", &idx
))
148 return (ldp_vty_trans_pref_ipv4(vty
, negate
));
151 DEFUN (ldp_dual_stack_cisco_interop
,
152 ldp_dual_stack_cisco_interop_cmd
,
153 "[no] dual-stack cisco-interop",
154 "Negate a command or set its defaults\n"
155 "Configure dual stack parameters\n"
156 "Use Cisco non-compliant format to send and interpret the Dual-Stack capability TLV\n")
161 if (argv_find(argv
, argc
, "no", &idx
))
164 return (ldp_vty_ds_cisco_interop(vty
, negate
));
167 DEFUN (ldp_neighbor_password
,
168 ldp_neighbor_password_cmd
,
169 "[no] neighbor A.B.C.D password WORD",
170 "Negate a command or set its defaults\n"
171 "Configure neighbor parameters\n"
172 "LDP Id of neighbor\n"
173 "Configure password for MD5 authentication\n"
178 const char *neighbor
;
179 const char *password
;
181 if (argv_find(argv
, argc
, "no", &idx
))
183 argv_find(argv
, argc
, "A.B.C.D", &idx
);
184 neighbor
= argv
[idx
]->arg
;
185 argv_find(argv
, argc
, "WORD", &idx
);
186 password
= argv
[idx
]->arg
;
188 return (ldp_vty_neighbor_password(vty
, negate
, neighbor
, password
));
191 DEFUN (ldp_neighbor_session_holdtime
,
192 ldp_neighbor_session_holdtime_cmd
,
193 "[no] neighbor A.B.C.D session holdtime (15-65535)",
194 "Negate a command or set its defaults\n"
195 "Configure neighbor parameters\n"
196 "LDP Id of neighbor\n"
197 "Configure session parameters\n"
198 "Configure session holdtime\n"
203 const char *neighbor
;
204 const char *holdtime
;
206 if (argv_find(argv
, argc
, "no", &idx
))
208 argv_find(argv
, argc
, "A.B.C.D", &idx
);
209 neighbor
= argv
[idx
]->arg
;
210 argv_find(argv
, argc
, "(15-65535)", &idx
);
211 holdtime
= argv
[idx
]->arg
;
213 return (ldp_vty_nbr_session_holdtime(vty
, negate
, neighbor
, holdtime
));
216 DEFUN (ldp_neighbor_ttl_security
,
217 ldp_neighbor_ttl_security_cmd
,
218 "[no] neighbor A.B.C.D ttl-security <disable|hops (1-254)>",
219 "Negate a command or set its defaults\n"
220 "Configure neighbor parameters\n"
221 "LDP Id of neighbor\n"
222 "LDP ttl security check\n"
223 "Disable ttl security\n"
225 "maximum number of hops\n")
229 const char *neighbor
;
230 const char *hops
= NULL
;
232 if (argv_find(argv
, argc
, "no", &idx
))
234 argv_find(argv
, argc
, "A.B.C.D", &idx
);
235 neighbor
= argv
[idx
]->arg
;
236 if (argv_find(argv
, argc
, "(1-254)", &idx
))
237 hops
= argv
[idx
]->arg
;
239 return (ldp_vty_neighbor_ttl_security(vty
, negate
, neighbor
, hops
));
242 DEFUN (ldp_router_id
,
244 "[no] router-id A.B.C.D",
245 "Negate a command or set its defaults\n"
246 "Configure router Id\n"
247 "LSR Id (in form of an IPv4 address)\n")
253 if (argv_find(argv
, argc
, "no", &idx
))
255 argv_find(argv
, argc
, "A.B.C.D", &idx
);
256 address
= argv
[idx
]->arg
;
258 return (ldp_vty_router_id(vty
, negate
, address
));
261 DEFUN (ldp_discovery_targeted_hello_accept
,
262 ldp_discovery_targeted_hello_accept_cmd
,
263 "[no] discovery targeted-hello accept [from <(1-199)|(1300-2699)|WORD>]",
264 "Negate a command or set its defaults\n"
265 "Configure discovery parameters\n"
266 "LDP Targeted Hellos\n"
267 "Accept and respond to targeted hellos\n"
268 "Access list to specify acceptable targeted hello source\n"
269 "IP access-list number\n"
270 "IP access-list number (expanded range)\n"
271 "IP access-list name\n")
275 const char *from_acl
= NULL
;
277 if (argv_find(argv
, argc
, "no", &idx
))
279 if (argv_find(argv
, argc
, "from", &idx
))
280 from_acl
= argv
[idx
+ 1]->arg
;
282 return (ldp_vty_targeted_hello_accept(vty
, negate
, from_acl
));
285 DEFUN (ldp_discovery_transport_address_ipv4
,
286 ldp_discovery_transport_address_ipv4_cmd
,
287 "[no] discovery transport-address A.B.C.D",
288 "Negate a command or set its defaults\n"
289 "Configure discovery parameters\n"
290 "Specify transport address for TCP connection\n"
291 "IP address to be used as transport address\n")
297 if (argv_find(argv
, argc
, "no", &idx
))
299 argv_find(argv
, argc
, "A.B.C.D", &idx
);
300 address
= argv
[idx
]->arg
;
302 return (ldp_vty_trans_addr(vty
, negate
, address
));
305 DEFUN (ldp_discovery_transport_address_ipv6
,
306 ldp_discovery_transport_address_ipv6_cmd
,
307 "[no] discovery transport-address X:X::X:X",
308 "Negate a command or set its defaults\n"
309 "Configure discovery parameters\n"
310 "Specify transport address for TCP connection\n"
311 "IPv6 address to be used as transport address\n")
317 if (argv_find(argv
, argc
, "no", &idx
))
319 argv_find(argv
, argc
, "X:X::X:X", &idx
);
320 address
= argv
[idx
]->arg
;
322 return (ldp_vty_trans_addr(vty
, negate
, address
));
325 DEFUN (ldp_label_local_advertise
,
326 ldp_label_local_advertise_cmd
,
327 "[no] label local advertise [{to <(1-199)|(1300-2699)|WORD>|for <(1-199)|(1300-2699)|WORD>}]",
328 "Negate a command or set its defaults\n"
329 "Configure label control and policies\n"
330 "Configure local label control and policies\n"
331 "Configure outbound label advertisement control\n"
332 "IP Access-list specifying controls on LDP Peers\n"
333 "IP access-list number\n"
334 "IP access-list number (expanded range)\n"
335 "IP access-list name\n"
336 "IP access-list for destination prefixes\n"
337 "IP access-list number\n"
338 "IP access-list number (expanded range)\n"
339 "IP access-list name\n")
343 const char *to_acl
= NULL
;
344 const char *for_acl
= NULL
;
346 if (argv_find(argv
, argc
, "no", &idx
))
349 /* arguments within curly braces may be provided in any order */
350 if (argv_find(argv
, argc
, "to", &idx
))
351 to_acl
= argv
[idx
+ 1]->arg
;
353 if (argv_find(argv
, argc
, "for", &idx
))
354 for_acl
= argv
[idx
+ 1]->arg
;
356 return (ldp_vty_label_advertise(vty
, negate
, to_acl
, for_acl
));
359 DEFUN (ldp_label_local_advertise_explicit_null
,
360 ldp_label_local_advertise_explicit_null_cmd
,
361 "[no] label local advertise explicit-null [for <(1-199)|(1300-2699)|WORD>]",
362 "Negate a command or set its defaults\n"
363 "Configure label control and policies\n"
364 "Configure local label control and policies\n"
365 "Configure outbound label advertisement control\n"
366 "Configure explicit-null advertisement\n"
367 "IP access-list for destination prefixes\n"
368 "IP access-list number\n"
369 "IP access-list number (expanded range)\n"
370 "IP access-list name\n")
374 const char *for_acl
= NULL
;
376 if (argv_find(argv
, argc
, "no", &idx
))
378 if (argv_find(argv
, argc
, "for", &idx
))
379 for_acl
= argv
[idx
+ 1]->arg
;
381 return (ldp_vty_label_expnull(vty
, negate
, for_acl
));
384 DEFUN (ldp_label_local_allocate
,
385 ldp_label_local_allocate_cmd
,
386 "[no] label local allocate <host-routes|for <(1-199)|(1300-2699)|WORD>>",
387 "Negate a command or set its defaults\n"
388 "Configure label control and policies\n"
389 "Configure local label control and policies\n"
390 "Configure label allocation control\n"
391 "allocate local label for host routes only\n"
393 "IP access-list number\n"
394 "IP access-list number (expanded range)\n"
395 "IP access-list name\n")
400 const char *for_acl
= NULL
;
402 if (argv_find(argv
, argc
, "no", &idx
))
405 /* arguments within curly braces may be provided in any order */
406 if (argv_find(argv
, argc
, "host-routes", &idx
))
409 if (argv_find(argv
, argc
, "for", &idx
))
410 for_acl
= argv
[idx
+ 1]->arg
;
412 return (ldp_vty_label_allocate(vty
, negate
, host_routes
, for_acl
));
415 DEFUN (ldp_label_remote_accept
,
416 ldp_label_remote_accept_cmd
,
417 "[no] label remote accept {from <(1-199)|(1300-2699)|WORD>|for <(1-199)|(1300-2699)|WORD>}",
418 "Negate a command or set its defaults\n"
419 "Configure label control and policies\n"
420 "Configure remote/peer label control and policies\n"
421 "Configure inbound label acceptance control\n"
422 "Neighbor from whom to accept label advertisement\n"
423 "IP access-list number\n"
424 "IP access-list number (expanded range)\n"
425 "IP access-list name\n"
426 "IP access-list for destination prefixes\n"
427 "IP access-list number\n"
428 "IP access-list number (expanded range)\n"
429 "IP access-list name\n")
433 const char *from_acl
= NULL
;
434 const char *for_acl
= NULL
;
436 if (argv_find(argv
, argc
, "no", &idx
))
439 /* arguments within curly braces may be provided in any order */
440 if (argv_find(argv
, argc
, "from", &idx
))
441 from_acl
= argv
[idx
+ 1]->arg
;
443 if (argv_find(argv
, argc
, "for", &idx
))
444 for_acl
= argv
[idx
+ 1]->arg
;
446 return (ldp_vty_label_accept(vty
, negate
, from_acl
, for_acl
));
449 DEFUN (ldp_ttl_security_disable
,
450 ldp_ttl_security_disable_cmd
,
451 "[no] ttl-security disable",
452 "Negate a command or set its defaults\n"
453 "LDP ttl security check\n"
454 "Disable ttl security\n")
459 if (argv_find(argv
, argc
, "no", &idx
))
462 return (ldp_vty_ttl_security(vty
, negate
));
465 DEFUN (ldp_session_holdtime
,
466 ldp_session_holdtime_cmd
,
467 "[no] session holdtime (15-65535)",
468 "Negate a command or set its defaults\n"
469 "Configure session parameters\n"
470 "Configure session holdtime\n"
475 const char *holdtime
;
477 if (argv_find(argv
, argc
, "no", &idx
))
479 argv_find(argv
, argc
, "(15-65535)", &idx
);
480 holdtime
= argv
[idx
]->arg
;
482 return (ldp_vty_af_session_holdtime(vty
, negate
, holdtime
));
485 DEFUN_NOSH(ldp_interface
,
487 "[no] interface IFNAME",
488 "Negate a command or set its defaults\n"
489 "Enable LDP on an interface and enter interface submode\n"
490 "Interface's name\n")
496 if (argv_find(argv
, argc
, "no", &idx
))
498 argv_find(argv
, argc
, "IFNAME", &idx
);
499 ifname
= argv
[idx
]->arg
;
501 return (ldp_vty_interface(vty
, negate
, ifname
));
504 DEFUN (ldp_neighbor_ipv4_targeted
,
505 ldp_neighbor_ipv4_targeted_cmd
,
506 "[no] neighbor A.B.C.D targeted",
507 "Negate a command or set its defaults\n"
508 "Configure neighbor parameters\n"
509 "IP address of neighbor\n"
510 "Establish targeted session\n")
516 if (argv_find(argv
, argc
, "no", &idx
))
518 argv_find(argv
, argc
, "A.B.C.D", &idx
);
519 address
= argv
[idx
]->arg
;
521 return (ldp_vty_neighbor_targeted(vty
, negate
, address
));
524 DEFUN (ldp_neighbor_ipv6_targeted
,
525 ldp_neighbor_ipv6_targeted_cmd
,
526 "[no] neighbor X:X::X:X targeted",
527 "Negate a command or set its defaults\n"
528 "Configure neighbor parameters\n"
529 "IPv6 address of neighbor\n"
530 "Establish targeted session\n")
536 if (argv_find(argv
, argc
, "no", &idx
))
538 argv_find(argv
, argc
, "X:X::X:X", &idx
);
539 address
= argv
[idx
]->arg
;
541 return (ldp_vty_neighbor_targeted(vty
, negate
, address
));
546 "[no] bridge IFNAME",
547 "Negate a command or set its defaults\n"
549 "Interface's name\n")
555 if (argv_find(argv
, argc
, "no", &idx
))
557 argv_find(argv
, argc
, "IFNAME", &idx
);
558 ifname
= argv
[idx
]->arg
;
560 return (ldp_vty_l2vpn_bridge(vty
, negate
, ifname
));
565 "[no] mtu (1500-9180)",
566 "Negate a command or set its defaults\n"
567 "Set Maximum Transmission Unit\n"
568 "Maximum Transmission Unit value\n")
574 if (argv_find(argv
, argc
, "no", &idx
))
576 argv_find(argv
, argc
, "(1500-9180)", &idx
);
577 mtu
= argv
[idx
]->arg
;
579 return (ldp_vty_l2vpn_mtu(vty
, negate
, mtu
));
582 DEFUN (ldp_member_interface
,
583 ldp_member_interface_cmd
,
584 "[no] member interface IFNAME",
585 "Negate a command or set its defaults\n"
586 "L2VPN member configuration\n"
588 "Interface's name\n")
594 if (argv_find(argv
, argc
, "no", &idx
))
596 argv_find(argv
, argc
, "IFNAME", &idx
);
597 ifname
= argv
[idx
]->arg
;
599 return (ldp_vty_l2vpn_interface(vty
, negate
, ifname
));
602 DEFUN_NOSH(ldp_member_pseudowire
,
603 ldp_member_pseudowire_cmd
,
604 "[no] member pseudowire IFNAME",
605 "Negate a command or set its defaults\n"
606 "L2VPN member configuration\n"
607 "Pseudowire interface\n"
608 "Interface's name\n")
614 if (argv_find(argv
, argc
, "no", &idx
))
616 argv_find(argv
, argc
, "IFNAME", &idx
);
617 ifname
= argv
[idx
]->arg
;
619 return (ldp_vty_l2vpn_pseudowire(vty
, negate
, ifname
));
624 "[no] vc type <ethernet|ethernet-tagged>",
625 "Negate a command or set its defaults\n"
626 "Virtual Circuit options\n"
627 "Virtual Circuit type to use\n"
628 "Ethernet (type 5)\n"
629 "Ethernet-tagged (type 4)\n")
635 if (argv_find(argv
, argc
, "no", &idx
))
637 argv_find(argv
, argc
, "type", &idx
);
638 vc_type
= argv
[idx
+ 1]->text
;
640 return (ldp_vty_l2vpn_pwtype(vty
, negate
, vc_type
));
643 DEFUN (ldp_control_word
,
644 ldp_control_word_cmd
,
645 "[no] control-word <exclude|include>",
646 "Negate a command or set its defaults\n"
647 "Control-word options\n"
648 "Exclude control-word in pseudowire packets\n"
649 "Include control-word in pseudowire packets\n")
653 const char *preference
;
655 if (argv_find(argv
, argc
, "no", &idx
))
657 argv_find(argv
, argc
, "control-word", &idx
);
658 preference
= argv
[idx
+ 1]->text
;
660 return (ldp_vty_l2vpn_pw_cword(vty
, negate
, preference
));
663 DEFUN (ldp_neighbor_address
,
664 ldp_neighbor_address_cmd
,
665 "[no] neighbor address <A.B.C.D|X:X::X:X>",
666 "Negate a command or set its defaults\n"
667 "Remote endpoint configuration\n"
668 "Specify the IPv4 or IPv6 address of the remote endpoint\n"
676 if (argv_find(argv
, argc
, "no", &idx
))
678 argv_find(argv
, argc
, "address", &idx
);
679 address
= argv
[idx
+ 1]->arg
;
681 return (ldp_vty_l2vpn_pw_nbr_addr(vty
, negate
, address
));
684 DEFUN (ldp_neighbor_lsr_id
,
685 ldp_neighbor_lsr_id_cmd
,
686 "[no] neighbor lsr-id A.B.C.D",
687 "Negate a command or set its defaults\n"
688 "Remote endpoint configuration\n"
689 "Specify the LSR-ID of the remote endpoint\n"
696 if (argv_find(argv
, argc
, "no", &idx
))
698 argv_find(argv
, argc
, "A.B.C.D", &idx
);
699 address
= argv
[idx
]->arg
;
701 return (ldp_vty_l2vpn_pw_nbr_id(vty
, negate
, address
));
706 "[no] pw-id (1-4294967295)",
707 "Negate a command or set its defaults\n"
708 "Set the Virtual Circuit ID\n"
709 "Virtual Circuit ID value\n")
715 if (argv_find(argv
, argc
, "no", &idx
))
717 argv_find(argv
, argc
, "(1-4294967295)", &idx
);
718 pwid
= argv
[idx
]->arg
;
720 return (ldp_vty_l2vpn_pw_pwid(vty
, negate
, pwid
));
723 DEFUN (ldp_pw_status_disable
,
724 ldp_pw_status_disable_cmd
,
725 "[no] pw-status disable",
726 "Negate a command or set its defaults\n"
727 "Configure PW status\n"
728 "Disable PW status\n")
733 if (argv_find(argv
, argc
, "no", &idx
))
736 return (ldp_vty_l2vpn_pw_pwstatus(vty
, negate
));
739 DEFUN (ldp_clear_mpls_ldp_neighbor
,
740 ldp_clear_mpls_ldp_neighbor_cmd
,
741 "clear mpls ldp neighbor [<A.B.C.D|X:X::X:X>]",
743 "Reset MPLS statistical information\n"
745 "Clear LDP neighbor sessions\n"
750 const char *address
= NULL
;
752 if (argv_find(argv
, argc
, "neighbor", &idx
))
753 address
= argv
[idx
+ 1]->arg
;
755 return (ldp_vty_clear_nbr(vty
, address
));
758 DEFUN (ldp_debug_mpls_ldp_discovery_hello
,
759 ldp_debug_mpls_ldp_discovery_hello_cmd
,
760 "[no] debug mpls ldp discovery hello <recv|sent>",
761 "Negate a command or set its defaults\n"
762 "Debugging functions\n"
764 "Label Distribution Protocol\n"
765 "Discovery messages\n"
766 "Discovery hello message\n"
767 "Received messages\n"
774 if (argv_find(argv
, argc
, "no", &idx
))
776 argv_find(argv
, argc
, "hello", &idx
);
777 dir
= argv
[idx
+ 1]->text
;
779 return (ldp_vty_debug(vty
, negate
, "discovery", dir
, 0));
782 DEFUN (ldp_debug_mpls_ldp_type
,
783 ldp_debug_mpls_ldp_type_cmd
,
784 "[no] debug mpls ldp <errors|event|zebra>",
785 "Negate a command or set its defaults\n"
786 "Debugging functions\n"
788 "Label Distribution Protocol\n"
790 "LDP event information\n"
791 "LDP zebra information\n")
797 if (argv_find(argv
, argc
, "no", &idx
))
799 argv_find(argv
, argc
, "ldp", &idx
);
800 type
= argv
[idx
+ 1]->text
;
802 return (ldp_vty_debug(vty
, negate
, type
, NULL
, 0));
805 DEFUN (ldp_debug_mpls_ldp_messages_recv
,
806 ldp_debug_mpls_ldp_messages_recv_cmd
,
807 "[no] debug mpls ldp messages recv [all]",
808 "Negate a command or set its defaults\n"
809 "Debugging functions\n"
811 "Label Distribution Protocol\n"
813 "Received messages, excluding periodic Keep Alives\n"
814 "Received messages, including periodic Keep Alives\n")
820 if (argv_find(argv
, argc
, "no", &idx
))
822 if (argv_find(argv
, argc
, "all", &idx
))
825 return (ldp_vty_debug(vty
, negate
, "messages", "recv", all
));
828 DEFUN (ldp_debug_mpls_ldp_messages_sent
,
829 ldp_debug_mpls_ldp_messages_sent_cmd
,
830 "[no] debug mpls ldp messages sent [all]",
831 "Negate a command or set its defaults\n"
832 "Debugging functions\n"
834 "Label Distribution Protocol\n"
836 "Sent messages, excluding periodic Keep Alives\n"
837 "Sent messages, including periodic Keep Alives\n")
843 if (argv_find(argv
, argc
, "no", &idx
))
845 if (argv_find(argv
, argc
, "all", &idx
))
848 return (ldp_vty_debug(vty
, negate
, "messages", "sent", all
));
851 DEFUN (ldp_show_mpls_ldp_binding
,
852 ldp_show_mpls_ldp_binding_cmd
,
853 "show mpls ldp [<ipv4|ipv6>] binding [detail] [json]",
854 "Show running system information\n"
856 "Label Distribution Protocol\n"
857 "IPv4 Address Family\n"
858 "IPv6 Address Family\n"
859 "Label Information Base (LIB) information\n"
860 "Show detailed information\n"
861 "JavaScript Object Notation\n")
864 const char *af
= NULL
;
868 if (argv_find(argv
, argc
, "ipv4", &idx
) ||
869 argv_find(argv
, argc
, "ipv6", &idx
))
870 af
= argv
[idx
]->text
;
871 if (argv_find(argv
, argc
, "detail", &idx
))
873 if (argv_find(argv
, argc
, "json", &idx
))
876 return (ldp_vty_show_binding(vty
, af
, detail
, json
));
879 DEFUN (ldp_show_mpls_ldp_discovery
,
880 ldp_show_mpls_ldp_discovery_cmd
,
881 "show mpls ldp [<ipv4|ipv6>] discovery [detail] [json]",
882 "Show running system information\n"
884 "Label Distribution Protocol\n"
885 "IPv4 Address Family\n"
886 "IPv6 Address Family\n"
887 "Discovery Hello Information\n"
888 "Show detailed information\n"
889 "JavaScript Object Notation\n")
892 const char *af
= NULL
;
896 if (argv_find(argv
, argc
, "ipv4", &idx
) ||
897 argv_find(argv
, argc
, "ipv6", &idx
))
898 af
= argv
[idx
]->text
;
899 if (argv_find(argv
, argc
, "detail", &idx
))
901 if (argv_find(argv
, argc
, "json", &idx
))
904 return (ldp_vty_show_discovery(vty
, af
, detail
, json
));
907 DEFUN (ldp_show_mpls_ldp_interface
,
908 ldp_show_mpls_ldp_interface_cmd
,
909 "show mpls ldp [<ipv4|ipv6>] interface [json]",
910 "Show running system information\n"
912 "Label Distribution Protocol\n"
913 "IPv4 Address Family\n"
914 "IPv6 Address Family\n"
915 "interface information\n"
916 "JavaScript Object Notation\n")
919 const char *af
= NULL
;
922 if (argv_find(argv
, argc
, "ipv4", &idx
) ||
923 argv_find(argv
, argc
, "ipv6", &idx
))
924 af
= argv
[idx
]->text
;
925 if (argv_find(argv
, argc
, "json", &idx
))
928 return (ldp_vty_show_interface(vty
, af
, json
));
931 DEFUN (ldp_show_mpls_ldp_capabilities
,
932 ldp_show_mpls_ldp_capabilities_cmd
,
933 "show mpls ldp capabilities [json]",
934 "Show running system information\n"
936 "Label Distribution Protocol\n"
937 "Display LDP Capabilities information\n"
938 "JavaScript Object Notation\n")
943 if (argv_find(argv
, argc
, "json", &idx
))
946 return (ldp_vty_show_capabilities(vty
, json
));
949 DEFUN (ldp_show_mpls_ldp_neighbor
,
950 ldp_show_mpls_ldp_neighbor_cmd
,
951 "show mpls ldp neighbor [detail] [json]",
952 "Show running system information\n"
954 "Label Distribution Protocol\n"
955 "Neighbor information\n"
956 "Show detailed information\n"
957 "JavaScript Object Notation\n")
963 if (argv_find(argv
, argc
, "detail", &idx
))
965 if (argv_find(argv
, argc
, "json", &idx
))
968 return (ldp_vty_show_neighbor(vty
, 0, detail
, json
));
971 DEFUN (ldp_show_mpls_ldp_neighbor_capabilities
,
972 ldp_show_mpls_ldp_neighbor_capabilities_cmd
,
973 "show mpls ldp neighbor capabilities [json]",
974 "Show running system information\n"
976 "Label Distribution Protocol\n"
977 "Neighbor information\n"
978 "Display neighbor capability information\n"
979 "JavaScript Object Notation\n")
984 if (argv_find(argv
, argc
, "json", &idx
))
987 return (ldp_vty_show_neighbor(vty
, 1, 0, json
));
990 DEFUN (ldp_show_l2vpn_atom_binding
,
991 ldp_show_l2vpn_atom_binding_cmd
,
992 "show l2vpn atom binding [json]",
993 "Show running system information\n"
994 "Show information about Layer2 VPN\n"
995 "Show Any Transport over MPLS information\n"
996 "Show AToM label binding information\n"
997 "JavaScript Object Notation\n")
1002 if (argv_find(argv
, argc
, "json", &idx
))
1005 return (ldp_vty_show_atom_binding(vty
, json
));
1008 DEFUN (ldp_show_l2vpn_atom_vc
,
1009 ldp_show_l2vpn_atom_vc_cmd
,
1010 "show l2vpn atom vc [json]",
1011 "Show running system information\n"
1012 "Show information about Layer2 VPN\n"
1013 "Show Any Transport over MPLS information\n"
1014 "Show AToM virtual circuit information\n"
1015 "JavaScript Object Notation\n")
1020 if (argv_find(argv
, argc
, "json", &idx
))
1023 return (ldp_vty_show_atom_vc(vty
, json
));
1026 DEFUN (ldp_show_debugging_mpls_ldp
,
1027 ldp_show_debugging_mpls_ldp_cmd
,
1028 "show debugging mpls ldp",
1029 "Show running system information\n"
1030 "Debugging functions\n"
1031 "MPLS information\n"
1032 "Label Distribution Protocol\n")
1034 return (ldp_vty_show_debugging(vty
));
1040 install_node(&ldp_node
, ldp_config_write
);
1041 install_node(&ldp_ipv4_node
, NULL
);
1042 install_node(&ldp_ipv6_node
, NULL
);
1043 install_node(&ldp_ipv4_iface_node
, NULL
);
1044 install_node(&ldp_ipv6_iface_node
, NULL
);
1045 install_node(&ldp_l2vpn_node
, ldp_l2vpn_config_write
);
1046 install_node(&ldp_pseudowire_node
, NULL
);
1047 install_node(&ldp_debug_node
, ldp_debug_config_write
);
1048 install_default(LDP_NODE
);
1049 install_default(LDP_IPV4_NODE
);
1050 install_default(LDP_IPV6_NODE
);
1051 install_default(LDP_IPV4_IFACE_NODE
);
1052 install_default(LDP_IPV6_IFACE_NODE
);
1053 install_default(LDP_L2VPN_NODE
);
1054 install_default(LDP_PSEUDOWIRE_NODE
);
1056 install_element(CONFIG_NODE
, &ldp_mpls_ldp_cmd
);
1057 install_element(CONFIG_NODE
, &ldp_l2vpn_cmd
);
1058 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_discovery_hello_cmd
);
1059 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_type_cmd
);
1060 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_messages_recv_cmd
);
1061 install_element(CONFIG_NODE
, &ldp_debug_mpls_ldp_messages_sent_cmd
);
1063 install_element(LDP_NODE
, &ldp_address_family_cmd
);
1064 install_element(LDP_NODE
, &ldp_discovery_holdtime_cmd
);
1065 install_element(LDP_NODE
, &ldp_discovery_interval_cmd
);
1066 install_element(LDP_NODE
, &ldp_dual_stack_transport_connection_prefer_ipv4_cmd
);
1067 install_element(LDP_NODE
, &ldp_dual_stack_cisco_interop_cmd
);
1068 install_element(LDP_NODE
, &ldp_neighbor_password_cmd
);
1069 install_element(LDP_NODE
, &ldp_neighbor_session_holdtime_cmd
);
1070 install_element(LDP_NODE
, &ldp_neighbor_ttl_security_cmd
);
1071 install_element(LDP_NODE
, &ldp_router_id_cmd
);
1073 install_element(LDP_IPV4_NODE
, &ldp_discovery_holdtime_cmd
);
1074 install_element(LDP_IPV4_NODE
, &ldp_discovery_interval_cmd
);
1075 install_element(LDP_IPV4_NODE
, &ldp_discovery_targeted_hello_accept_cmd
);
1076 install_element(LDP_IPV4_NODE
, &ldp_discovery_transport_address_ipv4_cmd
);
1077 install_element(LDP_IPV4_NODE
, &ldp_label_local_advertise_cmd
);
1078 install_element(LDP_IPV4_NODE
, &ldp_label_local_advertise_explicit_null_cmd
);
1079 install_element(LDP_IPV4_NODE
, &ldp_label_local_allocate_cmd
);
1080 install_element(LDP_IPV4_NODE
, &ldp_label_remote_accept_cmd
);
1081 install_element(LDP_IPV4_NODE
, &ldp_ttl_security_disable_cmd
);
1082 install_element(LDP_IPV4_NODE
, &ldp_interface_cmd
);
1083 install_element(LDP_IPV4_NODE
, &ldp_session_holdtime_cmd
);
1084 install_element(LDP_IPV4_NODE
, &ldp_neighbor_ipv4_targeted_cmd
);
1086 install_element(LDP_IPV6_NODE
, &ldp_discovery_holdtime_cmd
);
1087 install_element(LDP_IPV6_NODE
, &ldp_discovery_interval_cmd
);
1088 install_element(LDP_IPV6_NODE
, &ldp_discovery_targeted_hello_accept_cmd
);
1089 install_element(LDP_IPV6_NODE
, &ldp_discovery_transport_address_ipv6_cmd
);
1090 install_element(LDP_IPV6_NODE
, &ldp_label_local_advertise_cmd
);
1091 install_element(LDP_IPV6_NODE
, &ldp_label_local_advertise_explicit_null_cmd
);
1092 install_element(LDP_IPV6_NODE
, &ldp_label_local_allocate_cmd
);
1093 install_element(LDP_IPV6_NODE
, &ldp_label_remote_accept_cmd
);
1094 install_element(LDP_IPV6_NODE
, &ldp_ttl_security_disable_cmd
);
1095 install_element(LDP_IPV6_NODE
, &ldp_interface_cmd
);
1096 install_element(LDP_IPV6_NODE
, &ldp_session_holdtime_cmd
);
1097 install_element(LDP_IPV6_NODE
, &ldp_neighbor_ipv6_targeted_cmd
);
1099 install_element(LDP_IPV4_IFACE_NODE
, &ldp_discovery_holdtime_cmd
);
1100 install_element(LDP_IPV4_IFACE_NODE
, &ldp_discovery_interval_cmd
);
1102 install_element(LDP_IPV6_IFACE_NODE
, &ldp_discovery_holdtime_cmd
);
1103 install_element(LDP_IPV6_IFACE_NODE
, &ldp_discovery_interval_cmd
);
1105 install_element(LDP_L2VPN_NODE
, &ldp_bridge_cmd
);
1106 install_element(LDP_L2VPN_NODE
, &ldp_mtu_cmd
);
1107 install_element(LDP_L2VPN_NODE
, &ldp_member_interface_cmd
);
1108 install_element(LDP_L2VPN_NODE
, &ldp_member_pseudowire_cmd
);
1109 install_element(LDP_L2VPN_NODE
, &ldp_vc_type_cmd
);
1111 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_control_word_cmd
);
1112 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_neighbor_address_cmd
);
1113 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_neighbor_lsr_id_cmd
);
1114 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_pw_id_cmd
);
1115 install_element(LDP_PSEUDOWIRE_NODE
, &ldp_pw_status_disable_cmd
);
1117 install_element(ENABLE_NODE
, &ldp_clear_mpls_ldp_neighbor_cmd
);
1118 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_discovery_hello_cmd
);
1119 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_type_cmd
);
1120 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_messages_recv_cmd
);
1121 install_element(ENABLE_NODE
, &ldp_debug_mpls_ldp_messages_sent_cmd
);
1123 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_binding_cmd
);
1124 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_discovery_cmd
);
1125 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_interface_cmd
);
1126 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_capabilities_cmd
);
1127 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_neighbor_cmd
);
1128 install_element(VIEW_NODE
, &ldp_show_mpls_ldp_neighbor_capabilities_cmd
);
1129 install_element(VIEW_NODE
, &ldp_show_l2vpn_atom_binding_cmd
);
1130 install_element(VIEW_NODE
, &ldp_show_l2vpn_atom_vc_cmd
);
1131 install_element(VIEW_NODE
, &ldp_show_debugging_mpls_ldp_cmd
);