capfileconvert_example.h Source File

Reference Documentation

Platform
Intel® PAC
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.10
Napatech Software Suite: examples/net/capfileconvert/capfileconvert_example.h Source File
capfileconvert_example.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2023 Napatech A/S. All Rights Reserved.
4  *
5  * 1. Copying, modification, and distribution of this file, or executable
6  * versions of this file, is governed by the terms of the Napatech Software
7  * license agreement under which this file was made available. If you do not
8  * agree to the terms of the license do not install, copy, access or
9  * otherwise use this file.
10  *
11  * 2. Under the Napatech Software license agreement you are granted a
12  * limited, non-exclusive, non-assignable, copyright license to copy, modify
13  * and distribute this file in conjunction with Napatech SmartNIC's and
14  * similar hardware manufactured or supplied by Napatech A/S.
15  *
16  * 3. The full Napatech Software license agreement is included in this
17  * distribution, please see "NP-0405 Napatech Software license
18  * agreement.pdf"
19  *
20  * 4. Redistributions of source code must retain this copyright notice,
21  * list of conditions and the following disclaimer.
22  *
23  * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES, EXPRESS OR
24  * IMPLIED, AND NAPATECH DISCLAIMS ALL IMPLIED WARRANTIES INCLUDING ANY
25  * IMPLIED WARRANTY OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, OR OF
26  * FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY
27  * APPLICABLE LAW, IN NO EVENT SHALL NAPATECH BE LIABLE FOR PERSONAL INJURY,
28  * OR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER,
29  * INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, CORRUPTION OR
30  * LOSS OF DATA, FAILURE TO TRANSMIT OR RECEIVE ANY DATA OR INFORMATION,
31  * BUSINESS INTERRUPTION OR ANY OTHER COMMERCIAL DAMAGES OR LOSSES, ARISING
32  * OUT OF OR RELATED TO YOUR USE OR INABILITY TO USE NAPATECH SOFTWARE OR
33  * SERVICES OR ANY THIRD PARTY SOFTWARE OR APPLICATIONS IN CONJUNCTION WITH
34  * THE NAPATECH SOFTWARE OR SERVICES, HOWEVER CAUSED, REGARDLESS OF THE THEORY
35  * OF LIABILITY (CONTRACT, TORT OR OTHERWISE) AND EVEN IF NAPATECH HAS BEEN
36  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT ALLOW
37  * THE EXCLUSION OR LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF
38  * INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU.
39  *
40  *
41 
42  */
43 
44 /**
45  * @file
46  *
47  * This header file contains documentation on the capfileconvert tool.
48  */
49 #ifndef __CAPFILECONVERT_H__
50 #define __CAPFILECONVERT_H__
51 
52 static const char *usageText[] = {
53  /* Printed before the options */
54  "The capfileconvert tool is used to convert to/from 3GD capture file format\n"
55  "\n"
56  "Syntax:\n"
57  " capfileconvert -i <file> -o <file> --outputformat=<format> [--inputformat=<format>] [--verbose] [--help]\n",
58 
59  /* Printed after the options */
60  "\ninputformat:\n"
61  "When using a Napatech adapter to capture in pcap format either by using libpcap \n"
62  "or capturing directly in pcap (using the capture tool) by setting: \n"
63  " \n"
64  "TimestampFormat = PCAP | PCAP_NS\n"
65  "PacketDescriptor = PCAP\n"
66  " \n"
67  "The captured data will be captured in a slightly changed pcap format. When capturing \n"
68  "using libpcap a 4 bytes crc will be added to the end of each packet and be a part of len\n"
69  "and caplen. When capturing directly in pcap format using the capture tool a 4 byte crc \n"
70  "and an 8 byte alignment padding is added to each packet. The crc is a part of len and both crc \n"
71  "and padding are a part of caplen. This means that caplen can be larger than len. \n"
72  " \n"
73  "By converting the capture file using capfileconvert the crc and padding can be removed \n"
74  "from the pcap file, but as the ntpcap additions is not easily detected, it is necessary to \n"
75  "state the input format when converting a pcap file to either another pcap file (remove crc and padding) \n"
76  "or to a nt3gd file. \n"
77  "\n"
78  "Note:\n"
79  "Most pcap applications does not care about the added crc and padding. But some does and it can\n"
80  "be necessary to remove the crc and padding.\n"
81  "\n"
82  "Captured by Format Input Content\n"
83  "LibPCAP using a standard adapter --inputformat=libpcap Native PCAP format.\n"
84  " len: No CRC\n"
85  " caplen: No CRC. \n"
86  "\n"
87  "LibPCAP using a Napatech adapter --inputformat=ntpcap Napatech PCAP format.\n"
88  " len: Including a 4 byte CRC\n"
89  " caplen: Including a 4 byte CRC\n"
90  "\n"
91  "LibPCAP using a Napatech adapter --inputformat=ntpcap Napatech PCAP format.\n"
92  "TimestampFormat = PCAP | PCAP_NS len: Including a 4 byte CRC\n"
93  "PacketDescriptor = PCAP caplen: Including a four bytes CRC\n"
94  " and eight bytes alignment padding\n"
95  "\n"
96  "Note:\n"
97  "Converting to/from pcap will result in descriptor info loss due to the very\n"
98  "simple pcap header.\n"
99  "\n"
100  "Examples:\n"
101  "* capfileconvert -i src.cap -o dest.cap --outputformat=pcap\n"
102  " Convert to pcap\n\n"
103  "* capfileconvert -i src.cap -o dest.cap --outputformat=nt3gd\n"
104  " Convert to nt3gd from 2gd\n\n"
105  "* capfileconvert -i pcap.cap -o nt3gd.cap --outputformat=nt3gd --inputformat=ntpcap\n"
106  " Convert to nt3gd from Napatech pcap format\n\n"
107  "* capfileconvert -i pcap.cap -o nt3gd.cap --outputformat=nt3gd --inputformat=libpcap\n"
108  " Convert to nt3gd from libpcap pcap format\n\n"
109  "* capfileconvert -i pcapin.cap -o pcapout.cap --outputformat=pcap --inputformat=ntpcap\n"
110  " Convert to pcap from Napatech pcap format\n\n"
111  "* capfileconvert -i pcapin.cap -o pcapout.cap --outputformat=pcap --inputformat=libpcap\n"
112  " Convert to pcap from pcap format (For example from pcapnano to pcap)\n",
113  /* Terminator */
114  NULL
115 };
116 
117 
118 #endif