| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
| |
libpcap has been using strdup() for a long time too, but never
substituted it under the assumption the function is available in all
supported OSes, see libpcap commit cb71eef from 2006. The only
exception to that is Windows, which can have a different name for the
function, but both libpcap and tcpdump for that already use a separate
workaround, which does not involve the substitution.
Let's take this as a proof that strdup() substitution in tcpdump is dead
code, and remove it.
|
| |
|
|
|
|
|
|
|
|
|
| |
The file could be compiled on demand using "make snprintf.o", although
with many warnings, but tcpdump build would never use the file
regardless of the variety of the build.
Some of the code there has been commented out since commit 45aef49 in
2001, and the rest became unused after commit 1ed63b5 in 2019.
|
|
|
|
|
|
|
| |
We don't use it, and there's no Windows tradition of an "ethers file"
that I know of, so I'm not sure there's a reason to use it.
Fixes GitHub issue #971.
|
| |
|
|
|
|
|
|
|
| |
Apparently, it does not like pragmas in the middle of a statement:
./missing/getopt_long.c: In function 'getopt_internal':
./missing/getopt_long.c:572:3: error: 'else' without a previous 'if'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's explicitly cheating in some places; just cast away the warnings.
Add a Clang version testing macro to compiler-tests.h.
Move the diagnostic control #defines from netdissect-stdinc.h to
diag-control.h, libpcap-style, so that they can be used by code that
doesn't use (or need) netdissect-stdinc.h. This also means that we can
limit the inclusion of diag-control.h, and the definition of those
Do them more libpcap-style, with separate DIAG_OFF/DIAG_ON pairs for
particular issues, rather than having DIAG_OFF() and DIAG_ON() macros
that take -W option names as arguments; that way, if we need to define
them for compilers that don't have the GCC/Clang syntax for those
pragmas, e.g. MSVC, we can do so.
|
| |
|
|
|
|
|
|
|
| |
DLT_LANE8023 was never defined in libpcap.
It was, perhaps, defined in some SuSE libpcap update, but no evidence
of this.
It is not defined in OpenSuSE Leap 15.2 (information from Guy).
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
That's what we did for win_ether_ntohost.h.
|
|
|
|
|
|
| |
This reverts commit a5eca2cbbfa991c0ae26d0b039bf303fa92734ac.
MSVC doesn't complain about it, so leave it alone.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This eliminates a warning from MSVC, and makes the flow a little
clearer.
(Yes, it duplicates some code, but compilers have been pretty good at
merging common code sequences, so it might just turn it into the
equivalent of
if (optopt == (int)':')
goto label;
oli = strchr(ostr, optopt);
if (!oli) {
label:
/*
* Unknown option character.
*/
if (!*place)
++optind;
...
}
although it does mean that the same C code exists in two places.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It looks like CMake after commit 3e9e2b6 started to use the newly added
missing/pcap_dump_ftell.c to make pcap_dump_ftell() available in tcpdump
if libpcap does not have it. However, autotools continued to use the
previously existing ./pcap_dump_ftell.c for the same purpose. Remove the
previously existing file and amend autotools files to cover
pcap_dump_ftell() the same way as the other functions in the missing/
directory files.
Amend missing/pcap_dump_ftell.c not to use pcap_dump_file(), as it may be
unavailable.
This has been tested to work with libpcap 0.6.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).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Move the source to our own ether_ntohost() to the "missing" directory,
just as we do in libpcap for the Windows snprintf() wrapper around
_snprintf().
Add a header file for it, and include it in both the wrapper and in
addrtoname.c on Windows.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Let the compiler do the optimizations (or not) based on build options.
Avoid 'value has been optimized out' messages in gdb using '-O0'.
|
|
|
|
|
|
| |
- fixed none _WIN32 implementation
- on windows, see if a services file exists in the same directory as tcpdump and use that
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Have our own routines to convert between IPv4/IPv6 addresses and
strings; that helps if, for example, we want to build binary versions of
tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't
have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do. It
also means that we don't require IPv6 library support on UN*X to print
addresses (if somebody wants to build tcpdump for older UN*Xes lacking
IPv6 support in the system library or in add-on libraries).
Get rid of files in the missing directory that we don't need, and
various no-longer-necessary autoconf tests.
|
|
|
|
|
|
|
| |
Moreover:
Remove netdissect.h include in interface.h
Move thiszone declaration in netdissect.h
Update a comment
|
|
|
|
| |
Get the full log via: git log --follow netdissect-stdinc.h
|
|
|
|
|
|
|
|
| |
Do the case-insensitive comparisons in a locale-independent fashion that
only maps ASCII letters, in the standard English-language fashion; that
way, we don't get bitten by, for example, Turkish having separate "i
with dot" and "i without dot" letters, with lower-case "i with dot" being
mapped to upper-case "I with dot" rather than being mapped to "I".
|
| |
|
|
|
|
|
| |
The warning was:
./missing/strsep.c:54:1: warning: no previous prototype for 'strsep' [-Wmissing-prototypes]
|
| |
|
|
|
|
|
|
|
| |
We need <errno.h> on UN*X in some files that include tcpdump-stdinc.h,
such as missing/inet_pton.c.
Remove includes of <errno.h> from files that include tcpdump-stdinc.h.
|
|
|
| |
Removed <errno.h> here since it's already included in ./tcpdump-stdinc.h. The local 'win32/Include/errno.h' is deleted.
|
| |
|
|
|
|
|
| |
That's necessary on Windows, where you're not going to get them defined
by getopt().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All tests that should print IPv6-addresses failed since 'INET6' wasn't
set when my missing/inet_ntop.c was compiled. Due to "config.h" was not
included.
Also got rid of 2 warnings:
Missing/inet_ntop.c:146:23: warning: 'cur.len' may be used
uninitialized in this function [-Wmaybe-uninitialized]
The tests also failed since the inet_ntop_v6() was returning hex-chars
in upper-case. So this patch returns string in lower-case.
|
| |
|
| |
|
|
|
|
| |
The extra 'return (NULL)' is dead code.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
This also fixes configure-script problems on OSes that have IPv6 support
but don't have <netinet6/in6.h> - no standard I could find requires that
header for IPv6 support (the Single UNIX Specification speaks of
<netinet/in.h> for both IPv4 and IPv6, and RFCs 2292 and 3542 don't
mention <netinet6/in6.h>, just <netinet/in.h> and <netinet6/ip6.h>).
|
| |
|
|
|
|
| |
make it build on Tru64 UNIX, so get rid of it.
|
|
|
|
| |
is set, it doesn't get treated as a negative number.
|
|
|
|
|
|
|
|
|
|
|
| |
the _errno() stuff isn't needed for current versions of MinGW;
get rid of some definitions not needed with MSVC++ and other
non-MinGW32/non-Watcom compilers;
add IPv6 capability to inet_pton.c, courtesy of Paul Vixie;
add inline ntoh{ls}/hton{ls} functions for GCC/i386.
|
| |
|
|
|
|
| |
with Windows printf.
|
|
|
|
|
|
|
|
|
|
| |
causes the configure script to attempt to define the PRI[doux]64 macros
if they're not defined by including <inttypes.h>, and causes
"missing/bittypes.h" to attempt to define them, if undefined, in a
fashion that should, with any luck, work on MSVC++ and various flavors
of GNU C on Windows.
Fix the spelling of "Mac OS X".
|