Initial geoip support
This commit is contained in:
+10
-1
@@ -218,7 +218,16 @@ if test "${with_pcre+set}" = set; then :
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl> TCP segments management (buffer, sort and reassembly the segments)
|
dnl> GeoIP
|
||||||
|
AC_CHECK_LIB([maxminddb], [MMDB_lookup_sockaddr])
|
||||||
|
AC_HAVE_HEADERS(maxminddb.h)
|
||||||
|
if test ".${ac_cv_lib_maxminddb_MMDB_lookup_sockaddr}" = ".yes" &&
|
||||||
|
test ".${ac_cv_header_maxminddb_h}" = ".yes"; then
|
||||||
|
ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lmaxminddb"
|
||||||
|
AC_DEFINE_UNQUOTED(HAVE_MAXMINDDB, 1, [MaxMind DB support])
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl> TCP segments management (buffer, sort and reassembly the segments)
|
||||||
dnl> FRAG_MAN_ENABLED=1
|
dnl> FRAG_MAN_ENABLED=1
|
||||||
dnl> AC_DEFINE_UNQUOTED(FRAG_MAN, ${FRAG_MAN_ENABLED}, [Enable the TCP segments fragmentation management])
|
dnl> AC_DEFINE_UNQUOTED(FRAG_MAN, ${FRAG_MAN_ENABLED}, [Enable the TCP segments fragmentation management])
|
||||||
|
|
||||||
|
|||||||
Vendored
+1600
-2
File diff suppressed because it is too large
Load Diff
@@ -39,10 +39,18 @@ if test "$CENTOS_RELEASE" -ne 8; then
|
|||||||
RPM_SIGN_CMD="./rpm-sign.exp"
|
RPM_SIGN_CMD="./rpm-sign.exp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_LIB([maxminddb], [MMDB_lookup_sockaddr])
|
||||||
|
AC_HAVE_HEADERS(maxminddb.h)
|
||||||
|
if test ".${ac_cv_lib_maxminddb_MMDB_lookup_sockaddr}" = ".yes" &&
|
||||||
|
test ".${ac_cv_header_maxminddb_h}" = ".yes"; then
|
||||||
|
GEOIP_DEP="libmaxminddb"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile ndpi.spec])
|
AC_CONFIG_FILES([Makefile ndpi.spec])
|
||||||
|
|
||||||
AC_SUBST(PACKAGE_VERSION)
|
AC_SUBST(PACKAGE_VERSION)
|
||||||
AC_SUBST(PLATFORM)
|
AC_SUBST(PLATFORM)
|
||||||
|
AC_SUBST(GEOIP_DEP)
|
||||||
AC_SUBST(MACHINE)
|
AC_SUBST(MACHINE)
|
||||||
AC_SUBST(EXTN)
|
AC_SUBST(EXTN)
|
||||||
AC_SUBST(DATE)
|
AC_SUBST(DATE)
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ URL: http://www.ntop.org/products/deep-packet-inspection/ndpi/
|
|||||||
Source: ndpi-%{version}.tgz
|
Source: ndpi-%{version}.tgz
|
||||||
Packager: Luca Deri <deri@ntop.org>
|
Packager: Luca Deri <deri@ntop.org>
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||||
%{?el7:Requires: glibc >= 2.3.4 numactl coreutils }
|
%{?el8:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||||
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils }
|
%{?el7:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||||
|
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||||
AutoReqProv: no
|
AutoReqProv: no
|
||||||
|
|
||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|||||||
Vendored
+1601
-15
File diff suppressed because it is too large
Load Diff
@@ -28,9 +28,17 @@ NDPI_VERS=`$(dirname "${0}")/../version.sh --release`
|
|||||||
MAJOR_RELEASE=`$(dirname "${0}")/../version.sh --major-release`
|
MAJOR_RELEASE=`$(dirname "${0}")/../version.sh --major-release`
|
||||||
GIT_REVISION=`$(dirname "${0}")/../version.sh --revision`
|
GIT_REVISION=`$(dirname "${0}")/../version.sh --revision`
|
||||||
|
|
||||||
|
AC_CHECK_LIB([maxminddb], [MMDB_lookup_sockaddr])
|
||||||
|
AC_HAVE_HEADERS(maxminddb.h)
|
||||||
|
if test ".${ac_cv_lib_maxminddb_MMDB_lookup_sockaddr}" = ".yes" &&
|
||||||
|
test ".${ac_cv_header_maxminddb_h}" = ".yes"; then
|
||||||
|
GEOIP_DEP="libmaxminddb"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile debian/changelog debian/files debian/control])
|
AC_CONFIG_FILES([Makefile debian/changelog debian/files debian/control])
|
||||||
|
|
||||||
AC_SUBST(NDPI_VERS)
|
AC_SUBST(NDPI_VERS)
|
||||||
|
AC_SUBST(GEOIP_DEP)
|
||||||
AC_SUBST(MACHINE)
|
AC_SUBST(MACHINE)
|
||||||
AC_SUBST(EXTN)
|
AC_SUBST(EXTN)
|
||||||
AC_SUBST(DATE)
|
AC_SUBST(DATE)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Build-Conflicts:
|
|||||||
|
|
||||||
Package: ndpi
|
Package: ndpi
|
||||||
Architecture: @EXTN@
|
Architecture: @EXTN@
|
||||||
Depends: libnuma1
|
Depends: libnuma1 @GEOIP_DEP@
|
||||||
Recommends:
|
Recommends:
|
||||||
Suggests:
|
Suggests:
|
||||||
Pre-Depends:
|
Pre-Depends:
|
||||||
|
|||||||
@@ -1465,6 +1465,12 @@ extern "C" {
|
|||||||
int ndpi_hash_find_entry(ndpi_str_hash *h, char *key, u_int key_len, u_int8_t *value);
|
int ndpi_hash_find_entry(ndpi_str_hash *h, char *key, u_int key_len, u_int8_t *value);
|
||||||
int ndpi_hash_add_entry(ndpi_str_hash *h, char *key, u_int8_t key_len, u_int8_t value);
|
int ndpi_hash_add_entry(ndpi_str_hash *h, char *key, u_int8_t key_len, u_int8_t value);
|
||||||
|
|
||||||
|
/* ******************************* */
|
||||||
|
|
||||||
|
int ndpi_load_geeoip(struct ndpi_detection_module_struct *ndpi_str,
|
||||||
|
const char *ip_city_data, const char *ip_as_data);
|
||||||
|
int ndpi_free_geeoip(struct ndpi_detection_module_struct *ndpi_str);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -26,8 +26,12 @@
|
|||||||
|
|
||||||
#include "ndpi_define.h"
|
#include "ndpi_define.h"
|
||||||
#include "ndpi_protocol_ids.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_utils.h"
|
#include "ndpi_utils.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_MAXMINDDB
|
||||||
|
#include <maxminddb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* NDPI_LOG_LEVEL */
|
/* NDPI_LOG_LEVEL */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NDPI_LOG_ERROR,
|
NDPI_LOG_ERROR,
|
||||||
@@ -1153,6 +1157,11 @@ struct ndpi_detection_module_struct {
|
|||||||
#ifdef CUSTOM_NDPI_PROTOCOLS
|
#ifdef CUSTOM_NDPI_PROTOCOLS
|
||||||
#include "../../../nDPI-custom/custom_ndpi_typedefs.h"
|
#include "../../../nDPI-custom/custom_ndpi_typedefs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MAXMINDDB
|
||||||
|
MMDB_s mmdb_city, mmdb_as;
|
||||||
|
u_int8_t mmdb_city_loaded, mmdb_as_loaded;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* NDPI_LIB_COMPILATION */
|
#endif /* NDPI_LIB_COMPILATION */
|
||||||
|
|||||||
@@ -2449,6 +2449,8 @@ void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_str) {
|
|||||||
#include "../../../nDPI-custom/ndpi_exit_detection_module.c"
|
#include "../../../nDPI-custom/ndpi_exit_detection_module.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ndpi_free_geeoip(ndpi_str);
|
||||||
|
|
||||||
ndpi_free(ndpi_str);
|
ndpi_free(ndpi_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7123,3 +7125,5 @@ uint8_t ndpi_connection_tracking(struct ndpi_detection_module_struct *ndpi_str,
|
|||||||
|
|
||||||
return(rc);
|
return(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ******************************************************************** */
|
||||||
|
|||||||
Reference in New Issue
Block a user