Merge branch 'dev' of https://github.com/ntop/nDPI into dev-unstable
This commit is contained in:
@@ -41,6 +41,7 @@ AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
|
|||||||
|
|
||||||
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
|
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
|
||||||
|
|
||||||
|
ADDITIONAL_LIBS=
|
||||||
PCAP_HOME=$HOME/PF_RING/userland
|
PCAP_HOME=$HOME/PF_RING/userland
|
||||||
|
|
||||||
DPDK_TARGET=
|
DPDK_TARGET=
|
||||||
@@ -161,6 +162,9 @@ AM_CONDITIONAL([HAS_FUZZLDFLAGS], [test "x$has_sanitizefuzzer" = "xyes"])
|
|||||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
||||||
|
|
||||||
AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE_UNQUOTED(HAVE_PCRE, 1, [libpcre(-dev) is present]))
|
AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE_UNQUOTED(HAVE_PCRE, 1, [libpcre(-dev) is present]))
|
||||||
|
if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then :
|
||||||
|
ADDITIONAL_LIBS=-lpcre
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile fuzz/Makefile])
|
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile fuzz/Makefile])
|
||||||
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
||||||
@@ -173,6 +177,7 @@ AC_SUBST(SVN_DATE)
|
|||||||
AC_SUBST(JSON_C_LIB)
|
AC_SUBST(JSON_C_LIB)
|
||||||
AC_SUBST(PCAP_INC)
|
AC_SUBST(PCAP_INC)
|
||||||
AC_SUBST(PCAP_LIB)
|
AC_SUBST(PCAP_LIB)
|
||||||
|
AC_SUBST(ADDITIONAL_LIBS)
|
||||||
AC_SUBST(DL_LIB)
|
AC_SUBST(DL_LIB)
|
||||||
AC_SUBST(DPDK_TARGET)
|
AC_SUBST(DPDK_TARGET)
|
||||||
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ CXX=@CXX@
|
|||||||
SRCHOME=../src
|
SRCHOME=../src
|
||||||
CFLAGS=-g -I$(SRCHOME)/include @CFLAGS@
|
CFLAGS=-g -I$(SRCHOME)/include @CFLAGS@
|
||||||
LIBNDPI=$(SRCHOME)/lib/libndpi.a
|
LIBNDPI=$(SRCHOME)/lib/libndpi.a
|
||||||
LDFLAGS=$(LIBNDPI) @PCAP_LIB@ -lpthread -lm @LDFLAGS@
|
LDFLAGS=$(LIBNDPI) @PCAP_LIB@ @ADDITIONAL_LIBS@ -lpthread -lm @LDFLAGS@
|
||||||
HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)/include/ndpi_api.h \
|
HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)/include/ndpi_api.h \
|
||||||
$(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h
|
$(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h
|
||||||
OBJS=ndpiReader.o reader_util.o intrusion_detection.o
|
OBJS=ndpiReader.o reader_util.o intrusion_detection.o
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ static int ndpi_community_id_peer_v6_is_less_than(struct ndpi_in6_addr *ip1, str
|
|||||||
/* **************************************************** */
|
/* **************************************************** */
|
||||||
|
|
||||||
static void ndpi_community_id_sha1_hash(const uint8_t *message, size_t len, u_char *hash /* 20-bytes */) {
|
static void ndpi_community_id_sha1_hash(const uint8_t *message, size_t len, u_char *hash /* 20-bytes */) {
|
||||||
SHA1_CTX ctx = { 0 };
|
SHA1_CTX ctx;
|
||||||
SHA1Init(&ctx);
|
SHA1Init(&ctx);
|
||||||
SHA1Update(&ctx, message, len);
|
SHA1Update(&ctx, message, len);
|
||||||
SHA1Final(hash, &ctx);
|
SHA1Final(hash, &ctx);
|
||||||
@@ -217,7 +217,7 @@ static int ndpi_community_id_finalize_and_compute_hash(u_int8_t *comm_buf, u_int
|
|||||||
if (community_id == NULL)
|
if (community_id == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if 1 /* Debug Info */
|
#if 0 /* Debug Info */
|
||||||
printf("Hex output: ");
|
printf("Hex output: ");
|
||||||
for(int i = 0; i < off; i++)
|
for(int i = 0; i < off; i++)
|
||||||
printf("%.2x ", comm_buf[i]);
|
printf("%.2x ", comm_buf[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user