summaryrefslogtreecommitdiff
path: root/parsenfsfh.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't use <ctype.h> macros.Guy Harris2019-09-011-1/+3
| | | | | | | | | | | | | | Some of them are locale-dependent, and all of them run the risk of failing if you hand them a char with the 8th bit set. Move our replacements to a new netdissect-ctype.h file, and, for the ones that check for particular character types, add _ASCII to the name, to indicate that only ASCII characters pass the check. Do the same for the ones that map between cases, to indicate that they only map ASCII letters. For isspace(), explicitly check for the characters we care about, to make it clearer what we're doing.
* Remove more old-compiler compensation.Guy Harris2019-08-081-1/+1
| | | | | | | | | | | | We require an environment with a C99-compatible snprintf(), so we don't need to work around older implementations. Make the configuration process fail if we don't have snprintf() and vsnprintf(). We require at least VS 2015, so we don't have to check for _MSC_VER >= 1400. Make the build fail if we don't have at least VS 2015. We apparently do, however, have to use __inline, as the VS 2015 documentation doesn't meaning plain old "inline". Update a comment.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-57/+57
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* Add the ndo parameter to some functionsFrancois-Xavier Le Bail2019-03-261-5/+5
| | | | This parameter will be needed at the next step.
* Fix an undefined behavior at runtime in parsenfsfh.cFrancois-Xavier Le Bail2018-07-101-2/+2
| | | | | | The error was: parsenfsfh.c:359:37: runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
* Use EXTRACT_ macros, don't reassemble multi-byte quantities ourselves.Guy Harris2018-07-081-79/+29
|
* Add nd_{v}snprintf() routines/wrappers.Guy Harris2018-01-291-1/+1
| | | | | | | | Some versions of the MSVC runtime library have a non-C99-compliant vsnprintf(), which we want to avoid. On Windows, use snprintf() and vsnprintf() for VS 2015 and later, where they both exist in C99-compliant forms, and wrap _{v}snprintf_s() otherwise (they're guaranteed to do the null termination that we want).
* NFS: Use the EXTRACT_U_1() macro in the file handles parserFrancois-Xavier Le Bail2018-01-281-58/+96
|
* Always include <config.h> rather than "config.h".Guy Harris2018-01-211-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Remove a never used macroFrancois-Xavier Le Bail2017-12-161-10/+0
|
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-3/+3
| | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
* Make sure the Opaque_Handle string is null-terminated.Guy Harris2017-01-181-0/+1
| | | | ...even if the file handle length is 0.
* Don't overflow the Opaque_Handle buffer.Guy Harris2017-01-181-4/+4
| | | | | The file handle length can be arbitrarily large; don't assume its hex dump will fit in the buffer, just truncate it if it doesn't.
* Don't run past the end of an NFSv3 file handle.Guy Harris2017-01-181-105/+120
| | | | | | | | | NFSv2 file handles are always 32 bytes long, possibly with zero padding at the end. NFSv3 file handles are variable-length, however, so we cannot assume that they have any minimum number of bytes of data; check that bytes are present before looking at them.
* libnetdissect code must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-111-1/+1
| | | | | | | Moreover: Remove netdissect.h include in interface.h Move thiszone declaration in netdissect.h Update a comment
* Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'Francois-Xavier Le Bail2015-09-101-1/+1
| | | | Get the full log via: git log --follow netdissect-stdinc.h
* Fix a bunch of de-constifications.Guy Harris2015-04-261-3/+3
|
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+0
| | | | | | | The purpose of this macro was to enable the file-by-file switch to NDO, after which only tcpdump.c had a use of it and the definitions guarded by it. Update tcpdump.c not to require them any more and dismiss the unused definitions.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-4/+4
| | | | | | | | | And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well.
* Define NETDISSECT_REWORKED in a bunch of files, and fix the issues it finds.Guy Harris2014-04-041-0/+1
| | | | | The only one it found was that routines in sigsecret.c needed to refer to ndo->ndo_sigsecret, not just sigsecret.
* parsenfsfh: fix old-style function definitionsFrancois-Xavier Le Bail2014-03-261-10/+6
|
* Do our own isascii(), isprint(), isgraph(), and toascii().Guy Harris2014-02-021-1/+1
| | | | | | | | | We do *not* want the behavior of isprint() and isgraph() to be locale-dependent - we want both of them to return "true" only for ASCII characters. We have to do our own isascii() and toascii() on non-UN*X systems anyway, so let's just do all of them ourselves.
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-5/+0
| | | | | | Remove lots of $Header's and a few $Id's that all belong to the former CVS repository of tcpdump itself. These keywords have been frozen since the migration to git in late 2008.
* NFS: replace ino_t with u_int32_t (GH #335 pt. 1)Denis Ovsienko2013-10-121-19/+10
| | | | | | | | | | | | | | | | NFS file handle is an opaque server-issued sequence of bytes. Parse_fh() function implements heuristics to decode file handles generated by some NFS servers, among other information extracting the node (inode) number. It decodes only 32-bit node numbers. NFS implementations use ino_t C type to represent the node number. The type size may vary across implementations/encodings and may be missing during compile time. Tcpdump used to have its own typedef for ino_t. Gisle Vanem points that it caused a problem with MSVC v.16.00.40219.01 for 80x86, which defines the same type in <sys/types.h>. This change fixes tcpdump code to use u_int32_t and removes the typedef.
* From NetBSD:guy2006-06-131-2/+28
| | | | | | | | | | | | | | | | | revision 1.7 date: 2006/03/25 11:43:53; author: rpaulo; state: Exp; lines: +23 -3 PR 13604: detect and print correct information for 4.4BSD/NetBSD NFS filehandles. The heuristic may or may not be wrong, but no one replied in the tcpdump-workers mailing list. Extraction of the fsid information contributed by Chuck Silvers. Discussed with Chuck Silvers. ---------------------------- revision 1.6 date: 2006/03/22 04:30:28; author: christos; state: Exp; lines: +4 -2 Coverity CID 563: Kill SUNOS3 case; it is dead code. ----------------------------
* cleaned up warning.mcr2004-03-251-2/+2
|
* 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".
* Added support for Win32, based on WinPcap.risso2002-08-011-4/+2
|
* Get rid of casts of pointers-to-const to pointers-to-nonconst.guy2002-04-241-5/+5
|
* Eliminate some unused parameters.fenner2001-09-171-3/+3
| | | | | | | | | | | Use const more. Use EXTRACT_* macros more. Use TCHECK* more. Use tok2str() to replace some home-grown workalikes. smb: - Get rid of private types, use tcpdump-defined types - Rename fdata and fdata1 to smb_fdata and smb_fdata1 to avoid conflict with IRIX library function.
* on netbsd mailing list, it was mentioned that the NetBSD byteorder guessingitojun2001-06-241-73/+1
| | | | code needs revisit.
* have support for FHT_NETBSDE[LB]. maybe useful for other implementations.itojun2001-06-181-4/+74
|
* avoid sprintfitojun2001-06-151-2/+2
|
* clearify copyright. based on communication with the author,itojun2001-06-151-1/+34
| | | | | Jeffrey Mogul <mogul@pa.dec.com>. From: Jakob Schlyter <jakob@openbsd.org>
* remove non-STDC codeassar2000-07-011-4/+1
|
* (my_fsid): add Opaque_Handle for storing the actual filehandle. Fromassar2000-06-011-8/+12
| | | | Francisco Matias Cuenca-Acuna <mcuenca@george.rutgers.edu>
* 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-2/+3
|
* Initial revisionmcr1999-10-071-0/+423