Added JSON-C check for unit tests
This commit is contained in:
+5
-3
@@ -71,7 +71,11 @@ NDPI_API_VERSION=`echo $NDPI_API_VERSION | sed 's/^0*//'`
|
|||||||
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
|
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
|
||||||
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
|
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])
|
dnl> used by json-c
|
||||||
|
JSONC_INC=`pkg-config --cflags json-c`
|
||||||
|
CFLAGS="${CFLAGS} ${JSONC_INC}"
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h json.h])
|
||||||
|
|
||||||
ADDITIONAL_LIBS=
|
ADDITIONAL_LIBS=
|
||||||
PCAP_HOME=$HOME/PF_RING/userland
|
PCAP_HOME=$HOME/PF_RING/userland
|
||||||
@@ -196,8 +200,6 @@ AC_SUBST(NDPI_MAJOR)
|
|||||||
AC_SUBST(NDPI_MINOR)
|
AC_SUBST(NDPI_MINOR)
|
||||||
AC_SUBST(NDPI_PATCH)
|
AC_SUBST(NDPI_PATCH)
|
||||||
AC_SUBST(NDPI_VERSION_SHORT)
|
AC_SUBST(NDPI_VERSION_SHORT)
|
||||||
AC_SUBST(SVN_DATE)
|
|
||||||
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(ADDITIONAL_LIBS)
|
||||||
|
|||||||
+6
-2
@@ -52,17 +52,20 @@
|
|||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
|
|
||||||
#include "json.h"
|
|
||||||
|
|
||||||
#include "ndpi_config.h"
|
#include "ndpi_config.h"
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_JSON_H
|
||||||
|
#include "json.h" /* JSON-C */
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct ndpi_detection_module_struct *ndpi_info_mod = NULL;
|
static struct ndpi_detection_module_struct *ndpi_info_mod = NULL;
|
||||||
static int verbose = 0;
|
static int verbose = 0;
|
||||||
|
|
||||||
/* *********************************************** */
|
/* *********************************************** */
|
||||||
|
|
||||||
int serializerUnitTest() {
|
int serializerUnitTest() {
|
||||||
|
#ifdef HAVE_JSON_H
|
||||||
ndpi_serializer serializer, deserializer;
|
ndpi_serializer serializer, deserializer;
|
||||||
int i, loop_id;
|
int i, loop_id;
|
||||||
u_int8_t verbose = 0;
|
u_int8_t verbose = 0;
|
||||||
@@ -220,6 +223,7 @@ int serializerUnitTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("%s OK\n", __FUNCTION__);
|
printf("%s OK\n", __FUNCTION__);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user