Skip to content

Commit 806a1f9

Browse files
committed
Tools: add README to pcap2flow tool
1 parent 23d8299 commit 806a1f9

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

src/tools/pcap2flow/README.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
pcap2flow
2+
=========
3+
4+
Simple tool for extracting NetFlow v5/v9 and IPFIX packets from a PCAP file and
5+
exporting them to a collector.
6+
7+
The PCAP file can contain capture of multiple sessions between exporters and
8+
one or more collectors. To preserve original Transport Sessions (and avoid
9+
mixing packets together), the tool creates a new independent session to the
10+
newly specified collector for each original TS.
11+
12+
All non-flow packets in the file are automatically ignored.
13+
14+
Dependencies
15+
------------
16+
17+
- python3
18+
- `python3-scapy <pypi.org/project/scapy/>`_
19+
20+
Parameters
21+
----------
22+
23+
:``-h``:
24+
Show help message and exit
25+
:``-i FILE``:
26+
PCAP file with NetFlow/IPFIX packets
27+
:``-d ADDR``:
28+
Destination IP address or hostname (default: 127.0.0.1)
29+
:``-p PORT``:
30+
Destination port number (default: 4739)
31+
:``-t TYPE``:
32+
Connection type (options: TCP/UDP, default: UDP)
33+
:``-4``:
34+
Force the tool to send flows to an IPv4 address only
35+
:``-6``:
36+
Force the tool to send flows to an IPv6 address only
37+
:``-v``:
38+
Increase verbosity
39+
40+
Examples
41+
--------
42+
43+
Replay packets over UDP to a collector listening on localhost (port 4739):
44+
45+
.. code:: bash
46+
47+
./pcap2flow -i data.pcap
48+
49+
Replay packets over TCP to a collector on example.org (port 3000):
50+
51+
.. code:: bash
52+
53+
./pcap2flow -i data.pcap -d example.org -p 3000 -t TCP
54+
55+
Note
56+
----
57+
58+
The only purpose of this tool is to test the collector and its plugins on
59+
previously captured flow packets. Performance of the tool is not ideal and it's
60+
not itendent to be used in producion environment.
61+

src/tools/pcap2flow/pcap2flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def arg_check_port(value):
180180
description="Simple tool for replaying NetFlow v5/v9 and IPFIX packets to a collector.",
181181
)
182182
parser.add_argument("-i", dest="file", help="PCAP with NetFlow/IPFIX packets", required=True)
183-
parser.add_argument("-d", dest="addr", help="Destination IP address (default: %(default)s)",
183+
parser.add_argument("-d", dest="addr", help="Destination IP address or hostname (default: %(default)s)",
184184
default="127.0.0.1")
185185
parser.add_argument("-p", dest="port", help="Destination port number (default: %(default)d)",
186186
default=4739, type=arg_check_port)

0 commit comments

Comments
 (0)