]> git.puffer.fish Git - mirror/frr.git/commitdiff
ldpd: remove the interface vty node
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 30 Mar 2017 23:26:17 +0000 (20:26 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 31 Mar 2017 15:57:25 +0000 (12:57 -0300)
ldpd uses a hierarchical configuration model where all commands are
defined inside the "mpls ldp" node and its subnodes. The idea is to keep
all LDP configuration in a single place to keep things simple. With that
said, we can remove the "config-if" node from ldpd because we already
have a separate node ("config-ldp-af-if") for LDP-related interface
specific commands.

Example:
vtysh(config)# mpls ldp
vtysh(config-ldp)# address-family ipv4
vtysh(config-ldp-af)# interface eth1
vtysh(config-ldp-af-if)# discovery hello ?
  holdtime  Hello holdtime
  interval  Hello interval

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

index 0b05e6fbf10d34f9d5d75fdd02fc4223ec5afc79..8510a394ec28c49e0d8e76898a5f0f6daf6e4a44 100644 (file)
@@ -80,6 +80,5 @@ int    ldp_vty_debug(struct vty *, struct vty_arg *[]);
 int     ldp_vty_show_debugging(struct vty *, struct vty_arg *[]);
 
 void    ldp_vty_init(void);
-void    ldp_vty_if_init(void);
 
 #endif /* _LDP_VTY_H_ */
index bab5e1736834d126033b588a25be3936b08346aa..dcf5f5243681194c6be4d559da6c3140a6feffec 100644 (file)
@@ -32,7 +32,6 @@
 #include "vty.h"
 #include "ldp_vty.h"
 
-static int      interface_config_write(struct vty *);
 static void     ldp_af_iface_config_write(struct vty *, int);
 static void     ldp_af_config_write(struct vty *, int, struct ldpd_conf *,
                    struct ldpd_af_conf *);
@@ -48,13 +47,6 @@ static struct iface  *vty_iface;
 static struct l2vpn    *vty_l2vpn;
 static struct l2vpn_pw *vty_pw;
 
-static struct cmd_node interface_node =
-{
-       INTERFACE_NODE,
-       "%s(config-if)# ",
-       1
-};
-
 struct cmd_node ldp_node =
 {
        LDP_NODE,
@@ -122,26 +114,6 @@ ldp_get_address(const char *str, int *af, union ldpd_addr *addr)
        return (-1);
 }
 
-static int
-interface_config_write(struct vty *vty)
-{
-       struct listnode         *node;
-       struct interface        *ifp;
-       int                      write = 0;
-
-       for (ALL_LIST_ELEMENTS_RO(vrf_iflist (VRF_DEFAULT), node, ifp)) {
-               vty_out(vty, "!%s", VTY_NEWLINE);
-               vty_out(vty, "interface %s%s", ifp->name, VTY_NEWLINE);
-               if (ifp->desc)
-                       vty_out(vty, " description %s%s", ifp->desc,
-                           VTY_NEWLINE);
-
-               write++;
-       }
-
-       return (write);
-}
-
 static void
 ldp_af_iface_config_write(struct vty *vty, int af)
 {
@@ -1794,14 +1766,6 @@ ldp_vty_l2vpn_pw_pwstatus(struct vty *vty, struct vty_arg *args[])
        return (CMD_SUCCESS);
 }
 
-void
-ldp_vty_if_init(void)
-{
-       /* Install interface node. */
-       install_node (&interface_node, interface_config_write);
-       if_cmd_init ();
-}
-
 struct iface *
 iface_new_api(struct ldpd_conf *conf, const char *name)
 {
index 3023d94469c6568d8cb1b696268136680aa05083..3b3a07c28c5425d787970dfc283ee94d1fae4d60 100644 (file)
@@ -338,7 +338,6 @@ main(int argc, char *argv[])
        vrf_init();
        access_list_init();
        ldp_vty_init();
-       ldp_vty_if_init();
        ldp_zebra_init(master);
 
        /* create base configuration with sane defaults */
index 114022d199269018cf77afaaae2db313686b4c1b..7d5fa8442b8852503dd0067d6634cfe490be83f3 100644 (file)
@@ -1799,7 +1799,7 @@ DEFUNSH (VTYSH_INTERFACE,
 }
 
 /* TODO Implement "no interface command in isisd. */
-DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD,
+DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D,
        vtysh_no_interface_cmd,
        "no interface IFNAME",
        NO_STR
@@ -1883,7 +1883,7 @@ DEFUNSH (VTYSH_VRF,
 
 /* TODO Implement interface description commands in ripngd, ospf6d
  * and isisd. */
-DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD|VTYSH_LDPD,
+DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD,
        vtysh_interface_desc_cmd,
        "description LINE...",
        "Interface specific description\n"
index 07ba8367dec0e044834d74c07047ff1b177fb18a..6d9e21d8a0cdd0ed3a29a5a84d5224d221158771 100644 (file)
@@ -44,7 +44,7 @@ DECLARE_MGROUP(MVTYSH)
  * things like prefix lists are not even initialised) */
 #define VTYSH_ALL        VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD
 #define VTYSH_RMAP       VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_PIMD
-#define VTYSH_INTERFACE          VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD
+#define VTYSH_INTERFACE          VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD
 #define VTYSH_NS          VTYSH_ZEBRA
 #define VTYSH_VRF        VTYSH_ZEBRA