Skip to content

Commit

Permalink
Merge pull request #109 from CESNET/ipfixprobe
Browse files Browse the repository at this point in the history
Ipfixprobe
  • Loading branch information
havraji6 committed Feb 6, 2019
2 parents 0a34bbf + eb7d0bd commit a5a55ed
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 42 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Expand Up @@ -84,9 +84,11 @@ AX_C_BIGENDIAN_CROSS
AX_OPENMP([], [AC_MSG_ERROR([OpenMP was not found. Some modules need it (e.g. merger)])])
AC_SUBST(OPENMP_CFLAGS)

backup_libs=${LIBS}
AX_LIBTRAP_CHECK
AX_UNIREC_CHECK
AX_NEMEACOMMON_CHECK
LIBS=${backup_libs}

AC_ARG_WITH([openssl],
[AS_HELP_STRING([--without-openssl], [Force to disable openssl])],
Expand Down
91 changes: 50 additions & 41 deletions flow_meter/Makefile.am
@@ -1,51 +1,60 @@
SUBDIRS=. tests
bin_PROGRAMS=flow_meter
flow_meter_SOURCES=flow_meter.cpp \
flow_meter.h \
packet.h \
packetreceiver.h \
pcapreader.h \
flowexporter.h \
flowifc.h \
flowcache.h \
bin_PROGRAMS=flow_meter ipfixprobe

ipfixprobe_LIBS=-lpcap
ipfixprobe_LDADD=-lpcap
ipfixprobe_CXXFLAGS=-std=c++98 -Wno-write-strings
ipfixprobe_CPPFLAGS=-DDISABLE_UNIREC
flow_meter_src=flow_meter.cpp \
flow_meter.h \
packet.h \
packetreceiver.h \
pcapreader.h \
flowexporter.h \
flowifc.h \
flowcache.h \
pcapreader.cpp \
nhtflowcache.cpp \
nhtflowcache.h \
stats.cpp \
stats.h \
flowcacheplugin.h \
httpplugin.cpp \
httpplugin.h \
sipplugin.cpp \
sipplugin.h \
httpsplugin.cpp \
httpsplugin.h \
smtpplugin.cpp \
smtpplugin.h \
dnsplugin.cpp \
dnsplugin.h \
passivednsplugin.cpp \
passivednsplugin.h \
ntpplugin.cpp \
ntpplugin.h \
ipaddr.h \
arpplugin.cpp \
arpplugin.h \
ipfixexporter.cpp \
ipfix-elements.h \
ipfixexporter.h \
xxhash.c \
xxhash.h \
dns.h \
conversion.h \
conversion.cpp
ipfixprobe_SOURCES=$(flow_meter_src)

flow_meter_SOURCES=$(flow_meter_src) \
unirecexporter.h \
pcapreader.cpp \
nhtflowcache.cpp \
nhtflowcache.h \
unirecexporter.cpp \
stats.cpp \
stats.h \
flowcacheplugin.h \
httpplugin.cpp \
httpplugin.h \
sipplugin.cpp \
sipplugin.h \
httpsplugin.cpp \
httpsplugin.h \
smtpplugin.cpp \
smtpplugin.h \
fields.c \
fields.h \
dnsplugin.cpp \
dnsplugin.h \
passivednsplugin.cpp \
passivednsplugin.h \
ntpplugin.cpp \
ntpplugin.h \
ipaddr.h \
arpplugin.cpp \
arpplugin.h \
ipfixexporter.cpp \
ipfix-elements.h \
ipfixexporter.h \
xxhash.c \
xxhash.h \
dns.h \
conversion.h \
conversion.cpp
fields.h

flow_meter_LDADD=-ltrap -lunirec -lpcap
flow_meter_CXXFLAGS=-std=c++98 -Wno-write-strings

pkgdocdir=${docdir}/flow_meter
pkgdoc_DATA=README.md
EXTRA_DIST=README.md \
Expand Down
2 changes: 2 additions & 0 deletions flow_meter/arpplugin.h
Expand Up @@ -77,13 +77,15 @@ struct RecordExtARP : RecordExt {

virtual void fillUnirec(ur_template_t *tmplt, void *record)
{
#ifndef DISABLE_UNIREC
ur_set(tmplt, record, F_ARP_HA_FORMAT, ha_type);
ur_set(tmplt, record, F_ARP_PA_FORMAT, pa_type);
ur_set(tmplt, record, F_ARP_OPCODE, opcode);
ur_set_var(tmplt, record, F_ARP_SRC_HA, src_ha, ha_len);
ur_set_var(tmplt, record, F_ARP_SRC_PA, src_pa, pa_len);
ur_set_var(tmplt, record, F_ARP_DST_HA, dst_ha, ha_len);
ur_set_var(tmplt, record, F_ARP_DST_PA, dst_pa, pa_len);
#endif
}

virtual int fillIPFIX(uint8_t *buffer, int size)
Expand Down
2 changes: 2 additions & 0 deletions flow_meter/dnsplugin.h
Expand Up @@ -93,6 +93,7 @@ struct RecordExtDNS : RecordExt {

virtual void fillUnirec(ur_template_t *tmplt, void *record)
{
#ifndef DISABLE_UNIREC
ur_set(tmplt, record, F_DNS_ID, id);
ur_set(tmplt, record, F_DNS_ANSWERS, answers);
ur_set(tmplt, record, F_DNS_RCODE, rcode);
Expand All @@ -104,6 +105,7 @@ struct RecordExtDNS : RecordExt {
ur_set_var(tmplt, record, F_DNS_RDATA, data, rlength);
ur_set(tmplt, record, F_DNS_PSIZE, psize);
ur_set(tmplt, record, F_DNS_DO, dns_do);
#endif
}
virtual int fillIPFIX(uint8_t *buffer, int size)
{
Expand Down

0 comments on commit a5a55ed

Please sign in to comment.