]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/ldp_vty_cmds.c
staticd: Do not ready prefix for printing till it's decoded
[mirror_frr.git] / ldpd / ldp_vty_cmds.c
index 3d8b4306c01bdb0e89dc27404df8155b4111c745..c24e1917ccf7b974cf859caf24d01b6930d8758b 100644 (file)
 
 #include "ldpd/ldpd.h"
 #include "ldpd/ldp_vty.h"
+#ifndef VTYSH_EXTRACT_PL
 #include "ldpd/ldp_vty_cmds_clippy.c"
+#endif
 
-DEFUN_NOSH(ldp_mpls_ldp,
+DEFPY_NOSH(ldp_mpls_ldp,
        ldp_mpls_ldp_cmd,
        "mpls ldp",
        "Global MPLS configuration subcommands\n"
@@ -46,21 +48,15 @@ DEFPY  (no_ldp_mpls_ldp,
        return (ldp_vty_mpls_ldp(vty, "no"));
 }
 
-DEFUN_NOSH(ldp_l2vpn,
+DEFPY_NOSH(ldp_l2vpn,
        ldp_l2vpn_cmd,
-       "l2vpn WORD type vpls",
+       "l2vpn WORD$l2vpn_name type vpls",
        "Configure l2vpn commands\n"
        "L2VPN name\n"
        "L2VPN type\n"
        "Virtual Private LAN Service\n")
 {
-       int              idx = 0;
-       const char      *name;
-
-       argv_find(argv, argc, "WORD", &idx);
-       name = argv[idx]->arg;
-
-       return (ldp_vty_l2vpn(vty, 0, name));
+       return (ldp_vty_l2vpn(vty, NULL, l2vpn_name));
 }
 
 DEFPY  (no_ldp_l2vpn,
@@ -75,20 +71,14 @@ DEFPY  (no_ldp_l2vpn,
        return (ldp_vty_l2vpn(vty, "no", l2vpn_name));
 }
 
-DEFUN_NOSH(ldp_address_family,
+DEFPY_NOSH(ldp_address_family,
        ldp_address_family_cmd,
-       "address-family <ipv4|ipv6>",
+       "address-family <ipv4|ipv6>$af",
        "Configure Address Family and its parameters\n"
        "IPv4\n"
        "IPv6\n")
 {
-       int              idx = 0;
-       const char      *af;
-
-       argv_find(argv, argc, "address-family", &idx);
-       af = argv[idx + 1]->text;
-
-       return (ldp_vty_address_family(vty, 0, af));
+       return (ldp_vty_address_family(vty, NULL, af));
 }
 
 DEFPY  (no_ldp_address_family,
@@ -102,7 +92,7 @@ DEFPY  (no_ldp_address_family,
        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,
        "exit-address-family",
        "Exit from Address Family configuration mode\n")
@@ -112,30 +102,52 @@ DEFUN_NOSH(ldp_exit_address_family,
        return CMD_SUCCESS;
 }
 
-DEFPY  (ldp_discovery_holdtime,
-       ldp_discovery_holdtime_cmd,
-       "[no] discovery <hello|targeted-hello>$hello_type holdtime (1-65535)$holdtime",
+DEFPY  (ldp_discovery_link_holdtime,
+       ldp_discovery_link_holdtime_cmd,
+       "[no] discovery hello holdtime (1-65535)$holdtime",
        NO_STR
        "Configure discovery parameters\n"
        "LDP Link Hellos\n"
+       "Hello holdtime\n"
+       "Time (seconds) - 65535 implies infinite\n")
+{
+       return (ldp_vty_disc_holdtime(vty, no, HELLO_LINK, holdtime));
+}
+
+DEFPY  (ldp_discovery_targeted_holdtime,
+       ldp_discovery_targeted_holdtime_cmd,
+       "[no] discovery targeted-hello holdtime (1-65535)$holdtime",
+       NO_STR
+       "Configure discovery parameters\n"
        "LDP Targeted Hellos\n"
        "Hello holdtime\n"
        "Time (seconds) - 65535 implies infinite\n")
 {
-       return (ldp_vty_disc_holdtime(vty, no, hello_type, holdtime));
+       return (ldp_vty_disc_holdtime(vty, no, HELLO_TARGETED, holdtime));
 }
 
-DEFPY  (ldp_discovery_interval,
-       ldp_discovery_interval_cmd,
-       "[no] discovery <hello|targeted-hello>$hello_type interval (1-65535)$interval",
+DEFPY  (ldp_discovery_link_interval,
+       ldp_discovery_link_interval_cmd,
+       "[no] discovery hello interval (1-65535)$interval",
        NO_STR
        "Configure discovery parameters\n"
        "LDP Link Hellos\n"
+       "Hello interval\n"
+       "Time (seconds)\n")
+{
+       return (ldp_vty_disc_interval(vty, no, HELLO_LINK, interval));
+}
+
+DEFPY  (ldp_discovery_targeted_interval,
+       ldp_discovery_targeted_interval_cmd,
+       "[no] discovery targeted-hello interval (1-65535)$interval",
+       NO_STR
+       "Configure discovery parameters\n"
        "LDP Targeted Hellos\n"
        "Hello interval\n"
        "Time (seconds)\n")
 {
-       return (ldp_vty_disc_interval(vty, no, hello_type, interval));
+       return (ldp_vty_disc_interval(vty, no, HELLO_TARGETED, interval));
 }
 
 DEFPY  (ldp_dual_stack_transport_connection_prefer_ipv4,
@@ -144,7 +156,7 @@ DEFPY  (ldp_dual_stack_transport_connection_prefer_ipv4,
        NO_STR
        "Configure dual stack parameters\n"
        "Configure TCP transport parameters\n"
-       "Configure prefered address family for TCP transport connection with neighbor\n"
+       "Configure preferred address family for TCP transport connection with neighbor\n"
        "IPv4\n")
 {
        return (ldp_vty_trans_pref_ipv4(vty, no));
@@ -337,19 +349,13 @@ DEFPY  (ldp_session_holdtime,
        return (ldp_vty_af_session_holdtime(vty, no, holdtime));
 }
 
-DEFUN_NOSH(ldp_interface,
+DEFPY_NOSH(ldp_interface,
        ldp_interface_cmd,
-       "interface IFNAME",
+       "interface IFNAME$ifname",
        "Enable LDP on an interface and enter interface submode\n"
        "Interface's name\n")
 {
-       int              idx = 0;
-       const char      *ifname;
-
-       argv_find(argv, argc, "IFNAME", &idx);
-       ifname = argv[idx]->arg;
-
-       return (ldp_vty_interface(vty, 0, ifname));
+       return (ldp_vty_interface(vty, NULL, ifname));
 }
 
 DEFPY  (no_ldp_interface,
@@ -415,20 +421,14 @@ DEFPY  (ldp_member_interface,
        return (ldp_vty_l2vpn_interface(vty, no, ifname));
 }
 
-DEFUN_NOSH(ldp_member_pseudowire,
+DEFPY_NOSH(ldp_member_pseudowire,
        ldp_member_pseudowire_cmd,
-       "member pseudowire IFNAME",
+       "member pseudowire IFNAME$ifname",
        "L2VPN member configuration\n"
        "Pseudowire interface\n"
        "Interface's name\n")
 {
-       int              idx = 0;
-       const char      *ifname;
-
-       argv_find(argv, argc, "IFNAME", &idx);
-       ifname = argv[idx]->arg;
-
-       return (ldp_vty_l2vpn_pseudowire(vty, 0, ifname));
+       return (ldp_vty_l2vpn_pseudowire(vty, NULL, ifname));
 }
 
 DEFPY  (no_ldp_member_pseudowire,
@@ -735,7 +735,7 @@ DEFPY  (ldp_show_l2vpn_atom_vc,
        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,
            "show debugging [mpls ldp]",
            "Show running system information\n"
@@ -797,8 +797,10 @@ ldp_vty_init (void)
 
        install_element(LDP_NODE, &ldp_address_family_cmd);
        install_element(LDP_NODE, &no_ldp_address_family_cmd);
-       install_element(LDP_NODE, &ldp_discovery_holdtime_cmd);
-       install_element(LDP_NODE, &ldp_discovery_interval_cmd);
+       install_element(LDP_NODE, &ldp_discovery_link_holdtime_cmd);
+       install_element(LDP_NODE, &ldp_discovery_targeted_holdtime_cmd);
+       install_element(LDP_NODE, &ldp_discovery_link_interval_cmd);
+       install_element(LDP_NODE, &ldp_discovery_targeted_interval_cmd);
        install_element(LDP_NODE, &ldp_dual_stack_transport_connection_prefer_ipv4_cmd);
        install_element(LDP_NODE, &ldp_dual_stack_cisco_interop_cmd);
        install_element(LDP_NODE, &ldp_neighbor_password_cmd);
@@ -806,8 +808,10 @@ ldp_vty_init (void)
        install_element(LDP_NODE, &ldp_neighbor_ttl_security_cmd);
        install_element(LDP_NODE, &ldp_router_id_cmd);
 
-       install_element(LDP_IPV4_NODE, &ldp_discovery_holdtime_cmd);
-       install_element(LDP_IPV4_NODE, &ldp_discovery_interval_cmd);
+       install_element(LDP_IPV4_NODE, &ldp_discovery_link_holdtime_cmd);
+       install_element(LDP_IPV4_NODE, &ldp_discovery_targeted_holdtime_cmd);
+       install_element(LDP_IPV4_NODE, &ldp_discovery_link_interval_cmd);
+       install_element(LDP_IPV4_NODE, &ldp_discovery_targeted_interval_cmd);
        install_element(LDP_IPV4_NODE, &ldp_discovery_targeted_hello_accept_cmd);
        install_element(LDP_IPV4_NODE, &ldp_discovery_transport_address_ipv4_cmd);
        install_element(LDP_IPV4_NODE, &ldp_label_local_advertise_cmd);
@@ -821,8 +825,10 @@ ldp_vty_init (void)
        install_element(LDP_IPV4_NODE, &ldp_neighbor_ipv4_targeted_cmd);
        install_element(LDP_IPV4_NODE, &ldp_exit_address_family_cmd);
 
-       install_element(LDP_IPV6_NODE, &ldp_discovery_holdtime_cmd);
-       install_element(LDP_IPV6_NODE, &ldp_discovery_interval_cmd);
+       install_element(LDP_IPV6_NODE, &ldp_discovery_link_holdtime_cmd);
+       install_element(LDP_IPV6_NODE, &ldp_discovery_targeted_holdtime_cmd);
+       install_element(LDP_IPV6_NODE, &ldp_discovery_link_interval_cmd);
+       install_element(LDP_IPV6_NODE, &ldp_discovery_targeted_interval_cmd);
        install_element(LDP_IPV6_NODE, &ldp_discovery_targeted_hello_accept_cmd);
        install_element(LDP_IPV6_NODE, &ldp_discovery_transport_address_ipv6_cmd);
        install_element(LDP_IPV6_NODE, &ldp_label_local_advertise_cmd);
@@ -831,15 +837,16 @@ ldp_vty_init (void)
        install_element(LDP_IPV6_NODE, &ldp_label_remote_accept_cmd);
        install_element(LDP_IPV6_NODE, &ldp_ttl_security_disable_cmd);
        install_element(LDP_IPV6_NODE, &ldp_interface_cmd);
+       install_element(LDP_IPV6_NODE, &no_ldp_interface_cmd);
        install_element(LDP_IPV6_NODE, &ldp_session_holdtime_cmd);
        install_element(LDP_IPV6_NODE, &ldp_neighbor_ipv6_targeted_cmd);
        install_element(LDP_IPV6_NODE, &ldp_exit_address_family_cmd);
 
-       install_element(LDP_IPV4_IFACE_NODE, &ldp_discovery_holdtime_cmd);
-       install_element(LDP_IPV4_IFACE_NODE, &ldp_discovery_interval_cmd);
+       install_element(LDP_IPV4_IFACE_NODE, &ldp_discovery_link_holdtime_cmd);
+       install_element(LDP_IPV4_IFACE_NODE, &ldp_discovery_link_interval_cmd);
 
-       install_element(LDP_IPV6_IFACE_NODE, &ldp_discovery_holdtime_cmd);
-       install_element(LDP_IPV6_IFACE_NODE, &ldp_discovery_interval_cmd);
+       install_element(LDP_IPV6_IFACE_NODE, &ldp_discovery_link_holdtime_cmd);
+       install_element(LDP_IPV6_IFACE_NODE, &ldp_discovery_link_interval_cmd);
 
        install_element(LDP_L2VPN_NODE, &ldp_bridge_cmd);
        install_element(LDP_L2VPN_NODE, &ldp_mtu_cmd);