Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

bogons.c File Reference


Detailed Description

Support for IP bogons detection.

Author:
Raphael Manfredi
Date:
2004

#include "common.h"
#include "bogons.h"
#include "settings.h"
#include "lib/file.h"
#include "lib/misc.h"
#include "lib/glib-missing.h"
#include "lib/iprange.h"
#include "lib/walloc.h"
#include "lib/watcher.h"
#include "if/gnet_property_priv.h"
#include "if/bridge/c2ui.h"
#include "lib/override.h"

Functions

gint bogons_load (FILE *f)
 Load bogons data from the supplied FILE.
void bogons_changed (const gchar *filename, gpointer unused_udata)
 Watcher callback, invoked when the file from which we read the bogus addresses changed.
void bogons_retrieve (void)
 Loads the bogons.txt into memory.
void bogons_init (void)
 Called on startup.
void bogons_close (void)
 Frees all entries in the hostiles.
gboolean bogons_check (const host_addr_t ha)
 Check the given IP against the entries in the bogus IP database.

Variables

const gchar bogon [] = "bogon"
const gchar bogons_file [] = "bogons.txt"
const gchar bogons_what [] = "Bogus IP addresses"
iprange_dbbogons_db
 The database of bogus CIDR ranges.


Function Documentation

void bogons_changed const gchar *  filename,
gpointer  unused_udata
[static]
 

Watcher callback, invoked when the file from which we read the bogus addresses changed.

gboolean bogons_check const host_addr_t  ha  ) 
 

Check the given IP against the entries in the bogus IP database.

Returns:
TRUE if found, and FALSE if not.

void bogons_close void   ) 
 

Frees all entries in the hostiles.

void bogons_init void   ) 
 

Called on startup.

Loads the bogons.txt into memory.

gint bogons_load FILE *  f  )  [static]
 

Load bogons data from the supplied FILE.

Returns:
the amount of entries loaded.

void bogons_retrieve void   )  [static]
 

Loads the bogons.txt into memory.

Choosing the first file we find among the several places we look at, typically:

  1. ~/.gtk-gnutella/bogons.txt
  2. /usr/share/gtk-gnutella/bogons.txt
  3. PACKAGE_EXTRA_SOURCE_DIR/bogons.txt

The selected file will then be monitored and a reloading will occur shortly after a modification.


Variable Documentation

const gchar bogon[] = "bogon" [static]
 

struct iprange_db* bogons_db [static]
 

The database of bogus CIDR ranges.

const gchar bogons_file[] = "bogons.txt" [static]
 

const gchar bogons_what[] = "Bogus IP addresses" [static]
 


Generated on Sat Jun 30 17:53:25 2007 for gtk-gnutella by  doxygen 1.3.9.1