ICd network API handling
[ICd internal functions]


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_moduleicd_network_api_find_module (gchar *module_name)
gboolean icd_network_api_has_type (struct icd_network_module *module, const gchar *type)
icd_network_moduleicd_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 Documentation

#define ICD_NW_API_PREFIX   "libicd_network_"

prefix for the ICd network API modules

#define ICD_NW_INIT   "icd_nw_init"

name of the ICd network API init function


Typedef Documentation

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

Parameters:
module the network module
user_data user data passed to icd_network_api_foreach_module
Returns:
if TRUE the callback will be called again with the next module; if FALSE iteration is stopped


Function Documentation

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

Parameters:
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

static struct icd_network_module* icd_network_api_find_module ( gchar *  module_name  )  [static]

Find a network module by its name

Parameters:
module_name module name
Returns:
the module structure or NULL if not found

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 
)

Iterate over all network modules

Parameters:
icd_ctx icd context
foreach_fn the function to call for each module
user_data user data to pass to the function
Returns:
a pointer to the module if the iteration function returns FALSE; NULL otherwise

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

Parameters:
module the network module to examine
user_data the pid notify structure
Returns:
TRUE to continue searching, FALSE to exit iteration and return a pointer to the module

gboolean icd_network_api_has_type ( struct icd_network_module module,
const gchar *  type 
)

Function for checking wheter a modules supports a given type

Parameters:
module the module
type the type to check for
Returns:
TRUE if the module supports the given type, FALSE otherwise

static gboolean icd_network_api_init_cb ( const gchar *  module_name,
void *  handle,
gpointer  init_function,
gpointer  data 
) [static]

Initialize the loaded module

Parameters:
module_name module filename without path
handle module handle; used for unloading
init_function module init function
data icd context
Returns:
TRUE on success, FALSE on failure

gboolean icd_network_api_load_modules ( struct icd_context icd_ctx  ) 

Load all network API modules

Parameters:
icd_ctx icd context
Returns:
the status from icd_plugin_load_all

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

Parameters:
icd_ctx the context
pid the process id
exit_value exit value
Returns:
TRUE if the process id was in use by the network api; FALSE if not

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

Parameters:
renew_layer the network module layer to renew
network_type network type
network_attrs network_attrs
network_id network_id

Todo:
when saving, the dialog might try to save a name for a failed iap...

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

Parameters:
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

void icd_network_api_unload_modules ( struct icd_context icd_ctx  ) 

Unload all network modules

Parameters:
icd_ctx icd context

static void icd_network_api_watch_pid ( const pid_t  pid,
gpointer  watch_cb_token 
) [static]

Set ICd to watch a child pid

Parameters:
pid process id
watch_cb_token the watch callback token given on initialization


Variable Documentation

const gchar* icd_iap_state_names[ICD_IAP_MAX_STATES]

names for the different states


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