This project simulates and generates NetFlow data in pcap file, typically used for network monitoring and analysis.
-
Clone the repository:
git clone https://github.com/GavinITP/netflow-generator.git cd netflow-generator -
Compile the code:
clang++ -std=c++20 -O3 main.cpp netflow.cpp utils.cpp -o netflow_pcap_writer
or
g++ -std=c++20 -O3 main.cpp netflow.cpp utils.cpp -o netflow_pcap_writer
-
Run the program:
./netflow_pcap_writer
main.cpp: Generate raw packets with NetFlow data and writing them to a .pcap file.netflow.cpp: Contains the logic to generate and serialize NetFlow data.utils.cpp: Provides utility functions like generating random numbers and converting IP addresses touint32_t.