summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-11-11 07:23:02 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2016-11-23 08:32:30 +0100
commit34d5ef459140ee7e8ae22c220764dba54b6527cf (patch)
treeade8d724fb7f11d75981b96db40caf1032abf59f
parenta7c36d8552cc71538bc42087531866cc16851a39 (diff)
vtysh: fix some macro breakage
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>
-rw-r--r--lib/command.h5
-rw-r--r--lib/distribute.c8
-rw-r--r--ospf6d/ospf6_top.c5
-rw-r--r--ospf6d/ospf6d.c31
4 files changed, 24 insertions, 25 deletions
diff --git a/lib/command.h b/lib/command.h
index f5572f7f83..f120063ea9 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -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 *));
diff --git a/lib/distribute.c b/lib/distribute.c
index 8726e993c5..09f5c8a464 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -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. */
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 32ec2731d6..4c50828e18 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -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);
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c
index c3b4005d1d..c66a124890 100644
--- a/ospf6d/ospf6d.c
+++ b/ospf6d/ospf6d.c
@@ -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 ();