History log of /openbsd-current/lib/libpcap/scanner.l
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.30 08-Apr-2024 jsg

more ansi function decls
ok deraadt@


# 1.29 05-Apr-2024 deraadt

ANSI functions; ok tb


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 OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.28 03-Aug-2020 dlg

add "sample NUM" so you can ask to capture 1/NUM packets from a filter.

the use of the sample keyword matches similar config in other
products.

NUM can be a number between 2 and 1048576, and is used to divide
0x100000000 into a threshold that is then compared against a randomly
generated number produced by a load of BPF_RND.

having sampling as part of the grammar means you can write things
like "icmp or sample 128". this lets you capture all icmp traffic
and a sample of the rest of the traffic.

ok jmatthew@ kn@ tb@


# 1.27 03-Aug-2020 dlg

add support for handling loads from BPF_RND.

this adds "rnd" and "random" as keywords in the grammar, and handles
them as an arithmetic operator. the decoder recognises the load,
so tcpdump can print it as 'ld #random'. most of the handling is
copied from the "len"/"length" keywoard handling that generates and
decodes a load of the actual wire length of the packet.

ok jmatthew@ tb@ kn@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.26 09-Dec-2018 denis

add basic MPLS filtering support

OK claudio@ jca@


Revision tags: OPENBSD_6_4_BASE
# 1.25 03-Jun-2018 sthen

Change some libpcap functions which use pointers as arguments and
returns to const pointers:

- the prefix argument to pcap_perror();
- the return value of pcap_strerror();
- the filter expression argument to pcap_compile() and pcap_compile_nopcap();
- the BPF filter program argument to bpf_image().

Matches changes made earlier in tcpdump.org's version of libpcap.
From Guy Harris, ok tb@, been through a bulk ports build.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.24 09-Jul-2017 espie

use working boilerplate for yacc/lex instead of homemade rules.
okay millert@
(forgot the obvious scanner.l tweak in my diff)


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.23 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.22 28-Mar-2011 giovanni

Add icmptype and tcpflags support to the grammar
ok claudio@ jsing@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.21 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.20 11-Jun-2008 dtucker

Import vlan support from upstream libpcap. This allows, eg, "tcpdump vla 3"
to work on a vlan parent interface. ok mcbride@, "commit it" deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.19 02-Jan-2007 reyk

define bpf filters to match address and header fields in IEEE 802.11
wlan frames (DLT_IEEE802_11 and DLT_IEEE802_11_RADIO linktypes). see
tcpdump(8) for details.

"Works for me" claudio@
ok jmc@ deraadt@


Revision tags: OPENBSD_4_0_BASE
# 1.18 18-Apr-2006 otto

strnvis illegal tokens as well and remove a spurious "i" that crept in
the pattern long ago; ok deraadt@ and markus@ for the "i" removal


# 1.17 18-Apr-2006 deraadt

vis() illegal characters; ok otto


Revision tags: OPENBSD_3_9_BASE
# 1.16 07-Oct-2005 mpf

Add Spanning Tree Protocol support.
Bump version to 3.1.
OK brad@


# 1.15 27-Sep-2005 deraadt

accept hostnames 1 char long; spotted by otto, ok otto


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.14 14-May-2003 canacar

libpcap and tcpdump now understand the new pflog datalink type.
old datalink type is still recognized.

ok henning@ dhartmei@ frantzen@


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 26-Aug-2002 deraadt

must yyrestart after longjmp; moritz@jodeit.org


Revision tags: OPENBSD_3_1_BASE
# 1.12 23-Mar-2002 frantzen

language extensions for PF logs. can specify direction, interface, rule
number, reason and action. fix the ipv4/ipv6 distinction while I'm here.


Revision tags: OPENBSD_3_0_BASE
# 1.11 06-Jul-2001 millert

#include string.h to get memset() prototype


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.10 29-Jun-2000 dugsong

remove legacy over-general :{B} match for MAC addresses, fixing filters like 'arp[6:2] = 2'. ok angelos@


Revision tags: OPENBSD_2_7_BASE
# 1.9 26-Apr-2000 jakob

sync with libpcap v0.5
add support for INET6 (kame)


Revision tags: OPENBSD_2_6_BASE
# 1.8 20-Jul-1999 deraadt

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


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.7 26-Jun-1998 deraadt

handle single char hostnames; jch@honig.net


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.6 22-Jul-1997 deraadt

permit numbers at start of hostname; leres@ee.lbl.gov


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.5 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.4 18-Jun-1996 deraadt

libpcap used yyparse(), which is bad; netbsd pr#2031; lukem@supp.cpr.itg.telecom.com.au


# 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.29 05-Apr-2024 deraadt

ANSI functions; ok tb


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 OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.28 03-Aug-2020 dlg

add "sample NUM" so you can ask to capture 1/NUM packets from a filter.

the use of the sample keyword matches similar config in other
products.

NUM can be a number between 2 and 1048576, and is used to divide
0x100000000 into a threshold that is then compared against a randomly
generated number produced by a load of BPF_RND.

having sampling as part of the grammar means you can write things
like "icmp or sample 128". this lets you capture all icmp traffic
and a sample of the rest of the traffic.

ok jmatthew@ kn@ tb@


# 1.27 03-Aug-2020 dlg

add support for handling loads from BPF_RND.

this adds "rnd" and "random" as keywords in the grammar, and handles
them as an arithmetic operator. the decoder recognises the load,
so tcpdump can print it as 'ld #random'. most of the handling is
copied from the "len"/"length" keywoard handling that generates and
decodes a load of the actual wire length of the packet.

ok jmatthew@ tb@ kn@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.26 09-Dec-2018 denis

add basic MPLS filtering support

OK claudio@ jca@


Revision tags: OPENBSD_6_4_BASE
# 1.25 03-Jun-2018 sthen

Change some libpcap functions which use pointers as arguments and
returns to const pointers:

- the prefix argument to pcap_perror();
- the return value of pcap_strerror();
- the filter expression argument to pcap_compile() and pcap_compile_nopcap();
- the BPF filter program argument to bpf_image().

Matches changes made earlier in tcpdump.org's version of libpcap.
From Guy Harris, ok tb@, been through a bulk ports build.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.24 09-Jul-2017 espie

use working boilerplate for yacc/lex instead of homemade rules.
okay millert@
(forgot the obvious scanner.l tweak in my diff)


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.23 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.22 28-Mar-2011 giovanni

Add icmptype and tcpflags support to the grammar
ok claudio@ jsing@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.21 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.20 11-Jun-2008 dtucker

Import vlan support from upstream libpcap. This allows, eg, "tcpdump vla 3"
to work on a vlan parent interface. ok mcbride@, "commit it" deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.19 02-Jan-2007 reyk

define bpf filters to match address and header fields in IEEE 802.11
wlan frames (DLT_IEEE802_11 and DLT_IEEE802_11_RADIO linktypes). see
tcpdump(8) for details.

"Works for me" claudio@
ok jmc@ deraadt@


Revision tags: OPENBSD_4_0_BASE
# 1.18 18-Apr-2006 otto

strnvis illegal tokens as well and remove a spurious "i" that crept in
the pattern long ago; ok deraadt@ and markus@ for the "i" removal


# 1.17 18-Apr-2006 deraadt

vis() illegal characters; ok otto


Revision tags: OPENBSD_3_9_BASE
# 1.16 07-Oct-2005 mpf

Add Spanning Tree Protocol support.
Bump version to 3.1.
OK brad@


# 1.15 27-Sep-2005 deraadt

accept hostnames 1 char long; spotted by otto, ok otto


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.14 14-May-2003 canacar

libpcap and tcpdump now understand the new pflog datalink type.
old datalink type is still recognized.

ok henning@ dhartmei@ frantzen@


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 26-Aug-2002 deraadt

must yyrestart after longjmp; moritz@jodeit.org


Revision tags: OPENBSD_3_1_BASE
# 1.12 23-Mar-2002 frantzen

language extensions for PF logs. can specify direction, interface, rule
number, reason and action. fix the ipv4/ipv6 distinction while I'm here.


Revision tags: OPENBSD_3_0_BASE
# 1.11 06-Jul-2001 millert

#include string.h to get memset() prototype


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.10 29-Jun-2000 dugsong

remove legacy over-general :{B} match for MAC addresses, fixing filters like 'arp[6:2] = 2'. ok angelos@


Revision tags: OPENBSD_2_7_BASE
# 1.9 26-Apr-2000 jakob

sync with libpcap v0.5
add support for INET6 (kame)


Revision tags: OPENBSD_2_6_BASE
# 1.8 20-Jul-1999 deraadt

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


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.7 26-Jun-1998 deraadt

handle single char hostnames; jch@honig.net


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.6 22-Jul-1997 deraadt

permit numbers at start of hostname; leres@ee.lbl.gov


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.5 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.4 18-Jun-1996 deraadt

libpcap used yyparse(), which is bad; netbsd pr#2031; lukem@supp.cpr.itg.telecom.com.au


# 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.28 03-Aug-2020 dlg

add "sample NUM" so you can ask to capture 1/NUM packets from a filter.

the use of the sample keyword matches similar config in other
products.

NUM can be a number between 2 and 1048576, and is used to divide
0x100000000 into a threshold that is then compared against a randomly
generated number produced by a load of BPF_RND.

having sampling as part of the grammar means you can write things
like "icmp or sample 128". this lets you capture all icmp traffic
and a sample of the rest of the traffic.

ok jmatthew@ kn@ tb@


# 1.27 03-Aug-2020 dlg

add support for handling loads from BPF_RND.

this adds "rnd" and "random" as keywords in the grammar, and handles
them as an arithmetic operator. the decoder recognises the load,
so tcpdump can print it as 'ld #random'. most of the handling is
copied from the "len"/"length" keywoard handling that generates and
decodes a load of the actual wire length of the packet.

ok jmatthew@ tb@ kn@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.26 09-Dec-2018 denis

add basic MPLS filtering support

OK claudio@ jca@


Revision tags: OPENBSD_6_4_BASE
# 1.25 03-Jun-2018 sthen

Change some libpcap functions which use pointers as arguments and
returns to const pointers:

- the prefix argument to pcap_perror();
- the return value of pcap_strerror();
- the filter expression argument to pcap_compile() and pcap_compile_nopcap();
- the BPF filter program argument to bpf_image().

Matches changes made earlier in tcpdump.org's version of libpcap.
From Guy Harris, ok tb@, been through a bulk ports build.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.24 09-Jul-2017 espie

use working boilerplate for yacc/lex instead of homemade rules.
okay millert@
(forgot the obvious scanner.l tweak in my diff)


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.23 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.22 28-Mar-2011 giovanni

Add icmptype and tcpflags support to the grammar
ok claudio@ jsing@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.21 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.20 11-Jun-2008 dtucker

Import vlan support from upstream libpcap. This allows, eg, "tcpdump vla 3"
to work on a vlan parent interface. ok mcbride@, "commit it" deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.19 02-Jan-2007 reyk

define bpf filters to match address and header fields in IEEE 802.11
wlan frames (DLT_IEEE802_11 and DLT_IEEE802_11_RADIO linktypes). see
tcpdump(8) for details.

"Works for me" claudio@
ok jmc@ deraadt@


Revision tags: OPENBSD_4_0_BASE
# 1.18 18-Apr-2006 otto

strnvis illegal tokens as well and remove a spurious "i" that crept in
the pattern long ago; ok deraadt@ and markus@ for the "i" removal


# 1.17 18-Apr-2006 deraadt

vis() illegal characters; ok otto


Revision tags: OPENBSD_3_9_BASE
# 1.16 07-Oct-2005 mpf

Add Spanning Tree Protocol support.
Bump version to 3.1.
OK brad@


# 1.15 27-Sep-2005 deraadt

accept hostnames 1 char long; spotted by otto, ok otto


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.14 14-May-2003 canacar

libpcap and tcpdump now understand the new pflog datalink type.
old datalink type is still recognized.

ok henning@ dhartmei@ frantzen@


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 26-Aug-2002 deraadt

must yyrestart after longjmp; moritz@jodeit.org


Revision tags: OPENBSD_3_1_BASE
# 1.12 23-Mar-2002 frantzen

language extensions for PF logs. can specify direction, interface, rule
number, reason and action. fix the ipv4/ipv6 distinction while I'm here.


Revision tags: OPENBSD_3_0_BASE
# 1.11 06-Jul-2001 millert

#include string.h to get memset() prototype


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.10 29-Jun-2000 dugsong

remove legacy over-general :{B} match for MAC addresses, fixing filters like 'arp[6:2] = 2'. ok angelos@


Revision tags: OPENBSD_2_7_BASE
# 1.9 26-Apr-2000 jakob

sync with libpcap v0.5
add support for INET6 (kame)


Revision tags: OPENBSD_2_6_BASE
# 1.8 20-Jul-1999 deraadt

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


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.7 26-Jun-1998 deraadt

handle single char hostnames; jch@honig.net


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.6 22-Jul-1997 deraadt

permit numbers at start of hostname; leres@ee.lbl.gov


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.5 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.4 18-Jun-1996 deraadt

libpcap used yyparse(), which is bad; netbsd pr#2031; lukem@supp.cpr.itg.telecom.com.au


# 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.26 09-Dec-2018 denis

add basic MPLS filtering support

OK claudio@ jca@


Revision tags: OPENBSD_6_4_BASE
# 1.25 03-Jun-2018 sthen

Change some libpcap functions which use pointers as arguments and
returns to const pointers:

- the prefix argument to pcap_perror();
- the return value of pcap_strerror();
- the filter expression argument to pcap_compile() and pcap_compile_nopcap();
- the BPF filter program argument to bpf_image().

Matches changes made earlier in tcpdump.org's version of libpcap.
From Guy Harris, ok tb@, been through a bulk ports build.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.24 09-Jul-2017 espie

use working boilerplate for yacc/lex instead of homemade rules.
okay millert@
(forgot the obvious scanner.l tweak in my diff)


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.23 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.22 28-Mar-2011 giovanni

Add icmptype and tcpflags support to the grammar
ok claudio@ jsing@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.21 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.20 11-Jun-2008 dtucker

Import vlan support from upstream libpcap. This allows, eg, "tcpdump vla 3"
to work on a vlan parent interface. ok mcbride@, "commit it" deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.19 02-Jan-2007 reyk

define bpf filters to match address and header fields in IEEE 802.11
wlan frames (DLT_IEEE802_11 and DLT_IEEE802_11_RADIO linktypes). see
tcpdump(8) for details.

"Works for me" claudio@
ok jmc@ deraadt@


Revision tags: OPENBSD_4_0_BASE
# 1.18 18-Apr-2006 otto

strnvis illegal tokens as well and remove a spurious "i" that crept in
the pattern long ago; ok deraadt@ and markus@ for the "i" removal


# 1.17 18-Apr-2006 deraadt

vis() illegal characters; ok otto


Revision tags: OPENBSD_3_9_BASE
# 1.16 07-Oct-2005 mpf

Add Spanning Tree Protocol support.
Bump version to 3.1.
OK brad@


# 1.15 27-Sep-2005 deraadt

accept hostnames 1 char long; spotted by otto, ok otto


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.14 14-May-2003 canacar

libpcap and tcpdump now understand the new pflog datalink type.
old datalink type is still recognized.

ok henning@ dhartmei@ frantzen@


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 26-Aug-2002 deraadt

must yyrestart after longjmp; moritz@jodeit.org


Revision tags: OPENBSD_3_1_BASE
# 1.12 23-Mar-2002 frantzen

language extensions for PF logs. can specify direction, interface, rule
number, reason and action. fix the ipv4/ipv6 distinction while I'm here.


Revision tags: OPENBSD_3_0_BASE
# 1.11 06-Jul-2001 millert

#include string.h to get memset() prototype


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.10 29-Jun-2000 dugsong

remove legacy over-general :{B} match for MAC addresses, fixing filters like 'arp[6:2] = 2'. ok angelos@


Revision tags: OPENBSD_2_7_BASE
# 1.9 26-Apr-2000 jakob

sync with libpcap v0.5
add support for INET6 (kame)


Revision tags: OPENBSD_2_6_BASE
# 1.8 20-Jul-1999 deraadt

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


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.7 26-Jun-1998 deraadt

handle single char hostnames; jch@honig.net


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.6 22-Jul-1997 deraadt

permit numbers at start of hostname; leres@ee.lbl.gov


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.5 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.4 18-Jun-1996 deraadt

libpcap used yyparse(), which is bad; netbsd pr#2031; lukem@supp.cpr.itg.telecom.com.au


# 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.25 03-Jun-2018 sthen

Change some libpcap functions which use pointers as arguments and
returns to const pointers:

- the prefix argument to pcap_perror();
- the return value of pcap_strerror();
- the filter expression argument to pcap_compile() and pcap_compile_nopcap();
- the BPF filter program argument to bpf_image().

Matches changes made earlier in tcpdump.org's version of libpcap.
From Guy Harris, ok tb@, been through a bulk ports build.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.24 09-Jul-2017 espie

use working boilerplate for yacc/lex instead of homemade rules.
okay millert@
(forgot the obvious scanner.l tweak in my diff)


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.23 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.22 28-Mar-2011 giovanni

Add icmptype and tcpflags support to the grammar
ok claudio@ jsing@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.21 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.20 11-Jun-2008 dtucker

Import vlan support from upstream libpcap. This allows, eg, "tcpdump vla 3"
to work on a vlan parent interface. ok mcbride@, "commit it" deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.19 02-Jan-2007 reyk

define bpf filters to match address and header fields in IEEE 802.11
wlan frames (DLT_IEEE802_11 and DLT_IEEE802_11_RADIO linktypes). see
tcpdump(8) for details.

"Works for me" claudio@
ok jmc@ deraadt@


Revision tags: OPENBSD_4_0_BASE
# 1.18 18-Apr-2006 otto

strnvis illegal tokens as well and remove a spurious "i" that crept in
the pattern long ago; ok deraadt@ and markus@ for the "i" removal


# 1.17 18-Apr-2006 deraadt

vis() illegal characters; ok otto


Revision tags: OPENBSD_3_9_BASE
# 1.16 07-Oct-2005 mpf

Add Spanning Tree Protocol support.
Bump version to 3.1.
OK brad@


# 1.15 27-Sep-2005 deraadt

accept hostnames 1 char long; spotted by otto, ok otto


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.14 14-May-2003 canacar

libpcap and tcpdump now understand the new pflog datalink type.
old datalink type is still recognized.

ok henning@ dhartmei@ frantzen@


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 26-Aug-2002 deraadt

must yyrestart after longjmp; moritz@jodeit.org


Revision tags: OPENBSD_3_1_BASE
# 1.12 23-Mar-2002 frantzen

language extensions for PF logs. can specify direction, interface, rule
number, reason and action. fix the ipv4/ipv6 distinction while I'm here.


Revision tags: OPENBSD_3_0_BASE
# 1.11 06-Jul-2001 millert

#include string.h to get memset() prototype


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.10 29-Jun-2000 dugsong

remove legacy over-general :{B} match for MAC addresses, fixing filters like 'arp[6:2] = 2'. ok angelos@


Revision tags: OPENBSD_2_7_BASE
# 1.9 26-Apr-2000 jakob

sync with libpcap v0.5
add support for INET6 (kame)


Revision tags: OPENBSD_2_6_BASE
# 1.8 20-Jul-1999 deraadt

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


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.7 26-Jun-1998 deraadt

handle single char hostnames; jch@honig.net


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.6 22-Jul-1997 deraadt

permit numbers at start of hostname; leres@ee.lbl.gov


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.5 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.4 18-Jun-1996 deraadt

libpcap used yyparse(), which is bad; netbsd pr#2031; lukem@supp.cpr.itg.telecom.com.au


# 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


Revision tags: OPENBSD_6_2_BASE
# 1.24 09-Jul-2017 espie

use working boilerplate for yacc/lex instead of homemade rules.
okay millert@
(forgot the obvious scanner.l tweak in my diff)


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.23 17-Nov-2015 mmcc

Remove register keyword.

ok deraadt@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.22 28-Mar-2011 giovanni

Add icmptype and tcpflags support to the grammar
ok claudio@ jsing@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.21 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.20 11-Jun-2008 dtucker

Import vlan support from upstream libpcap. This allows, eg, "tcpdump vla 3"
to work on a vlan parent interface. ok mcbride@, "commit it" deraadt@


Revision tags: OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.19 02-Jan-2007 reyk

define bpf filters to match address and header fields in IEEE 802.11
wlan frames (DLT_IEEE802_11 and DLT_IEEE802_11_RADIO linktypes). see
tcpdump(8) for details.

"Works for me" claudio@
ok jmc@ deraadt@


Revision tags: OPENBSD_4_0_BASE
# 1.18 18-Apr-2006 otto

strnvis illegal tokens as well and remove a spurious "i" that crept in
the pattern long ago; ok deraadt@ and markus@ for the "i" removal


# 1.17 18-Apr-2006 deraadt

vis() illegal characters; ok otto


Revision tags: OPENBSD_3_9_BASE
# 1.16 07-Oct-2005 mpf

Add Spanning Tree Protocol support.
Bump version to 3.1.
OK brad@


# 1.15 27-Sep-2005 deraadt

accept hostnames 1 char long; spotted by otto, ok otto


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.14 14-May-2003 canacar

libpcap and tcpdump now understand the new pflog datalink type.
old datalink type is still recognized.

ok henning@ dhartmei@ frantzen@


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.13 26-Aug-2002 deraadt

must yyrestart after longjmp; moritz@jodeit.org


Revision tags: OPENBSD_3_1_BASE
# 1.12 23-Mar-2002 frantzen

language extensions for PF logs. can specify direction, interface, rule
number, reason and action. fix the ipv4/ipv6 distinction while I'm here.


Revision tags: OPENBSD_3_0_BASE
# 1.11 06-Jul-2001 millert

#include string.h to get memset() prototype


Revision tags: OPENBSD_2_8_BASE OPENBSD_2_9_BASE
# 1.10 29-Jun-2000 dugsong

remove legacy over-general :{B} match for MAC addresses, fixing filters like 'arp[6:2] = 2'. ok angelos@


Revision tags: OPENBSD_2_7_BASE
# 1.9 26-Apr-2000 jakob

sync with libpcap v0.5
add support for INET6 (kame)


Revision tags: OPENBSD_2_6_BASE
# 1.8 20-Jul-1999 deraadt

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


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.7 26-Jun-1998 deraadt

handle single char hostnames; jch@honig.net


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.6 22-Jul-1997 deraadt

permit numbers at start of hostname; leres@ee.lbl.gov


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.5 12-Jul-1996 mickey

bring it to the latest 0.2 LBL release.


# 1.4 18-Jun-1996 deraadt

libpcap used yyparse(), which is bad; netbsd pr#2031; lukem@supp.cpr.itg.telecom.com.au


# 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