1
0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-09-20 03:33:04 +02:00

Some fixes for netflow integration in main tool

This commit is contained in:
Pavel Odintsov 2015-01-23 19:37:23 +03:00
parent c22168f059
commit 55a35b7b33
2 changed files with 12 additions and 1 deletions

View File

@ -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;

View File

@ -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;
};