From 9cefe96a4940381ca4e07865280018866b31b78d Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Mon, 16 Mar 2015 15:33:22 +0300 Subject: [PATCH] Fix plugin runner --- build_plugin_tester.sh | 5 +++-- plugin_runner.cpp | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/build_plugin_tester.sh b/build_plugin_tester.sh index 92a65ab..570e4f8 100755 --- a/build_plugin_tester.sh +++ b/build_plugin_tester.sh @@ -3,7 +3,8 @@ g++ netflow_plugin/netflow_collector.cpp -c -onetflow_collector.o g++ sflow_plugin/sflow_collector.cpp -c -osflow_collector.o g++ pcap_plugin/pcap_collector.cpp -c -opcap_collector.o -g++ pfring_plugin/pfring_collector.cpp -c -opfring_collector.o -I/opt/pf_ring/include -lpfring -g++ plugin_runner.cpp -lpcap -llog4cpp netflow_collector.o sflow_collector.o pcap_collector.o pfring_collector.o -oplugin_tester +g++ pfring_plugin/pfring_collector.cpp -c -opfring_collector.o -I/opt/pf_ring/include + +g++ plugin_runner.cpp -lpcap -llog4cpp netflow_collector.o sflow_collector.o pcap_collector.o pfring_collector.o -oplugin_tester -I/opt/pf_ring/include -lpfring -lpthread -L/opt/pf_ring/lib rm -f netflow_collector.o sflow_collector.o pcap_collector.o diff --git a/plugin_runner.cpp b/plugin_runner.cpp index 4584843..85c9488 100644 --- a/plugin_runner.cpp +++ b/plugin_runner.cpp @@ -5,7 +5,7 @@ #include #include #include - +#include #include #include #include @@ -28,12 +28,19 @@ using namespace std; +uint64_t total_unparsed_packets = 0; + std::string log_file_path = "/tmp/fastnetmon_plugin_tester.log"; log4cpp::Category& logger = log4cpp::Category::getRoot(); // Global map with parsed config file std::map configuration_map; +// convert string to integer +int convert_string_to_integer(std::string line) { + return atoi(line.c_str()); +} + void init_logging() { log4cpp::PatternLayout* layout = new log4cpp::PatternLayout(); layout->setConversionPattern ("%d [%p] %m%n");