mirror of
https://github.com/pavel-odintsov/fastnetmon
synced 2024-12-04 19:08:22 +01:00
Fix plugin runner
This commit is contained in:
parent
490728dd11
commit
9cefe96a49
@ -3,7 +3,8 @@
|
|||||||
g++ netflow_plugin/netflow_collector.cpp -c -onetflow_collector.o
|
g++ netflow_plugin/netflow_collector.cpp -c -onetflow_collector.o
|
||||||
g++ sflow_plugin/sflow_collector.cpp -c -osflow_collector.o
|
g++ sflow_plugin/sflow_collector.cpp -c -osflow_collector.o
|
||||||
g++ pcap_plugin/pcap_collector.cpp -c -opcap_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++ 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
|
|
||||||
|
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
|
rm -f netflow_collector.o sflow_collector.o pcap_collector.o
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
@ -28,12 +28,19 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
uint64_t total_unparsed_packets = 0;
|
||||||
|
|
||||||
std::string log_file_path = "/tmp/fastnetmon_plugin_tester.log";
|
std::string log_file_path = "/tmp/fastnetmon_plugin_tester.log";
|
||||||
log4cpp::Category& logger = log4cpp::Category::getRoot();
|
log4cpp::Category& logger = log4cpp::Category::getRoot();
|
||||||
|
|
||||||
// Global map with parsed config file
|
// Global map with parsed config file
|
||||||
std::map<std::string, std::string> configuration_map;
|
std::map<std::string, std::string> configuration_map;
|
||||||
|
|
||||||
|
// convert string to integer
|
||||||
|
int convert_string_to_integer(std::string line) {
|
||||||
|
return atoi(line.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
void init_logging() {
|
void init_logging() {
|
||||||
log4cpp::PatternLayout* layout = new log4cpp::PatternLayout();
|
log4cpp::PatternLayout* layout = new log4cpp::PatternLayout();
|
||||||
layout->setConversionPattern ("%d [%p] %m%n");
|
layout->setConversionPattern ("%d [%p] %m%n");
|
||||||
|
Loading…
Reference in New Issue
Block a user