IAP connection abstraction
[ICd internal functions]


Classes

struct  icd_iap_disconnect_data
struct  icd_iap_env
struct  icd_iap

Typedefs

typedef void(* icd_iap_request_cb_fn )(enum icd_iap_status status, struct icd_iap *iap, gpointer user_data)
typedef gboolean(* icd_iap_foreach_fn )(struct icd_iap *iap, gpointer user_data)

Enumerations

enum  icd_iap_state {
  ICD_IAP_STATE_DISCONNECTED = 0, ICD_IAP_STATE_SCRIPT_PRE_UP, ICD_IAP_STATE_LINK_UP, ICD_IAP_STATE_LINK_POST_UP,
  ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_SRV_UP, ICD_IAP_STATE_SCRIPT_POST_UP, ICD_IAP_STATE_SAVING,
  ICD_IAP_STATE_CONNECTED, ICD_IAP_STATE_CONNECTED_DOWN, ICD_IAP_STATE_SRV_DOWN, ICD_IAP_STATE_IP_DOWN,
  ICD_IAP_STATE_IP_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_PRE_DOWN, ICD_IAP_STATE_LINK_PRE_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_DOWN,
  ICD_IAP_STATE_LINK_RESTART_SCRIPTS, ICD_IAP_STATE_SCRIPT_POST_DOWN, ICD_IAP_MAX_STATES
}
enum  icd_iap_status { ICD_IAP_CREATED = 0, ICD_IAP_DISCONNECTED, ICD_IAP_BUSY, ICD_IAP_FAILED }

Functions

static void icd_iap_srv_disconnect_cb (enum icd_srv_status status, gpointer disconnect_cb_token)
static void icd_iap_module_next (struct icd_iap *iap)
static void icd_iap_disconnect_module (struct icd_iap *iap)
static void icd_iap_run_pre_up_scripts (struct icd_iap *iap)
static void icd_iap_run_post_down_scripts (struct icd_iap *iap)
static gboolean icd_iap_run_renew (struct icd_iap *iap)
static gboolean string_equal (const gchar *a, const gchar *b)
void icd_iap_free (struct icd_iap *iap)
struct icd_iapicd_iap_new (void)
gboolean icd_iap_id_create (struct icd_iap *iap, const gchar *new_id)
static struct icd_network_moduleicd_iap_next_ip_up_module (struct icd_iap *iap)
static struct icd_network_moduleicd_iap_next_link_post_up_module (struct icd_iap *iap)
static struct icd_network_moduleicd_iap_next_link_up_module (struct icd_iap *iap)
static void icd_iap_modules_reset (struct icd_iap *iap)
static void icd_iap_do_callback (enum icd_iap_status status, struct icd_iap *iap)
static void icd_iap_disconnect_cb (const enum icd_nw_status status, const gpointer cb_token)
static gboolean icd_iap_run_restart (struct icd_iap *iap)
static void icd_iap_post_down_script_done (const pid_t pid, const gint exit_value, gpointer user_data)
static void icd_iap_up_callback (const enum icd_nw_status status, const gchar *err_str, const gpointer cb_token)
static void icd_iap_link_up_cb (const enum icd_nw_status status, const gchar *err_str, const gchar *interface_name, const gpointer link_up_cb_token,...)
static void icd_iap_link_post_up_cb (const enum icd_nw_status status, const gchar *err_str, const gpointer link_post_up_cb_token,...)
static void icd_iap_ip_up_cb (const enum icd_nw_status status, const gchar *err_str, const gpointer ip_up_cb_token,...)
static void icd_iap_srv_connect_cb (enum icd_srv_status status, const gchar *err_str, gpointer user_data)
static void icd_iap_has_connected (struct icd_iap *iap)
static void icd_iap_save_cb (gboolean success, gpointer user_data)
static void icd_iap_post_up_script_done (const pid_t pid, const gint exit_value, gpointer user_data)
static void icd_iap_pre_up_script_done (const pid_t pid, const gint exit_value, gpointer user_data)
void icd_iap_connect (struct icd_iap *iap, icd_iap_request_cb_fn request_cb, gpointer user_data)
static void icd_iap_pre_down_script_done (const pid_t pid, const gint exit_value, gpointer user_data)
static gboolean icd_iap_check_connected (struct icd_iap *iap, gpointer user_data)
static void icd_iap_script_pre_down (const enum icd_nw_status status, const gpointer cb_token)
void icd_iap_disconnect (struct icd_iap *iap, const gchar *err_str)
static void icd_iap_run_renew_cb (enum icd_nw_renew_status status, gpointer renew_token)
void icd_iap_renew (struct icd_iap *iap, enum icd_nw_layer renew_layer)
void icd_iap_restart (struct icd_iap *iap, enum icd_nw_layer restart_layer)
guint icd_iap_get_ipinfo (struct icd_iap *iap, icd_nw_ip_addr_info_cb_fn cb, gpointer user_data)
gboolean icd_iap_get_ip_stats (struct icd_iap *iap, icd_nw_ip_stats_cb_fn cb, gpointer user_data)
gboolean icd_iap_get_link_post_stats (struct icd_iap *iap, icd_nw_link_post_stats_cb_fn cb, gpointer user_data)
gboolean icd_iap_get_link_stats (struct icd_iap *iap, icd_nw_link_stats_cb_fn cb, gpointer user_data)
struct icd_iapicd_iap_find (const gchar *network_type, const guint network_attrs, const gchar *network_id)
struct icd_iapicd_iap_find_by_id (const gchar *iap_id, const gboolean is_local)
struct icd_iapicd_iap_foreach (icd_iap_foreach_fn fn, gpointer user_data)
gboolean icd_iap_rename (struct icd_iap *iap, const gchar *name)

Variables

const gchar * icd_iap_state_names [ICD_IAP_MAX_STATES]
static const gchar * icd_iap_status_names []
static const gchar * icd_iap_layer_names []

Typedef Documentation

typedef gboolean(* icd_iap_foreach_fn)(struct icd_iap *iap, gpointer user_data)

Iterator function called for each active IAP structure starting from the structure associated with the newest request. Only active IAPs are iterated through, not the ones in a request that will be tried if the current one fails.

Parameters:
iap the IAP struct
user_data user data
Returns:
TRUE to continue, FALSE to stop iterating

typedef void(* icd_iap_request_cb_fn)(enum icd_iap_status status, struct icd_iap *iap, gpointer user_data)

The IAP status callback function

Parameters:
status the status from the IAP creation process
iap the IAP
user_data user data


Enumeration Type Documentation

State of an IAP

Enumerator:
ICD_IAP_STATE_DISCONNECTED  iap is not connected
ICD_IAP_STATE_SCRIPT_PRE_UP  iap pre-up script is being run
ICD_IAP_STATE_LINK_UP  iap is connecting its link layer
ICD_IAP_STATE_LINK_POST_UP  iap is connecting its post link layer, i.e. link authentication
ICD_IAP_STATE_IP_UP  iap is connecting its ip layer
ICD_IAP_STATE_SRV_UP  srv module is being run
ICD_IAP_STATE_SCRIPT_POST_UP  iap (post-)up script is being run
ICD_IAP_STATE_SAVING  connection is being saved
ICD_IAP_STATE_CONNECTED  iap is connected
ICD_IAP_STATE_CONNECTED_DOWN  iap is being disconnected
ICD_IAP_STATE_SRV_DOWN  srv module is disconnecting
ICD_IAP_STATE_IP_DOWN  iap is disconnecting its ip layer
ICD_IAP_STATE_IP_RESTART_SCRIPTS  iap is restarting at ip layer and running post-down and pre-up scripts
ICD_IAP_STATE_LINK_PRE_DOWN  iap is disconnecting its pre link layer, i.e. link deauthenticating
ICD_IAP_STATE_LINK_PRE_RESTART_SCRIPTS  iap is restarting at pre link layer and running post-down and pre-up scripts
ICD_IAP_STATE_LINK_DOWN  iap is disconnecting its link layer
ICD_IAP_STATE_LINK_RESTART_SCRIPTS  iap is restarting at link layer and running post-down and pre-up scripts
ICD_IAP_STATE_SCRIPT_POST_DOWN  iap post-down script is being run
ICD_IAP_MAX_STATES  number of states

status of the request

Enumerator:
ICD_IAP_CREATED  a new IAP was created and connected succesfully
ICD_IAP_DISCONNECTED  the iap was successfully disconnected
ICD_IAP_BUSY  iap failed because some other module was in use by another iap
ICD_IAP_FAILED  the iap failed with some critical error while connecting


Function Documentation

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

Helper function for pre down script to check wheter there is another connected IAP

Parameters:
iap IAP to examine
user_data IAP that is going down
Returns:
TRUE to continue iterating, FALSE to stop and return the IAP

References ICD_IAP_STATE_CONNECTED, and state.

Referenced by icd_iap_script_pre_down().

void icd_iap_connect ( struct icd_iap iap,
icd_iap_request_cb_fn  request_cb,
gpointer  user_data 
)

Request a network connection. The caller needs to free the given icd_iap data structure when the IAP is no longer in use.

Parameters:
iap IAP to connect
request_cb the callback to call when the outcome of the request is known
user_data user data to pass to the callback

References busy, connection, icd_context_get(), icd_ctx, icd_iap_do_callback(), ICD_IAP_FAILED, icd_iap_modules_reset(), icd_iap_run_pre_up_scripts(), ICD_IAP_STATE_DISCONNECTED, icd_iap_state_names, ICD_IAP_STATE_SCRIPT_PRE_UP, ILOG_CRIT, ILOG_DEBUG, ILOG_ERR, network_modules, icd_policy_request::network_type, request_cb, request_cb_user_data, state, and icd_context::type_to_module.

Referenced by icd_request_try_iap().

void icd_iap_disconnect ( struct icd_iap iap,
const gchar *  err_str 
)

static void icd_iap_disconnect_cb ( const enum icd_nw_status  status,
const gpointer  cb_token 
) [static]

Disconnect callback function for all IAP network _down functions

Parameters:
status the status of the _down function, ignored mostly for now
cb_token the IAP

References icd_iap_disconnect_module(), ICD_IAP_STATE_IP_DOWN, ICD_IAP_STATE_LINK_DOWN, ICD_IAP_STATE_LINK_PRE_DOWN, icd_iap_state_names, ICD_IAP_STATE_SRV_DOWN, ILOG_DEBUG, ILOG_ERR, and state.

Referenced by icd_iap_disconnect(), and icd_iap_disconnect_module().

static void icd_iap_disconnect_module ( struct icd_iap iap  )  [static]

static void icd_iap_do_callback ( enum icd_iap_status  status,
struct icd_iap iap 
) [static]

Report the final status of the connection attempt to the caller. Do notice that the IAP is freed by the caller, do not use it after calling this function

Parameters:
status the status to report
iap the IAP

References icd_iap_status_names, ILOG_INFO, request_cb, and request_cb_user_data.

Referenced by icd_iap_connect(), icd_iap_has_connected(), icd_iap_post_down_script_done(), and icd_iap_run_restart().

struct icd_iap * icd_iap_find ( const gchar *  network_type,
const guint  network_attrs,
const gchar *  network_id 
) [read]

struct icd_iap * icd_iap_find_by_id ( const gchar *  iap_id,
const gboolean  is_local 
) [read]

Find an IAP according to id and locally generated flag

Parameters:
iap_id IAP id
is_local TRUE if a locally generated icd2 id is requested, FALSE otherwise
Returns:
a pointer to the IAP on success, NULL on failure

References icd_context_get(), icd_ctx, id, id_is_local, ILOG_DEBUG, ILOG_ERR, icd_context::request_list, string_equal(), and icd_request::try_iaps.

Referenced by icd_request_find_by_iap_id().

struct icd_iap * icd_iap_foreach ( icd_iap_foreach_fn  fn,
gpointer  user_data 
) [read]

Iterate over all active IAPs

Parameters:
fn function to call for each IAP
user_data user data to pass to the iterator function
Returns:
the IAP struct where fn returns FALSE, NULL otherwise or on error

References icd_context_get(), icd_ctx, ILOG_DEBUG, ILOG_ERR, icd_context::request_list, and icd_request::try_iaps.

Referenced by icd_dbus_api_disconnect_req(), icd_iap_script_pre_down(), icd_idle_timer_gconf_changed(), icd_policy_api_existing_conn_get(), and icd_request_try_iap_cb().

void icd_iap_free ( struct icd_iap iap  ) 

gboolean icd_iap_get_ip_stats ( struct icd_iap iap,
icd_nw_ip_stats_cb_fn  cb,
gpointer  user_data 
)

guint icd_iap_get_ipinfo ( struct icd_iap iap,
icd_nw_ip_addr_info_cb_fn  cb,
gpointer  user_data 
)

Get IP address info from an IAP

Parameters:
iap IAP
cb callback function
user_data user data
Returns:
the number of times the callback is going to be called

References connection, ICD_IAP_STATE_CONNECTED, icd_iap_state_names, ILOG_ERR, ILOG_INFO, ILOG_WARN, icd_nw_api::ip_addr_info, icd_network_module::name, icd_policy_request::network_attrs, icd_policy_request::network_id, network_modules, icd_policy_request::network_type, icd_network_module::nw, icd_nw_api::private, and state.

Referenced by icd_dbus_api_addrinfo_send(), and icd_osso_ic_ipinfo().

gboolean icd_iap_get_link_post_stats ( struct icd_iap iap,
icd_nw_link_post_stats_cb_fn  cb,
gpointer  user_data 
)

Get link post level statistics from an IAP.

Parameters:
iap the IAP
cb callback function
user_data user data
Returns:
TRUE if callback will be called, FALSE otherwise

References connection, ICD_IAP_STATE_CONNECTED, icd_iap_state_names, ILOG_ERR, ILOG_INFO, ILOG_WARN, icd_nw_api::link_post_stats, icd_network_module::name, icd_policy_request::network_attrs, icd_policy_request::network_id, network_modules, icd_policy_request::network_type, icd_network_module::nw, icd_nw_api::private, and state.

Referenced by icd_dbus_api_statistics_link_cb(), and icd_osso_ic_connstats_link_cb().

gboolean icd_iap_get_link_stats ( struct icd_iap iap,
icd_nw_link_stats_cb_fn  cb,
gpointer  user_data 
)

Get link level statistics from an IAP.

Parameters:
iap the IAP
cb callback function
user_data user data
Returns:
TRUE if callback will be called, FALSE otherwise

References connection, ICD_IAP_STATE_CONNECTED, icd_iap_state_names, ILOG_ERR, ILOG_INFO, ILOG_WARN, icd_nw_api::link_stats, icd_network_module::name, icd_policy_request::network_attrs, icd_policy_request::network_id, network_modules, icd_policy_request::network_type, icd_network_module::nw, icd_nw_api::private, and state.

Referenced by icd_dbus_api_statistics_send(), and icd_osso_ic_connstats_link_get().

static void icd_iap_has_connected ( struct icd_iap iap  )  [static]

Notify the caller (request) that the IAP has connected

Parameters:
iap the IAP

References ICD_IAP_CREATED, icd_iap_do_callback(), icd_iap_modules_reset(), ICD_IAP_STATE_CONNECTED, icd_idle_timer_set(), and state.

Referenced by icd_iap_post_up_script_done(), icd_iap_rename(), and icd_iap_save_cb().

gboolean icd_iap_id_create ( struct icd_iap iap,
const gchar *  new_id 
)

Create a new unique id for the iap, settings are accessed using this id

Parameters:
iap the IAP
new_id preferably NULL but can also be the new id
Returns:
TRUE on success, FALSE on failure

References connection, ICD_NW_ATTR_IAPNAME, id, id_is_local, ILOG_ERR, icd_policy_request::network_attrs, and icd_policy_request::network_id.

Referenced by icd_request_add_iap().

static void icd_iap_ip_up_cb ( const enum icd_nw_status  status,
const gchar *  err_str,
const gpointer  ip_up_cb_token,
  ... 
) [static]

Callback function called when IP address configuration has completed

Parameters:
status status of the operation
err_str NULL if the network was disconnected normally or an error string
ip_up_cb_token the callback token
... zero or more arrays of strings where each string in the array is an environment variable of the form name=value; end with NULL

References ICD_IAP_STATE_IP_UP, icd_iap_state_names, icd_iap_up_callback(), ICD_NW_SUCCESS, ICD_NW_SUCCESS_NEXT_LAYER, ILOG_CRIT, ILOG_DEBUG, and state.

Referenced by icd_iap_module_next().

static void icd_iap_link_post_up_cb ( const enum icd_nw_status  status,
const gchar *  err_str,
const gpointer  link_post_up_cb_token,
  ... 
) [static]

Callback for link_post_up; common _up callback handling in icd_iap_up_callback()

Parameters:
status status of the operation
err_str NULL if the network was disconnected normally or any ICD_DBUS_ERROR_* from osso-ic-dbus.h on error
link_up_cb_token the IAP in question
... zero or more arrays of strings where each string in the array is an environment variable of the form name=value; end with NULL

References ICD_IAP_STATE_LINK_POST_UP, icd_iap_state_names, icd_iap_up_callback(), ICD_NW_SUCCESS, ICD_NW_SUCCESS_NEXT_LAYER, ILOG_CRIT, ILOG_DEBUG, and state.

Referenced by icd_iap_module_next().

static void icd_iap_link_up_cb ( const enum icd_nw_status  status,
const gchar *  err_str,
const gchar *  interface_name,
const gpointer  link_up_cb_token,
  ... 
) [static]

Callback for link_up; saves the interface name on success, common _up callback handling in icd_iap_up_callback()

Parameters:
status status of the operation
err_str NULL if the network was disconnected normally or any ICD_DBUS_ERROR_* from osso-ic-dbus.h on error
interface_name the device interface name on ICD_NW_SUCCESS*
link_up_cb_token the IAP in question
... zero or more arrays of strings where each string in the array is an environment variable of the form name=value; end with NULL

References ICD_IAP_MAX_STATES, ICD_IAP_STATE_LINK_UP, icd_iap_state_names, icd_iap_up_callback(), ICD_NW_SUCCESS, ICD_NW_SUCCESS_NEXT_LAYER, ILOG_CRIT, ILOG_DEBUG, interface_name, and state.

Referenced by icd_iap_module_next().

static void icd_iap_module_next ( struct icd_iap iap  )  [static]

static void icd_iap_modules_reset ( struct icd_iap iap  )  [static]

Reset the list of modules to try

Parameters:
iap the IAP

References current_module.

Referenced by icd_iap_connect(), icd_iap_has_connected(), icd_iap_run_restart(), and icd_iap_up_callback().

struct icd_iap * icd_iap_new ( void   )  [read]

Allocate memory for a new IAP structure. Caller is responsible of freeing the IAP structure with icd_iap_free() after use

Returns:
the newly created IAP structure

Referenced by icd_request_add_iap().

static struct icd_network_module* icd_iap_next_ip_up_module ( struct icd_iap iap  )  [static, read]

Find the next module that has implemented ip_up()

Parameters:
iap the IAP
Returns:
the next module or NULL if none

References current_module, icd_nw_api::ip_up, network_modules, and icd_network_module::nw.

Referenced by icd_iap_module_next().

static struct icd_network_module* icd_iap_next_link_post_up_module ( struct icd_iap iap  )  [static, read]

Find the next module that has implemented link_post_up()

Parameters:
iap the IAP
Returns:
the next module or NULL if none

References current_module, icd_nw_api::link_post_up, network_modules, and icd_network_module::nw.

Referenced by icd_iap_module_next().

static struct icd_network_module* icd_iap_next_link_up_module ( struct icd_iap iap  )  [static, read]

Find the next module that has implemented link_up()

Parameters:
iap the IAP
Returns:
the next module or NULL if none

References current_module, icd_nw_api::link_up, network_modules, and icd_network_module::nw.

Referenced by icd_iap_module_next().

static void icd_iap_post_down_script_done ( const pid_t  pid,
const gint  exit_value,
gpointer  user_data 
) [static]

Post-down script has run, restart IAP or report final status.

Parameters:
pid the process id of the script that exited
exit_value exit value of the script or -1 on timeout
user_data current IAP

References busy, err_str, ICD_IAP_BUSY, ICD_IAP_DISCONNECTED, icd_iap_do_callback(), ICD_IAP_FAILED, icd_iap_run_pre_up_scripts(), icd_iap_run_restart(), ICD_IAP_STATE_DISCONNECTED, ICD_IAP_STATE_IP_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_PRE_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_RESTART_SCRIPTS, icd_iap_state_names, ICD_IAP_STATE_SCRIPT_POST_DOWN, ILOG_DEBUG, ILOG_ERR, ILOG_INFO, script_pids, and state.

static void icd_iap_post_up_script_done ( const pid_t  pid,
const gint  exit_value,
gpointer  user_data 
) [static]

A post-up script has exited

Parameters:
pid the process id of the script that exited
exit_value exit value of the script or -1 on timeout
user_data the current IAP

Todo:
what to do with this iap if UI goes down?

References connection, icd_gconf_is_temporary(), icd_iap_has_connected(), icd_iap_save_cb(), ICD_IAP_STATE_SAVING, icd_osso_ui_send_save(), id, id_is_local, ILOG_INFO, icd_policy_request::network_id, save_dlg, script_pids, and state.

Referenced by icd_iap_module_next().

static void icd_iap_pre_down_script_done ( const pid_t  pid,
const gint  exit_value,
gpointer  user_data 
) [static]

Pre-down script callback to remove script pid from list.

Parameters:
pid the process id of the script that exited
exit_value exit value of the script or -1 on timeout
user_data user data

References icd_iap_disconnect_module(), ILOG_INFO, and script_pids.

Referenced by icd_iap_script_pre_down().

static void icd_iap_pre_up_script_done ( const pid_t  pid,
const gint  exit_value,
gpointer  user_data 
) [static]

Callback function called when pre-up scripts have been run

Parameters:
pid the process id of the script that exited
exit_value exit value of the script or -1 on timeout
user_data user data

References icd_iap_module_next(), ICD_IAP_STATE_IP_RESTART_SCRIPTS, ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_LINK_POST_UP, ICD_IAP_STATE_LINK_PRE_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_UP, icd_iap_state_names, ILOG_DEBUG, script_pids, and state.

Referenced by icd_iap_run_pre_up_scripts().

gboolean icd_iap_rename ( struct icd_iap iap,
const gchar *  name 
)

Rename an IAP and continue connecting it if it's in ICD_IAP_STATE_SAVING

Parameters:
iap the IAP
name the new name of the IAP

References icd_gconf_rename(), icd_iap_has_connected(), ICD_IAP_STATE_SAVING, id, id_is_local, ILOG_ERR, ILOG_INFO, and state.

Referenced by icd_osso_ui_save().

void icd_iap_renew ( struct icd_iap iap,
enum icd_nw_layer  renew_layer 
)

Request a renew for the specified IAP and network layer

Parameters:
iap the IAP
renew_layer the network module layer to renew
Renew a network module layer for an IAP
Parameters:
iap the IAP
renew_layer the network module layer to renew

References connection, current_renew_module, icd_iap_layer_names, icd_iap_restart(), icd_iap_run_renew(), ICD_NW_LAYER_NONE, ILOG_DEBUG, icd_policy_request::network_attrs, icd_policy_request::network_id, network_modules, icd_policy_request::network_type, and renew_layer.

Referenced by icd_network_api_renew().

void icd_iap_restart ( struct icd_iap iap,
enum icd_nw_layer  restart_layer 
)

Restart a network module by disconnecting network modules including the requested layer. When the requested layer has been disconnected, reconnect starting from the requested layer.

Parameters:
iap the IAP
renew_layer the layer which is to be disconnectd

References icd_iap_disconnect(), icd_iap_layer_names, ICD_IAP_STATE_CONNECTED_DOWN, ICD_IAP_STATE_IP_DOWN, ICD_IAP_STATE_LINK_DOWN, ICD_IAP_STATE_LINK_PRE_DOWN, ICD_IAP_STATE_SCRIPT_POST_DOWN, ICD_IAP_STATE_SRV_DOWN, ILOG_INFO, restart_layer, restart_state, and state.

Referenced by icd_iap_renew(), icd_iap_run_renew_cb(), icd_iap_up_callback(), icd_network_api_close(), icd_network_api_renew(), and icd_srv_provider_close().

static void icd_iap_run_pre_up_scripts ( struct icd_iap iap  )  [static]

static gboolean icd_iap_run_renew ( struct icd_iap iap  )  [static]

static void icd_iap_run_renew_cb ( enum icd_nw_renew_status  status,
gpointer  renew_token 
) [static]

static gboolean icd_iap_run_restart ( struct icd_iap iap  )  [static]

static void icd_iap_save_cb ( gboolean  success,
gpointer  user_data 
) [static]

Callback for save connection dialog request

Parameters:
success TRUE on success, FALSE on failure
user_data the IAP

References icd_iap_has_connected(), ILOG_DEBUG, ILOG_WARN, and save_dlg.

Referenced by icd_iap_post_up_script_done().

static void icd_iap_script_pre_down ( const enum icd_nw_status  status,
const gpointer  cb_token 
) [static]

Call pre-down network scripts.

Parameters:
status the status of the _down function, ignored for now
cb_token the IAP

References connection, icd_iap_check_connected(), icd_iap_foreach(), icd_iap_pre_down_script_done(), icd_script_cancel(), icd_script_pre_down(), id, id_is_local, ILOG_DEBUG, ILOG_INFO, interface_name, icd_policy_request::network_type, script_env, and script_pids.

Referenced by icd_iap_disconnect().

static void icd_iap_srv_connect_cb ( enum icd_srv_status  status,
const gchar *  err_str,
gpointer  user_data 
) [static]

Service provider connect callback function

Parameters:
status status of the connect
user_data user data

References icd_iap_state_names, ICD_IAP_STATE_SRV_UP, icd_iap_up_callback(), ICD_NW_ERROR, ICD_NW_RESTART, ICD_NW_SUCCESS, ICD_SRV_ERROR, ICD_SRV_RESTART, ICD_SRV_SUCCESS, ILOG_CRIT, and state.

Referenced by icd_iap_module_next().

static void icd_iap_srv_disconnect_cb ( enum icd_srv_status  status,
gpointer  disconnect_cb_token 
) [static]

Disconnect callback for the service provider module

Parameters:
status status of the disconnect, ignored for now
disconnect_cb_token token passed to the disconnect function

References icd_iap_disconnect_module(), ICD_NW_ERROR, ICD_NW_RESTART, ICD_NW_SUCCESS, ICD_SRV_ERROR, ICD_SRV_RESTART, and ICD_SRV_SUCCESS.

Referenced by icd_iap_disconnect(), and icd_iap_disconnect_module().

static void icd_iap_up_callback ( const enum icd_nw_status  status,
const gchar *  err_str,
const gpointer  cb_token 
) [static]

static gboolean string_equal ( const gchar *  a,
const gchar *  b 
) [static]

Helper function for comparing two strings where a NULL string is equal to another NULL string

Parameters:
a string A
b string B
Returns:
TRUE if equal, FALSE if unequal

Referenced by icd_iap_find(), icd_iap_find_by_id(), icd_scan_cache_entry_find(), icd_scan_cache_entry_remove(), icd_scan_cache_remove_iap_for_module(), icd_srv_provider_identify_cb(), and policy_iap_ask_cancel_request().


Variable Documentation

const gchar* icd_iap_layer_names[] [static]

Initial value:

 {
  "ICD_NW_LAYER_NONE",
  "ICD_NW_LAYER_LINK",
  "ICD_NW_LAYER_LINK_POST",
  "ICD_NW_LAYER_IP",
  "ICD_NW_LAYER_SERVICE",
  "ICD_NW_LAYER_ALL"
}
names for network module layers

Referenced by icd_iap_renew(), icd_iap_restart(), icd_iap_run_renew(), icd_iap_run_renew_cb(), and icd_iap_run_restart().

const gchar* icd_iap_state_names[ICD_IAP_MAX_STATES]

Initial value:

 {
  "ICD_IAP_STATE_DISCONNECTED",
  "ICD_IAP_STATE_SCRIPT_PRE_UP",
  "ICD_IAP_STATE_LINK_UP",
  "ICD_IAP_STATE_LINK_POST_UP",
  "ICD_IAP_STATE_IP_UP",
  "ICD_IAP_STATE_SRV_UP",
  "ICD_IAP_STATE_SCRIPT_POST_UP",
  "ICD_IAP_STATE_SAVING",
  "ICD_IAP_STATE_CONNECTED",
  "ICD_IAP_STATE_CONNECTED_DOWN",
  "ICD_IAP_STATE_SRV_DOWN",
  "ICD_IAP_STATE_IP_DOWN",
  "ICD_IAP_STATE_IP_RESTART_SCRIPTS",
  "ICD_IAP_STATE_LINK_PRE_DOWN",
  "ICD_IAP_STATE_LINK_PRE_RESTART_SCRIPTS",
  "ICD_IAP_STATE_LINK_DOWN",
  "ICD_IAP_STATE_LINK_RESTART_SCRIPTS",
  "ICD_IAP_STATE_SCRIPT_POST_DOWN"
}
names for the different states

Referenced by icd_iap_connect(), icd_iap_disconnect(), icd_iap_disconnect_cb(), icd_iap_disconnect_module(), icd_iap_get_ip_stats(), icd_iap_get_ipinfo(), icd_iap_get_link_post_stats(), icd_iap_get_link_stats(), icd_iap_ip_up_cb(), icd_iap_link_post_up_cb(), icd_iap_link_up_cb(), icd_iap_module_next(), icd_iap_post_down_script_done(), icd_iap_pre_up_script_done(), icd_iap_run_restart(), icd_iap_srv_connect_cb(), icd_iap_up_callback(), icd_network_api_close(), and icd_network_api_renew().

const gchar* icd_iap_status_names[] [static]

Initial value:

 {
  "ICD_IAP_CREATED",
  "ICD_IAP_DISCONNECTED",
  "ICD_IAP_BUSY",
  "ICD_IAP_FAILED"
}
names for status codes

Referenced by icd_iap_do_callback().


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