diff --git a/fastnetmon.cpp b/fastnetmon.cpp index 0514f54..4ea6c92 100644 --- a/fastnetmon.cpp +++ b/fastnetmon.cpp @@ -130,6 +130,8 @@ bool enable_data_collection_from_mirror = true; bool enable_sflow_collection = false; +bool enable_netflow_collection = false; + // Time consumed by reaclculation for all IPs struct timeval speed_calculation_time; @@ -838,6 +840,14 @@ bool load_configuration_file() { } } + if (configuration_map.count("netflow") != 0) { + if (configuration_map[ "netflow" ] == "on") { + enable_netflow_collection = true; + } else { + enable_netflow_collection = false; + } + } + if (configuration_map.count("mirror") != 0) { if (configuration_map["mirror"] == "on") { enable_data_collection_from_mirror = true; diff --git a/fastnetmon_types.h b/fastnetmon_types.h index 9a1320f..2690bed 100644 --- a/fastnetmon_types.h +++ b/fastnetmon_types.h @@ -4,7 +4,7 @@ // simplified packet struct for lightweight save into memory class simple_packet { public: - simple_packet() : sample_ratio(1), src_ip(0), dst_ip(0), source_port(0), destination_port(0), protocol(0), length(0), flags(0) { + simple_packet() : sample_ratio(1), src_ip(0), dst_ip(0), source_port(0), destination_port(0), protocol(0), length(0), flags(0), number_of_packets(1) { ts.tv_usec = 0; ts.tv_sec = 0; } @@ -15,6 +15,7 @@ public: uint16_t destination_port; unsigned int protocol; unsigned int length; + unsigned int number_of_packets; /* for netflow */ uint8_t flags; /* tcp flags */ struct timeval ts; };