Main Page | Modules | Alphabetical List | Data Structures | 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"

Defines

#define THERE   GUINT_TO_POINTER(0x2)

Functions

 RCSID ("$Id:bogons.c, v 1.19 2005/10/24 17:58:02 cbiere Exp $")
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 bogons_file [] = "bogons.txt"
const gchar bogons_what [] = "Bogus IP addresses"
gpointer bogons_db
 The database of bogus CIDR ranges.


Define Documentation

#define THERE   GUINT_TO_POINTER(0x2)
 


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.

RCSID "$Id:bogons.  c,
v 1.19 2005/10/24 17:58:02 cbiere Exp $" 
 


Variable Documentation

gpointer 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 Sun Feb 12 10:49:59 2006 for Gtk-Gnutella by doxygen 1.3.6