diff options
Diffstat (limited to 'contrib/tcpdump/print-sunrpc.c')
-rw-r--r-- | contrib/tcpdump/print-sunrpc.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/contrib/tcpdump/print-sunrpc.c b/contrib/tcpdump/print-sunrpc.c index 6d98282..2c7f6c7 100644 --- a/contrib/tcpdump/print-sunrpc.c +++ b/contrib/tcpdump/print-sunrpc.c @@ -17,11 +17,10 @@ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $FreeBSD$ */ -#define NETDISSECT_REWORKED +/* \summary: Sun Remote Procedure Call printer */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -41,7 +40,7 @@ */ #undef _XOPEN_SOURCE_EXTENDED -#include <tcpdump-stdinc.h> +#include <netdissect-stdinc.h> #if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H) #include <rpc/rpc.h> @@ -53,14 +52,12 @@ #include <stdio.h> #include <string.h> -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" #include "extract.h" #include "ip.h" -#ifdef INET6 #include "ip6.h" -#endif #include "rpc_auth.h" #include "rpc_msg.h" @@ -95,7 +92,7 @@ * * from: @(#)pmap_prot.h 1.14 88/02/08 SMI * from: @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC - * $FreeBSD$ + * $FreeBSD: stable/11/contrib/tcpdump/print-sunrpc.c 276788 2015-01-07 19:55:18Z delphij $ */ /* @@ -173,13 +170,11 @@ sunrpcrequest_print(netdissect_options *ndo, register const u_char *bp, { register const struct sunrpc_msg *rp; register const struct ip *ip; -#ifdef INET6 register const struct ip6_hdr *ip6; -#endif uint32_t x; char srcid[20], dstid[20]; /*fits 32bit*/ - rp = (struct sunrpc_msg *)bp; + rp = (const struct sunrpc_msg *)bp; if (!ndo->ndo_nflag) { snprintf(srcid, sizeof(srcid), "0x%x", @@ -191,21 +186,19 @@ sunrpcrequest_print(netdissect_options *ndo, register const u_char *bp, snprintf(dstid, sizeof(dstid), "0x%x", SUNRPC_PMAPPORT); } - switch (IP_V((struct ip *)bp2)) { + switch (IP_V((const struct ip *)bp2)) { case 4: - ip = (struct ip *)bp2; + ip = (const struct ip *)bp2; ND_PRINT((ndo, "%s.%s > %s.%s: %d", ipaddr_string(ndo, &ip->ip_src), srcid, ipaddr_string(ndo, &ip->ip_dst), dstid, length)); break; -#ifdef INET6 case 6: - ip6 = (struct ip6_hdr *)bp2; + ip6 = (const struct ip6_hdr *)bp2; ND_PRINT((ndo, "%s.%s > %s.%s: %d", ip6addr_string(ndo, &ip6->ip6_src), srcid, ip6addr_string(ndo, &ip6->ip6_dst), dstid, length)); break; -#endif default: ND_PRINT((ndo, "%s.%s > %s.%s: %d", "?", srcid, "?", dstid, length)); break; |