]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: snmp: add a load of "static" specifiers
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 28 Jul 2016 15:23:45 +0000 (17:23 +0200)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 28 Jul 2016 11:27:47 +0000 (07:27 -0400)
Make it easier to see which bits in *_snmp.c are actually referenced
from non-SNMP parts of the code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_snmp.c
ospf6d/ospf6_snmp.c
ospfd/ospf_snmp.c
ripd/rip_snmp.c
zebra/zebra_snmp.c

index 84a527b96a46b34f186c8a5d9fc8b506877a476c..fc5a0eb59c6673b4304f2c4ab64ad53cd4157a5a 100644 (file)
@@ -116,8 +116,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 SNMP_LOCAL_VARIABLES
 
 /* BGP-MIB instances. */
-oid bgp_oid [] = { BGP4MIB };
-oid bgp_trap_oid [] = { BGP4MIB, 0 };
+static oid bgp_oid [] = { BGP4MIB };
+static oid bgp_trap_oid [] = { BGP4MIB, 0 };
 
 /* IP address 0.0.0.0. */
 static struct in_addr bgp_empty_addr = { .s_addr = 0 };
@@ -137,7 +137,7 @@ static u_char *bgp4PathAttrTable (struct variable *, oid [], size_t *,
                                  int, size_t *, WriteMethod **);
 /* static u_char *bgpTraps (); */
 
-struct variable bgp_variables[] = 
+static struct variable bgp_variables[] = 
 {
   /* BGP version. */
   {BGPVERSION,                OCTET_STRING, RONLY, bgpVersion,
@@ -831,7 +831,7 @@ bgp4PathAttrTable (struct variable *v, oid name[], size_t *length,
 }
 
 /* BGP Traps. */
-struct trap_object bgpTrapList[] =
+static struct trap_object bgpTrapList[] =
 {
   {3, {3, 1, BGPPEERLASTERROR}},
   {3, {3, 1, BGPPEERSTATE}}
index 7423a3733a223e9a0438a92a8014ede7e673c804..cf1630bbc99fe2f781e17b9822e7813cd7d8dddd 100644 (file)
 SNMP_LOCAL_VARIABLES
 
 /* OSPFv3-MIB instances. */
-oid ospfv3_oid [] = { OSPFv3MIB };
-oid ospfv3_trap_oid [] = { OSPFv3MIB, 0 };
+static oid ospfv3_oid [] = { OSPFv3MIB };
+static oid ospfv3_trap_oid [] = { OSPFv3MIB, 0 };
 
 /* Hook functions. */
 static u_char *ospfv3GeneralGroup (struct variable *, oid *, size_t *,
@@ -222,7 +222,7 @@ static u_char *ospfv3NbrEntry (struct variable *, oid *, size_t *,
 static u_char *ospfv3IfEntry (struct variable *, oid *, size_t *,
                              int, size_t *, WriteMethod **);
 
-struct variable ospfv3_variables[] =
+static struct variable ospfv3_variables[] =
 {
   /* OSPF general variables */
   {OSPFv3ROUTERID,             UNSIGNED,   RWRITE, ospfv3GeneralGroup,
index 16361533789919964a19d5cfdc67858da833e204..0eaf44b4d2ac42782d8c7979e921b758a1ac7037 100644 (file)
 SNMP_LOCAL_VARIABLES
 
 /* OSPF-MIB instances. */
-oid ospf_oid [] = { OSPF2MIB };
-oid ospf_trap_oid [] = { OSPF2MIB, 16, 2 }; /* Not reverse mappable! */
+static oid ospf_oid [] = { OSPF2MIB };
+static oid ospf_trap_oid [] = { OSPF2MIB, 16, 2 }; /* Not reverse mappable! */
 
 /* IP address 0.0.0.0. */
 static struct in_addr ospf_empty_addr = { .s_addr = 0 };
@@ -243,7 +243,7 @@ static u_char *ospfExtLsdbEntry (struct variable *, oid *, size_t *, int,
 static u_char *ospfAreaAggregateEntry (struct variable *, oid *, size_t *,
                                       int, size_t *, WriteMethod **);
 
-struct variable ospf_variables[] = 
+static struct variable ospf_variables[] =
 {
   /* OSPF general variables */
   {OSPFROUTERID,              IPADDRESS, RWRITE, ospfGeneralGroup,
@@ -1408,7 +1408,7 @@ ospfHostEntry (struct variable *v, oid *name, size_t *length, int exact,
   return NULL;
 }
 
-struct list *ospf_snmp_iflist;
+static struct list *ospf_snmp_iflist;
 
 struct ospf_snmp_if
 {
@@ -1912,7 +1912,7 @@ ospfIfMetricEntry (struct variable *v, oid *name, size_t *length, int exact,
   return NULL;
 }
 
-struct route_table *ospf_snmp_vl_table;
+static struct route_table *ospf_snmp_vl_table;
 
 void
 ospf_snmp_vl_add (struct ospf_vl_data *vl_data)
@@ -2618,7 +2618,7 @@ ospfAreaAggregateEntry (struct variable *v, oid *name, size_t *length,
 #define NBRSTATECHANGE      2
 #define VIRTNBRSTATECHANGE  3
 
-struct trap_object ospfNbrTrapList[] =
+static struct trap_object ospfNbrTrapList[] =
 {
   {-2, {1, OSPFROUTERID}},
   {3, {10, 1, OSPFNBRIPADDR}},
@@ -2627,7 +2627,7 @@ struct trap_object ospfNbrTrapList[] =
 };
 
 
-struct trap_object ospfVirtNbrTrapList[] =
+static struct trap_object ospfVirtNbrTrapList[] =
 {
   {-2, {1, 1}},
   {3, {11, 1, OSPFVIRTNBRAREA}},
@@ -2635,7 +2635,7 @@ struct trap_object ospfVirtNbrTrapList[] =
   {3, {11, 1, OSPFVIRTNBRSTATE}}
 };
 
-struct trap_object ospfIfTrapList[] =
+static struct trap_object ospfIfTrapList[] =
 {
   {-2, {1, OSPFROUTERID}},
   {3, {7, 1, OSPFIFIPADDRESS}},
@@ -2643,7 +2643,7 @@ struct trap_object ospfIfTrapList[] =
   {3, {7, 1, OSPFIFSTATE}}
 };
 
-struct trap_object ospfVirtIfTrapList[] =
+static struct trap_object ospfVirtIfTrapList[] =
 {
   {-2, {1, OSPFROUTERID}},
   {3, {9, 1, OSPFVIRTIFAREAID}},
index 4b7d1b4c5020e465d8eedd9def9626614016d3ad..c28b9379ccb864d5584a8c36271f7c70d6cda105 100644 (file)
 SNMP_LOCAL_VARIABLES
 
 /* RIP-MIB instances. */
-oid rip_oid [] = { RIPV2MIB };
+static oid rip_oid [] = { RIPV2MIB };
 
 /* Interface cache table sorted by interface's address. */
-struct route_table *rip_ifaddr_table;
+static struct route_table *rip_ifaddr_table;
 
 /* Hook functions. */
 static u_char *rip2Globals (struct variable *, oid [], size_t *,
@@ -96,7 +96,7 @@ static u_char *rip2IfConfAddress (struct variable *, oid [], size_t *,
 static u_char *rip2PeerTable (struct variable *, oid [], size_t *,
                              int, size_t *, WriteMethod **);
 
-struct variable rip_variables[] = 
+static struct variable rip_variables[] =
 {
   /* RIP Global Counters. */
   {RIP2GLOBALROUTECHANGES,    COUNTER, RONLY, rip2Globals,
index 3ba9fc26a8a17ebe2ddbcd235e01bd7baee7ab00..3186ebf6937f4516de5f3010d857e83a4c23a42b 100644 (file)
@@ -85,7 +85,7 @@
 #define IPADDRESS ASN_IPADDRESS
 #define OBJECTIDENTIFIER ASN_OBJECT_ID
 
-oid ipfw_oid [] = { IPFWMIB };
+static oid ipfw_oid [] = { IPFWMIB };
 
 /* Hook functions. */
 static u_char * ipFwNumber (struct variable *, oid [], size_t *,
@@ -97,7 +97,7 @@ static u_char * ipCidrNumber (struct variable *, oid [], size_t *,
 static u_char * ipCidrTable (struct variable *, oid [], size_t *,
                             int, size_t *, WriteMethod **);
 
-struct variable zebra_variables[] = 
+static struct variable zebra_variables[] =
   {
     {0, GAUGE32, RONLY, ipFwNumber, 1, {1}},
     {IPFORWARDDEST, IPADDRESS, RONLY, ipFwTable, 3, {2, 1, 1}},