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

settings.h File Reference


Detailed Description

Gtk-Gnutella configuration.

Author:
Raphael Manfredi

Richard Eckart

Date:
2001-2003

#include "common.h"
#include "if/core/settings.h"
#include "lib/host_addr.h"

Go to the source code of this file.

Functions

host_addr_t listen_addr (void)
void settings_init (void)
void settings_save_if_dirty (void)
 Save settings if dirty.

void settings_shutdown (void)
 Called at exit time to flush the property files.

void settings_addr_changed (const host_addr_t new_addr, const host_addr_t peer)
 This routine is called when we determined that our IP was no longer the one we computed.

guint32 settings_max_msg_size (void)
 Maximum message payload size we are configured to handle.

void settings_close (void)
 Finally free all memory allocated.

void settings_ask_for_property (const gchar *name, const gchar *value) G_GNUC_NORETURN
 Ask them to set a property to be able to run.

guint32 get_average_servent_uptime (time_t now)
 Compute the EMA of the averate servent uptime, up to now, but do not update the property.

guint32 get_average_ip_lifetime (time_t now)
 Compute the EMA of the IP address lifetime up to now, but do not update the property.


Variables

in_addr * local_netmasks
 Global Data.


Function Documentation

guint32 get_average_ip_lifetime time_t  now  ) 
 

Compute the EMA of the IP address lifetime up to now, but do not update the property.

guint32 get_average_servent_uptime time_t  now  ) 
 

Compute the EMA of the averate servent uptime, up to now, but do not update the property.

host_addr_t listen_addr void   ) 
 

Returns:
the currently used local listening address.

void settings_addr_changed const host_addr_t  new_addr,
const host_addr_t  peer
 

This routine is called when we determined that our IP was no longer the one we computed.

We base this on some headers sent back when we handshake with other nodes, and as a result, cannot trust the information.

What we do henceforth is trust 3 successive indication that our IP changed, provided we get the same information each time.

--RAM, 13/01/2002

Parameters:
`new_addr' the newly suggested address.
`peer' the IP address of peer which reported the new IP address.
There must be 3 peers from 3 different /16 networks before a change is accepted. Otherwise, it would be very easy to confuse GTKG by connecting 3 times in a row and submitting a *wrong* IP address.

--cbiere, 2004-08-01

void settings_ask_for_property const gchar *  name,
const gchar *  value
 

Ask them to set a property to be able to run.

void settings_close void   ) 
 

Finally free all memory allocated.

Call after settings_shutdown.

void settings_init void   ) 
 

guint32 settings_max_msg_size void   ) 
 

Maximum message payload size we are configured to handle.

void settings_save_if_dirty void   ) 
 

Save settings if dirty.

void settings_shutdown void   ) 
 

Called at exit time to flush the property files.


Variable Documentation

struct in_addr* local_netmasks
 

Global Data.


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