Add initial PF_RING support

This commit is contained in:
Pavel Odintsov 2014-03-11 20:19:20 +04:00
parent 7b40775ad2
commit dc2005995b
3 changed files with 22 additions and 3 deletions

View File

@ -1,8 +1,10 @@
all: fastnetmon
# User parameters
ENGINE = ULOG2
ENGINE = PF_RING
#ENGINE = ULOG2
#ENGINE = PCAP
#ENGINE = PF_RING
REDIS_SUPPORT = yes
GEOIP_SUPPORT = yes
@ -39,11 +41,21 @@ ifeq ($(ENGINE), PCAP)
LIBS += -lpcap
endif
# add path to PF_RING headers
ifeq ($(ENGINE), PF_RING)
HEADERS += -I/opt/pf_ring/include
LIBS += -lpfring
LIBS += -lnuma
# for clock_gettime
LIBS += -lrt
LIBS_PATH += -L/opt/pf_ring/lib
endif
fastnetmon: libipulog.o fastnetmon.o
g++ libipulog.o fastnetmon.o -o fastnetmon $(LIBS) $(BUILD_FLAGS)
g++ libipulog.o fastnetmon.o -o fastnetmon $(LIBS_PATH) $(LIBS) $(BUILD_FLAGS)
libipulog.o: libipulog.c
g++ -c libipulog.c -o libipulog.o -Wno-write-strings
fastnetmon.o: fastnetmon.cpp
g++ $(DEFINES) -c fastnetmon.cpp -o fastnetmon.o -std=c++11 $(BUILD_FLAGS)
g++ $(DEFINES) $(HEADERS) -c fastnetmon.cpp -o fastnetmon.o -std=c++11 $(BUILD_FLAGS)
clean:
rm -f libipulog.o fastnetmon.o fastnetmon

View File

@ -18,6 +18,9 @@ Install
# If you need traffic counting
apt-get install -y libhiredis-dev
# If you need PF_RING abilities
apt-get install -y libnuma-dev
# If you need ASN/geoip stats
apt-get install -y libgeoip-dev

View File

@ -65,6 +65,10 @@
#include <hiredis/hiredis.h>
#endif
#ifdef PF_RING
#include "pfring.h"
#endif
using namespace std;
/*