Skip to content

Commit 3ef9f2f

Browse files
authored
Merge branch 'master' into historical-status-introduction
2 parents fd45399 + 6d161ac commit 3ef9f2f

13 files changed

+3821
-614
lines changed

.github/workflows/archive.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: "Checkout"
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616

1717
- name: "Update Archive"
1818
uses: martinthomson/i-d-template@v1
@@ -29,6 +29,6 @@ jobs:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030

3131
- name: "Save Archive"
32-
uses: actions/upload-artifact@v2
32+
uses: actions/upload-artifact@v4
3333
with:
3434
path: archive.json

.github/workflows/ghpages.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: "Checkout"
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2424

2525
- name: "Cache Setup"
2626
id: cache-setup
2727
run: |
2828
mkdir -p "$HOME"/.cache/xml2rfc
29-
echo "::set-output name=path::$HOME/.cache/xml2rfc"
30-
date -u "+::set-output name=date::%FT%T"
29+
echo "path=$HOME/.cache/xml2rfc" >> $GITHUB_OUTPUT
30+
date -u "+date=%FT%T" >> $GITHUB_OUTPUT
3131
3232
- name: "Cache References"
33-
uses: actions/cache@v2
33+
uses: actions/cache@v4
3434
with:
3535
path: ${{ steps.cache-setup.outputs.path }}
3636
key: refcache-${{ steps.cache-setup.outputs.date }}
@@ -50,11 +50,11 @@ jobs:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151

5252
- name: "Save HTML"
53-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v4
5454
with:
5555
path: "*.html"
5656

5757
- name: "Save Text"
58-
uses: actions/upload-artifact@v2
58+
uses: actions/upload-artifact@v4
5959
with:
6060
path: "*.txt"

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: "Checkout"
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515

1616
# See https://github.com/actions/checkout/issues/290
1717
- name: "Get Tag Annotations"
@@ -21,11 +21,11 @@ jobs:
2121
id: cache-setup
2222
run: |
2323
mkdir -p "$HOME"/.cache/xml2rfc
24-
echo "::set-output name=path::$HOME/.cache/xml2rfc"
25-
date -u "+::set-output name=date::%FT%T"
24+
echo "path=HOME/.cache/xml2rfc" >> $GITHUB_OUTPUT
25+
date -u "+date=%FT%T" >> $GITHUB_OUTPUT
2626
2727
- name: "Cache References"
28-
uses: actions/cache@v2
28+
uses: actions/cache@v4
2929
with:
3030
path: ${{ steps.cache-setup.outputs.path }}
3131
key: refcache-${{ steps.date.outputs.date }}

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ else
99
git clone -q --depth 10 $(CLONE_ARGS) \
1010
-b main https://github.com/martinthomson/i-d-template $(LIBDIR)
1111
endif
12+
13+
linktypes.md: linktypes.csv
14+
/usr/bin/perl linktype2stanza >linktypes.md
15+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is the working area for individual Internet-Drafts.
88
* [Individual Draft](https://tools.ietf.org/html/draft-ietf-opsawg-pcap)
99
* [Compare Editor's Copy to Individual Draft](https://ietf-opsawg-wg.github.io/draft-ietf-opsawg-pcap/#go.draft-ietf-opsawg-pcap.diff)
1010

11-
## PCAP Next Generation (pcapng) Capture File Format
11+
## PCAP Now Generic (pcapng) Capture File Format
1212

1313
* [Editor's Copy](https://ietf-opsawg-wg.github.io/draft-ietf-opsawg-pcap/#go.draft-ietf-opsawg-pcapng.html)
1414
* [Individual Draft](https://tools.ietf.org/html/draft-ietf-opsawg-pcapng)

draft-ietf-opsawg-pcap.md

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
stand_alone: true
33
ipr: trust200902
44
docname: draft-ietf-opsawg-pcap-latest
5-
cat: info
5+
cat: historic
66
pi:
77
symrefs: 'yes'
88
toc: 'yes'
@@ -79,7 +79,7 @@ A capture file begins with a File Header, followed by zero or more
7979
Packet Records, one per packet.
8080

8181
All fields in the File Header and in the headers of Packet Records will
82-
always be written according to the characteristics (little endian / big
82+
always be written according to the characteristics (little-endian / big-
8383
endian) of the machine that is writing the file. This refers to all the
8484
fields that are written as numbers and that span over two or more
8585
octets.
@@ -90,18 +90,21 @@ when writing the file or reading the file on the host that wrote the
9090
file, which is the most common case when generating or processing
9191
capture captures.
9292

93+
When hosts with a different native endian format read a file, they must swap bytes as appropriate.
94+
This is less efficient, but less common, and if repeated access to the files are important, then files can be translated and saved.
95+
9396
# File Header
9497

9598
The File Header has the following format, with the octet offset of
9699
fields shown to the left of the field:
97100

98101
~~~~
102+
1 2 3
103+
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
99104
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
100105
0 | Magic Number |
101106
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
102-
4 | Major Version |
103-
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
104-
6 | Minor Version |
107+
4 | Major Version | Minor Version |
105108
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
106109
8 | Reserved1 |
107110
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -129,21 +132,25 @@ written on little-endian machines from the ones written on big-endian
129132
machines, and to heuristically identify pcap files.
130133

131134
Major Version (16 bits):
132-
: an unsigned value, giving the number of the current major version of
133-
the format. The value for the current version of the format is 2. This
135+
: an unsigned integer, giving the number of the current major version of
136+
the format. The value for the current version of the format is 2
137+
(big-endian 0x00 0x02 or little-endian 0x02 0x00). This
134138
value should change if the format changes in such a way that code that
135139
reads the new format could not read the old format (i.e., code to read
136140
both formats would have to check the version number and use different
137141
code paths for the two formats) and code that reads the old format could
138-
not read the new format.
142+
not read the new format. As this document is historical, and no newer formats were publicly released,
143+
this value will not change again.
139144

140145
Minor Version (16 bits):
141-
: an unsigned value, giving the number of the current minor version of
142-
the format. The value is for the current version of the format is 4.
146+
: an unsigned integer, giving the number of the current minor version of
147+
the format. The value for the current version of the format is 4
148+
(big-endian 0x00 0x04 or little-endian 0x04 0x00).
143149
This value should change if the format changes in such a way that code
144150
that reads the new format could read the old format without checking the
145151
version number but code that reads the old format could not read all
146-
files in the new format.
152+
files in the new format. As this document is historical, and no newer formats exist,
153+
this value will not change again.
147154

148155
Reserved1 (32 bits):
149156
: not used - SHOULD be filled with 0 by pcap file writers, and MUST be
@@ -158,14 +165,14 @@ implementations as "accuracy of timestamps". Some older pcap file
158165
writers stored non-zero values in this field.
159166

160167
SnapLen (32 bits):
161-
: an unsigned value indicating the maximum number of octets captured
168+
: an unsigned integer indicating the maximum number of octets captured
162169
from each packet. The portion of each packet that exceeds this value
163170
will not be stored in the file. This value MUST NOT be zero; if no
164171
limit was specified, the value SHOULD be a number greater than or equal
165172
to the largest packet length in the file.
166173

167174
LinkType and additional information (32 bits):
168-
: a 32-bit unsigned value that contains the link-layer type of packets
175+
: an unsigned integer that contains the link-layer type of packets
169176
in the file and may contain additional information.
170177

171178
The LinkType and additional information field is in the form
@@ -184,7 +191,7 @@ or writing the file, with bit 0 being the most-significant bit of the
184191
field and bit 31 being the least-significant bit of the field.
185192

186193
Link-layer type (16 bits):
187-
: a 16-bit value indicating link-layer type for packets in the file;
194+
: an unsigned integer indicating link-layer type for packets in the file;
188195
it is a value as defined in the PCAP LinkType list registry, as defined in {{I-D.ietf-opsawg-pcaplinktype}}.
189196

190197
Reserved3 (10 bits):
@@ -203,13 +210,23 @@ interpreted by pcap readers; a reader SHOULD treat a non-zero value as
203210
an error.
204211

205212
FCS len (4 bits):
206-
: a 4-bit unsigned value indicating the number of 16-bit (2-octet) words
213+
: an unsigned integer indicating the number of 16-bit (2-octet) words
207214
of FCS that are appended to each packet, if the P bit is set; if the P
208215
bit is not set, and the FCS length is not indicated by the link-layer
209216
type value, the FCS length is unknown. The valid values of the FCS len
210217
field are between 0 and 15; Ethernet, for example, would have an FCS
211218
length value of 2, corresponding to a 4-octet FCS.
212219

220+
## File Endian Information
221+
222+
The magic number is stored in native endian format, so all the byte sequences below are magic numbers.
223+
224+
* 0xA1,0xB2,0xC3,0xD4: little endian file, with timestamps in seconds/microseconds.
225+
* 0x1A,0x2B,0x3C,0x4D: little endian file, with timestamps in seconds/nanoseconds.
226+
* 0xD4,0xC3,0xB2,0xA1: big endian file, with timestamps in seconds/microseconds.
227+
* 0x4D,0x3C,0x2B,0x1A: big endian file, with timestamps in seconds/nanoseconds.
228+
229+
213230
# Packet Record
214231

215232
A Packet Record is the standard container for storing the packets
@@ -241,21 +258,21 @@ Timestamp (Seconds) and Timestamp (Microseconds or nanoseconds):
241258
: seconds and fraction of a seconds values of a timestamp.
242259
: The seconds value is a 32-bit unsigned integer that represents the
243260
number of seconds that have elapsed since 1970-01-01 00:00:00 UTC, and
244-
the microseconds or nanoseconds value is a 32-bit unsigned value that
261+
the microseconds or nanoseconds value is a 32-bit unsigned integer that
245262
represents the number of microseconds or nanoseconds that have elapsed
246263
since that seconds.
247264
: The Magic Number field in the File Header of a file indicates
248265
whether the values of the Timestamp (Microseconds or nanoseconds) fields
249266
of packets in that file are in units of microseconds or nanoseconds.
250267

251268
Captured Packet Length (32 bits):
252-
: an unsigned value that indicates the number of octets captured from
269+
: an unsigned integer that indicates the number of octets captured from
253270
the packet (i.e., the length of the Packet Data field). It will be the
254271
minimum value among the Original Packet Length and the snapshot length
255272
for the interface (SnapLen, defined in Figure 1).
256273

257274
Original Packet Length (32 bits):
258-
: an unsigned value that indicates the number of octets of packet data
275+
: an unsigned integer that indicates the number of octets of packet data
259276
that would have been provided had the packet not been truncated to the
260277
snapshot length for the interface or to a length limit imposed by the
261278
capture mechanism. If no truncation was done, it will be the same as
@@ -301,9 +318,9 @@ specification.
301318

302319
Please note: To avoid confusion (such as the current usage of .cap for a
303320
plethora of different capture file formats) file name extensions other
304-
than .pcap should be avoided.
321+
than `.pcap` should be avoided.
305322

306-
There is new work to create the PCAP Next Generation capture File Format
323+
There is new work to create the PCAP Now Generic capture File Format
307324
(see {{I-D.ietf-opsawg-pcapng}}). The new file format is not
308325
compatible with this specification, but many programs read both
309326
transparently. Files of that type will start with a Section
@@ -314,11 +331,10 @@ format of a file.
314331

315332
# Security Considerations
316333

317-
A pcap file reader MUST do invalid header and packet checks.
318-
It can receive as input not only valid headers or packets, but any arbitrary
334+
A pcap file reader MUST validate the file header and file packet header, and also the contained headers for the packet capture.
335+
A reader can receive as input not only valid headers or packets, but any arbitrary
319336
random sequence of octets:
320-
Headers or packets originally malformed by the sender or by a fuzz tester,
321-
corrupted in transit or for some other reason.
337+
Headers or packets may be intentionally malformed by a sender, and capture files from outside sources may contain intentionally malformed contents, for malicious reasons.
322338

323339
See also:
324340
https://www.iana.org/assignments/media-types/application/vnd.tcpdump.pcap

0 commit comments

Comments
 (0)