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

whitelist.c File Reference


Detailed Description

Needs brief description here.

Functions for keeping a whitelist of nodes we always allow in, and whom we try to keep a connection to.

Author:
Vidar Madsen
Date:
2002

#include "common.h"
#include "whitelist.h"
#include "settings.h"
#include "nodes.h"
#include "lib/file.h"
#include "lib/glib-missing.h"
#include "lib/tm.h"
#include "lib/walloc.h"
#include "lib/override.h"

Functions

 RCSID ("$Id:whitelist.c, v 1.14 2005/09/10 08:17:29 daichik Exp $")
void whitelist_retrieve (void)
 Loads the whitelist into memory.

guint whitelist_connect (void)
 Attempts to connect to the nodes we have whitelisted.

void whitelist_init (void)
 Called on startup.

void whitelist_close (void)
 Frees all entries in the whitelist.

void whitelist_reload (void)
 Reloads the whitelist.

gboolean whitelist_check (const host_addr_t ha)
 Check the given IP agains the entries in the whitelist.


Variables

GSList * sl_whitelist = NULL
const gchar whitelist_file [] = "whitelist"
time_t whitelist_mtime
time_t whitelist_checked
gchar * whitelist_path = NULL


Function Documentation

RCSID "$Id:whitelist.  c,
v 1.14 2005/09/10 08:17:29 daichik Exp $" 
 

gboolean whitelist_check const host_addr_t  ha  ) 
 

Check the given IP agains the entries in the whitelist.

Also, it will periodically check the whitelist file for updates, and reload it if it has changed.

Parameters:
ha the host address to check.
Returns:
TRUE if found, and FALSE if not.

void whitelist_close void   ) 
 

Frees all entries in the whitelist.

guint whitelist_connect void   ) 
 

Attempts to connect to the nodes we have whitelisted.

Only entries with a specified port will be tried.

Returns:
the number of new nodes that are connected to.

void whitelist_init void   ) 
 

Called on startup.

Loads the whitelist into memory.

void whitelist_reload void   ) 
 

Reloads the whitelist.

void whitelist_retrieve void   )  [static]
 

Loads the whitelist into memory.


Variable Documentation

GSList* sl_whitelist = NULL [static]
 

time_t whitelist_checked [static]
 

const gchar whitelist_file[] = "whitelist" [static]
 

time_t whitelist_mtime [static]
 

gchar* whitelist_path = NULL [static]
 


Generated on Sun Feb 12 10:50:10 2006 for Gtk-Gnutella by doxygen 1.3.6