run_server(isc_task_t *task, isc_event_t *event) {
isc_result_t result;
named_server_t *server = (named_server_t *)event->ev_arg;
+ dns_geoip_databases_t *geoip;
INSIST(task == server->task);
dns_dispatchmgr_setstats(named_g_dispatchmgr, server->resolverstats);
+#if defined(HAVE_GEOIP) || defined(HAVE_GEOIP2)
+ geoip = named_g_geoip;
+#else
+ geoip = NULL;
+#endif
+
CHECKFATAL(ns_interfacemgr_create(named_g_mctx, server->sctx,
named_g_taskmgr, named_g_timermgr,
named_g_socketmgr,
named_g_dispatchmgr,
- server->task, named_g_udpdisp,
-#if defined(HAVE_GEOIP) || defined(HAVE_GEOIP2)
- named_g_geoip,
-#else
- NULL,
-#endif
+ server->task, named_g_udpdisp, geoip,
&server->interfacemgr),
"creating interface manager");
***** Module Info
*****/
-/*! \file dns/acl.h
+/*! \file dns/geoip.h
* \brief
- * Address match list handling.
+ * GeoIP/GeoIP2 data types and function prototypes.
*/
+#if defined(HAVE_GEOIP) || defined(HAVE_GEOIP2)
+
/***
*** Imports
***/
};
} dns_geoip_elem_t;
-typedef struct dns_geoip_databases {
-#if defined(HAVE_GEOIP2)
+struct dns_geoip_databases {
+#ifdef HAVE_GEOIP2
void *country; /* GeoIP2-Country or GeoLite2-Country */
void *city; /* GeoIP2-CIty or GeoLite2-City */
void *domain; /* GeoIP2-Domain */
void *as; /* GeoIP2-ASN or GeoLite2-ASN */
#define DNS_GEOIP_DATABASE_INIT \
{ NULL, NULL, NULL, NULL, NULL }
-#elif defined(HAVE_GEOIP)
- void *country_v4; /* DB 1 */
- void *city_v4; /* DB 2 or 6 */
- void *region; /* DB 3 or 7 */
- void *isp; /* DB 4 */
- void *org; /* DB 5 */
- void *as; /* DB 9 */
- void *netspeed; /* DB 10 */
- void *domain; /* DB 11 */
- void *country_v6; /* DB 12 */
- void *city_v6; /* DB 30 or 31 */
+#else /* HAVE_GEOIP */
+ void *country_v4; /* GeoIP DB 1 */
+ void *city_v4; /* GeoIP DB 2 or 6 */
+ void *region; /* GeoIP DB 3 or 7 */
+ void *isp; /* GeoIP DB 4 */
+ void *org; /* GeoIP DB 5 */
+ void *as; /* GeoIP DB 9 */
+ void *netspeed; /* GeoIP DB 10 */
+ void *domain; /* GeoIP DB 11 */
+ void *country_v6; /* GeoIP DB 12 */
+ void *city_v6; /* GeoIP DB 30 or 31 */
#define DNS_GEOIP_DATABASE_INIT \
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-#endif
-} dns_geoip_databases_t;
+#endif /* HAVE_GEOIP */
+};
/***
*** Functions
dns_geoip_shutdown(void);
ISC_LANG_ENDDECLS
+
+#endif /* HAVE_GEOIP | HAVE_GEOIP2 */
+
#endif /* DNS_GEOIP_H */