capfileconvert

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: capfileconvert
capfileconvert

capfileconvert

The capfileconvert tool is used to convert to and from 3GD capture file format.

Syntax

capfileconvert -i <file> -o <file> --outputformat=<format> [--inputformat=<format>] [--help]

Commands
Command Description
--help, -h Show help text and exit
-i <file>,
--input <file>
Specify the input file
-o <file>,
--output <file>
Specify the output file
-f <pcap | nt3gd | pcapnano>,
--outputformat <pcap | nt3gd | pcapnano>
Specify the output format: pcap, pcapnano, or nt3gd
-n <libpcap | ntpcap>,
--inputformat <libpcap | ntpcap>
Specify the input format when converting a pcap file.

Input Format

When using a Napatech adapter to capture in pcap format, either by using libpcap or capturing directly in pcap (using the capture tool), by setting:

TimestampFormat = PCAP | PCAP_NS
PacketDescriptor = PCAP

The captured data will be captured in a slightly changed pcap format. When capturing using libpcap, a four bytes crc is added to the end of each packet and is a part of len and caplen. When using the capture tool to capture directly in pcap format, a four bytes crc and an eight bytes alignment padding are added to each packet. The crc is a part of len, and both crc and padding are a part of caplen. This means that caplen can be larger than len.

By converting the capture file using capfileconvert, the crc and padding can be removed from the pcap file, but as the ntpcap additions are not easily detected, it is necessary to state the input format when converting a pcap file to either another pcap file (remove crc and padding) or to a nt3gd file.

Note
Most pcap applications does not care about the added crc and padding. But some does and it can be necessary to remove the crc and padding.
Conversion Options
Captured by Format Input Content
LibPCAP using a standard adapter --inputformat=libpcap Native PCAP format.
len: No CRC
caplen: No CRC.
LibPCAP using a Napatech adapter --inputformat=ntpcap Napatech PCAP format.
len: Including a 4 byte CRC
caplen: Including a 4 byte CRC
Capture using a Napatech adapter
TimestampFormat = PCAP | PCAP_NS
PacketDescriptor = PCAP
--inputformat=ntpcap Napatech PCAP format.
len: Including a 4 byte CRC
caplen: Including a four bytes CRC and eight bytes alignment padding
Note
Converting to and from pcap results in packet descriptor information loss due to the very simple pcap header.

Examples

  • Convert to pcap
    capfileconvert -i src.cap -o dest.cap --outputformat=pcap
  • Convert to nt3gd from 2gd
    capfileconvert -i src.cap -o dest.cap --outputformat=nt3gd
  • Convert to nt3gd from Napatech pcap format
    capfileconvert -i pcap.cap -o nt3gd.cap --outputformat=nt3gd --inputformat=ntpcap
  • Convert to nt3gd from libpcap pcap format
    capfileconvert -i pcap.cap -o nt3gd.cap --outputformat=nt3gd --inputformat=libpcap
  • Convert to pcap from Napatech pcap format
    capfileconvert -i pcapin.cap -o pcapout.cap --outputformat=pcap --inputformat=ntpcap
  • Convert to pcap from pcap format (for example from pcapnano to pcap)
    capfileconvert -i pcapin.cap -o pcapout.cap --outputformat=pcap --inputformat=libpcap