aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.seed10
-rw-r--r--src/include/ndpi_api.h.in (renamed from src/include/ndpi_api.h)4
-rw-r--r--src/lib/ndpi_main.c2
3 files changed, 12 insertions, 4 deletions
diff --git a/configure.seed b/configure.seed
index ead7f7a0f..6fbe687cf 100644
--- a/configure.seed
+++ b/configure.seed
@@ -40,9 +40,15 @@ if test -d ".git"; then :
#
GIT_NUM=`git log --pretty=oneline | wc -l | tr -d '[[:space:]]'`
GIT_RELEASE="${PACKAGE_VERSION}-${GIT_NUM}-${GIT_TAG}"
+
+ A=`git log src/include/ndpi_typedefs.h|wc -l`
+ B=`git log src/include/ndpi_protocol_ids.h|wc -l`
+ C=`git log src/include/ndpi_api.h.in|wc -l`
+ NDPI_API_VERSION=$((A+B+C))
else
GIT_RELEASE="${PACKAGE_VERSION}"
GIT_DATE=`date -u -r CHANGELOG.md`
+ NDPI_API_VERSION=`date +%s`
fi
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
@@ -179,7 +185,8 @@ if test "${with_pcre+set}" = set; then :
fi
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 src/include/ndpi_api.h])
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
AC_SUBST(GIT_RELEASE)
AC_SUBST(NDPI_MAJOR)
@@ -195,4 +202,5 @@ AC_SUBST(DL_LIB)
AC_SUBST(DPDK_TARGET)
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
AC_SUBST(CUSTOM_NDPI)
+AC_SUBST(NDPI_API_VERSION)
AC_OUTPUT
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h.in
index 5028f111b..75a1bb5e2 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h.in
@@ -34,7 +34,7 @@ extern "C" {
/* The #define below is used for apps that dynamically link with nDPI to make
sure that datastructures and in sync across versions
*/
-#define NDPI_API_VERSION 1
+#define NDPI_API_VERSION @NDPI_API_VERSION@
#define SIZEOF_ID_STRUCT ( sizeof(struct ndpi_id_struct) )
#define SIZEOF_FLOW_STRUCT ( sizeof(struct ndpi_flow_struct) )
@@ -852,7 +852,7 @@ extern "C" {
//void * ndpi_malloc(size_t size);
//void * ndpi_calloc(unsigned long count, size_t size);
//void ndpi_free(void *ptr);
- u_int8_t ndpi_get_api_version(void);
+ int ndpi_get_api_version(void);
/* https://github.com/corelight/community-id-spec */
int ndpi_flowv4_flow_hash(u_int8_t l4_proto, u_int32_t src_ip, u_int32_t dst_ip, u_int16_t src_port, u_int16_t dst_port,
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index e6d7385e5..8a24e506d 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -6544,7 +6544,7 @@ void NDPI_DUMP_BITMASK(NDPI_PROTOCOL_BITMASK a) {
}
#endif
-u_int8_t ndpi_get_api_version() {
+int ndpi_get_api_version() {
return(NDPI_API_VERSION);
}