summaryrefslogtreecommitdiff
path: root/print-nfs.c
Commit message (Collapse)AuthorAgeFilesLines
* Enhance NFS access request messages.Lucas C. Villa Real2010-01-261-1/+32
| | | | | | | | When debugging NFS operations one may find it easier to get the actual access flags decoded rather than having to look up the NFS access flags to find which permissions were requested by the client. Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Add more bounds checks to the NFS dissector - check before references toguy2007-12-221-5/+21
| | | | | | | | | | | | items in the RPC header. When dissecting NFS over TCP, fetch the fragment header length, use it to limit the dissection of the request or reply (in case there's more than one request or reply in the packet), and do the same direction-plus-port checks that are done for NFS over UDP. Also eliminate the bounds check for the RPC header in the TCP dissector code, and do checks for the fields it looks at (other checks are done by the NFS dissector).
* Print unsigned values as such. Rename a variable to correspond to whatguy2007-06-151-14/+14
| | | | it is (a reply status).
* Pick up MSG_DENIED response dissection from NetBSD; don't interpret theguy2007-06-151-8/+82
| | | | reply as a possible NFS reply if it got MSG_DENIED.
* Add an "fn_printzp()" routine for printing null-padded strings (stringsguy2005-05-061-3/+5
| | | | | | | | | | | | | | | with a maximum length, where a string shorter than that length is padded with NULs), as "fn_print()" won't handle the maximum length *and* the snapshot length and "fn_printn()" won't stop on a null string. Use it where appropriate. Always pass "snapend" to "fn_print()" and "fn_printn()" if they're passed a pointer into the packet data; only pass NULL if they're being handed a pointer into a buffer that's not part of the packet data. Always check the return value of "fn_print()", "fn_printn()", and "fn_printzp()" if they're passed "snapend", and do the appropriate string termination and "packet truncated" indication if they return 1.
* Attempt to squelch a warning from the SGI C compiler.guy2005-04-201-2/+2
|
* For NFSv3 writes, show the byte count correctly - and show the length ofguy2005-01-051-4/+5
| | | | the data being written, just as we do for NFSv2 writes.
* Get rid of print_int64(), as we can now just use PRI[dux]64 andguy2005-01-051-75/+39
| | | | | | | | EXTRACT_64BITS() to directly extract and print 64-bit integers. Add some more bounds checking. Fix the dissection of the arguments to v3 WRITE.
* Have our own headers to declare the format of ONC (Sun) RPC messages onguy2004-12-271-25/+25
| | | | | | | | | | | | | | the wire; the definitions in many systems use u_long, which is 64 bits long on many platforms - that's OK for in-memory structures, but it doesn't match what's on the wire. Use headers based on the Sun ones, but use u_int32_t for fields, and otherwise make the structures match what's on the wire, and change some names to avoid collision with <rpc/rpc.h>, which print-sunrpc.c includes to declare "getrpcbynumber()" and the structure it returns. Record whether "getrpcbynumber()" is found, and use it only if it's found, rather than basing the decisison on whether we're building for Win32 or not.
* Add an "EXTRACT_64BITS()" macro - using the "EXTRACT_32BITS()" macro, soguy2004-09-241-2/+2
| | | | | we get the fast implementations if we are on a processor that doesn't require alignment.
* Assume that u_int64_t is defined, along with PRI[dux]64, as per theguy2004-04-171-26/+7
| | | | | | | recent configure script changes. On UN*X, include <inttypes.h> in "tcpdump-stdinc.h" if it defines the PRI[duxo]64 macros.
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | appropriately, and that GNUmakefile and the MSVC++ project file define it apppriately, as we do with libpcap, rather than defining it in "interface.h". Undo the rcsid-shuffling and addition of extra #includes, as we no longer need to arrange that "interface.h" be included before using _U_ in an RCS ID or copyright.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | use "_U_" in the definitions of "rcsid[]", to eliminate complaints about those variables being unused; move the definitions after the include of "interface.h", or add an include of "interface.h", so that "_U_" is defined. Include "config.h" before including "tcpdump-stdinc.h" in "missing/datalinks.c".
* From Charles M. Hannum <mycroft@netbsd.org>: NetBSD whitespace cleanups.guy2002-12-121-16/+15
|
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-111/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compile with Sun C, as "interface.h" isn't being included before the structures are being declared. Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun C to generate code that's safe with unaligned accesses, as "__attribute__" is defined as a do-nothing macro with compilers that don't support it. Therefore, we get rid of that tag on the structures to which it was added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch 16-bit and 32-bit big-endian quantities from packets. We also fix some other references to multi-byte quantities to get rid of code that tries to do unaligned loads on platforms that don't support them. We also throw in a hack that makes those macros use "__attribute__((packed))" on structures containing only one 16-bit or 32-bit integer to get the compiler to generate unaligned-safe code rather than doing it by hand. (GCC on SPARC produces the same code that doing it by hand does; I don't know if GCC on any other big-endian strict-alignment processor generates better code for that case. On little-endian processors, as "ntohs()" and "ntohl()" might be functions, that might actually produce worse code.) Fix some places to use "%u" rather than "%d" to print unsigned quantities.
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* Fixes for:guy2002-08-261-6/+25
| | | | | | | | parsefattr misuses nfsv2 version members for v3. print_int64 prints at least 9 digits unnecessarily. -u flag doesn't always suppress decoding handles. from Takashi Yamamoto <yamt@mwd.biglobe.ne.jp>.
* Added support for Win32, based on WinPcap.risso2002-08-011-7/+2
|
* whitespace cleanupitojun2002-06-111-4/+4
|
* Get rid of unneeded incomplete definitions of "struct mbuf" and "structguy2002-06-011-4/+1
| | | | | rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and <sys/ioctl.h>.
* V3 FSINFO and PATHCONF requests take a file handle as an argument; parseguy2002-05-311-13/+28
| | | | | | | | | | | | | | | | | | | | the request header and the file handle. "parsestatus()" should only return NULL if the packet was truncated, so that its callers can distinguish "packet truncated" from "NFS reply status reports an error". NFS-request-or-reply parsing routines that call "parsestatus()" should not return 0 if "parsestatus()" returns a non-zero NFS reply status, so that non-truncated packets with a non-zero NFS reply status aren't printed as truncated NFS packets. Fix some "TCHECK2()" calls to pass an object, not a pointer to an object, as the first argument (the TCHECK/TTEST macros take objects, not addresses, as the test argument). NFS-request-or-reply parsing routines should return 0 for truncated packets and 1 for non-truncated packets, not *vice versa*.
* Get rid of casts of pointers-to-const to pointers-to-nonconst.guy2002-04-241-6/+7
|
* constnessitojun2002-02-181-2/+2
|
* NULL is not 0itojun2001-07-081-2/+2
|
* Check for parse failure in ACCESS replies.fenner2001-07-041-2/+3
| | | | Submitted by: nathanw@MIT.EDU (Nathan J. Williams)
* put stripped-down version of ip6.h and icmp6.h into tcpdump tree.itojun2000-10-071-4/+4
| | | | | | | | ip6.h is almost normal RFC2292 header. icmp6.h has couple of extensions (not covered by RFC2292), like MLD, ICMPv6 nodeinfo, and router renumber. XXX how to synchronize with future kame changes?
* always use u_intXX_t for protocol format declaration. char/short/int may notitojun2000-10-031-4/+4
| | | | | | come with exact size. while at it, correct signedness of ip/udp header field. nuke most of the use of bitfield. TODO: bitfield in namser.h
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-2/+1
| | | | "n_long", and "n_time", defined in that file, with other types.
* Get rid of unneeded includes of <net/if.h>.guy2000-09-281-2/+1
|
* Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy2000-09-231-2/+3
| | | | | | | | | | | have dissectors include them rather than <netinet/ip.h> or <netinet/ip_var.h>, if they actually need that stuff. Put the declarations of the ICMP stuff directly into "print-icmp.c". Remove all unnecessary includes of <netinet/ip*.h> files. Copy the byte-order stuff from "nameser.h" into "tcp.h".
* Add definitions of Ethernet types fromguy2000-09-231-2/+1
| | | | | | | | | | | | | | | | "linux-includes/netinet/if_ether.h" to "ethertype.h". Move other stuff used by dissectors from <netinet/if_ether.h> to "ether.h", along the lines of "fddi.h" and "token.h". Move ARP declarations from BSD include files to "print-arp.c". Remove from dissectors includes of <netinet/if_ether.h>, and add includes of "ethertype.h" and/or "ether.h" as necessary. Get rid of configuration options that test declarations now made in "ether.h" or "print-arp.c", as those declarations are now under our control, not the OS's control.
* To translate NFS error statuses to strings, use "tok2str()" and a table,guy2000-08-031-2/+52
| | | | | | | | | rather than using "pcap_strerror()", as 1) not all NFS error statuses are UNIX errno values; 2) even those that are UNIX errno values aren't necessarily errno values for the system on which you're running tcpdump.
* s/nfstype/nfs_type/ to avoid conflict with system header filesassar2000-07-291-3/+3
|
* typo in pointer assignment. from netbsd-current.itojun2000-07-161-2/+2
|
* remove non-STDC codeassar2000-07-011-3/+1
|
* add fallback definition for INET_ADDRSTRLEN.itojun2000-06-121-1/+4
| | | | From: Kevin Steves <stevesk@sweden.hp.com>
* strncpy() does not ensure string termination.itojun2000-06-101-1/+2
|
* s/(unsigned)/(u_int32_t)/ for ntohl results.itojun2000-06-101-8/+8
|
* correct endianness in int64_print().itojun2000-06-101-8/+9
|
* correctly handle NFS-over-IPv6.itojun2000-06-101-51/+146
|
* (nfs_printfh): support print the opaque handle.assar2000-06-011-7/+11
| | | | From Francisco Matias Cuenca-Acuna <mcuenca@george.rutgers.edu>
* (unsigned) casts in printf to make gcc happyassar2000-05-151-7/+11
|
* Fix confusing indentation.fenner2000-01-281-152/+149
| | | | | | | Get rid of T2CHECK() in favor of TCHECK() or TCHECK2(). Use TCHECK() etc. instead of comparing vs. snapend. Replace strerr() with pcap_strerror(), and don't use errno as a local variable. Use tok2str() for nfsv3_writemodes to avoid array overrun by corrupt packets.
* Use %08x to make sure that the low half of a 64-bit quantity doesn'tfenner1999-12-151-2/+2
| | | | get printed incorrectly (i.e. 0x1000000001 could have been printed as 0x11)
* Switch to config.h instead of passing defines in DEFS.fenner1999-11-211-1/+5
|
* incorporate NFS parsing code from NetBSD. adds support for nfsv3assar1999-11-211-219/+929
|
* patches to help build on Linux 2.2linux22mcr1999-10-171-2/+1
|
* Initial revisionmcr1999-10-071-0/+869