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_iap * | icd_iap_new (void) |
gboolean | icd_iap_id_create (struct icd_iap *iap, const gchar *new_id) |
static struct icd_network_module * | icd_iap_next_ip_up_module (struct icd_iap *iap) |
static struct icd_network_module * | icd_iap_next_link_post_up_module (struct icd_iap *iap) |
static struct icd_network_module * | icd_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_iap * | icd_iap_find (const gchar *network_type, const guint network_attrs, const gchar *network_id) |
struct icd_iap * | icd_iap_find_by_id (const gchar *iap_id, const gboolean is_local) |
struct icd_iap * | icd_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 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.
iap | the IAP struct | |
user_data | user data |
typedef void(* icd_iap_request_cb_fn)(enum icd_iap_status status, struct icd_iap *iap, gpointer user_data) |
The IAP status callback function
status | the status from the IAP creation process | |
iap | the IAP | |
user_data | user data |
enum icd_iap_state |
State of an IAP
enum icd_iap_status |
status of the request
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
iap | IAP to examine | |
user_data | IAP that is going down |
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.
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 | |||
) |
Start disconnecting the current connecting module if it has not yet called it's callback. Set the state to _down so that the IAP cannot be disconnected again.
iap | IAP | |
err_str | NULL if the network was disconnected normally or any ICD_DBUS_ERROR_* from osso-ic-dbus.h on error |
References connection, current_module, err_str, icd_iap_disconnect_cb(), icd_iap_disconnect_module(), icd_iap_script_pre_down(), icd_iap_srv_disconnect_cb(), ICD_IAP_STATE_CONNECTED, ICD_IAP_STATE_CONNECTED_DOWN, ICD_IAP_STATE_DISCONNECTED, ICD_IAP_STATE_IP_DOWN, ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_LINK_DOWN, ICD_IAP_STATE_LINK_POST_UP, ICD_IAP_STATE_LINK_PRE_DOWN, ICD_IAP_STATE_LINK_UP, icd_iap_state_names, ICD_IAP_STATE_SAVING, ICD_IAP_STATE_SCRIPT_POST_UP, ICD_IAP_STATE_SCRIPT_PRE_UP, ICD_IAP_STATE_SRV_UP, icd_idle_timer_unset(), ICD_NW_SUCCESS, icd_osso_ui_send_save_cancel(), icd_srv_provider_disconnect(), icd_status_limited_conn(), ILOG_INFO, ILOG_WARN, interface_name, icd_nw_api::ip_down, limited_conn, icd_nw_api::link_down, icd_nw_api::link_pre_down, icd_network_module::name, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, icd_network_module::nw, icd_nw_api::private, save_dlg, and state.
Referenced by icd_iap_restart(), icd_idle_timer_trigger(), icd_network_api_close(), icd_request_cancel(), icd_request_try_iap_cb(), and icd_srv_provider_close().
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
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] |
Call all network module _down functions added to the IAP. This function does not handle cancelled IAPs which have not yet called their respective _up functions and can't thus be merged with icd_iap_disconnect().
iap | IAP to disconnect |
References connection, icd_iap_disconnect_data::function, icd_iap_disconnect_cb(), icd_iap_run_restart(), icd_iap_srv_disconnect_cb(), ICD_IAP_STATE_CONNECTED_DOWN, ICD_IAP_STATE_IP_DOWN, ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_LINK_DOWN, ICD_IAP_STATE_LINK_POST_UP, ICD_IAP_STATE_LINK_PRE_DOWN, ICD_IAP_STATE_LINK_UP, icd_iap_state_names, ICD_IAP_STATE_SCRIPT_POST_DOWN, ICD_IAP_STATE_SCRIPT_PRE_UP, ICD_IAP_STATE_SRV_DOWN, ICD_IAP_STATE_SRV_UP, icd_srv_provider_disconnect(), icd_status_limited_conn(), ILOG_ERR, ILOG_INFO, interface_name, ip_down_list, limited_conn, link_down_list, link_pre_down_list, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, icd_iap_disconnect_data::private, and state.
Referenced by icd_iap_disconnect(), icd_iap_disconnect_cb(), icd_iap_pre_down_script_done(), icd_iap_srv_disconnect_cb(), and icd_iap_up_callback().
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
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] |
Find an IAP according type, attributes and id
network_type | the type of the IAP | |
network_attrs | attributes | |
network_id | IAP id |
References connection, icd_context_get(), icd_ctx, ICD_NW_ATTR_IAPNAME, ICD_NW_ATTR_LOCALMASK, ILOG_DEBUG, ILOG_ERR, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, icd_context::request_list, string_equal(), and icd_request::try_iaps.
Referenced by icd_dbus_api_disconnect_req(), icd_dbus_api_statistics_ip_cb(), icd_dbus_api_statistics_link_cb(), icd_dbus_api_statistics_link_post_cb(), icd_network_api_close(), icd_network_api_renew(), icd_network_api_status_update(), icd_osso_ic_connstats(), icd_osso_ic_connstats_ip_cb(), icd_osso_ic_connstats_link_cb(), icd_osso_ic_connstats_link_post_cb(), icd_osso_ic_ipinfo_cb(), icd_osso_ui_save(), icd_request_find_by_iap(), icd_srv_provider_close(), and icd_srv_provider_limited_conn().
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
iap_id | IAP id | |
is_local | TRUE if a locally generated icd2 id is requested, FALSE otherwise |
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
fn | function to call for each IAP | |
user_data | user data to pass to the iterator function |
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 | ) |
Free up an iap structure
iap | the IAP to free |
References icd_iap_env::addrfam, icd_scan_cache_list::cache_list, connection, current_module, icd_iap_env::envlist, err_str, icd_gconf_remove_temporary(), icd_scan_cache_entry_remove(), icd_scan_cache_list_lookup(), id, id_is_local, ILOG_CRIT, ILOG_DEBUG, interface_name, ip_down_list, link_down_list, link_pre_down_list, icd_policy_request::network_attrs, icd_policy_request::network_id, network_name, icd_policy_request::network_type, script_env, icd_policy_request::service_id, service_name, and icd_policy_request::service_type.
Referenced by icd_request_free_iaps(), icd_request_try_iap(), and icd_request_try_iap_cb().
gboolean icd_iap_get_ip_stats | ( | struct icd_iap * | iap, | |
icd_nw_ip_stats_cb_fn | cb, | |||
gpointer | user_data | |||
) |
Get ip level statistics from an IAP.
iap | the IAP | |
cb | callback function | |
user_data | user data |
References connection, ICD_IAP_STATE_CONNECTED, icd_iap_state_names, ILOG_ERR, ILOG_INFO, ILOG_WARN, icd_nw_api::ip_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_post_cb(), and icd_osso_ic_connstats_link_post_cb().
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
iap | IAP | |
cb | callback function | |
user_data | user data |
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.
iap | the IAP | |
cb | callback function | |
user_data | user data |
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.
iap | the IAP | |
cb | callback function | |
user_data | user data |
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
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
iap | the IAP | |
new_id | preferably NULL but can also be the new id |
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
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()
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()
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] |
Continue (or start) connecting an IAP by finding a suitable _up function from the available modules. Calls icd_iap_connect_module() to call the relevant _up function
iap | the IAP to connect |
References connection, icd_dbus_api_update_state(), icd_iap_ip_up_cb(), icd_iap_link_post_up_cb(), icd_iap_link_up_cb(), icd_iap_next_ip_up_module(), icd_iap_next_link_post_up_module(), icd_iap_next_link_up_module(), icd_iap_post_up_script_done(), icd_iap_srv_connect_cb(), ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_LINK_POST_UP, ICD_IAP_STATE_LINK_UP, icd_iap_state_names, ICD_IAP_STATE_SCRIPT_POST_UP, ICD_IAP_STATE_SCRIPT_PRE_UP, ICD_IAP_STATE_SRV_UP, icd_script_post_up(), icd_srv_provider_connect(), icd_srv_provider_has_next(), ICD_STATE_INTERNAL_ADDRESS_ACQUIRED, icd_status_limited_conn(), id, id_is_local, ILOG_DEBUG, ILOG_ERR, ILOG_INFO, ILOG_WARN, interface_name, icd_nw_api::ip_up, limited_conn, icd_nw_api::link_post_up, icd_nw_api::link_up, icd_network_module::name, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, icd_network_module::nw, icd_nw_api::private, script_env, script_pids, and state.
Referenced by icd_iap_pre_up_script_done(), icd_iap_run_restart(), and icd_iap_up_callback().
static void icd_iap_modules_reset | ( | struct icd_iap * | iap | ) | [static] |
Reset the list of modules to try
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
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()
iap | the IAP |
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()
iap | the IAP |
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()
iap | the IAP |
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.
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
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 |
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.
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
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
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
iap | the IAP | |
renew_layer | the network module layer to renew |
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.
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] |
Run pre up scripts
iap | the IAP |
References connection, icd_iap_pre_up_script_done(), icd_script_pre_up(), id, id_is_local, icd_policy_request::network_type, and script_pids.
Referenced by icd_iap_connect(), and icd_iap_post_down_script_done().
static gboolean icd_iap_run_renew | ( | struct icd_iap * | iap | ) | [static] |
Run the renew function for the specified IAP
iap | the IAP |
References connection, current_renew_module, icd_iap_layer_names, icd_iap_run_renew_cb(), ICD_NW_LAYER_IP, ICD_NW_LAYER_LINK, ICD_NW_LAYER_LINK_POST, ILOG_DEBUG, icd_nw_api::ip_renew, icd_nw_api::link_post_renew, icd_nw_api::link_renew, icd_network_module::name, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, icd_network_module::nw, icd_nw_api::private, and renew_layer.
Referenced by icd_iap_renew(), and icd_iap_run_renew_cb().
static void icd_iap_run_renew_cb | ( | enum icd_nw_renew_status | status, | |
gpointer | renew_token | |||
) | [static] |
Renew function callback
status | renewal status | |
renew_token | the IAP that is being renewed |
References connection, current_renew_module, icd_iap_layer_names, icd_iap_restart(), icd_iap_run_renew(), ICD_NW_LAYER_NONE, ICD_NW_RENEW_NO_CHANGES, ILOG_DEBUG, ILOG_ERR, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, renew_layer, and restart_layer.
Referenced by icd_iap_run_renew().
static gboolean icd_iap_run_restart | ( | struct icd_iap * | iap | ) | [static] |
Check wheter the iap needs to be initiated. Called when the network module layer disconnect functions have been exhausted and when post down scripts have been run.
iap | the IAP |
References connection, err_str, icd_iap_do_callback(), ICD_IAP_FAILED, icd_iap_layer_names, icd_iap_module_next(), icd_iap_modules_reset(), ICD_IAP_STATE_CONNECTED, ICD_IAP_STATE_DISCONNECTED, ICD_IAP_STATE_IP_DOWN, ICD_IAP_STATE_IP_RESTART_SCRIPTS, ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_LINK_DOWN, ICD_IAP_STATE_LINK_POST_UP, ICD_IAP_STATE_LINK_PRE_DOWN, ICD_IAP_STATE_LINK_PRE_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_UP, icd_iap_state_names, ICD_IAP_STATE_SAVING, ICD_IAP_STATE_SCRIPT_POST_UP, ICD_NW_LAYER_ALL, ICD_NW_LAYER_IP, ICD_NW_LAYER_LINK, ICD_NW_LAYER_LINK_POST, ICD_NW_LAYER_NONE, icd_policy_api_iap_restart(), ICD_POLICY_REJECTED, ILOG_DEBUG, ILOG_ERR, restart_count, restart_layer, restart_state, and state.
Referenced by icd_iap_disconnect_module(), and icd_iap_post_down_script_done().
static void icd_iap_save_cb | ( | gboolean | success, | |
gpointer | user_data | |||
) | [static] |
Callback for save connection dialog request
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.
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
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
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] |
Callback for _up functions; adds _down functions and calls the next module on success, starts disconnecting on failure
status | status | |
err_str | error string or NULL if no error | |
cb_token | the IAP |
References busy, current_module, err_str, icd_iap_disconnect_data::function, icd_iap_disconnect_module(), icd_iap_module_next(), icd_iap_modules_reset(), icd_iap_restart(), ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_LINK_POST_UP, ICD_IAP_STATE_LINK_UP, icd_iap_state_names, ICD_IAP_STATE_SRV_UP, ICD_NW_ERROR_USER_ACTION_DONE, ICD_NW_LAYER_ALL, ICD_NW_LAYER_IP, ICD_NW_LAYER_LINK, ICD_NW_LAYER_LINK_POST, ICD_NW_RESTART, ICD_NW_RESTART_IP, ICD_NW_RESTART_LINK, ICD_NW_RESTART_LINK_POST, ICD_NW_SUCCESS, ICD_NW_SUCCESS_NEXT_LAYER, ICD_NW_TOO_MANY_CONNECTIONS, ILOG_CRIT, ILOG_DEBUG, ILOG_ERR, ILOG_INFO, interface_name, icd_nw_api::ip_down, ip_down_list, icd_nw_api::link_down, link_down_list, icd_nw_api::link_pre_down, link_pre_down_list, icd_network_module::name, icd_network_module::nw, icd_nw_api::private, icd_iap_disconnect_data::private, state, and user_interaction_done.
Referenced by icd_iap_ip_up_cb(), icd_iap_link_post_up_cb(), icd_iap_link_up_cb(), and icd_iap_srv_connect_cb().
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
a | string A | |
b | string B |
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().
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" }
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" }
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" }
Referenced by icd_iap_do_callback().