mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-05-19 07:54:24 +00:00
Initial geoip support
This commit is contained in:
parent
a2c5adc374
commit
bce54079d8
10 changed files with 3251 additions and 22 deletions
|
|
@ -218,7 +218,16 @@ if test "${with_pcre+set}" = set; then :
|
|||
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> AC_DEFINE_UNQUOTED(FRAG_MAN, ${FRAG_MAN_ENABLED}, [Enable the TCP segments fragmentation management])
|
||||
|
||||
|
|
|
|||
1602
packages/rpm/configure
vendored
1602
packages/rpm/configure
vendored
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"
|
||||
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_SUBST(PACKAGE_VERSION)
|
||||
AC_SUBST(PLATFORM)
|
||||
AC_SUBST(GEOIP_DEP)
|
||||
AC_SUBST(MACHINE)
|
||||
AC_SUBST(EXTN)
|
||||
AC_SUBST(DATE)
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ URL: http://www.ntop.org/products/deep-packet-inspection/ndpi/
|
|||
Source: ndpi-%{version}.tgz
|
||||
Packager: Luca Deri <deri@ntop.org>
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||
%{?el7:Requires: glibc >= 2.3.4 numactl coreutils }
|
||||
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils }
|
||||
%{?el8:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||
%{?el7:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||
AutoReqProv: no
|
||||
|
||||
%define debug_package %{nil}
|
||||
|
|
|
|||
1616
packages/ubuntu/configure
vendored
1616
packages/ubuntu/configure
vendored
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`
|
||||
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_SUBST(NDPI_VERS)
|
||||
AC_SUBST(GEOIP_DEP)
|
||||
AC_SUBST(MACHINE)
|
||||
AC_SUBST(EXTN)
|
||||
AC_SUBST(DATE)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Build-Conflicts:
|
|||
|
||||
Package: ndpi
|
||||
Architecture: @EXTN@
|
||||
Depends: libnuma1
|
||||
Depends: libnuma1 @GEOIP_DEP@
|
||||
Recommends:
|
||||
Suggests:
|
||||
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_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
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -26,8 +26,12 @@
|
|||
|
||||
#include "ndpi_define.h"
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_utils.h"
|
||||
|
||||
#ifdef HAVE_MAXMINDDB
|
||||
#include <maxminddb.h>
|
||||
#endif
|
||||
|
||||
/* NDPI_LOG_LEVEL */
|
||||
typedef enum {
|
||||
NDPI_LOG_ERROR,
|
||||
|
|
@ -1153,6 +1157,11 @@ struct ndpi_detection_module_struct {
|
|||
#ifdef CUSTOM_NDPI_PROTOCOLS
|
||||
#include "../../../nDPI-custom/custom_ndpi_typedefs.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MAXMINDDB
|
||||
MMDB_s mmdb_city, mmdb_as;
|
||||
u_int8_t mmdb_city_loaded, mmdb_as_loaded;
|
||||
#endif
|
||||
};
|
||||
|
||||
#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"
|
||||
#endif
|
||||
|
||||
ndpi_free_geeoip(ndpi_str);
|
||||
|
||||
ndpi_free(ndpi_str);
|
||||
}
|
||||
}
|
||||
|
|
@ -7123,3 +7125,5 @@ uint8_t ndpi_connection_tracking(struct ndpi_detection_module_struct *ndpi_str,
|
|||
|
||||
return(rc);
|
||||
}
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue