]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-igmp.c
More UNALIGNED_MEM{CPY,CMP} on IP addresses.
[tcpdump] / print-igmp.c
index 4087ee0980205cc6ea17e845c8cbe84bb9617e9a..d1cc4f35b115c19955d75db819d8ed646f66149d 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifndef lint
-static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.15 2004-03-24 00:59:16 guy Exp $ (LBL)";
-#endif
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -41,6 +36,8 @@ static const char rcsid[] _U_ =
 #define IN_CLASSD(i) (((int32_t)(i) & 0xf0000000) == 0xe0000000)
 #endif
 
+static const char tstr[] = "[|igmp]";
+
 /* (following from ipmulti/mrouted/prune.h) */
 
 /*
@@ -96,7 +93,7 @@ struct tr_resp {
 #define TR_PROTO_CBT    4
 
 /* igmpv3 report types */
-static struct tok igmpv3report2str[] = {
+static const struct tok igmpv3report2str[] = {
        { 1,    "is_in" },
        { 2,    "is_ex" },
        { 3,    "to_in" },
@@ -124,7 +121,7 @@ print_mtrace(register const u_char *bp, register u_int len)
         printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
     return;
 trunc:
-    (void)printf("[|igmp]");
+    printf("%s", tstr);
     return;
 }
 
@@ -146,7 +143,7 @@ print_mresp(register const u_char *bp, register u_int len)
         printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
     return;
 trunc:
-    (void)printf("[|igmp]");
+    printf("%s", tstr);
     return;
 }
 
@@ -200,7 +197,7 @@ print_igmpv3_report(register const u_char *bp, register u_int len)
     }
     return;
 trunc:
-    (void)printf("[|igmp]");
+    (void)printf("%s", tstr);
     return;
 }
 
@@ -256,7 +253,7 @@ print_igmpv3_query(register const u_char *bp, register u_int len)
     (void)printf("]");
     return;
 trunc:
-    (void)printf("[|igmp]");
+    (void)printf("%s", tstr);
     return;
 }
 
@@ -340,5 +337,5 @@ igmp_print(register const u_char *bp, register u_int len)
     }
     return;
 trunc:
-    fputs("[|igmp]", stdout);
+    (void)printf("%s", tstr);
 }