Commit Graph

352 Commits

Author SHA1 Message Date
Denis Ovsienko
0d397bff47 Remove unused missing/snprintf.c. [skip ci]
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.
2023-01-31 12:38:49 +00:00
Francois-Xavier Le Bail
258df5c65f Makefile.in: Get rid of a remain of gnuc.h
gnuc.h was removed in commit fcf0144ed2.

[skip ci]
2023-01-10 13:21:44 +01:00
Francois-Xavier Le Bail
ef280660f2 Makefile.in: Add the whitespacecheck target
Display errors when there are trailing space(s)/tab(s).

[skip ci]
2022-12-19 21:04:18 +01:00
Francois-Xavier Le Bail
02a09dc8d3 Makefile.in: Add "make -s install" in the releasecheck target 2022-12-11 19:03:19 +01:00
Francois-Xavier Le Bail
9fee4c6280 Makefile.in: Add the releasecheck target
This change do, in a fresh directory from a release archive:
1) a "configure --enable-smb" and build,
2) a "cmake -DENABLE_SMB=yes" and build.

It may allow to find some necessary files missing in the release archive.

Define CMAKE_MESSAGE_LOG_LEVEL=NOTICE to minimize the cmake output.
Define CMAKE_RULE_MESSAGES=OFF to minimize the make output in cmake case.

[skip ci]
2022-11-26 09:10:33 +01:00
Francois-Xavier Le Bail
a268f5d657 Remove the release candidate rcX targets
These tricky targets used "autoreconf -f" (via "make releasetar") and
they changed the VERSION and configure files locally.

If building a release candidate tar archive is needed, it's better to:
Update VERSION with rcX suffix and configure via "autoreconf -f",
commit them, add a tag and build the archive via "make releasetar".
It should display: Archive build from tag tcpdump-...rcX.

Note: the "autoreconf -f" command changes the configure file in an
uncontrolled way (runstatedir, #define LARGE_OFF_T, etc.) depending on
the autoconf version.
It is necessary to choose the parts that will be added in the commit
with "git add -i".

This is a follow-up to c378c2a04c.

[skip ci]
2022-10-31 17:20:18 +01:00
Francois-Xavier Le Bail
c378c2a04c Use "git archive" for the "make releasetar" process
Use the release tag if it exists or use HEAD.

Remove the "autoreconf -f" command, because it changes the configure file
locally in an uncontrolled way (runstatedir, #define LARGE_OFF_T, etc.)
depending on the autoconf version. This command is run in the release
process before a commit and we can choose the parts that will be added
in the commit.

Note:
The following target (rcX) must be updated ou removed in a next step
because it was using "autoreconf -f" (via "make releasetar") and it
changes the VERSION and configure files locally.

This change
1) Ensures that we only release files from tag/HEAD, not locally
   modified ones.
2) Avoids disclosing personal data such as the username/group of the
   local user.
3) Puts by default a umask of 0002, which turns off the world write bit
   on files in the archive.
4) Avoids problems on some OSes (no more tar, Git builtin tar.gz
   handling).
2022-10-28 18:34:55 +02:00
Denis Ovsienko
77476409d9 Update some references to README files. [skip ci] 2022-09-24 12:46:55 +01:00
Denis Ovsienko
daad3ca54b Update AIX and Solaris-related specifics. 2022-06-15 11:04:58 +01:00
Denis Ovsienko
b50d074de3 Say CONTRIBUTING.md in Makefile.in too. [skip ci] 2022-06-15 00:11:45 +01:00
Denis Ovsienko
9a0d013dfc Improve error detection in "make releasetar". [skip ci]
(Same as in libpcap commit d62ed0c.)

Before:

$ make releasetar
tar: CONTRIBUTING: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
Cleaning...
$ make distclean

After:

$ make releasetar
tar: CONTRIBUTING: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
make: *** [Makefile:475: releasetar] Error 2
2022-06-15 00:11:45 +01:00
Francois-Xavier Le Bail
deaa7bace2 instrument functions: Remove tcpdump_ prefix from flag files
This make easier to use instrument-functions.c in other projects.
2022-02-02 11:56:59 +01:00
Guy Harris
fe762c04a6 Handle DLT_PFLOG on all OSes.
Don't pad the pflog header with BPF_WORDALIGN(); round up to a multiple
of 4, instead, as that's what all but FreeBSD do, and FreeBSD used to do
that and should go back to doing so (kern/261566).

Don't rely on the OS's pflog include files to define direction types,
reason types, action types, or the layout of the header; instead, define
them ourselves in a header of our own, with #ifs to select the ones that
are only on some platforms.  That way, it'll handle some fields and
field values (the ones common to all OSes with pflog) on all OSes, even
ones without pflog.

That also expands the set of direction, reason, and action codes to what
various *BSDs and Darwin support.

Also, handle all the different AF_INET6 values in various *BSDs and
Darwin.
2022-01-29 22:30:33 -08:00
Francois-Xavier Le Bail
65f4c88d27 instrument functions: Enhance the output
If entering in a function, print also the calling function name with
file name and line number. There may be a small shift in the line number.

In some cases, with Clang 11, the file number is unknown (printed '??')
or the line number is unknown (printed '?'). In this case, use GCC.

To print nothing, like with no instrumentation:
$ make instrument_off

As before, the following commands are available:
To configure the printing of only the global functions names:
$ make instrument_global

To go back to print all the functions names:
$ make instrument_all

The library libbfd is used, therefore the binutils-dev package is required.
2022-01-27 16:05:58 +01:00
Guy Harris
a10ab62bf4 Rename print-rrcp.c to print-realtek.c.
It handles more than just RRCP, so rename it appropriately.
2022-01-23 01:46:20 -08:00
Francois-Xavier Le Bail
49c0110e96 Makefile.in: Ignore build errors with nm command in Solaris
The default output format is different and the grep don't find anything.

To be fixed later.
2022-01-22 14:35:56 +01:00
Francois-Xavier Le Bail
6d854639ea autoconf: Enhance the --enable-instrument-functions result output
It prints now, by default, also the static functions names.

To configure the printing of only the global functions names, as before:
$ make instrument_global

To go back to print all the functions names:
$ make instrument_all

In case of truncation, the indentation level is reset to its previous
level in pretty_print_packet().

[skip ci]
2022-01-22 13:19:33 +01:00
Guy Harris
d584b1caba Get rid of the Windows ether_ntohost().
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.
2022-01-19 14:38:53 -08:00
Francois-Xavier Le Bail
c6b7d41176 autoconf: Add the option to print functions names (entry and exit)
This should help some debugging processes.

Usage:
./configure --enable-instrument-functions

Generate instrumentation calls for entry and exit to functions.
Just after function entry and just before function exit, these
profiling functions are called and print the function names with
indentation and call level.

To instument a static function, remove temporarily the static specifier.

In case of truncation, the indentation level is reset currently to 1 in
pretty_print_packet(), main is level 0.
2022-01-17 20:48:57 +01:00
Francois-Xavier Le Bail
0153755fe7 Makefile.in: Sort the files in EXTRA_DIST 2022-01-17 16:15:41 +01:00
Francois-Xavier Le Bail
97e4fe30d8 WHOIS: Add its own printer source file and printer function
Like all other text protocols.

This is a follow-up to 185b7ce04b.
2022-01-14 13:34:49 +01:00
Denis Ovsienko
27b74a81ae CI: Disable shellcheck SC2006 in the Makefile. [skip ci]
Same as in tcpslice and libpcap.
2022-01-04 12:37:14 +00:00
Denis Ovsienko
efaa145475 Reformat the installation notes in Markdown. [skip ci] 2021-12-22 14:02:13 +00:00
Rui Paulo
8ce37b54ed Initial support to parse QUIC packets. 2021-11-09 09:11:34 +01:00
Guy Harris
39f09d68ce Suppress "casting away const" warnings in missing/getopt_long.c.
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.
2021-07-24 01:51:02 -07:00
Denis Ovsienko
b8dd8f34b5 Makefile: Run shellcheck for build_common.sh too. [skip ci] 2021-07-23 14:11:45 +01:00
Denis Ovsienko
789b35b598 Import Autoconf/make and "make releasetar" fixes. [skip ci]
These have been tested in tcpslice and libpcap.
2021-07-22 18:27:08 +01:00
Francois-Xavier Le Bail
657d672cb6 Makefile.in: Add the shellcheck target
Run shellcheck on the build.sh and the build_matrix.sh scripts.
(using 'gcc' format: GCC compatible output. See the shellcheck man page)

[skip ci]
2021-06-01 10:14:00 +02:00
Guy Harris
c7e9212a01 Merge Readme.Win32 into doc/README.Win32.md. [skip ci]
We should only have one "how to build on Windows" file.
2021-05-31 04:47:47 -07:00
Francois-Xavier Le Bail
4356f99512 Makefile.in: Add the build for release candidates
It adds rcX suffix to the version.
This avoid to manually update 'VERSION' and 'configure'.
Same as for libpcap.
2021-05-30 10:47:22 +02:00
Denis Ovsienko
e3a00d340c Refine README.md and some related files. [skip ci]
Lose the README symlink, it was a bad idea of mine to add it in the
first place as it made the packaging problem space bigger, not smaller.

Remove two CI badges at the top of README.md. One badge was stale
anyway, and the other does not represent the current CI configuration,
which is bigger, changes frequently and fits the web-site much better.

Remove the reference to ITA, it has been down for quite a while, it
looks like it won't re-emerge this time.

Merge PLATFORMS into README.md.
2021-04-16 18:27:34 +01:00
Francois-Xavier Le Bail
9389efe24b Uninstall the version stamped tcpdump 2021-03-13 17:37:39 +01:00
Francois-Xavier Le Bail
1239ef3d07 Fix "make clean" for out-of-tree autotools builds 2021-03-13 17:06:28 +01:00
Denis Ovsienko
ca3470f44e Remove GENSRC remnants from Makefile.in. [skip appveyor]
The variable does not exist since commit 4943adf.
2021-02-06 01:47:44 +00:00
Francois-Xavier Le Bail
b1e86c1f03 Makefile.in: Run 'autoreconf -f' when buiding release
Same as for libpcap.

It's needed to update configure (PACKAGE_VERSION, PACKAGE_STRING, etc.)
when VERSION is updated.
2021-01-02 14:27:00 +01:00
Guy Harris
eebc98d735 Add ftmacros.h, defining various feature test macros, and use it.
This attempts to ensure that we get all the APIs for the platform
declared, including the ones that, shock horror, "pollute the
namespace".

This fixes some compile failures with Sun C on Solaris 11.
2021-01-01 22:47:27 -08:00
Francois-Xavier Le Bail
191020bd7f Makefile.in: Remove the non included header files from TAGHDR 2020-10-01 19:20:28 +02:00
Denis Ovsienko
bdac249ee0 OpenFlow 1.3: Add initial partial support.
This code processes only the simplest message types (9 out of the 30
defined).

Add a test from [1], which comes from [2], which comes from a
contributor in Ericsson (Zoltán Lajos Kis).

1: https://wiki.wireshark.org/SampleCaptures#OpenFlow
2: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9283
2020-09-28 13:58:12 +01:00
Denis Ovsienko
95096be4f0 Install into bindir, not sbindir. [skip ci]
As discussed on GitHub and on the mailing list, install tcpdump into
bindir because it can be useful to non-root users too, in ways that do
not involve doing live packet captures. Original idea by Guy Harris.
2020-09-10 12:59:25 +01:00
Francois-Xavier Le Bail
a797c3a0b9 Makefile.in: Remove files win32/prj/* from EXTRA_DIST
Files removed in commit dbe0eab455.
2020-07-27 09:25:41 +02:00
Guy Harris
7885cfa165
Merge branch 'master' into macsec 2020-05-27 17:01:23 -07:00
Francois-Xavier Le Bail
f7c5619eed Makefile.in: Remove win32/prj/GNUmakefile from EXTRA_DIST
File removed in commit 1d77715d2e.

[skip ci]
2020-05-24 10:54:18 +02:00
Francois-Xavier Le Bail
25687e1a31 Print packets for unsupported link-layer protocols in hexadecimal/ASCII
This avoids to get only:
tcpdump: packet printing is not supported for link type XYZ: use -w

The default printing is like:
18:45:52.723872 UNSUPPORTED
        0x0000:  001f 0000 0540 6078 725d 586d 4d66 4671  .....@`xr]XmMfFq
        0x0010:  6d58 4d5c 7159 5f71 565c 556c 4e71 7171  mXM\qY_qV\UlNqqq
        0x0020:  7171 7171 7171 7171 7171 7171 7171 5180  qqqqqqqqqqqqqqQ.
        0x0030:  7f7f                                     ..
18:45:52.755995 UNSUPPORTED
        0x0000:  001f 0000 0540 6043 7851 807f 7f         .....@`CxQ...
        [...]
2020-05-10 11:05:59 +02:00
Herwin Weststrate
763bef5f53 Extract NTP printing
This method is required to dissect some RADIUS attributes
2020-04-21 23:50:03 +02:00
Francois-Xavier Le Bail
f0ca5e92c4 Makefile.in: Restore alphabetical order for printers 2020-04-03 09:12:38 +02:00
Hannes Gredler
a193f168bf add support for Broadcom LI header
(pull request #843)

fix build break for Broadcom LI printer on BSD platforms

incorporate review comments: make bcm_li_print() void, add a sample capture

incorporate review comments: remove trailing tabs

add BCM LI outputs to testset

incorporate review comment: return after printing

update verbose output for bcm-li
2020-04-02 18:44:26 +02:00
Francois-Xavier Le Bail
52d1befa62 Makefile.in: Add some source files in TAGFILES
they are not in LIBNETDISSECT_SRC because they are optionally built.

[skip ci]
2020-03-29 11:18:22 +02:00
Guy Harris
91e2aa9b13 Look for mkdep in the top-level source directory.
Not currently a problem for tcpdump, as we have no subdirectories, but
this will leave us prepared for subdirectories if we ever add any.
2020-03-02 16:15:07 -08:00
Guy Harris
f763b30f67 Fix "make depend" for out-of-tree builds.
Have mkdep take a -s argument, giving the source directory, and have it
prepend that directory to all source files before running them through
the compiler's make-dependencies operation.
2020-03-02 15:23:13 -08:00
Francois-Xavier Le Bail
052b90a52e Add doc/README.Win32.md to the release tarball
[skip ci]
2020-02-27 10:42:27 +01:00