X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/68fe98a0fbe192222cfbf7f57f0e1bf34a17baaa..6e12d87355718f309ce9f33183ff8235b9c5eb0d:/print-nfs.c diff --git a/print-nfs.c b/print-nfs.c index 5cd1adf3..92308f8c 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -19,11 +19,6 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifndef lint -static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.111 2007-12-22 03:08:04 guy Exp $ (LBL)"; -#endif - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -48,6 +43,8 @@ static const char rcsid[] _U_ = #include "rpc_auth.h" #include "rpc_msg.h" +static const char tstr[] = " [|nfs]"; + static void nfs_printfh(const u_int32_t *, const u_int); static int xid_map_enter(const struct sunrpc_msg *, const u_char *); static int xid_map_find(const struct sunrpc_msg *, const u_char *, @@ -309,7 +306,7 @@ nfsreply_print(register const u_char *bp, u_int length, trunc: if (!nfserr) - fputs(" [|nfs]", stdout); + printf("%s", tstr); } void @@ -411,7 +408,7 @@ nfsreply_print_noaddr(register const u_char *bp, u_int length, trunc: if (!nfserr) - fputs(" [|nfs]", stdout); + printf("%s", tstr); } /* @@ -545,7 +542,7 @@ nfsreq_print(register const u_char *bp, u_int length, trunc: if (!nfserr) - fputs(" [|nfs]", stdout); + printf("%s", tstr); } void @@ -872,7 +869,7 @@ nfsreq_print_noaddr(register const u_char *bp, u_int length, trunc: if (!nfserr) - fputs(" [|nfs]", stdout); + printf("%s", tstr); } /* @@ -997,14 +994,14 @@ xid_map_enter(const struct sunrpc_msg *rp, const u_char *bp) xmep->xid = rp->rm_xid; if (ip) { xmep->ipver = 4; - memcpy(&xmep->client, &ip->ip_src, sizeof(ip->ip_src)); - memcpy(&xmep->server, &ip->ip_dst, sizeof(ip->ip_dst)); + UNALIGNED_MEMCPY(&xmep->client, &ip->ip_src, sizeof(ip->ip_src)); + UNALIGNED_MEMCPY(&xmep->server, &ip->ip_dst, sizeof(ip->ip_dst)); } #ifdef INET6 else if (ip6) { xmep->ipver = 6; - memcpy(&xmep->client, &ip6->ip6_src, sizeof(ip6->ip6_src)); - memcpy(&xmep->server, &ip6->ip6_dst, sizeof(ip6->ip6_dst)); + UNALIGNED_MEMCPY(&xmep->client, &ip6->ip6_src, sizeof(ip6->ip6_src)); + UNALIGNED_MEMCPY(&xmep->server, &ip6->ip6_dst, sizeof(ip6->ip6_dst)); } #endif xmep->proc = EXTRACT_32BITS(&rp->rm_call.cb_proc); @@ -1038,18 +1035,18 @@ xid_map_find(const struct sunrpc_msg *rp, const u_char *bp, u_int32_t *proc, goto nextitem; switch (xmep->ipver) { case 4: - if (memcmp(&ip->ip_src, &xmep->server, + if (UNALIGNED_MEMCMP(&ip->ip_src, &xmep->server, sizeof(ip->ip_src)) != 0 || - memcmp(&ip->ip_dst, &xmep->client, + UNALIGNED_MEMCMP(&ip->ip_dst, &xmep->client, sizeof(ip->ip_dst)) != 0) { cmp = 0; } break; #ifdef INET6 case 6: - if (memcmp(&ip6->ip6_src, &xmep->server, + if (UNALIGNED_MEMCMP(&ip6->ip6_src, &xmep->server, sizeof(ip6->ip6_src)) != 0 || - memcmp(&ip6->ip6_dst, &xmep->client, + UNALIGNED_MEMCMP(&ip6->ip6_dst, &xmep->client, sizeof(ip6->ip6_dst)) != 0) { cmp = 0; } @@ -1882,5 +1879,5 @@ interp_reply(const struct sunrpc_msg *rp, u_int32_t proc, u_int32_t vers, int le } trunc: if (!nfserr) - fputs(" [|nfs]", stdout); + printf("%s", tstr); }