Add initial PF_RING support
This commit is contained in:
parent
7b40775ad2
commit
dc2005995b
18
Makefile
18
Makefile
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -65,6 +65,10 @@
|
|||
#include <hiredis/hiredis.h>
|
||||
#endif
|
||||
|
||||
#ifdef PF_RING
|
||||
#include "pfring.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue