Commit graph

8 commits

Author SHA1 Message Date
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Gleb Smirnoff f70a2e2948 ipfwpcap: use PF_DIVERT/SOCK_RAW instead of PF_INET/SOCK_RAW/IPPROTO_DIVERT 2022-08-30 16:24:37 -07:00
Hans Petter Selasky 609169becc Buildfix for GCC after r334277.
MFC after:	1 month
Sponsored by:	Mellanox Technologies
2018-05-28 09:41:44 +00:00
Ed Schouten b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Ed Schouten 6f8f50af89 Several cleanups to ipfwpcap(8).
- Enable WARNS?=6.
- Include missing headers.
- Mark prog and pidfile as static. Remove unneeded initializer.
- Use ANSI prototypes.
- Remove unneeded fp variable.
- snprintf() guarantees the buffer to be null terminated. Remove
  unneeded - 1 and bzero call.
- Remove unneeded casting.

Submitted by:	Pawel Worach, Christoph Mallon
2009-05-31 20:59:20 +00:00
Christian S.J. Peron 9195f2b323 Add a signal handler for SIGINT to make sure that the PID file
gets cleaned up upon receiving SIGINT.  This un-breaks subsequent
executions of ipfwpcap and helps when debugging network/divert
issues like this:

ipfwpcap -r 6000 - | tcpdump -r -

MFC after:	1 week
2007-10-12 14:57:39 +00:00
Sam Leffler 85fb34beb0 add define's from config.h for pcap-int.h; this is a noop now
but will be required for libpcap 0.9.4
2006-09-04 19:30:44 +00:00
Poul-Henning Kamp 983e5de60b Add a small tool which captures packets on a DIVERT socket and writes
them as pcap (tcpdump) format data to a file or pipe.

Volunters wanted for:	manpage
Contributed by:	P Kern <pkern@cns.utoronto.ca>
2005-10-17 20:27:15 +00:00