aboutsummaryrefslogtreecommitdiff
path: root/etherent.c
Commit message (Collapse)AuthorAgeFilesLines
* Make some static variables thread-local.Guy Harris2023-05-051-1/+3
| | | | | | | | This should make some functions thread-safe, even if it doesn't make them fully-reentrant; at least some of them would requiree API changes to full reentrancy. This should fix #1174.
* Nine is a digit.Bill Fenner2019-09-241-1/+1
| | | | Fixes fencepost errors in git commit 5a41835
* Get rid of PCAP_ISLWSP and PCAP_ISSPACE.Guy Harris2019-08-311-3/+4
| | | | | | | Explicitly check for the characters we care about, to make it clearer what we're doing. Fix a bug introduced by an earlier change in the process.
* Don't use ctype.h macros.Guy Harris2019-08-311-8/+11
| | | | | | | | | | | | | | | 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. Define our own locale-independent macros that can be handed any integral value. Don't include <ctype.h>. This should address the issue in GitHub pull request #839, and should also catch any (highly unlikely) cases in which something other than Boring Old Space And Tab and, sometimes, CR and LF are treated as white space. (No, we don't want FF or VT treated as white space.)
* Squelch warnings.Guy Harris2018-03-201-3/+3
| | | | | Cast bytes read from getc(), and already known not to be EOF, to u_char before treating them as unsigned 8-bit bytes.
* Squelch warnings.Guy Harris2018-03-201-10/+11
| | | | | | | | | xdtoi turns an (unsigned) 8-bit character from a string into a hex digit value, which is also an unsigned 8-bit byte value; make it take a u_char as an argument and return a u_char, and make the octet value accumulated in pcap_next_etherent() a u_char as well. Use a size_t variable for a size.
* Don't use old-style function definitions.Guy Harris2018-03-201-6/+3
|
* Get rid of pcap-stdinc.h.Guy Harris2017-09-051-3/+0
| | | | | On Windows, in each file, include whatever that particular file needs, just as we do on UN*X and MS-DOS.
* Put the stuff to get the sized integer types defined into pcap-types.h.Guy Harris2017-09-041-10/+1
| | | | | | | | | Have pcap-types.h arrange to define the intN_t/u_intN_t types, and the INTn_MAX/UINTn_MAX values, on all platforms, and use it wherever it's appropriate. Include it up front in scanner.l, to avoid redefinitions of the INTn_MAX/UINTn_MAX types.
* Always check for EOF after reading a character from /etc/ethers.Guy Harris2017-08-311-9/+22
| | | | | | | | | | | | | | | | | | | | We can get an EOF at any time, either due to a file that doesn't end cleanly with an NL or due to an I/O error. In pcap_next_etherent(), every time we call a routine that returns a character from the file, check for EOF and return NULL. (According to the C90 standard (and presumably all subsequent standards), 1) you can safely pass EOF to all the isXXX() macros and 2) EOF is not a space character, so we don't need to check for EOF there.) This should address the concerns of Coverity CID 1416964; hopefully Coverity realizes that getc() returns either a nonnegative value or EOF, and therefore that checking for EOF is sufficient to ensure that the return value is nonnegative. (Given how much it complains about strcmp() with a string constant, because some tests can be evaluated at compile time and therefore some code happens to be unreachable in that particular call - code that will be optimized out by any competent compiler - I'm not going to *assume* Coverity has a clue there.)
* Always include <config.h> rather than "config.h".Guy Harris2017-08-181-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.
* The official #define for 32-bit and 64-bit Windows is _WIN32.Guy Harris2015-08-311-3/+3
| | | | | | | | | | | | | It's _WIN32, with a leading underscore, not WIN32. See, for example: https://sourceforge.net/p/predef/wiki/OperatingSystems/ and https://msdn.microsoft.com/en-us/library/b0084kay.aspx *Some* environments may also define WIN32, but we shouldn't depend on that.
* remove libpcap's own CVS keywordsDenis Ovsienko2014-01-031-5/+0
| | | | | | This change removes CVS keywords that express that the file belongs to libpcap repository. All such keywords represented the revision and timestamp by the end of 2008 or even older.
* Include headers that should cause u_int64_t to be defined.Guy Harris2010-01-261-0/+12
|
* Put the public libpcap headers into a pcap subdirectory in both theguy2006-10-041-2/+2
| | | | | | | | source directory and the target include directory, and have include files at the top-level directory to include those headers, for backwards compatibility. Update the FILES and INSTALL.txt files to reflect current reality.
* Add _U_ to "rcsid[]" definitions, to eliminate "unused variable"guy2003-11-151-2/+2
| | | | warnings from newer versions of GCC.
* add config.h, remove gnuc.h. remove __deadassar2000-07-111-2/+5
|
* Initial revisionmcr1999-10-071-0/+159