print-nfs.c (26184) | print-nfs.c (39300) |
---|---|
1/* | 1/* |
2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 | 2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 |
3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and 9 * this paragraph in its entirety in the documentation or other materials 10 * provided with the distribution, and (3) all advertising materials mentioning --- 5 unchanged lines hidden (view full) --- 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 */ 21 22#ifndef lint 23static const char rcsid[] = | 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and 9 * this paragraph in its entirety in the documentation or other materials 10 * provided with the distribution, and (3) all advertising materials mentioning --- 5 unchanged lines hidden (view full) --- 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 */ 21 22#ifndef lint 23static const char rcsid[] = |
24 "@(#) $Header: print-nfs.c,v 1.63 96/12/10 23:18:07 leres Exp $ (LBL)"; | 24 "@(#) $Header: print-nfs.c,v 1.65 97/08/17 13:24:22 leres Exp $ (LBL)"; |
25#endif 26 27#include <sys/param.h> 28#include <sys/time.h> 29#include <sys/socket.h> 30 31#include <net/if.h> 32 --- 209 unchanged lines hidden (view full) --- 242 register const struct ip *ip; 243 u_int32_t proc, vers; 244 245 nfserr = 0; /* assume no error */ 246 rp = (const struct rpc_msg *)bp; 247 ip = (const struct ip *)bp2; 248 249 if (!nflag) | 25#endif 26 27#include <sys/param.h> 28#include <sys/time.h> 29#include <sys/socket.h> 30 31#include <net/if.h> 32 --- 209 unchanged lines hidden (view full) --- 242 register const struct ip *ip; 243 u_int32_t proc, vers; 244 245 nfserr = 0; /* assume no error */ 246 rp = (const struct rpc_msg *)bp; 247 ip = (const struct ip *)bp2; 248 249 if (!nflag) |
250 (void)printf("%s.nfs > %s.%x: reply %s %d", | 250 (void)printf("%s.nfs > %s.%u: reply %s %d", |
251 ipaddr_string(&ip->ip_src), 252 ipaddr_string(&ip->ip_dst), 253 (u_int32_t)ntohl(rp->rm_xid), 254 ntohl(rp->rm_reply.rp_stat) == MSG_ACCEPTED? 255 "ok":"ERR", 256 length); 257 else | 251 ipaddr_string(&ip->ip_src), 252 ipaddr_string(&ip->ip_dst), 253 (u_int32_t)ntohl(rp->rm_xid), 254 ntohl(rp->rm_reply.rp_stat) == MSG_ACCEPTED? 255 "ok":"ERR", 256 length); 257 else |
258 (void)printf("%s.%x > %s.%x: reply %s %d", | 258 (void)printf("%s.%u > %s.%u: reply %s %d", |
259 ipaddr_string(&ip->ip_src), 260 NFS_PORT, 261 ipaddr_string(&ip->ip_dst), 262 (u_int32_t)ntohl(rp->rm_xid), 263 ntohl(rp->rm_reply.rp_stat) == MSG_ACCEPTED? 264 "ok":"ERR", 265 length); 266 --- 111 unchanged lines hidden (view full) --- 378 nfstype type; 379 int proc, v3; 380 struct nfsv3_sattr sa3; 381 382 nfserr = 0; /* assume no error */ 383 rp = (const struct rpc_msg *)bp; 384 ip = (const struct ip *)bp2; 385 if (!nflag) | 259 ipaddr_string(&ip->ip_src), 260 NFS_PORT, 261 ipaddr_string(&ip->ip_dst), 262 (u_int32_t)ntohl(rp->rm_xid), 263 ntohl(rp->rm_reply.rp_stat) == MSG_ACCEPTED? 264 "ok":"ERR", 265 length); 266 --- 111 unchanged lines hidden (view full) --- 378 nfstype type; 379 int proc, v3; 380 struct nfsv3_sattr sa3; 381 382 nfserr = 0; /* assume no error */ 383 rp = (const struct rpc_msg *)bp; 384 ip = (const struct ip *)bp2; 385 if (!nflag) |
386 (void)printf("%s.%x > %s.nfs: %d", | 386 (void)printf("%s.%u > %s.nfs: %d", |
387 ipaddr_string(&ip->ip_src), 388 (u_int32_t)ntohl(rp->rm_xid), 389 ipaddr_string(&ip->ip_dst), 390 length); 391 else | 387 ipaddr_string(&ip->ip_src), 388 (u_int32_t)ntohl(rp->rm_xid), 389 ipaddr_string(&ip->ip_dst), 390 length); 391 else |
392 (void)printf("%s.%x > %s.%x: %d", | 392 (void)printf("%s.%u > %s.%u: %d", |
393 ipaddr_string(&ip->ip_src), 394 (u_int32_t)ntohl(rp->rm_xid), 395 ipaddr_string(&ip->ip_dst), 396 NFS_PORT, 397 length); 398 399 xid_map_enter(rp, ip); /* record proc number for later on */ 400 --- 352 unchanged lines hidden (view full) --- 753 *vers = xmep->vers; 754 return 0; 755 } 756 if (++i >= XIDMAPSIZE) 757 i = 0; 758 } while (i != xid_map_hint); 759 760 /* search failed */ | 393 ipaddr_string(&ip->ip_src), 394 (u_int32_t)ntohl(rp->rm_xid), 395 ipaddr_string(&ip->ip_dst), 396 NFS_PORT, 397 length); 398 399 xid_map_enter(rp, ip); /* record proc number for later on */ 400 --- 352 unchanged lines hidden (view full) --- 753 *vers = xmep->vers; 754 return 0; 755 } 756 if (++i >= XIDMAPSIZE) 757 i = 0; 758 } while (i != xid_map_hint); 759 760 /* search failed */ |
761 return (-1); | 761 return (0); |
762} 763 764/* 765 * Routines for parsing reply packets 766 */ 767 768/* 769 * Return a pointer to the beginning of the actual results. --- 791 unchanged lines hidden --- | 762} 763 764/* 765 * Routines for parsing reply packets 766 */ 767 768/* 769 * Return a pointer to the beginning of the actual results. --- 791 unchanged lines hidden --- |