]> git.puffer.fish Git - mirror/frr.git/commitdiff
vtysh: fix some macro breakage
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 11 Nov 2016 06:23:02 +0000 (07:23 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 23 Nov 2016 07:32:30 +0000 (08:32 +0100)
vtysh's extract.pl script doesn't cope with install_element(var, ) where
"var" is not one of the FOO_NODE constants.  Also, the future defun_lex
tool doesn't deal well with preprocessor expansions in the same regard.

This tries simplifying out some of these.  lib/distribute.c needs
further thinking.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/command.h
lib/distribute.c
ospf6d/ospf6_top.c
ospf6d/ospf6d.c

index f5572f7f830bf188d6fd9a612c497b3bd1ebfa33..f120063ea9d5893a9a7292f2d971dc925162e914 100644 (file)
@@ -386,14 +386,9 @@ struct cmd_element
 
 /* IPv4 only machine should not accept IPv6 address for peer's IP
    address.  So we replace VTY command string like below. */
-#ifdef HAVE_IPV6
 #define NEIGHBOR_ADDR_STR  "Neighbor address\nIPv6 address\n"
 #define NEIGHBOR_ADDR_STR2 "Neighbor address\nNeighbor IPv6 address\nInterface name or neighbor tag\n"
 #define NEIGHBOR_ADDR_STR3 "Neighbor address\nIPv6 address\nInterface name\n"
-#else
-#define NEIGHBOR_ADDR_STR  "Neighbor address\n"
-#define NEIGHBOR_ADDR_STR2 "Neighbor address\nNeighbor tag\n"
-#endif /* HAVE_IPV6 */
 
 /* Prototypes. */
 extern void install_node (struct cmd_node *, int (*) (struct vty *));
index 8726e993c5496a14e049559654dcc4fe097b9ca9..09f5c8a46445b87451cb26b594be397e5ed1d2f4 100644 (file)
@@ -525,10 +525,16 @@ distribute_list_init (int node)
 
   install_element (node, &distribute_list_cmd);
   install_element (node, &no_distribute_list_cmd);
+/*
+  install_element (RIP_NODE, &distribute_list_cmd);
+  install_element (RIP_NODE, &no_distribute_list_cmd);
+  install_element (RIPNG_NODE, &distribute_list_cmd);
+  install_element (RIPNG_NODE, &no_distribute_list_cmd);
+ */
 
   /* install v6 */
   if (node == RIPNG_NODE) {
-    install_element (node, &ipv6_distribute_list_cmd);
+    install_element (RIPNG_NODE, &ipv6_distribute_list_cmd);
   }
 
   /* TODO: install v4 syntax command for v6 only protocols. */
index 32ec2731d6b91bf30a3c085ac1f91069109c1b05..4c50828e1880b65a12fbebb8f364adef621805d8 100644 (file)
@@ -1191,12 +1191,13 @@ ospf6_top_init (void)
   install_element (OSPF6_NODE, &no_ospf6_interface_area_cmd);
   install_element (OSPF6_NODE, &ospf6_stub_router_admin_cmd);
   install_element (OSPF6_NODE, &no_ospf6_stub_router_admin_cmd);
-  /* For a later time
+  /* For a later time */
+#if 0
   install_element (OSPF6_NODE, &ospf6_stub_router_startup_cmd);
   install_element (OSPF6_NODE, &no_ospf6_stub_router_startup_cmd);
   install_element (OSPF6_NODE, &ospf6_stub_router_shutdown_cmd);
   install_element (OSPF6_NODE, &no_ospf6_stub_router_shutdown_cmd);
-  */
+#endif
 
   install_element (OSPF6_NODE, &ospf6_distance_cmd);
   install_element (OSPF6_NODE, &no_ospf6_distance_cmd);
index c3b4005d1d8aa25d04ade008b2dc1db1529b58bc..c66a124890c95f37876e9977e00c5bbbedbaf30c 100644 (file)
@@ -1243,23 +1243,20 @@ ospf6_init (void)
   install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_cmd);
   install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_detail_cmd);
 
-#define INSTALL(n,c) \
-  install_element (n ## _NODE, &show_ipv6_ospf6_ ## c)
-
-  INSTALL (VIEW, database_cmd);
-  INSTALL (VIEW, database_type_cmd);
-  INSTALL (VIEW, database_id_cmd);
-  INSTALL (VIEW, database_router_cmd);
-  INSTALL (VIEW, database_type_id_cmd);
-  INSTALL (VIEW, database_type_router_cmd);
-  INSTALL (VIEW, database_adv_router_linkstate_id_cmd);
-  INSTALL (VIEW, database_id_router_cmd);
-  INSTALL (VIEW, database_type_id_router_cmd);
-  INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd);
-  INSTALL (VIEW, database_self_originated_cmd);
-  INSTALL (VIEW, database_type_self_originated_cmd);
-  INSTALL (VIEW, database_type_id_self_originated_cmd);
-  INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_id_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_router_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_id_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_router_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_adv_router_linkstate_id_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_id_router_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_id_router_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_self_originated_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_self_originated_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_id_self_originated_cmd);
+  install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd);
 
   /* Make ospf protocol socket. */
   ospf6_serv_sock ();