#include "common.h"
#include "geo_ip.h"
#include "settings.h"
#include "lib/file.h"
#include "lib/misc.h"
#include "lib/glib-missing.h"
#include "lib/iprange.h"
#include "lib/iso3166.h"
#include "lib/walloc.h"
#include "lib/watcher.h"
#include "if/gnet_property_priv.h"
#include "if/bridge/c2ui.h"
#include "lib/override.h"
Data Structures | |
struct | range_context |
Context used during ip_range_split() calls. More... | |
Functions | |
RCSID ("$Id:geo_ip.c, v 1.25 2005/12/17 10:32:06 cbiere Exp $") | |
void | gip_add_cidr (guint32 ip, guint bits, gpointer udata) |
ip_range_split() callback. | |
gint | gip_load (FILE *f) |
Load geographic IP data from the supplied FILE. | |
void | gip_changed (const gchar *filename, gpointer unused) |
Watcher callback, invoked when the file from which we read the geographic IP mappings changed. | |
void | gip_retrieve (void) |
Loads the geo-ip.txt into memory. | |
void | gip_init (void) |
Called on startup. | |
void | gip_close (void) |
Frees all entries in the hostiles. | |
gint | gip_country (const host_addr_t ha) |
Retrieves the country an address is assigned to. | |
Variables | |
const gchar | gip_file [] = "geo-ip.txt" |
const gchar | gip_what [] = "Geographic IP mappings" |
gpointer | geo_db |
The database of bogus CIDR ranges. |
|
ip_range_split() callback. Insert IP range in database, linking it to the proper country code. |
|
Watcher callback, invoked when the file from which we read the geographic IP mappings changed.
|
|
Frees all entries in the hostiles.
|
|
Retrieves the country an address is assigned to.
|
|
Called on startup. Loads the bogons.txt into memory. |
|
Load geographic IP data from the supplied FILE.
|
|
Loads the geo-ip.txt into memory. Choosing the first file we find among the several places we look at, typically:
The selected file will then be monitored and a reloading will occur shortly after a modification. |
|
|
|
The database of bogus CIDR ranges.
|
|
|
|
|