capfileconvert_example.h

Reference Documentation

product_line_custom
Napatech SmartNIC
category
Reference Information

Go to the documentation of this file.

1/* 2 * %NT_SOFTWARE_LICENSE% 3 */ 4 5/** 6 * @file 7 * 8 * This header file contains documentation on the capfileconvert tool. 9 */ 10#ifndef __CAPFILECONVERT_H__ 11#define __CAPFILECONVERT_H__ 12 13static const char *usageText[] = { 14 /* Printed before the options */ 15 "The capfileconvert tool is used to convert to/from 3GD capture file format\n" 16 "\n" 17 "Syntax:\n" 18 " capfileconvert -i <file> -o <file> --outputformat=<format> [--inputformat=<format>] [--verbose] [--help]\n", 19 20 /* Printed after the options */ 21 "\ninputformat:\n" 22 "When using a Napatech adapter to capture in pcap format either by using libpcap \n" 23 "or capturing directly in pcap (using the capture tool) by setting: \n" 24 " \n" 25 "TimestampFormat = PCAP | PCAP_NS\n" 26 "PacketDescriptor = PCAP\n" 27 " \n" 28 "The captured data will be captured in a slightly changed pcap format. When capturing \n" 29 "using libpcap a 4 bytes crc will be added to the end of each packet and be a part of len\n" 30 "and caplen. When capturing directly in pcap format using the capture tool a 4 byte crc \n" 31 "and an 8 byte alignment padding is added to each packet. The crc is a part of len and both crc \n" 32 "and padding are a part of caplen. This means that caplen can be larger than len. \n" 33 " \n" 34 "By converting the capture file using capfileconvert the crc and padding can be removed \n" 35 "from the pcap file, but as the ntpcap additions is not easily detected, it is necessary to \n" 36 "state the input format when converting a pcap file to either another pcap file (remove crc and padding) \n" 37 "or to a nt3gd file. \n" 38 "\n" 39 "Note:\n" 40 "Most pcap applications does not care about the added crc and padding. But some does and it can\n" 41 "be necessary to remove the crc and padding.\n" 42 "\n" 43 "Captured by Format Input Content\n" 44 "LibPCAP using a standard adapter --inputformat=libpcap Native PCAP format.\n" 45 " len: No CRC\n" 46 " caplen: No CRC. \n" 47 "\n" 48 "LibPCAP using a Napatech adapter --inputformat=ntpcap Napatech PCAP format.\n" 49 " len: Including a 4 byte CRC\n" 50 " caplen: Including a 4 byte CRC\n" 51 "\n" 52 "LibPCAP using a Napatech adapter --inputformat=ntpcap Napatech PCAP format.\n" 53 "TimestampFormat = PCAP | PCAP_NS len: Including a 4 byte CRC\n" 54 "PacketDescriptor = PCAP caplen: Including a four bytes CRC\n" 55 " and eight bytes alignment padding\n" 56 "\n" 57 "Note:\n" 58 "Converting to/from pcap will result in descriptor info loss due to the very\n" 59 "simple pcap header.\n" 60 "\n" 61 "Examples:\n" 62 "* capfileconvert -i src.cap -o dest.cap --outputformat=pcap\n" 63 " Convert to pcap\n\n" 64 "* capfileconvert -i src.cap -o dest.cap --outputformat=nt3gd\n" 65 " Convert to nt3gd from 2gd\n\n" 66 "* capfileconvert -i pcap.cap -o nt3gd.cap --outputformat=nt3gd --inputformat=ntpcap\n" 67 " Convert to nt3gd from Napatech pcap format\n\n" 68 "* capfileconvert -i pcap.cap -o nt3gd.cap --outputformat=nt3gd --inputformat=libpcap\n" 69 " Convert to nt3gd from libpcap pcap format\n\n" 70 "* capfileconvert -i pcapin.cap -o pcapout.cap --outputformat=pcap --inputformat=ntpcap\n" 71 " Convert to pcap from Napatech pcap format\n\n" 72 "* capfileconvert -i pcapin.cap -o pcapout.cap --outputformat=pcap --inputformat=libpcap\n" 73 " Convert to pcap from pcap format (For example from pcapnano to pcap)\n", 74 /* Terminator */ 75 NULL 76}; 77 78 79#endif