Extracted AF_PACKET logic into function
This commit is contained in:
parent
64b74b979b
commit
42e85db9d9
@ -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";
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user