Commit 17d8c5de authored by Mark Karpilovskij's avatar Mark Karpilovskij

geoip: initial commit

parent 4d34c15e
......@@ -144,6 +144,7 @@ src/knot/journal/serialization.h
src/knot/modules/cookies/cookies.c
src/knot/modules/dnsproxy/dnsproxy.c
src/knot/modules/dnstap/dnstap.c
src/knot/modules/geoip/geoip.c
src/knot/modules/noudp/noudp.c
src/knot/modules/onlinesign/nsec_next.c
src/knot/modules/onlinesign/nsec_next.h
......
......@@ -306,6 +306,7 @@ doc_modules=""
KNOT_MODULE([cookies], "yes")
KNOT_MODULE([dnsproxy], "yes", "non-shareable")
KNOT_MODULE([dnstap], "no")
KNOT_MODULE([geoip], "yes")
KNOT_MODULE([noudp], "yes")
KNOT_MODULE([onlinesign], "yes", "non-shareable")
KNOT_MODULE([rrl], "yes")
......@@ -344,6 +345,41 @@ AM_CONDITIONAL([HAVE_DNSTAP], test "$enable_dnstap" != "no")
AM_CONDITIONAL([HAVE_LIBDNSTAP], test "$enable_dnstap" != "no" -o \
"$STATIC_MODULE_dnstap" != "no" -o \
"$SHARED_MODULE_dnstap" != "no")
# MaxMind DB for the GeoIP module
AC_ARG_ENABLE([maxminddb],
AS_HELP_STRING([--enable-maxminddb=auto|yes|no], [enable MaxMind DB [default=auto]]),
[enable_maxminddb="$enableval"], [enable_maxminddb=auto])
AS_IF([test "$enable_daemon" = "no"],[enable_maxminddb=no])
AS_CASE([$enable_maxminddb],
[no],[],
[auto],[PKG_CHECK_MODULES([libmaxminddb], [libmaxminddb], [enable_maxminddb=yes], [enable_maxminddb=no])],
[yes], [PKG_CHECK_MODULES([libmaxminddb], [libmaxminddb])],
[*],[
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
AS_IF([test "$enable_maxminddb" != ""],[
LIBS="$LIBS -L$enable_maxminddb"
CFLAGS="$CFLAGS -I$enable_maxminddb/include"
])
AC_SEARCH_LIBS([MMDB_open], [maxminddb], [
AS_IF([test "$enable_maxminddb" != ""], [
libmaxminddb_CFLAGS="-I$enable_maxminddb/include"
libmaxminddb_LIBS="-L$enable_maxminddb -lmaxminddb"
],[
libmaxminddb_CFLAGS=""
libmaxminddb_LIBS="$ac_cv_search_MMDB_open"
])
],[AC_MSG_ERROR("not found in `$enable_maxminddb'")])
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
AC_SUBST([libmaxminddb_CFLAGS])
AC_SUBST([libmaxminddb_LIBS])
enable_maxminddb=yes
])
AS_IF([test "$enable_maxminddb" = yes], [AC_DEFINE([HAVE_MAXMINDDB], [1], [Define to 1 to enable MaxMind DB.])])
AM_CONDITIONAL([HAVE_MAXMINDDB], [test "$enable_maxminddb" = yes])
dnl Check for LMDB
lmdb_MIN_VERSION_MAJOR=0
......@@ -582,6 +618,7 @@ result_msg_base=" Knot DNS $VERSION
Fast zone parser: ${enable_fastparser}
Utilities with IDN: ${with_libidn}
Utilities with Dnstap: ${enable_dnstap}
MaxMind DB support: ${enable_maxminddb}
Systemd integration: ${enable_systemd}
PKCS #11 support: ${enable_pkcs11}
Ed25519 support: ${enable_ed25519}
......
......@@ -188,6 +188,7 @@ pkglib_LTLIBRARIES =
include $(srcdir)/knot/modules/cookies/Makefile.inc
include $(srcdir)/knot/modules/dnsproxy/Makefile.inc
include $(srcdir)/knot/modules/dnstap/Makefile.inc
include $(srcdir)/knot/modules/geoip/Makefile.inc
include $(srcdir)/knot/modules/noudp/Makefile.inc
include $(srcdir)/knot/modules/onlinesign/Makefile.inc
include $(srcdir)/knot/modules/rrl/Makefile.inc
......
knot_modules_geoip_la_SOURCES = knot/modules/geoip/geoip.c
EXTRA_DIST += knot/modules/geoip/geoip.rst
if STATIC_MODULE_geoip
libknotd_la_SOURCES += $(knot_modules_geoip_la_SOURCES)
libknotd_la_CPPFLAGS += $(libmaxminddb_CFLAGS)
libknotd_la_LIBADD += $(libmaxminddb_LIBS)
endif
if SHARED_MODULE_geoip
knot_modules_geoip_la_LDFLAGS = $(KNOTD_MOD_LDFLAGS)
knot_modules_geoip_la_CPPFLAGS = $(KNOTD_MOD_CPPFLAGS)
pkglib_LTLIBRARIES += knot/modules/geoip.la
endif
This diff is collapsed.
.. _mod-geoip:
``geoip`` —
=========================
Example
-------
Module reference
----------------
::
mod-geoip:
.. _mod-geoip_id:
id
..
A module identifier.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment