implement searching of geoip2 database

- revise mapping of search terms to database types to match the
  GeoIP2 schemas.
- open GeoIP2 databases when starting up; close when shutting down.
- clarify the logged error message when an unknown database type
  is configured.
- add new geoip ACL subtypes to support searching for continent in
  country databases.
- map geoip ACL subtypes to specific MMDB database queries.
- perform MMDB lookups based on subtype, saving state between
  queries so repeated lookups for the same address aren't necessary.
This commit is contained in:
Evan Hunt
2019-06-11 20:32:21 -07:00
parent fe46d5bc34
commit 6e0b93e5a0
9 changed files with 1016 additions and 108 deletions

View File

@@ -9,18 +9,15 @@
* information regarding copyright ownership.
*/
#ifndef _GEOIP_H
#define _GEOIP_H
#pragma once
#ifdef HAVE_GEOIP
#include <GeoIP.h>
#include <GeoIPCity.h>
#endif /* HAVE_GEOIP */
void named_geoip_init(void);
void named_geoip_load(char *dir);
#ifdef HAVE_GEOIP
extern dns_geoip_databases_t *named_g_geoip;
#endif /* HAVE_GEOIP */
#endif
void
named_geoip_init(void);
void
named_geoip_load(char *dir);
void
named_geoip_shutdown(void);