]> git.puffer.fish Git - mirror/frr.git/commitdiff
ldpd: remove the "discovery targeted-hello" commands from the interface node
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 3 Oct 2017 13:27:05 +0000 (10:27 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 3 Oct 2017 19:30:11 +0000 (16:30 -0300)
These commands belong only in the global LDP node and in the LDP
address-family nodes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/ldp_vty.h
ldpd/ldp_vty_cmds.c
ldpd/ldp_vty_conf.c

index 3d2072f1e51c8098c712ac98a6c347c91dfaa5ee..baf9db51d4f4b9d7811a2bda1e3feda343633f3d 100644 (file)
@@ -38,8 +38,8 @@ int    ldp_l2vpn_config_write(struct vty *);
 int     ldp_debug_config_write(struct vty *);
 int     ldp_vty_mpls_ldp (struct vty *, const char *);
 int     ldp_vty_address_family (struct vty *, const char *, const char *);
-int     ldp_vty_disc_holdtime(struct vty *, const char *, const char *, long);
-int     ldp_vty_disc_interval(struct vty *, const char *, const char *, long);
+int     ldp_vty_disc_holdtime(struct vty *, const char *, enum hello_type, long);
+int     ldp_vty_disc_interval(struct vty *, const char *, enum hello_type, long);
 int     ldp_vty_targeted_hello_accept(struct vty *, const char *, const char *);
 int     ldp_vty_nbr_session_holdtime(struct vty *, const char *, struct in_addr, long);
 int     ldp_vty_af_session_holdtime(struct vty *, const char *, long);
index cd92958d4c8fa2bd38ebbee71b56b60d4db5caa8..00151a4d994f87812dd100d4dae0f7c3fc5348aa 100644 (file)
@@ -112,30 +112,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,
@@ -747,8 +769,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);
@@ -756,8 +780,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);
@@ -771,8 +797,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);
@@ -785,11 +813,11 @@ ldp_vty_init (void)
        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);
index e938582d0d53096055054614387eb7dc2f162f06..f43370af2be1683979e997cded8fe1b0eb39f91f 100644 (file)
@@ -459,20 +459,13 @@ ldp_vty_address_family(struct vty *vty, const char *negate, const char *af_str)
        return (CMD_SUCCESS);
 }
 
-int
-ldp_vty_disc_holdtime(struct vty *vty, const char *negate,
-    const char *hello_type_str, long secs)
+int ldp_vty_disc_holdtime(struct vty *vty, const char *negate,
+    enum hello_type hello_type, long secs)
 {
        struct ldpd_af_conf     *af_conf;
        struct iface            *iface;
        struct iface_af         *ia;
        int                      af;
-       enum hello_type          hello_type;
-
-       if (hello_type_str[0] == 'h')
-               hello_type = HELLO_LINK;
-       else
-               hello_type = HELLO_TARGETED;
 
        switch (vty->node) {
        case LDP_NODE:
@@ -547,18 +540,12 @@ ldp_vty_disc_holdtime(struct vty *vty, const char *negate,
 
 int
 ldp_vty_disc_interval(struct vty *vty, const char *negate,
-    const char *hello_type_str, long secs)
+    enum hello_type hello_type, long secs)
 {
        struct ldpd_af_conf     *af_conf;
        struct iface            *iface;
        struct iface_af         *ia;
        int                      af;
-       enum hello_type          hello_type;
-
-       if (hello_type_str[0] == 'h')
-               hello_type = HELLO_LINK;
-       else
-               hello_type = HELLO_TARGETED;
 
        switch (vty->node) {
        case LDP_NODE: