Skip to content

Commit 5f634cf

Browse files
committed
Add SCTP to pcap-filter(7). [skip ci]
Address point 3 of GH bug report #326: list SCTP in contexts where it belongs, as far as the current implementation in gencode.c seems to go (although it is not immediately clear if the implicit fragment exclusion apllies to SCTP too). Improve wording and formatting in the "proto" qualifier description. Lose a stray bold decoration so it does not affect the next line. Refer to pcap_compile(3PCAP) properly. Update the timestamp.
1 parent 5abb304 commit 5f634cf

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Monthday, Month DD, YYYY:
88
Address assorted compiler warnings.
99
Documentation:
1010
Add README.solaris.md.
11+
Add SCTP to pcap-filter(7).
1112

1213
Monthday, Month DD, YYYY:
1314
Summary for 1.10.2 libpcap release (so far!)

pcap-filter.manmisc.in

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
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
2323
pcap-filter \- packet filter syntax
2424
.br
2525
.ad
2626
.SH DESCRIPTION
2727
.LP
28-
.BR pcap_compile ()
28+
.BR pcap_compile (3PCAP)
2929
is used to compile a string into a filter program.
3030
The resulting filter program can then be applied to
3131
some 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
8989
qualifiers restrict the match to a particular protocol.
9090
Possible
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
102103
and
103104
.BR udp .
104105
E.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
115116
identically 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
228229
bits wide.
229230
May 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
232233
destination port value of \fIport\fP.
233234
The \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"
246247
True 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
249250
destination port value between \fIport1\fP and \fIport2\fP (both inclusive).
250251
.I port1
251252
and
@@ -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
264265
Any 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
291292
of 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 (\\).
297298
Note that this primitive does not chase the protocol header chain.
298299
.IP "\fBip6 proto \fIprotocol\fR"
299300
True 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.
302303
True if the packet is an IPv4 or IPv6 packet of protocol type
303304
\fIprotocol\fP. Note that this primitive does not chase the protocol
304305
header chain.
305-
.IP "\fBtcp\fR, \fBudp\fR, \fBicmp\fR"
306+
.IP "\fBtcp\fR, \fBudp\fR, \fBicmp\fR, \fBsctp\fR"
306307
Abbreviations for:
307308
.in +.5i
308309
.nf
309-
\fBproto \\\fIprotocol\fR\fB
310+
\fBproto \\\fIprotocol\fR
310311
.fi
311312
.in -.5i
312313
where \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
842843
indicates the protocol layer for the index operation.
843844
(\fBether, fddi, wlan, tr, ppp, slip\fR and \fBlink\fR all refer to the
844845
link layer. \fBradio\fR refers to the "radio header" added to some

0 commit comments

Comments
 (0)