Classes | |
struct | pid_notify |
struct | icd_network_module |
Defines | |
#define | ICD_NW_API_PREFIX "libicd_network_" |
#define | ICD_NW_INIT "icd_nw_init" |
Typedefs | |
typedef gboolean(* | icd_network_api_foreach_module_fn )(struct icd_network_module *module, gpointer user_data) |
Functions | |
static struct icd_network_module * | icd_network_api_find_module (gchar *module_name) |
gboolean | icd_network_api_has_type (struct icd_network_module *module, const gchar *type) |
struct icd_network_module * | icd_network_api_foreach_module (struct icd_context *icd_ctx, icd_network_api_foreach_module_fn foreach_fn, gpointer user_data) |
static gboolean | icd_network_api_foreach_module_pid (struct icd_network_module *module, gpointer user_data) |
gboolean | icd_network_api_notify_pid (struct icd_context *icd_ctx, const pid_t pid, const gint exit_value) |
static void | icd_network_api_watch_pid (const pid_t pid, gpointer watch_cb_token) |
static void | icd_network_api_close (enum icd_nw_status status, const gchar *err_str, const gchar *network_type, const guint network_attrs, const gchar *network_id) |
static void | icd_network_api_renew (enum icd_nw_layer renew_layer, const gchar *network_type, const guint network_attrs, const gchar *network_id) |
static void | icd_network_api_status_update (gchar *network_type, guint network_attrs, gchar *network_id) |
static gboolean | icd_network_api_init_cb (const gchar *module_name, void *handle, gpointer init_function, gpointer data) |
gboolean | icd_network_api_load_modules (struct icd_context *icd_ctx) |
void | icd_network_api_unload_modules (struct icd_context *icd_ctx) |
Variables | |
const gchar * | icd_iap_state_names [ICD_IAP_MAX_STATES] |
#define ICD_NW_API_PREFIX "libicd_network_" |
prefix for the ICd network API modules
Referenced by icd_network_api_load_modules().
#define ICD_NW_INIT "icd_nw_init" |
name of the ICd network API init function
Referenced by icd_network_api_load_modules().
typedef gboolean(* icd_network_api_foreach_module_fn)(struct icd_network_module *module, gpointer user_data) |
Network api callback for going through every network module
module | the network module | |
user_data | user data passed to icd_network_api_foreach_module |
static void icd_network_api_close | ( | enum icd_nw_status | status, | |
const gchar * | err_str, | |||
const gchar * | network_type, | |||
const guint | network_attrs, | |||
const gchar * | network_id | |||
) | [static] |
Function for closing down a connection by request of a network module
status | reason for closing; ICD_NW_RESTART if the IAP needs to be restarted, success or error will both close the network connection | |
err_str | NULL if the network was disconnected normally or any ICD_DBUS_ERROR_* from osso-ic-dbus.h on error | |
network_type | the type of the IAP returned | |
network_attrs | attributes, such as type of network_id, security, etc. | |
network_id | IAP name or local id, e.g. SSID |
References icd_iap_disconnect(), icd_iap_find(), icd_iap_restart(), ICD_IAP_STATE_CONNECTED_DOWN, ICD_IAP_STATE_IP_DOWN, ICD_IAP_STATE_IP_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_DOWN, ICD_IAP_STATE_LINK_PRE_DOWN, ICD_IAP_STATE_LINK_PRE_RESTART_SCRIPTS, ICD_IAP_STATE_LINK_RESTART_SCRIPTS, icd_iap_state_names, ICD_IAP_STATE_SCRIPT_POST_DOWN, ICD_IAP_STATE_SRV_DOWN, ICD_NW_ERROR, 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_status_disconnect(), ILOG_INFO, ILOG_WARN, and icd_iap::state.
Referenced by icd_network_api_init_cb().
static struct icd_network_module* icd_network_api_find_module | ( | gchar * | module_name | ) | [static, read] |
Find a network module by its name
module_name | module name |
References icd_context_get(), icd_ctx, icd_network_module::name, and icd_context::nw_module_list.
Referenced by icd_network_api_load_modules().
struct icd_network_module * icd_network_api_foreach_module | ( | struct icd_context * | icd_ctx, | |
icd_network_api_foreach_module_fn | foreach_fn, | |||
gpointer | user_data | |||
) | [read] |
icd_ctx | icd context | |
foreach_fn | the function to call for each module | |
user_data | user data to pass to the function |
References ILOG_ERR, ILOG_WARN, and icd_context::nw_module_list.
Referenced by icd_dbus_api_scan_req(), icd_dbus_api_state_req(), icd_network_api_notify_pid(), and icd_scan_cache_remove_iap().
static gboolean icd_network_api_foreach_module_pid | ( | struct icd_network_module * | module, | |
gpointer | user_data | |||
) | [static] |
Find the network module that is watching a child process exit
module | the network module to examine | |
user_data | the pid notify structure |
References icd_nw_api::child_exit, pid_notify::exit_value, ILOG_INFO, ILOG_WARN, icd_network_module::name, icd_network_module::nw, pid_notify::pid, icd_network_module::pid_list, and icd_nw_api::private.
Referenced by icd_network_api_notify_pid().
gboolean icd_network_api_has_type | ( | struct icd_network_module * | module, | |
const gchar * | type | |||
) |
Function for checking wheter a modules supports a given type
module | the module | |
type | the type to check for |
References icd_context_get(), icd_ctx, ILOG_CRIT, and icd_context::type_to_module.
Referenced by icd_scan_results_request().
static gboolean icd_network_api_init_cb | ( | const gchar * | module_name, | |
void * | handle, | |||
gpointer | init_function, | |||
gpointer | data | |||
) | [static] |
Initialize the loaded module
module_name | module filename without path | |
handle | module handle; used for unloading | |
init_function | module init function | |
data | icd context |
References icd_network_module::handle, icd_ctx, icd_network_api_close(), icd_network_api_renew(), icd_network_api_status_update(), icd_network_api_watch_pid(), ICD_NW_MODULE_VERSION, icd_plugin_unload_module(), icd_scan_cache_init(), icd_version_compare(), ILOG_DEBUG, ILOG_ERR, ILOG_WARN, icd_nw_api::ip_addr_info, icd_nw_api::ip_stats, icd_nw_api::ip_up, icd_nw_api::link_post_stats, icd_nw_api::link_post_up, icd_nw_api::link_stats, icd_nw_api::link_up, icd_network_module::name, icd_nw_api::network_destruct, icd_network_module::nw, icd_context::nw_module_list, icd_nw_api::private, icd_nw_api::search_interval, icd_nw_api::search_lifetime, icd_nw_api::start_search, icd_nw_api::stop_search, and icd_nw_api::version.
Referenced by icd_network_api_load_modules().
gboolean icd_network_api_load_modules | ( | struct icd_context * | icd_ctx | ) |
Load all network API modules
icd_ctx | icd context |
References icd_network_api_find_module(), icd_network_api_init_cb(), icd_network_modules_get(), ICD_NW_API_PREFIX, ICD_NW_INIT, icd_plugin_load_all(), ILOG_CRIT, ILOG_DEBUG, ILOG_ERR, icd_network_module::network_types, and icd_context::type_to_module.
Referenced by main().
gboolean icd_network_api_notify_pid | ( | struct icd_context * | icd_ctx, | |
const pid_t | pid, | |||
const gint | exit_value | |||
) |
Notify a network module that its child process has exited
icd_ctx | the context | |
pid | the process id | |
exit_value | exit value |
References pid_notify::exit_value, icd_network_api_foreach_module(), icd_network_api_foreach_module_pid(), and pid_notify::pid.
Referenced by icd_exec_signal_cb().
static void icd_network_api_renew | ( | enum icd_nw_layer | renew_layer, | |
const gchar * | network_type, | |||
const guint | network_attrs, | |||
const gchar * | network_id | |||
) | [static] |
Request a network module layer to be renewed
renew_layer | the network module layer to renew | |
network_type | network type | |
network_attrs | network_attrs | |
network_id | network_id |
References icd_iap_find(), icd_iap_renew(), icd_iap_restart(), ICD_IAP_STATE_CONNECTED, ICD_IAP_STATE_DISCONNECTED, ICD_IAP_STATE_IP_UP, ICD_IAP_STATE_LINK_POST_UP, 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_NW_LAYER_IP, ICD_NW_LAYER_LINK, ICD_NW_LAYER_LINK_POST, ICD_NW_LAYER_SERVICE, ILOG_DEBUG, ILOG_WARN, and icd_iap::state.
Referenced by icd_network_api_init_cb().
static void icd_network_api_status_update | ( | gchar * | network_type, | |
guint | network_attrs, | |||
gchar * | network_id | |||
) | [static] |
Status of the network has changed while the network has been connected
network_type | the type of the IAP returned | |
network_attrs | attributes, such as type of network_id, security, etc. | |
network_id | IAP name or local id, e.g. SSID |
References icd_iap_find(), ICD_IAP_STATE_CONNECTED, icd_status_connected(), ILOG_INFO, ILOG_WARN, and icd_iap::state.
Referenced by icd_network_api_init_cb().
void icd_network_api_unload_modules | ( | struct icd_context * | icd_ctx | ) |
Unload all network modules
icd_ctx | icd context |
References icd_network_module::handle, icd_plugin_unload_module(), icd_scan_cache_remove(), ILOG_DEBUG, ILOG_ERR, icd_network_module::name, icd_nw_api::network_destruct, icd_network_module::network_types, icd_network_module::nw, icd_context::nw_module_list, icd_network_module::pid_list, icd_nw_api::private, and icd_context::type_to_module.
Referenced by main().
static void icd_network_api_watch_pid | ( | const pid_t | pid, | |
gpointer | watch_cb_token | |||
) | [static] |
Set ICd to watch a child pid
pid | process id | |
watch_cb_token | the watch callback token given on initialization |
References ILOG_CRIT, ILOG_DEBUG, icd_network_module::name, and icd_network_module::pid_list.
Referenced by icd_network_api_init_cb().
const gchar* icd_iap_state_names[ICD_IAP_MAX_STATES] |
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().