Load, parse and lookup IP addresses from a set of IP ranges defined by a list of addresses in CIDR (Classless Internet Domain Routing) format.
|
Data Structures |
struct | iprange_db |
struct | iprange_net |
| A CIDR network description. More...
|
Defines |
#define | IPRANGE_MARK 1 /**< Magic tagging of user values */ |
| Magic tagging of user values.
|
#define | IPRANGE_MAGIC 0x01b3a59e |
#define | IPAGESZ 256 |
Functions |
| RCSID ("$Id:iprange.c, v 1.9 2005/06/29 14:24:26 daichik Exp $") |
const gchar * | iprange_strerror (iprange_err_t errnum) |
void | iprange_free_nop (gpointer unused_value, gpointer unused_updata) |
| Null free callback, when values held in database are not pointers and we need to force insertion.
|
gpointer | iprange_clone_nop (gpointer value) |
| Identity clone callback, when values are not pointers and not meant to be freed.
|
gpointer | iprange_make (iprange_free_t freecb, iprange_clone_t clonecb) |
| Create a new IP range database.
|
void | iprange_free_each (gpointer db, gpointer udata) |
| Free values stored in the IP range database, then destroy database.
|
iprange_err_t | iprange_add_level1 (struct iprange_db *idb, guint32 net, guint bits, gpointer udata, gboolean force) |
| Add network in the level-1 page of the database.
|
iprange_err_t | iprange_add_level2 (struct iprange_db *idb, guint32 net, guint bits, gpointer *lvl2, gpointer udata, gboolean force) |
| Add network in the level-2 page of the database.
|
iprange_err_t | iprange_add_cidr_internal (gpointer db, guint32 net, guint bits, gpointer udata, gboolean force, gpointer cdata) |
| Add CIDR network to the database (common routine for both plain and forced database insertions).
|
iprange_err_t | iprange_add_cidr (gpointer db, guint32 net, guint bits, gpointer udata) |
| Add CIDR network to the database.
|
iprange_err_t | iprange_add_cidr_force (gpointer db, guint32 net, guint bits, gpointer udata, gpointer cdata) |
| Add CIDR network to the database, forcing entry if new range supersedes an older range.
|
gpointer | iprange_get (gpointer db, guint32 ip) |
| Retrieve value associated with an IP address, i.e.
|
void | iprange_get_stats (gpointer db, iprange_stats_t *stats) |
| Get statistics about the database.
|
Variables |
const gchar * | iprange_errstr [] |
| Error code stings.
|