]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Declare some variables as static
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 11 Sep 2016 19:45:26 +0000 (21:45 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 11 Sep 2016 19:45:26 +0000 (21:45 +0200)
12 files changed:
mib.h
print-cfm.c
print-fddi.c
print-forces.c
print-icmp6.c
print-isakmp.c
print-nfs.c
print-radius.c
print-slow.c
print-smb.c
print-snmp.c
print-telnet.c

diff --git a/mib.h b/mib.h
index 92c6c2c58f00b3c12c43f93d82a4de5148ecec24..6c8e63c978b5262528d2cd1e0a91a6c5f1ac511a 100644 (file)
--- a/mib.h
+++ b/mib.h
@@ -8,7 +8,7 @@
 
 /* parse problem: new name "mib" for mgmt.mib(1) ignored */
 /* parse problem: no parent for 0.nullSpecific(0) */
-struct obj
+static struct obj
 _proteon_obj = {
        "proteon", 1, 0,
        NULL, NULL
index 745492bd040e60e5046260f1ec6d1f2ce8b167a9..7db878fe9d9a0173ba2c68951020e11e8e525a12 100644 (file)
@@ -75,7 +75,7 @@ struct cfm_ccm_t {
  * Timer Bases for the CCM Interval field.
  * Expressed in units of seconds.
  */
-const float ccm_interval_base[8] = {0, 0.003333, 0.01, 0.1, 1, 10, 60, 600};
+static const float ccm_interval_base[8] = {0, 0.003333, 0.01, 0.1, 1, 10, 60, 600};
 #define CCM_INTERVAL_MIN_MULTIPLIER 3.25
 #define CCM_INTERVAL_MAX_MULTIPLIER 3.5
 
index 300441f186f0a0dedaf49a86e0a7989f6467fc9b..93f6ccd8be1430f3d3b2f39f1c972a6a27d6dcc4 100644 (file)
@@ -85,9 +85,9 @@ struct fddi_header {
  * Some FDDI interfaces use bit-swapped addresses.
  */
 #if defined(ultrix) || defined(__alpha) || defined(__bsdi) || defined(__NetBSD__) || defined(__linux__)
-int    fddi_bitswap = 0;
+static int fddi_bitswap = 0;
 #else
-int    fddi_bitswap = 1;
+static int fddi_bitswap = 1;
 #endif
 
 /*
index bc16dbb08505ad2d055580d3c78b833e44330808..3cc5ca7c887779266ba41c116a663c129099dc37 100644 (file)
@@ -288,7 +288,7 @@ static inline const struct optlv_h *get_forces_optlv_h(uint16_t opt)
 #define IND_CHR ' '
 #define IND_PREF '\n'
 #define IND_SUF 0x0
-char ind_buf[IND_SIZE];
+static char ind_buf[IND_SIZE];
 
 static inline char *indent_pr(int indent, int nlpref)
 {
index 5b53bbca94db9f02c8a62adc1d3972d70dd93b7a..63f336b9fe81dfd79bbba56258c219e09d273992 100644 (file)
@@ -629,7 +629,7 @@ static int icmp6_cksum(netdissect_options *ndo, const struct ip6_hdr *ip6,
                                IPPROTO_ICMPV6);
 }
 
-const struct tok rpl_mop_values[] = {
+static const struct tok rpl_mop_values[] = {
         { RPL_DIO_NONSTORING,         "nonstoring"},
         { RPL_DIO_STORING,            "storing"},
         { RPL_DIO_NONSTORING_MULTICAST, "nonstoring-multicast"},
@@ -637,7 +637,7 @@ const struct tok rpl_mop_values[] = {
         { 0, NULL},
 };
 
-const struct tok rpl_subopt_values[] = {
+static const struct tok rpl_subopt_values[] = {
         { RPL_OPT_PAD0, "pad0"},
         { RPL_OPT_PADN, "padN"},
         { RPL_DIO_METRICS, "metrics"},
index 8f06703536811ced6086d9606b3b25d16541c6fc..b11e22d46983c84117cf70816bd4b5e0b8f4bd5b 100644 (file)
@@ -644,12 +644,12 @@ ikev1_print(netdissect_options *ndo,
            const u_char *bp2, struct isakmp *base);
 
 #define MAXINITIATORS  20
-int ninitiator = 0;
+static int ninitiator = 0;
 union inaddr_u {
        struct in_addr in4;
        struct in6_addr in6;
 };
-struct {
+static struct {
        cookie_t initiator;
        u_int version;
        union inaddr_u iaddr;
index 77e1a1e364fe0df11d8859733a143ff44fed3521..a71e068da6888e2dfca7255ef926837575959d6c 100644 (file)
@@ -54,7 +54,7 @@ static const uint32_t *parse_post_op_attr(netdissect_options *, const uint32_t *
 /*
  * Mapping of old NFS Version 2 RPC numbers to generic numbers.
  */
-uint32_t nfsv3_procid[NFS_NPROCS] = {
+static uint32_t nfsv3_procid[NFS_NPROCS] = {
        NFSPROC_NULL,
        NFSPROC_GETATTR,
        NFSPROC_SETATTR,
@@ -855,10 +855,10 @@ struct xid_map_entry {
 
 #define        XIDMAPSIZE      64
 
-struct xid_map_entry xid_map[XIDMAPSIZE];
+static struct xid_map_entry xid_map[XIDMAPSIZE];
 
-int    xid_map_next = 0;
-int    xid_map_hint = 0;
+static int xid_map_next = 0;
+static int xid_map_hint = 0;
 
 static int
 xid_map_enter(netdissect_options *ndo,
index ae50efd84f6852efaa10acd9aeeac95400d61974..eb48de5059bd1fc4f9368477aa09b0614df068f9 100644 (file)
@@ -372,7 +372,8 @@ static const char *prompt[]={ "No Echo",
                             };
 
 
-struct attrtype { const char *name;      /* Attribute name                 */
+static struct attrtype {
+                  const char *name;      /* Attribute name                 */
                   const char **subtypes; /* Standard Values (if any)       */
                   u_char siz_subtypes;   /* Size of total standard values  */
                   u_char first_subtype;  /* First standard value is 0 or 1 */
index 1f8527e32154d6b537d0fbb6ab55e3feb6b15691..42154140d0020a10b191908e3edfdd5ef649473a 100644 (file)
@@ -246,7 +246,7 @@ struct lacp_marker_tlv_terminator_t {
 static void slow_marker_lacp_print(netdissect_options *, register const u_char *, register u_int);
 static void slow_oam_print(netdissect_options *, register const u_char *, register u_int);
 
-const struct slow_common_header_t *slow_com_header;
+static const struct slow_common_header_t *slow_com_header;
 
 void
 slow_print(netdissect_options *ndo,
index 174fd9afda7af3e8e8d5b9677933ac5f68cc7452..dd0f10453e5c168b7a5afa38c4406949c3d72f60 100644 (file)
@@ -1310,7 +1310,7 @@ out:
 /*
    print netbeui frames
 */
-struct nbf_strings {
+static struct nbf_strings {
        const char      *name;
        const char      *nonverbose;
        const char      *verbose;
index 83d4090ea60a7acd90abe331ed3f87457d363dc0..c89d934ef09d850495e396ab4b4814ee5f49caa8 100644 (file)
@@ -254,7 +254,7 @@ static const char *Form[] = {
  * A structure for the OID tree for the compiled-in MIB.
  * This is stored as a general-order tree.
  */
-struct obj {
+static struct obj {
        const char      *desc;          /* name of object */
        u_char  oid;                    /* sub-id following parent */
        u_char  type;                   /* object type (unused) */
index ab85e10fd24bd6449610b9c5ee07ae0c5f0fb3f7..2e32fce8af89e7320a96770b986dbeeec8200b99 100644 (file)
@@ -89,7 +89,7 @@
 #define SYNCH  242             /* for telfunc calls */
 
 #ifdef TELCMDS
-const char *telcmds[] = {
+static const char *telcmds[] = {
        "EOF", "SUSP", "ABORT", "EOR",
        "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
        "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
@@ -150,7 +150,7 @@ extern char *telcmds[];
 
 #define        NTELOPTS        (1+TELOPT_NEW_ENVIRON)
 #ifdef TELOPTS
-const char *telopts[NTELOPTS+1] = {
+static const char *telopts[NTELOPTS+1] = {
        "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
        "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
        "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",