]> The Tcpdump Group git mirrors - tcpdump/commitdiff
af.h/c: make several structs const
authorKovarththanan Rajaratnam <[email protected]>
Sat, 20 Feb 2010 06:44:56 +0000 (07:44 +0100)
committerKovarththanan Rajaratnam <[email protected]>
Sat, 20 Feb 2010 06:45:39 +0000 (07:45 +0100)
addrtoname.c
af.c
af.h

index d36767fd5b042256b9d8a912cff31fdfb10bc7d8..895f149245b74080fc781afbe17a987ce12c68f5 100644 (file)
@@ -768,7 +768,7 @@ init_protoidarray(void)
 {
        register int i;
        register struct protoidmem *tp;
-       struct protoidlist *pl;
+       const struct protoidlist *pl;
        u_char protoid[5];
 
        protoid[0] = 0;
@@ -817,7 +817,7 @@ static const struct etherlist {
 static void
 init_etherarray(void)
 {
-       register struct etherlist *el;
+       register const struct etherlist *el;
        register struct enamemem *tp;
 #ifdef USE_ETHER_NTOHOST
        char name[256];
diff --git a/af.c b/af.c
index e3c77bf3c4ceda58709cccdb91b90e605db1c549..2c8a928e02add6092d2d998eaf3f993d90e762a3 100644 (file)
--- a/af.c
+++ b/af.c
@@ -28,7 +28,7 @@ static const char rcsid[] _U_ =
 #include "interface.h"
 #include "af.h"
 
-struct tok af_values[] = {
+const struct tok af_values[] = {
     { 0,                      "Reserved"},
     { AFNUM_INET,             "IPv4"},
     { AFNUM_INET6,            "IPv6"},
@@ -50,7 +50,7 @@ struct tok af_values[] = {
     { 0, NULL},
 };
 
-struct tok bsd_af_values[] = {
+const struct tok bsd_af_values[] = {
     { BSD_AFNUM_INET, "IPv4" },
     { BSD_AFNUM_NS, "NS" },
     { BSD_AFNUM_ISO, "ISO" },
diff --git a/af.h b/af.h
index c036cef9637d4df99b78c2d23764e068dc5299d0..679cc8e5fa18678f7dbb102a0bbd511b4fb8a625 100644 (file)
--- a/af.h
+++ b/af.h
@@ -17,8 +17,8 @@
  * Original code by Hannes Gredler ([email protected])
  */
 
-extern struct tok af_values[];
-extern struct tok bsd_af_values[];
+extern const struct tok af_values[];
+extern const struct tok bsd_af_values[];
 
 /* RFC1700 address family numbers */
 #define AFNUM_INET     1