]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: Allow vtysh to not know about enabled daemons/features
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 24 Oct 2016 19:24:03 +0000 (15:24 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 25 Oct 2016 12:26:09 +0000 (08:26 -0400)
With the way that vtysh works, it compiles in cli even
if there is no support in the protocols.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
configure.ac
vtysh/vtysh.c

index e22dab8d04f3d835bc9aac89bfbed77a8f4bf7a4..4819d689caa92ddf467594a5919c15b1d46c51b2 100755 (executable)
@@ -1314,6 +1314,7 @@ AM_CONDITIONAL(OSPFD, test "x$OSPFD" = "xospfd")
 
 if test "${enable_ldpd}" = "yes";then
   LDPD="ldpd"
+  AC_DEFINE(HAVE_LDPD, 1, ldpd)
 else
   LDPD=""
 fi
index a5e146c9453caf4d52f01644d830601878b232bc..29697b564f08e7e1f7fdb3eafce4e66e136acfb8 100644 (file)
@@ -1251,6 +1251,7 @@ DEFUNSH (VTYSH_BGPD,
   return CMD_SUCCESS;
 }
 
+#if defined (ENABLE_BGP_VNC)
 DEFUNSH (VTYSH_BGPD,
          vnc_defaults,
          vnc_defaults_cmd,
@@ -1285,6 +1286,7 @@ DEFUNSH (VTYSH_BGPD,
   vty->node = BGP_VNC_L2_GROUP_NODE;
   return CMD_SUCCESS;
 }
+#endif
 
 DEFUNSH (VTYSH_RIPD,
         key_chain,
@@ -1361,6 +1363,7 @@ DEFUNSH (VTYSH_OSPF6D,
   return CMD_SUCCESS;
 }
 
+#if defined (HAVE_LDPD)
 DEFUNSH (VTYSH_LDPD,
         ldp_mpls_ldp,
         ldp_mpls_ldp_cmd,
@@ -1440,6 +1443,7 @@ DEFUNSH (VTYSH_LDPD,
   vty->node = LDP_PSEUDOWIRE_NODE;
   return CMD_SUCCESS;
 }
+#endif
 
 DEFUNSH (VTYSH_ISISD,
         router_isis,
@@ -1723,6 +1727,7 @@ ALIAS (vtysh_exit_ospf6d,
        "quit",
        "Exit current mode and down to previous mode\n")
 
+#if defined (HAVE_LDPD)
 DEFUNSH (VTYSH_LDPD,
         vtysh_exit_ldpd,
         vtysh_exit_ldpd_cmd,
@@ -1736,6 +1741,7 @@ ALIAS (vtysh_exit_ldpd,
        vtysh_quit_ldpd_cmd,
        "quit",
        "Exit current mode and down to previous mode\n")
+#endif
 
 DEFUNSH (VTYSH_ISISD,
         vtysh_exit_isisd,
@@ -2765,7 +2771,6 @@ ALIAS (vtysh_traceroute,
        "IP trace\n"
        "Trace route to destination address or hostname\n")
 
-#ifdef HAVE_IPV6
 DEFUN (vtysh_ping6,
        vtysh_ping6_cmd,
        "ping ipv6 WORD",
@@ -2787,7 +2792,6 @@ DEFUN (vtysh_traceroute6,
   execute_command ("traceroute6", 1, argv[0], NULL);
   return CMD_SUCCESS;
 }
-#endif
 
 #if defined(HAVE_SHELL_ACCESS)
 DEFUN (vtysh_telnet,
@@ -3102,20 +3106,14 @@ vtysh_init_vty (void)
   install_node (&bgp_encapv6_node, NULL);
   install_node (&bgp_ipv4_node, NULL);
   install_node (&bgp_ipv4m_node, NULL);
-/* #ifdef HAVE_IPV6 */
   install_node (&bgp_ipv6_node, NULL);
   install_node (&bgp_ipv6m_node, NULL);
-/* #endif */
-/*#if ENABLE_BGP_VNC                */
   install_node (&bgp_vnc_defaults_node, NULL);
   install_node (&bgp_vnc_nve_group_node, NULL);
   install_node (&bgp_vnc_l2_group_node, NULL);
-/* #endif */
   install_node (&ospf_node, NULL);
-/* #ifdef HAVE_IPV6 */
   install_node (&ripng_node, NULL);
   install_node (&ospf6_node, NULL);
-/* #endif */
   install_node (&ldp_node, NULL);
   install_node (&ldp_ipv4_node, NULL);
   install_node (&ldp_ipv6_node, NULL);
@@ -3146,11 +3144,11 @@ vtysh_init_vty (void)
   vtysh_install_default (BGP_IPV4M_NODE);
   vtysh_install_default (BGP_IPV6_NODE);
   vtysh_install_default (BGP_IPV6M_NODE);
-  /* #if ENABLE_BGP_VNC */
+#if ENABLE_BGP_VNC
   vtysh_install_default (BGP_VNC_DEFAULTS_NODE);
   vtysh_install_default (BGP_VNC_NVE_GROUP_NODE);
   vtysh_install_default (BGP_VNC_L2_GROUP_NODE);
-  /* #endif */
+#endif
   vtysh_install_default (OSPF_NODE);
   vtysh_install_default (RIPNG_NODE);
   vtysh_install_default (OSPF6_NODE);
@@ -3183,6 +3181,7 @@ vtysh_init_vty (void)
   install_element (OSPF_NODE, &vtysh_quit_ospfd_cmd);
   install_element (OSPF6_NODE, &vtysh_exit_ospf6d_cmd);
   install_element (OSPF6_NODE, &vtysh_quit_ospf6d_cmd);
+#if defined (HAVE_LDPD)
   install_element (LDP_NODE, &vtysh_exit_ldpd_cmd);
   install_element (LDP_NODE, &vtysh_quit_ldpd_cmd);
   install_element (LDP_IPV4_NODE, &vtysh_exit_ldpd_cmd);
@@ -3197,6 +3196,7 @@ vtysh_init_vty (void)
   install_element (LDP_L2VPN_NODE, &vtysh_quit_ldpd_cmd);
   install_element (LDP_PSEUDOWIRE_NODE, &vtysh_exit_ldpd_cmd);
   install_element (LDP_PSEUDOWIRE_NODE, &vtysh_quit_ldpd_cmd);
+#endif
   install_element (BGP_NODE, &vtysh_exit_bgpd_cmd);
   install_element (BGP_NODE, &vtysh_quit_bgpd_cmd);
   install_element (BGP_VPNV4_NODE, &vtysh_exit_bgpd_cmd);
@@ -3215,12 +3215,14 @@ vtysh_init_vty (void)
   install_element (BGP_IPV6_NODE, &vtysh_quit_bgpd_cmd);
   install_element (BGP_IPV6M_NODE, &vtysh_exit_bgpd_cmd);
   install_element (BGP_IPV6M_NODE, &vtysh_quit_bgpd_cmd);
+#if defined (ENABLE_BGP_VNC)
   install_element (BGP_VNC_DEFAULTS_NODE, &vtysh_exit_bgpd_cmd);
   install_element (BGP_VNC_DEFAULTS_NODE, &vtysh_quit_bgpd_cmd);
   install_element (BGP_VNC_NVE_GROUP_NODE, &vtysh_exit_bgpd_cmd);
   install_element (BGP_VNC_NVE_GROUP_NODE, &vtysh_quit_bgpd_cmd);
   install_element (BGP_VNC_L2_GROUP_NODE, &vtysh_exit_bgpd_cmd);
   install_element (BGP_VNC_L2_GROUP_NODE, &vtysh_quit_bgpd_cmd);
+#endif
   install_element (ISIS_NODE, &vtysh_exit_isisd_cmd);
   install_element (ISIS_NODE, &vtysh_quit_isisd_cmd);
   install_element (KEYCHAIN_NODE, &vtysh_exit_ripd_cmd);
@@ -3281,14 +3283,11 @@ vtysh_init_vty (void)
   install_element (VRF_NODE, &vtysh_quit_vrf_cmd);
 
   install_element (CONFIG_NODE, &router_rip_cmd);
-#ifdef HAVE_IPV6
   install_element (CONFIG_NODE, &router_ripng_cmd);
-#endif
   install_element (CONFIG_NODE, &router_ospf_cmd);
   install_element (CONFIG_NODE, &router_ospf_instance_cmd);
-#ifdef HAVE_IPV6
   install_element (CONFIG_NODE, &router_ospf6_cmd);
-#endif
+#if defined (HAVE_LDPD)
   install_element (CONFIG_NODE, &ldp_mpls_ldp_cmd);
   install_element (LDP_NODE, &ldp_address_family_ipv4_cmd);
   install_element (LDP_NODE, &ldp_address_family_ipv6_cmd);
@@ -3296,6 +3295,7 @@ vtysh_init_vty (void)
   install_element (LDP_IPV6_NODE, &ldp_interface_ifname_cmd);
   install_element (CONFIG_NODE, &ldp_l2vpn_word_type_vpls_cmd);
   install_element (LDP_L2VPN_NODE, &ldp_member_pseudowire_ifname_cmd);
+#endif
   install_element (CONFIG_NODE, &router_isis_cmd);
   install_element (CONFIG_NODE, &router_bgp_cmd);
   install_element (CONFIG_NODE, &router_bgp_asn_cmd);
@@ -3306,8 +3306,10 @@ vtysh_init_vty (void)
   install_element (BGP_NODE, &address_family_vpnv6_unicast_cmd);
   install_element (BGP_NODE, &address_family_encap_cmd);
   install_element (BGP_NODE, &address_family_encapv6_cmd);
+#if defined(ENABLE_BGP_VNC)
   install_element (BGP_NODE, &vnc_defaults_cmd);
   install_element (BGP_NODE, &vnc_nve_group_cmd);
+#endif
   install_element (BGP_NODE, &address_family_ipv4_unicast_cmd);
   install_element (BGP_NODE, &address_family_ipv4_multicast_cmd);
 #ifdef HAVE_IPV6
@@ -3366,10 +3368,8 @@ vtysh_init_vty (void)
   install_element (VIEW_NODE, &vtysh_ping_ip_cmd);
   install_element (VIEW_NODE, &vtysh_traceroute_cmd);
   install_element (VIEW_NODE, &vtysh_traceroute_ip_cmd);
-#ifdef HAVE_IPV6
   install_element (VIEW_NODE, &vtysh_ping6_cmd);
   install_element (VIEW_NODE, &vtysh_traceroute6_cmd);
-#endif
 #if defined(HAVE_SHELL_ACCESS)
   install_element (VIEW_NODE, &vtysh_telnet_cmd);
   install_element (VIEW_NODE, &vtysh_telnet_port_cmd);