1diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 2index dfbe8c1..a84d696 100644 3--- a/src/CMakeLists.txt 4+++ b/src/CMakeLists.txt 5@@ -10,6 +10,10 @@ project(FastNetMon) 6 # Enable it and fix all warnigns! 7 # add_definitions ("-Wall") 8 9+include_directories("/opt/libcuckoo/include/") 10+# We need C++11 support for libcuckoo 11+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 12+ 13 set (Tutorial_VERSION_MAJOR 1) 14 set (Tutorial_VERSION_MINOR 1) 15 16@@ -189,5 +193,7 @@ target_link_libraries(fastnetmon pcap_plugin) 17 target_link_libraries(fastnetmon example_plugin) 18 target_link_libraries(fastnetmon netmap_plugin) 19 20+target_link_libraries(fastnetmon /opt/libcuckoo/lib/libcityhash.so) 21+ 22 install(TARGETS fastnetmon DESTINATION bin) 23 install(TARGETS fastnetmon_client DESTINATION bin) 24diff --git a/src/fastnetmon.cpp b/src/fastnetmon.cpp 25index 5308244..cd9e9dc 100644 26--- a/src/fastnetmon.cpp 27+++ b/src/fastnetmon.cpp 28@@ -268,6 +268,8 @@ void process_packet(simple_packet& current_packet); 29 void traffic_draw_program(); 30 void interruption_signal_handler(int signal_number); 31 32+cuckoohash_map<std::string, map_element, CityHasher<std::string> > flow_tracking_table_new_generation; 33+ 34 /* Class for custom comparison fields by different fields */ 35 class TrafficComparatorClass { 36 private: 37@@ -1029,6 +1031,24 @@ void process_packet(simple_packet& current_packet) { 38 } 39 } 40 41+ 42+ if (packet_direction == OUTGOING or packet_direction == INCOMING) { 43+ std::string connection_tracking_hash_string = convert_ip_as_uint_to_string(current_packet.dst_ip) + "_" + convert_ip_as_uint_to_string(current_packet.src_ip) + "_" + 44+ convert_ip_as_uint_to_string(current_packet.source_port) + "_" + convert_ip_as_uint_to_string(current_packet.destination_port) + "_" + convert_ip_as_uint_to_string(current_packet.protocol) + "_"; 45+ get_direction_name(packet_direction); 46+ 47+ map_element temp_element; 48+ 49+ if (flow_tracking_table_new_generation.find(connection_tracking_hash_string, temp_element)) { 50+ // found! 51+ 52+ } else { 53+ // not found, create it 54+ flow_tracking_table_new_generation.insert(connection_tracking_hash_string, temp_element); 55+ } 56+ } 57+ 58+ 59 /* Because we support mirroring, sflow and netflow we should support different cases: 60 - One packet passed for processing (mirror) 61 - Multiple packets ("flows") passed for processing (netflow) 62diff --git a/src/fastnetmon_types.h b/src/fastnetmon_types.h 63index 8263645..6e098ca 100644 64--- a/src/fastnetmon_types.h 65+++ b/src/fastnetmon_types.h 66@@ -5,6 +5,9 @@ 67 #include <stdint.h> // uint32_t 68 #include <sys/time.h> // struct timeval 69 70+#include <libcuckoo/cuckoohash_map.hh> 71+#include <libcuckoo/city_hasher.hh> 72+ 73 #include <map> 74 #include <vector> 75 76