]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ahcp.c
Remove a useless warning about the SMB decoder.
[tcpdump] / print-ahcp.c
index 5d79f0fe54e5394f8dce56fc5005a769b720e36c..067b506944423c02b608dc8ac117d2ece0020b89 100644 (file)
@@ -1,8 +1,4 @@
 /*
- * This module implements decoding of AHCP (Ad Hoc Configuration Protocol) based
- * on draft-chroboczek-ahcp-00 and source code of ahcpd-0.53.
- *
- *
  * Copyright (c) 2013 The TCPDUMP project
  * All rights reserved.
  *
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+/* \summary: Ad Hoc Configuration Protocol (AHCP) printer */
+
+/* Based on draft-chroboczek-ahcp-00 and source code of ahcpd-0.53 */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
 #include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
 
 static const char tstr[] = " [|ahcp]";
-static const char cstr[] = "(invalid)";
 
 #define AHCP_MAGIC_NUMBER 43
 #define AHCP_VERSION_1 1
@@ -118,7 +117,7 @@ ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -136,7 +135,7 @@ ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -153,18 +152,14 @@ ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
                if (cp + 16 > ep)
                        goto invalid;
                ND_TCHECK2(*cp, 16);
-#ifdef INET6
                ND_PRINT((ndo, "%s%s", sep, ip6addr_string(ndo, cp)));
-#else
-               ND_PRINT((ndo, "%s(compiled w/o IPv6)", sep));
-#endif /* INET6 */
                cp += 16;
                sep = ", ";
        }
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -188,7 +183,7 @@ ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -205,18 +200,14 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
                if (cp + 17 > ep)
                        goto invalid;
                ND_TCHECK2(*cp, 17);
-#ifdef INET6
                ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), *(cp + 16)));
-#else
-               ND_PRINT((ndo, "%s(compiled w/o IPv6)/%u", sep, *(cp + 16)));
-#endif /* INET6 */
                cp += 17;
                sep = ", ";
        }
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -240,7 +231,7 @@ ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -301,7 +292,7 @@ ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return;
 
 invalid:
-       ND_PRINT((ndo, " %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -346,7 +337,7 @@ ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return;
 
 invalid:
-       ND_PRINT((ndo, " %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -412,7 +403,7 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
        return;
 
 invalid:
-       ND_PRINT((ndo, " %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc: