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

References icd_iap::connection, icd_idle_timer_start(), icd_idle_timer_unset(), ILOG_DEBUG, ILOG_WARN, icd_iap::interface_name, and icd_policy_request::network_type.

Referenced by icd_idle_timer_gconf_changed().

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

References icd_iap_foreach(), and icd_idle_timer_foreach_iap().

Referenced by icd_idle_timer_init().

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

References icd_idle_timer_gconf_changed(), and icd_context::idle_timer_notify.

Referenced by main().

void icd_idle_timer_remove ( struct icd_context icd_ctx  ) 

Remove gconf idle timer notification

Parameters:
icd_ctx icd context

References icd_context::idle_timer_notify.

Referenced by main().

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

References icd_iap::connection, icd_idle_timer_start(), icd_iap::idletimer_id, ILOG_CRIT, ILOG_DEBUG, ILOG_WARN, icd_iap::interface_name, and icd_policy_request::network_type.

Referenced by icd_iap_has_connected().

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

References ILOG_ERR.

Referenced by icd_idle_timer_start().

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

References icd_idle_timer_set_rules(), icd_idle_timer_trigger(), icd_iap::idletimer_id, ILOG_ERR, ILOG_INFO, ILOG_WARN, and icd_iap::interface_name.

Referenced by icd_idle_timer_foreach_iap(), and icd_idle_timer_set().

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;

References icd_iap_disconnect(), icd_iap::idletimer_id, ILOG_DEBUG, and ILOG_INFO.

Referenced by icd_idle_timer_start().

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

References icd_idle_timer_unset_rules(), icd_iap::idletimer_id, ILOG_DEBUG, ILOG_ERR, and icd_iap::interface_name.

Referenced by icd_iap_disconnect(), and icd_idle_timer_foreach_iap().

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

References ILOG_ERR, and ILOG_INFO.

Referenced by icd_idle_timer_unset().


Generated on Thu Mar 11 09:04:50 2010 for ICd2 by  doxygen 1.5.6