diff --git a/src/afpacket_plugin/afpacket_collector.cpp b/src/afpacket_plugin/afpacket_collector.cpp index bb1ffc82..cdde7a1f 100644 --- a/src/afpacket_plugin/afpacket_collector.cpp +++ b/src/afpacket_plugin/afpacket_collector.cpp @@ -318,6 +318,12 @@ void start_afpacket_collection(process_packet_pointer func_ptr) { int fanout_group_id = getpid() & 0xffff; + // It will block execution thread + start_af_packet_capture_for_interface(capture_interface, fanout_group_id, num_cpus); +} + +// Starts traffic capture for particular interface +void start_af_packet_capture_for_interface(std::string capture_interface, int fanout_group_id, unsigned int num_cpus) { if (num_cpus == 1) { logger << log4cpp::Priority::INFO << "Disable AF_PACKET fanout because you have only single CPU"; diff --git a/src/afpacket_plugin/afpacket_collector.h b/src/afpacket_plugin/afpacket_collector.h index b74104ac..ee1b21f8 100644 --- a/src/afpacket_plugin/afpacket_collector.h +++ b/src/afpacket_plugin/afpacket_collector.h @@ -4,5 +4,6 @@ #include "../fastnetmon_types.h" void start_afpacket_collection(process_packet_pointer func_ptr); +void start_af_packet_capture_for_interface(std::string capture_interface, int fanout_group_id, unsigned int num_cpus); #endif