diff options
Diffstat (limited to 'contrib/tcpdump/print-ipx.c')
-rw-r--r-- | contrib/tcpdump/print-ipx.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/contrib/tcpdump/print-ipx.c b/contrib/tcpdump/print-ipx.c index f076d02..d807a66 100644 --- a/contrib/tcpdump/print-ipx.c +++ b/contrib/tcpdump/print-ipx.c @@ -18,22 +18,20 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * Format and print Novell IPX packets. * Contributed by Brad Parker (brad@fcr.com). - * - * $FreeBSD$ */ -#define NETDISSECT_REWORKED +/* \summary: Novell IPX printer */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include <tcpdump-stdinc.h> +#include <netdissect-stdinc.h> #include <stdio.h> -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" #include "extract.h" @@ -91,7 +89,7 @@ ipx_print(netdissect_options *ndo, const u_char *p, u_int length) ND_TCHECK(ipx->length); length = EXTRACT_16BITS(&ipx->length); - ipx_decode(ndo, ipx, (u_char *)ipx + ipxSize, length - ipxSize); + ipx_decode(ndo, ipx, p + ipxSize, length - ipxSize); return; trunc: ND_PRINT((ndo, "[|ipx %d]", length)); @@ -119,14 +117,14 @@ ipx_decode(netdissect_options *ndo, const struct ipxHdr *ipx, const u_char *data ND_PRINT((ndo, "ipx-ncp %d", length)); break; case IPX_SKT_SAP: - ipx_sap_print(ndo, (u_short *)datap, length); + ipx_sap_print(ndo, (const u_short *)datap, length); break; case IPX_SKT_RIP: - ipx_rip_print(ndo, (u_short *)datap, length); + ipx_rip_print(ndo, (const u_short *)datap, length); break; case IPX_SKT_NETBIOS: ND_PRINT((ndo, "ipx-netbios %d", length)); -#ifdef TCPDUMP_DO_SMB +#ifdef ENABLE_SMB ipx_netbios_print(ndo, datap, length); #endif break; @@ -135,7 +133,7 @@ ipx_decode(netdissect_options *ndo, const struct ipxHdr *ipx, const u_char *data break; case IPX_SKT_NWLINK_DGM: ND_PRINT((ndo, "ipx-nwlink-dgm %d", length)); -#ifdef TCPDUMP_DO_SMB +#ifdef ENABLE_SMB ipx_netbios_print(ndo, datap, length); #endif break; @@ -167,7 +165,7 @@ ipx_sap_print(netdissect_options *ndo, const u_short *ipx, u_int length) ND_PRINT((ndo, "ipx-sap-nearest-req")); ND_TCHECK(ipx[0]); - ND_PRINT((ndo, " %s", ipxsap_string(htons(EXTRACT_16BITS(&ipx[0]))))); + ND_PRINT((ndo, " %s", ipxsap_string(ndo, htons(EXTRACT_16BITS(&ipx[0]))))); break; case 2: @@ -179,14 +177,14 @@ ipx_sap_print(netdissect_options *ndo, const u_short *ipx, u_int length) for (i = 0; i < 8 && length > 0; i++) { ND_TCHECK(ipx[0]); - ND_PRINT((ndo, " %s '", ipxsap_string(htons(EXTRACT_16BITS(&ipx[0]))))); - if (fn_printzp(ndo, (u_char *)&ipx[1], 48, ndo->ndo_snapend)) { + ND_PRINT((ndo, " %s '", ipxsap_string(ndo, htons(EXTRACT_16BITS(&ipx[0]))))); + if (fn_printzp(ndo, (const u_char *)&ipx[1], 48, ndo->ndo_snapend)) { ND_PRINT((ndo, "'")); goto trunc; } ND_TCHECK2(ipx[25], 10); ND_PRINT((ndo, "' addr %s", - ipxaddr_string(EXTRACT_32BITS(&ipx[25]), (u_char *)&ipx[27]))); + ipxaddr_string(EXTRACT_32BITS(&ipx[25]), (const u_char *)&ipx[27]))); ipx += 32; length -= 64; } |