[cleanup] Make command nodes static
The cmd_nodes used to configure vty, can mostly be static so
(basic data hiding 101).
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 1d5bf6b..fa316c5 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -856,7 +856,7 @@
return write;
}
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"",
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index e815ea3..53dea80 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -773,7 +773,7 @@
}
/* BGP node structure. */
-struct cmd_node bgp_dump_node =
+static struct cmd_node bgp_dump_node =
{
DUMP_NODE,
"",
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index 89e48bf..bdb756c 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -671,7 +671,7 @@
return write;
}
-struct cmd_node as_list_node =
+static struct cmd_node as_list_node =
{
AS_LIST_NODE,
"",
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 76c537b..e79e477 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -8775,42 +8775,42 @@
}
/* BGP node structure. */
-struct cmd_node bgp_node =
+static struct cmd_node bgp_node =
{
BGP_NODE,
"%s(config-router)# ",
1,
};
-struct cmd_node bgp_ipv4_unicast_node =
+static struct cmd_node bgp_ipv4_unicast_node =
{
BGP_IPV4_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_ipv4_multicast_node =
+static struct cmd_node bgp_ipv4_multicast_node =
{
BGP_IPV4M_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_ipv6_unicast_node =
+static struct cmd_node bgp_ipv6_unicast_node =
{
BGP_IPV6_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_ipv6_multicast_node =
+static struct cmd_node bgp_ipv6_multicast_node =
{
BGP_IPV6M_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_vpnv4_node =
+static struct cmd_node bgp_vpnv4_node =
{
BGP_VPNV4_NODE,
"%s(config-router-af)# ",
@@ -10734,7 +10734,7 @@
return write;
}
-struct cmd_node community_list_node =
+static struct cmd_node community_list_node =
{
COMMUNITY_LIST_NODE,
"",
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index af24988..d2923b5 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -2028,7 +2028,7 @@
}
#endif /* HAVE_IPV6 */
-struct cmd_node interface_node = {
+static struct cmd_node interface_node = {
INTERFACE_NODE,
"%s(config-if)# ",
1,
diff --git a/isisd/isisd.c b/isisd/isisd.c
index 7c669fc..1e84a1c 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -2076,7 +2076,7 @@
return write;
}
-struct cmd_node isis_node = {
+static struct cmd_node isis_node = {
ISIS_NODE,
"%s(config-router)# ",
1
diff --git a/lib/command.c b/lib/command.c
index 4887f94..0bbd99e 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -41,37 +41,37 @@
struct host host;
/* Standard command node structures. */
-struct cmd_node auth_node =
+static struct cmd_node auth_node =
{
AUTH_NODE,
"Password: ",
};
-struct cmd_node view_node =
+static struct cmd_node view_node =
{
VIEW_NODE,
"%s> ",
};
-struct cmd_node restricted_node =
+static struct cmd_node restricted_node =
{
RESTRICTED_NODE,
"%s$ ",
};
-struct cmd_node auth_enable_node =
+static struct cmd_node auth_enable_node =
{
AUTH_ENABLE_NODE,
"Password: ",
};
-struct cmd_node enable_node =
+static struct cmd_node enable_node =
{
ENABLE_NODE,
"%s# ",
};
-struct cmd_node config_node =
+static struct cmd_node config_node =
{
CONFIG_NODE,
"%s(config)# ",
diff --git a/lib/filter.c b/lib/filter.c
index 7aeb8de..af8d587 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -1857,7 +1857,7 @@
}
/* Access-list node. */
-struct cmd_node access_node =
+static struct cmd_node access_node =
{
ACCESS_NODE,
"", /* Access list has no interface. */
@@ -1953,7 +1953,7 @@
}
#ifdef HAVE_IPV6
-struct cmd_node access_ipv6_node =
+static struct cmd_node access_ipv6_node =
{
ACCESS_IPV6_NODE,
"",
diff --git a/lib/keychain.c b/lib/keychain.c
index af0a1d7..6719ceb 100644
--- a/lib/keychain.c
+++ b/lib/keychain.c
@@ -848,14 +848,14 @@
argv[3], argv[4]);
}
-struct cmd_node keychain_node =
+static struct cmd_node keychain_node =
{
KEYCHAIN_NODE,
"%s(config-keychain)# ",
1
};
-struct cmd_node keychain_key_node =
+static struct cmd_node keychain_key_node =
{
KEYCHAIN_KEY_NODE,
"%s(config-keychain-key)# ",
diff --git a/lib/plist.c b/lib/plist.c
index 4b498c4..0f802a8 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -2623,7 +2623,7 @@
/* Prefix-list node. */
-struct cmd_node prefix_node =
+static struct cmd_node prefix_node =
{
PREFIX_NODE,
"", /* Prefix list has no interface. */
@@ -2732,7 +2732,7 @@
#ifdef HAVE_IPV6
/* Prefix-list node. */
-struct cmd_node prefix_ipv6_node =
+static struct cmd_node prefix_ipv6_node =
{
PREFIX_IPV6_NODE,
"", /* Prefix list has no interface. */
diff --git a/lib/routemap.c b/lib/routemap.c
index 58ed09a..5f7a318 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -1280,7 +1280,7 @@
}
/* Route map node structure. */
-struct cmd_node rmap_node =
+static struct cmd_node rmap_node =
{
RMAP_NODE,
"%s(config-route-map)# ",
diff --git a/lib/smux.c b/lib/smux.c
index fd0c89c..349cc2f 100644
--- a/lib/smux.c
+++ b/lib/smux.c
@@ -73,7 +73,7 @@
int fail = 0;
/* SMUX node. */
-struct cmd_node smux_node =
+static struct cmd_node smux_node =
{
SMUX_NODE,
"" /* SMUX has no interface. */
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 4215208..5a79862 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -1509,7 +1509,7 @@
return 0;
}
-struct cmd_node interface_node =
+static struct cmd_node interface_node =
{
INTERFACE_NODE,
"%s(config-if)# ",
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index d45d132..609df41 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -650,7 +650,7 @@
}
/* OSPF6 node structure. */
-struct cmd_node ospf6_node =
+static struct cmd_node ospf6_node =
{
OSPF6_NODE,
"%s(config-ospf6)# ",
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index b5ffc0a..7083c96 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -335,7 +335,7 @@
}
/* Zebra node structure. */
-struct cmd_node zebra_node =
+static struct cmd_node zebra_node =
{
ZEBRA_NODE,
"%s(config-zebra)# ",
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c
index 1a615ff..7a766c8 100644
--- a/ospf6d/ospf6d.c
+++ b/ospf6d/ospf6d.c
@@ -92,7 +92,7 @@
return CMD_SUCCESS;
}
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"",
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 2fcbfe6..de9ef05 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -1509,7 +1509,7 @@
}
/* Debug node. */
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"",
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index c4abe7e..2e4b607 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -8073,7 +8073,7 @@
/* ospfd's interface node. */
-struct cmd_node interface_node =
+static struct cmd_node interface_node =
{
INTERFACE_NODE,
"%s(config-if)# ",
@@ -8184,13 +8184,6 @@
install_element (INTERFACE_NODE, &no_ospf_transmit_delay_cmd);
}
-/* Zebra node structure. */
-struct cmd_node zebra_node =
-{
- ZEBRA_NODE,
- "%s(config-router)#",
-};
-
static void
ospf_vty_zebra_init (void)
{
@@ -8283,7 +8276,7 @@
#endif /* 0 */
}
-struct cmd_node ospf_node =
+static struct cmd_node ospf_node =
{
OSPF_NODE,
"%s(config-router)# ",
diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c
index d788ea7..64dc27c 100644
--- a/ripd/rip_debug.c
+++ b/ripd/rip_debug.c
@@ -203,7 +203,7 @@
}
/* Debug node. */
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"", /* Debug node has no interface. */
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 54d357c..827663a 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -2051,7 +2051,7 @@
return 0;
}
-struct cmd_node interface_node =
+static struct cmd_node interface_node =
{
INTERFACE_NODE,
"%s(config-if)# ",
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index b924199..7729d9b 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -651,7 +651,7 @@
}
/* Zebra node structure. */
-struct cmd_node zebra_node =
+static struct cmd_node zebra_node =
{
ZEBRA_NODE,
"%s(config-router)# ",
diff --git a/ripd/ripd.c b/ripd/ripd.c
index cb2603d..0e3f877 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -3680,7 +3680,7 @@
}
/* RIP node structure. */
-struct cmd_node rip_node =
+static struct cmd_node rip_node =
{
RIP_NODE,
"%s(config-router)# ",
diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c
index 4ed4fa3..78f13a7 100644
--- a/ripngd/ripng_debug.c
+++ b/ripngd/ripng_debug.c
@@ -204,7 +204,7 @@
}
/* Debug node. */
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"", /* Debug node has no interface. */
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index d76e3a1..d70c299 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -1200,7 +1200,7 @@
}
/* ripngd's interface node. */
-struct cmd_node interface_node =
+static struct cmd_node interface_node =
{
INTERFACE_NODE,
"%s(config-if)# ",
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index 62185c0..4c44455 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -538,7 +538,7 @@
}
/* Zebra node structure. */
-struct cmd_node zebra_node =
+static struct cmd_node zebra_node =
{
ZEBRA_NODE,
"%s(config-router)# ",
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 7b00e03..9deac03 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2682,7 +2682,7 @@
}
/* RIPng node structure. */
-struct cmd_node cmd_ripng_node =
+static struct cmd_node cmd_ripng_node =
{
RIPNG_NODE,
"%s(config-router)# ",
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index bad05d9..32b626c 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -711,97 +711,97 @@
#endif
/* Vty node structures. */
-struct cmd_node bgp_node =
+static struct cmd_node bgp_node =
{
BGP_NODE,
"%s(config-router)# ",
};
-struct cmd_node rip_node =
+static struct cmd_node rip_node =
{
RIP_NODE,
"%s(config-router)# ",
};
-struct cmd_node isis_node =
+static struct cmd_node isis_node =
{
ISIS_NODE,
"%s(config-router)# ",
};
-struct cmd_node interface_node =
+static struct cmd_node interface_node =
{
INTERFACE_NODE,
"%s(config-if)# ",
};
-struct cmd_node rmap_node =
+static struct cmd_node rmap_node =
{
RMAP_NODE,
"%s(config-route-map)# "
};
-struct cmd_node zebra_node =
+static struct cmd_node zebra_node =
{
ZEBRA_NODE,
"%s(config-router)# "
};
-struct cmd_node bgp_vpnv4_node =
+static struct cmd_node bgp_vpnv4_node =
{
BGP_VPNV4_NODE,
"%s(config-router-af)# "
};
-struct cmd_node bgp_ipv4_node =
+static struct cmd_node bgp_ipv4_node =
{
BGP_IPV4_NODE,
"%s(config-router-af)# "
};
-struct cmd_node bgp_ipv4m_node =
+static struct cmd_node bgp_ipv4m_node =
{
BGP_IPV4M_NODE,
"%s(config-router-af)# "
};
-struct cmd_node bgp_ipv6_node =
+static struct cmd_node bgp_ipv6_node =
{
BGP_IPV6_NODE,
"%s(config-router-af)# "
};
-struct cmd_node bgp_ipv6m_node =
+static struct cmd_node bgp_ipv6m_node =
{
BGP_IPV6M_NODE,
"%s(config-router-af)# "
};
-struct cmd_node ospf_node =
+static struct cmd_node ospf_node =
{
OSPF_NODE,
"%s(config-router)# "
};
-struct cmd_node ripng_node =
+static struct cmd_node ripng_node =
{
RIPNG_NODE,
"%s(config-router)# "
};
-struct cmd_node ospf6_node =
+static struct cmd_node ospf6_node =
{
OSPF6_NODE,
"%s(config-ospf6)# "
};
-struct cmd_node keychain_node =
+static struct cmd_node keychain_node =
{
KEYCHAIN_NODE,
"%s(config-keychain)# "
};
-struct cmd_node keychain_key_node =
+static struct cmd_node keychain_key_node =
{
KEYCHAIN_KEY_NODE,
"%s(config-keychain-key)# "
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 0c31392..f50ab05 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -2030,10 +2030,10 @@
}
/* table node for protocol filtering */
-struct cmd_node protocol_node = { PROTOCOL_NODE, "", 1 };
+static struct cmd_node protocol_node = { PROTOCOL_NODE, "", 1 };
/* IP node for static routes. */
-struct cmd_node ip_node = { IP_NODE, "", 1 };
+static struct cmd_node ip_node = { IP_NODE, "", 1 };
/* Route VTY. */
void
diff --git a/zebra/zserv.c b/zebra/zserv.c
index ef79eaa..05380d6 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -1569,7 +1569,7 @@
}
/* table node for routing tables. */
-struct cmd_node table_node =
+static struct cmd_node table_node =
{
TABLE_NODE,
"", /* This node has no interface. */
@@ -1689,7 +1689,7 @@
}
/* table node for routing tables. */
-struct cmd_node forwarding_node =
+static struct cmd_node forwarding_node =
{
FORWARDING_NODE,
"", /* This node has no interface. */