History log of /openbsd-current/lib/libpcap/savefile.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.18 10-Aug-2023 sashan

Allow libpcap to read files with some additional link-layer type values

patch has been contributed by Guy Harris from libpcap/tcpdump. It
resolves collision between DLT_* values on various OSes. The issue
prevents correct interpretation of link layer information in capture
files which might come from another OS. To resolve this libpcap/tcpdump
community introduced a LINKTYPE_* values. The patch provides translation
between DLT_* and LINKTYPE_* for OpenBSD. More details can be found
here: https://www.tcpdump.org/linktypes.html

No objection from OpenBSD community.

OK sthen@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE
# 1.17 27-May-2020 dlg

add support for pcap_breakloop when reading packets from files.

djm pulled support in for pcap_breakloop on the bpf side of things,
this makes it work when reading files too.

from Caspar Schutijser
lteo@ seems keen
ok djm@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.16 22-Dec-2015 mmcc

remove NULL-checks before free()


# 1.15 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


# 1.14 17-Nov-2015 mmcc

memory.h -> string.h

ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.13 16-Jan-2015 lteo

Remove pointless casts for several malloc/calloc/free calls. No object
file change.


Revision tags: OPENBSD_5_6_BASE
# 1.12 14-Mar-2014 lteo

Remove pointless casts. No binary change.

suggested by krw@


# 1.11 14-Mar-2014 lteo

Change a few malloc+memset calls to calloc.

ok deraadt@ florian@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.10 25-May-2012 lteo

Import a number of core functions from libpcap-1.2.0 while preserving
local changes: strncpy() -> strlcpy(), malloc(x * y) -> calloc(x, y),
exclude cross-platform cruft, etc.

The new functions are pcap_create(), pcap_set_snaplen(),
pcap_set_promisc(), pcap_can_set_rfmon(), pcap_set_rfmon(),
pcap_set_timeout(), pcap_set_buffer_size(), pcap_activate(), and
pcap_statustostr().

This diff was tested on amd64, i386, macppc, and sparc64, where
regression tests were done on various pcap-based ports (especially amd64
and i386 where regression tests were run on all pcap-based ports).
Testers also tried running pcap-based ports that they are familiar with
to ensure that there is no behavioral change. tcpdump and pflogd in
base were also tested by different testers. The new pcap_* functions
were tested with a proof-of-concept Snort 2.9 port for many months.

Thank you to everyone who helped test this diff and provided feedback:
haesbaert@, sthen@, matthew@, gonzalo@, brett@, Rodolfo Gouveia,
Aaron Bieber, Markus Lude, and Ray Percival.

ok haesbaert sthen henning


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.9 26-Mar-2006 djm

add remaining tcpdump.org libpcap 0.9 APIs, most notably
pcap_setdirection() (which depends on the kernel-side bpf changes
committed yesterday); ok canacar@


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.8 27-Jan-2004 tedu

remove $Header, it was messing up cvs for me. ok deraadt@


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE
# 1.7 20-Jul-1999 deraadt

changes brought in from v0.4; started by brad, more by me, being tested by mts


# 1.6 19-Jul-1999 deraadt

if pcap_dump_open() specified a snaplen of -1, make sure pcap_open_offline() does not malloc -1, but uses max snaplen; pointed out by mts@nfr.net


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.5 14-Jul-1998 deraadt

buf oflows


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.4 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.3 10-Jun-1996 deraadt

merge to latest libpcap


# 1.2 04-Mar-1996 mickey

Update to the latest LBL release.


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.17 27-May-2020 dlg

add support for pcap_breakloop when reading packets from files.

djm pulled support in for pcap_breakloop on the bpf side of things,
this makes it work when reading files too.

from Caspar Schutijser
lteo@ seems keen
ok djm@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.16 22-Dec-2015 mmcc

remove NULL-checks before free()


# 1.15 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


# 1.14 17-Nov-2015 mmcc

memory.h -> string.h

ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.13 16-Jan-2015 lteo

Remove pointless casts for several malloc/calloc/free calls. No object
file change.


Revision tags: OPENBSD_5_6_BASE
# 1.12 14-Mar-2014 lteo

Remove pointless casts. No binary change.

suggested by krw@


# 1.11 14-Mar-2014 lteo

Change a few malloc+memset calls to calloc.

ok deraadt@ florian@


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.10 25-May-2012 lteo

Import a number of core functions from libpcap-1.2.0 while preserving
local changes: strncpy() -> strlcpy(), malloc(x * y) -> calloc(x, y),
exclude cross-platform cruft, etc.

The new functions are pcap_create(), pcap_set_snaplen(),
pcap_set_promisc(), pcap_can_set_rfmon(), pcap_set_rfmon(),
pcap_set_timeout(), pcap_set_buffer_size(), pcap_activate(), and
pcap_statustostr().

This diff was tested on amd64, i386, macppc, and sparc64, where
regression tests were done on various pcap-based ports (especially amd64
and i386 where regression tests were run on all pcap-based ports).
Testers also tried running pcap-based ports that they are familiar with
to ensure that there is no behavioral change. tcpdump and pflogd in
base were also tested by different testers. The new pcap_* functions
were tested with a proof-of-concept Snort 2.9 port for many months.

Thank you to everyone who helped test this diff and provided feedback:
haesbaert@, sthen@, matthew@, gonzalo@, brett@, Rodolfo Gouveia,
Aaron Bieber, Markus Lude, and Ray Percival.

ok haesbaert sthen henning


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.9 26-Mar-2006 djm

add remaining tcpdump.org libpcap 0.9 APIs, most notably
pcap_setdirection() (which depends on the kernel-side bpf changes
committed yesterday); ok canacar@


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE
# 1.8 27-Jan-2004 tedu

remove $Header, it was messing up cvs for me. ok deraadt@


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE OPENBSD_3_4_BASE
# 1.7 20-Jul-1999 deraadt

changes brought in from v0.4; started by brad, more by me, being tested by mts


# 1.6 19-Jul-1999 deraadt

if pcap_dump_open() specified a snaplen of -1, make sure pcap_open_offline() does not malloc -1, but uses max snaplen; pointed out by mts@nfr.net


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.5 14-Jul-1998 deraadt

buf oflows


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.4 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.3 10-Jun-1996 deraadt

merge to latest libpcap


# 1.2 04-Mar-1996 mickey

Update to the latest LBL release.


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision