]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip6opts.c
Regenerate config files.
[tcpdump] / print-ip6opts.c
index f0dd45036d44671ee3f48d516c8ada8c533f3630..4c16d80221294f5d2a1e812d6bfb2d05df9fb5e6 100644 (file)
  * SUCH DAMAGE.
  */
 
+/* \summary: IPv6 header option printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#ifdef INET6
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
 #include "ip6.h"
 
@@ -146,7 +147,7 @@ ip6_opt_print(netdissect_options *ndo, const u_char *bp, int len)
                ND_PRINT((ndo, "(homeaddr: invalid len %d)", bp[i + 1]));
                goto trunc;
            }
-           ND_PRINT((ndo, "(homeaddr: %s", ip6addr_string(&bp[i + 2])));
+           ND_PRINT((ndo, "(homeaddr: %s", ip6addr_string(ndo, &bp[i + 2])));
             if (bp[i + 1] > IP6OPT_HOMEADDR_MINLEN - 2) {
                ip6_sopt_print(ndo, &bp[i + IP6OPT_HOMEADDR_MINLEN],
                    (optlen - IP6OPT_HOMEADDR_MINLEN));
@@ -172,7 +173,7 @@ trunc:
 int
 hbhopt_print(netdissect_options *ndo, register const u_char *bp)
 {
-    const struct ip6_hbh *dp = (struct ip6_hbh *)bp;
+    const struct ip6_hbh *dp = (const struct ip6_hbh *)bp;
     int hbhlen = 0;
 
     ND_TCHECK(dp->ip6h_len);
@@ -185,14 +186,14 @@ hbhopt_print(netdissect_options *ndo, register const u_char *bp)
     return(hbhlen);
 
   trunc:
-    fputs("[|HBH]", stdout);
+    ND_PRINT((ndo, "[|HBH]"));
     return(-1);
 }
 
 int
 dstopt_print(netdissect_options *ndo, register const u_char *bp)
 {
-    const struct ip6_dest *dp = (struct ip6_dest *)bp;
+    const struct ip6_dest *dp = (const struct ip6_dest *)bp;
     int dstoptlen = 0;
 
     ND_TCHECK(dp->ip6d_len);
@@ -207,7 +208,6 @@ dstopt_print(netdissect_options *ndo, register const u_char *bp)
     return(dstoptlen);
 
   trunc:
-    fputs("[|DSTOPT]", stdout);
+    ND_PRINT((ndo, "[|DSTOPT]"));
     return(-1);
 }
-#endif /* INET6 */