How defining a new capture file format


We examine one LFF file which define the ACP format.

Characteristics of the ACP file format (for instance this is the native format of WinPcap and libpcap):

At the beginning of the file there is an header. Here it is its format:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Magic Number
Major Version Minor Version
Time Zone
File Length
Future Applications
Link Type
Value                        Description
0 no link-layer encapsulation
1 Ethernet (10Mb)
2 Experimental Ethernet (3Mb)
3 Amateur Radio AX.25
4 Proteon ProNET Token Ring
5 Chaos
6 IEEE 802 Networks
7 ARCNET
8 Serial Line IP
9 Point-to-point Protocol
10 FDDI
11 LLC/SNAP encapsulated ATM
12 Raw IP
13 BSD/OS Serial Line IP
14 BSD/OS Point-to-point Protocol

Then there are the packets; each packet has an header which contains the following information:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Packet Length
The packet part length contained in the file
Seconds from the capture beginning
Micro seconds from the capture beginning

The file structure shows that there are no info which allow to read the packet in two directions. In fact in the packet header there is not a field with the length of the previous packet frame.