1818.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1919.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2020.\"
21- .TH PCAP-FILTER @MAN_MISC_INFO@ "6 February 2021 "
21+ .TH PCAP-FILTER @MAN_MISC_INFO@ "4 January 2022 "
2222.SH NAME
2323pcap-filter \- packet filter syntax
2424.br
2525.ad
2626.SH DESCRIPTION
2727.LP
28- .BR pcap_compile ()
28+ .BR pcap_compile (3PCAP )
2929is used to compile a string into a filter program.
3030The resulting filter program can then be applied to
3131some stream of packets to determine which packets will be supplied to
@@ -88,7 +88,7 @@ qualifiers are only valid for IEEE 802.11 Wireless LAN link layers.
8888.I proto
8989qualifiers restrict the match to a particular protocol.
9090Possible
91- protos are:
91+ protocols are:
9292.BR ether ,
9393.BR fddi ,
9494.BR tr ,
@@ -98,18 +98,19 @@ protos are:
9898.BR arp ,
9999.BR rarp ,
100100.BR decnet ,
101+ .BR sctp ,
101102.B tcp
102103and
103104.BR udp .
104105E.g., `\fBether src\fP foo', `\fBarp net\fP 128.3', `\fBtcp port\fP 21',
105106`\fBudp portrange\fP 7000-7009', `\fBwlan addr2\fP 0:2:3:4:5:6'.
106- If there is
107- no proto qualifier, all protocols consistent with the type are
108- assumed.
109- E.g., `\fBsrc\fP foo' means `\fB(ip or arp or rarp) src\fP foo'
110- (except the latter is not legal syntax), `\fBnet\fP bar' means `\fB(ip or
111- arp or rarp) net\fP bar' and `\fBport\fP 53' means `\fB(tcp or udp)
112- port\fP 53' .
107+ If there is no
108+ .I proto
109+ qualifier, all protocols consistent with the type are assumed.
110+ E.g., `\fBsrc\fP foo' means `\fB(ip or arp or rarp) src\fP foo',
111+ `\fBnet\fP bar' means `\fB(ip or arp or rarp) net\fP bar' and
112+ `\fBport\fP 53' means `\fB(tcp or udp or sctp) port\fP 53'
113+ (note that these examples use invalid syntax to illustrate the principle) .
113114.LP
114115[\fBfddi\fP is actually an alias for \fBether\fP; the parser treats them
115116identically as meaning ``the data link level used on the specified
@@ -228,7 +229,7 @@ True if the IPv4/v6 address matches \fInet\fR with a netmask \fIlen\fR
228229bits wide.
229230May be qualified with \fBsrc\fR or \fBdst\fR.
230231.IP "\fBdst port \fIport\fR"
231- True if the packet is IPv4 TCP, IPv4 UDP, IPv6 TCP or IPv6 UDP and has a
232+ True if the packet is IPv4/v6 TCP, UDP or SCTP and has a
232233destination port value of \fIport\fP.
233234The \fIport\fP can be a number or a name used in /etc/services (see
234235.BR tcp (4P)
@@ -245,7 +246,7 @@ True if the packet has a source port value of \fIport\fP.
245246.IP "\fBport \fIport\fR"
246247True if either the source or destination port of the packet is \fIport\fP.
247248.IP "\fBdst portrange \fIport1-port2\fR"
248- True if the packet is IPv4 TCP, IPv4 UDP, IPv6 TCP or IPv6 UDP and has a
249+ True if the packet is IPv4/v6 TCP, UDP or SCTP and has a
249250destination port value between \fIport1\fP and \fIport2\fP (both inclusive).
250251.I port1
251252and
@@ -262,7 +263,7 @@ True if either the source or destination port of the packet is between
262263\fIport1\fP and \fIport2\fP (both inclusive).
263264.IP
264265Any of the above port or port range expressions can be prepended with
265- the keywords, \fBtcp\fP or \fBudp \fP, as in:
266+ the keywords, \fBtcp\fP, \fBudp\fP or \fBsctp \fP, as in:
266267.in +.5i
267268.nf
268269\fBtcp src port \fIport\fR
@@ -291,9 +292,9 @@ True if the packet is an IPv4 packet (see
291292of protocol type \fIprotocol\fP.
292293\fIProtocol\fP can be a number or one of the names
293294\fBicmp\fP, \fBicmp6\fP, \fBigmp\fP, \fBigrp\fP, \fBpim\fP, \fBah\fP,
294- \fBesp\fP, \fBvrrp\fP, \fBudp\fP, or \fBtcp\fP.
295- Note that the identifiers \fBtcp\fP, \fBudp\fP, and \fBicmp\fP are also
296- keywords and must be escaped via backslash (\\).
295+ \fBesp\fP, \fBvrrp\fP, \fBsctp\fP, \ fBudp\fP, or \fBtcp\fP.
296+ Note that the identifiers \fBtcp\fP, \fBudp\fP, \fBsctp\fP and \fBicmp\fP
297+ are also keywords and must be escaped via backslash (\\).
297298Note that this primitive does not chase the protocol header chain.
298299.IP "\fBip6 proto \fIprotocol\fR"
299300True if the packet is an IPv6 packet of protocol type \fIprotocol\fP.
@@ -302,11 +303,11 @@ Note that this primitive does not chase the protocol header chain.
302303True if the packet is an IPv4 or IPv6 packet of protocol type
303304\fIprotocol\fP. Note that this primitive does not chase the protocol
304305header chain.
305- .IP "\fBtcp\fR, \fBudp\fR, \fBicmp\fR"
306+ .IP "\fBtcp\fR, \fBudp\fR, \fBicmp\fR, \fBsctp\fR "
306307Abbreviations for:
307308.in +.5i
308309.nf
309- \fBproto \\\fIprotocol\fR\fB
310+ \fBproto \\\fIprotocol\fR
310311.fi
311312.in -.5i
312313where \fIprotocol\fR is one of the above protocols.
@@ -838,7 +839,7 @@ To access data inside the packet, use the following syntax:
838839.fi
839840.in -.5i
840841\fIProto\fR is one of \fBether, fddi, tr, wlan, ppp, slip, link,
841- ip, arp, rarp, tcp, udp, icmp, ip6\fR or \fBradio\fR, and
842+ ip, arp, rarp, tcp, udp, sctp, icmp, ip6\fR or \fBradio\fR, and
842843indicates the protocol layer for the index operation.
843844(\fBether, fddi, wlan, tr, ppp, slip\fR and \fBlink\fR all refer to the
844845link layer. \fBradio\fR refers to the "radio header" added to some
0 commit comments