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

core/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

gboolean is_my_address (const host_addr_t addr)
gboolean is_my_address_and_port (const host_addr_t addr, guint16 port)
void settings_early_init (void)
 Initializes "config_dir" and "home_dir".
gint settings_ensure_unicity (gboolean silent)
 Tries to ensure that the current process is the only running instance gtk-gnutella for the current value of GTK_GNUTELLA_DIR.
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.
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, enum net_type net)
 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,
enum net_type  net
 

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.

gboolean is_my_address const host_addr_t  addr  ) 
 

gboolean is_my_address_and_port const host_addr_t  addr,
guint16  port
 

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_close void   ) 
 

Finally free all memory allocated.

Call after settings_shutdown.

void settings_early_init void   ) 
 

Initializes "config_dir" and "home_dir".

gint settings_ensure_unicity gboolean  check_only  ) 
 

Tries to ensure that the current process is the only running instance gtk-gnutella for the current value of GTK_GNUTELLA_DIR.

Parameters:
check_only If TRUE, no warnings are emitted and a possibly created PID file is automagically removed.
Returns:
On success zero is returned, otherwise a non-zero is returned and errno is set.

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 Sat Jun 30 17:53:30 2007 for gtk-gnutella by  doxygen 1.3.9.1