Iptables idle timer handling
[ICd internal functions]


Defines

#define ICD2_IDLE_TIMER_IPTABLES_PREFIX   "icd2-idle-"

Functions

static gboolean icd_idle_timer_unset_rules (const char *interface)
static gboolean icd_idle_timer_set_rules (const gchar *interface, const guint timeout)
static gboolean icd_idle_timer_trigger (GIOChannel *source, GIOCondition condition, gpointer user_data)
static gboolean icd_idle_timer_start (struct icd_iap *iap, guint timeout)
gboolean icd_idle_timer_set (struct icd_iap *iap)
gboolean icd_idle_timer_unset (struct icd_iap *iap)
static gboolean icd_idle_timer_foreach_iap (struct icd_iap *iap, gpointer user_data)
static void icd_idle_timer_gconf_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
gboolean icd_idle_timer_init (struct icd_context *icd_ctx)
void icd_idle_timer_remove (struct icd_context *icd_ctx)

Function Documentation

static gboolean icd_idle_timer_foreach_iap ( struct icd_iap iap,
gpointer  user_data 
) [static]

Go through each IAP and see if the changed idle timer entry applies to the type of this IAP

Parameters:
iap the IAP
user_data the changed GConfEntry
Returns:
TRUE to go through all IAPs

static void icd_idle_timer_gconf_changed ( GConfClient *  client,
guint  cnxn_id,
GConfEntry *  entry,
gpointer  user_data 
) [static]

Callback for GConf entry change

Parameters:
client GConf client
cnxn_id connection id
entry the changed GConfEntry
user_data user data

gboolean icd_idle_timer_init ( struct icd_context icd_ctx  ) 

Clear all OUTPUT chain rules and add notification function for idle timer gconf values

Returns:
TRUE on success, FALSE on failure

void icd_idle_timer_remove ( struct icd_context icd_ctx  ) 

Remove gconf idle timer notification

Parameters:
icd_ctx icd context

gboolean icd_idle_timer_set ( struct icd_iap iap  ) 

Set idle timer for IAP

Parameters:
iap the IAP
Returns:
TRUE on success, FALSE on failure

static gboolean icd_idle_timer_set_rules ( const gchar *  interface,
const guint  timeout 
) [static]

Set idletimer iptables rules

Parameters:
interface the interface name
timeout_str time in seconds to wait until interface is considered idle
Returns:
TRUE on success, FALSE on failure

static gboolean icd_idle_timer_start ( struct icd_iap iap,
guint  timeout 
) [static]

Start idle timer

Parameters:
iap the IAP
timeout timeout in seconds
Returns:
TRUE on successful starting of the idle timer; FALSE on error

static gboolean icd_idle_timer_trigger ( GIOChannel *  source,
GIOCondition  condition,
gpointer  user_data 
) [static]

Idle timer callback function called when the idle timer has triggered

Parameters:
source the GIOChannel event source
condition the condition which has been satisfied
data user data set in g_io_add_watch() or g_io_add_watch_full()
Returns:
FALSE;

gboolean icd_idle_timer_unset ( struct icd_iap iap  ) 

Unset idle timer for an IAP

Parameters:
iap the IAP
Returns:
TRUE on success, FALSE on failure

static gboolean icd_idle_timer_unset_rules ( const char *  interface  )  [static]

Unset idletimer iptables rules

Parameters:
interface the interface name
Returns:
TRUE on success, FALSE on failure


Generated on Tue Feb 24 16:21:36 2009 for ICd2 by  doxygen 1.5.1