Classes | |
struct | icd_request |
Typedefs | |
typedef void(* | icd_request_cb_fn )(enum icd_request_status status, gpointer user_data) |
typedef gpointer(* | icd_request_foreach_fn )(struct icd_request *request, gpointer user_data) |
Enumerations | |
enum | icd_request_status { ICD_REQUEST_POLICY_PENDING = 0, ICD_REQUEST_WAITING, ICD_REQUEST_CHANGETO, ICD_REQUEST_MERGED, ICD_REQUEST_CONNECTING_IAPS, ICD_REQUEST_SUCCEEDED, ICD_REQUEST_DENIED, ICD_REQUEST_DISCONNECTED, ICD_REQUEST_MAX } |
Functions | |
static gboolean | icd_request_try_iap (struct icd_request *request) |
static void | icd_request_connect (struct icd_request *request) |
static gboolean | icd_request_string_equal (const gchar *a, const gchar *b) |
gpointer | icd_request_foreach (icd_request_foreach_fn fn, gpointer user_data) |
void | icd_request_tracking_info_remove (struct icd_request *request, struct icd_tracking_info *track) |
static gpointer | icd_request_tracking_info_delete_foreach (struct icd_request *request, gpointer user_data) |
gboolean | icd_request_tracking_info_delete (const gchar *sender) |
void | icd_request_tracking_info_add (struct icd_request *request, struct icd_tracking_info *track) |
static void | icd_request_tracking_info_free (struct icd_request *request) |
static gpointer | icd_request_find_foreach (struct icd_request *request, gpointer user_data) |
struct icd_request * | icd_request_find (const gchar *network_type, const guint network_attrs, const gchar *network_id) |
struct icd_request * | icd_request_find_by_iap (const gchar *network_type, const guint network_attrs, const gchar *network_id) |
struct icd_request * | icd_request_find_by_iap_id (const gchar *iap_id, const gboolean is_local) |
static void | icd_request_update_status (enum icd_request_status status, struct icd_request *request) |
void | icd_request_free_iaps (struct icd_request *request) |
static void | icd_request_free (struct icd_request *request) |
static gboolean | icd_request_find_iap_by_module (struct icd_iap *iap, gpointer user_data) |
static gpointer | icd_request_find_changeto (struct icd_request *request, gpointer user_data) |
void | icd_request_send_ack (struct icd_request *request, struct icd_iap *iap) |
void | icd_request_send_nack (struct icd_request *request) |
static void | icd_request_retry_cb (gboolean success, gpointer user_data) |
static void | icd_request_try_iap_cb (enum icd_iap_status status, struct icd_iap *iap, gpointer user_data) |
static void | icd_request_connect_iaps (enum icd_policy_status status, struct icd_policy_request *req) |
void | icd_request_add_iap (struct icd_request *request, gchar *service_type, guint service_attrs, gchar *service_id, gchar *network_type, guint network_attrs, gchar *network_id, gint network_priority) |
struct icd_request * | icd_request_new (guint policy_attrs, const gchar *service_type, const guint service_attrs, const gchar *service_id, const gchar *network_type, const guint network_attrs, const gchar *network_id) |
static gpointer | icd_request_make_check_duplicate (struct icd_request *request, gpointer user_data) |
void | icd_request_make (struct icd_request *request) |
gboolean | icd_request_merge (struct icd_request *merge_request, struct icd_request *existing) |
void | icd_request_cancel (struct icd_request *request, guint policy_attrs) |
Variables | |
const gchar * | icd_request_status_names [ICD_REQUEST_MAX] |
typedef void(* icd_request_cb_fn)(enum icd_request_status status, gpointer user_data) |
The request status callback function
status | the outcome of the request | |
user_data | user data |
typedef gpointer(* icd_request_foreach_fn)(struct icd_request *request, gpointer user_data) |
Function called for each request structure
request | the request | |
user_data | user data passed to icd_request_foreach() |
enum icd_request_status |
status of the request
void icd_request_add_iap | ( | struct icd_request * | request, | |
gchar * | service_type, | |||
guint | service_attrs, | |||
gchar * | service_id, | |||
gchar * | network_type, | |||
guint | network_attrs, | |||
gchar * | network_id, | |||
gint | network_priority | |||
) |
Add a network connection to try.
request | the request to which the new network is added | |
service_type | service provider type, see srv_provider_api.h | |
service_attrs | service provider attributes, see srv_provider_api.h | |
service_id | service_provider id, see srv_provider_api.h | |
network_type | network type, see network_api.h | |
network_attrs | network attributes, see network_api.h | |
network_id | network id, see network_api.h | |
network_priority | network priority, default value to use is -1 |
References icd_policy_request::attrs, icd_iap::connection, icd_iap_id_create(), icd_iap_new(), icd_network_priority_get(), ICD_NW_ATTR_ALWAYS_ONLINE, ICD_NW_ATTR_SILENT, ICD_POLICY_ATTRIBUTE_ALWAYS_ONLINE, ICD_POLICY_ATTRIBUTE_HAS_CONNECTIONS, ICD_POLICY_ATTRIBUTE_NO_INTERACTION, ILOG_DEBUG, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_priority, icd_policy_request::network_type, req, icd_policy_request::request_token, icd_policy_request::service_attrs, icd_policy_request::service_id, icd_policy_request::service_type, and try_iaps.
Referenced by icd_dbus_api_connect_req(), and icd_policy_api_add_iap().
void icd_request_cancel | ( | struct icd_request * | request, | |
guint | policy_attrs | |||
) |
Cancel a request. The request will be freed when the icd_request_try_iap_cb() callback is called at the time of IAP disconnection
request | the request | |
policy_attrs | ICD_POLICY_ATTRIBUTE_* attributes |
References icd_iap::connection, icd_context_get(), icd_ctx, icd_iap_disconnect(), ICD_POLICY_ACCEPTED, icd_policy_api_iap_disconnect(), icd_policy_api_request_cancel(), ICD_POLICY_ATTRIBUTE_CONN_UI, ICD_REQUEST_DENIED, icd_request_free(), icd_request_free_iaps(), ICD_REQUEST_POLICY_PENDING, icd_request_update_status(), ICD_REQUEST_WAITING, icd_status_disconnect(), ILOG_DEBUG, ILOG_INFO, req, icd_context::shutting_down, state, try_iaps, and users.
Referenced by icd_dbus_api_disconnect_req(), icd_exec_shutdown(), icd_name_owner_filter(), icd_osso_ic_activate(), icd_osso_ic_disconnect(), icd_osso_ui_disconnect(), icd_osso_ui_retry(), and icd_policy_api_disconnect_iap().
static void icd_request_connect | ( | struct icd_request * | request | ) | [static] |
Try to connect the request (for the first time), request UI dialog if unsuccessful
request | the request to connect |
References ICD_POLICY_ATTRIBUTE_BACKGROUND, ICD_POLICY_ATTRIBUTE_NO_INTERACTION, icd_request_make(), icd_request_merge(), icd_request_new(), icd_request_try_iap(), and ILOG_INFO.
Referenced by icd_request_connect_iaps(), and icd_request_try_iap_cb().
static void icd_request_connect_iaps | ( | enum icd_policy_status | status, | |
struct icd_policy_request * | req | |||
) | [static] |
Callback for the new_connection policy request.
status | status of the policy request | |
req | the policy request structure |
References icd_context_get(), icd_ctx, ICD_POLICY_MERGED, ICD_POLICY_REJECTED, ICD_POLICY_WAITING, icd_request_connect(), ICD_REQUEST_DENIED, icd_request_free(), icd_request_free_iaps(), icd_request_send_nack(), icd_request_update_status(), ICD_REQUEST_WAITING, ILOG_CRIT, ILOG_INFO, multi_iaps, icd_policy_request::request_token, icd_context::shutting_down, and try_iaps.
Referenced by icd_request_make().
struct icd_request * icd_request_find | ( | const gchar * | network_type, | |
const guint | network_attrs, | |||
const gchar * | network_id | |||
) | [read] |
Find a request
network_type | requested network type | |
network_attrs | requested network attributes | |
network_id | requesete (meta) IAP name |
References icd_request_find_foreach(), icd_request_foreach(), icd_policy_request::network_attrs, icd_policy_request::network_id, and icd_policy_request::network_type.
Referenced by icd_dbus_api_connect_req(), icd_name_owner_filter(), icd_osso_ic_activate(), and icd_osso_ui_retry().
struct icd_request * icd_request_find_by_iap | ( | const gchar * | network_type, | |
const guint | network_attrs, | |||
const gchar * | network_id | |||
) | [read] |
Find a request by IAP
network_type | network type | |
network_attrs | network attributes | |
network_id | network id |
References icd_iap::connection, icd_iap_find(), and icd_policy_request::request_token.
Referenced by icd_dbus_api_disconnect_req(), icd_osso_ic_disconnect(), and icd_osso_ui_retry().
struct icd_request * icd_request_find_by_iap_id | ( | const gchar * | iap_id, | |
const gboolean | is_local | |||
) | [read] |
Find a request by IAP id
iap_id | IAP id | |
is_local | TRUE if a locally generated icd2 id is requested, FALSE otherwise |
References icd_iap::connection, icd_iap_find_by_id(), and icd_policy_request::request_token.
Referenced by icd_osso_ui_retry().
static gpointer icd_request_find_changeto | ( | struct icd_request * | request, | |
gpointer | user_data | |||
) | [static] |
Find a request to change to
request | the request | |
user_data | user data passed to icd_request_foreach() |
References ICD_REQUEST_CHANGETO, and state.
Referenced by icd_request_try_iap_cb().
static gpointer icd_request_find_foreach | ( | struct icd_request * | request, | |
gpointer | user_data | |||
) | [static] |
Foreach function for network finding
request | the request | |
user_data | the network to search for |
References ICD_NW_ATTR_IAPNAME, ICD_NW_ATTR_LOCALMASK, icd_request_string_equal(), ILOG_DEBUG, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, and req.
Referenced by icd_request_find().
static gboolean icd_request_find_iap_by_module | ( | struct icd_iap * | iap, | |
gpointer | user_data | |||
) | [static] |
Find an iap by module
iap | the IAP struct | |
user_data | user data |
References ILOG_DEBUG, and icd_iap::network_modules.
Referenced by icd_request_try_iap_cb().
gpointer icd_request_foreach | ( | icd_request_foreach_fn | fn, | |
gpointer | user_data | |||
) |
Iterate over all requests and call the user given function for each of them
fn | the function | |
user_data | user data to pass to the function |
References icd_context_get(), icd_ctx, ILOG_ERR, and icd_context::request_list.
Referenced by icd_osso_ic_connstats(), icd_osso_ic_get_state(), icd_osso_ic_ipinfo(), icd_request_find(), icd_request_make(), icd_request_tracking_info_delete(), icd_request_try_iap_cb(), and icd_tracking_info_find().
static void icd_request_free | ( | struct icd_request * | request | ) | [static] |
Free an icd_request structure
request | the request |
References icd_context_get(), icd_ctx, ILOG_CRIT, icd_policy_request::network_id, icd_policy_request::network_type, req, icd_context::request_list, icd_policy_request::service_id, icd_policy_request::service_type, try_iaps, and users.
Referenced by icd_request_cancel(), icd_request_connect_iaps(), icd_request_make(), icd_request_merge(), icd_request_retry_cb(), and icd_request_try_iap_cb().
void icd_request_free_iaps | ( | struct icd_request * | request | ) |
Free memory allocated for all IAPs in a request
request | the request |
References icd_iap_free(), ILOG_CRIT, and try_iaps.
Referenced by icd_osso_ui_retry(), icd_request_cancel(), icd_request_connect_iaps(), icd_request_make(), icd_request_merge(), icd_request_retry_cb(), and icd_request_try_iap_cb().
void icd_request_make | ( | struct icd_request * | request | ) |
Make a request for a new network connection.
request | the request - do not use after calling this function, as the request may be freed without any further notice |
References icd_policy_request::attrs, icd_context_get(), icd_ctx, icd_policy_api_new_request(), icd_request_connect_iaps(), ICD_REQUEST_DISCONNECTED, icd_request_foreach(), icd_request_free(), icd_request_free_iaps(), icd_request_make_check_duplicate(), icd_request_send_nack(), icd_request_update_status(), ILOG_DEBUG, ILOG_INFO, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, req, icd_context::request_list, icd_policy_request::service_attrs, icd_policy_request::service_id, icd_policy_request::service_type, and icd_context::shutting_down.
Referenced by icd_dbus_api_connect_req(), icd_dbus_api_select_req(), icd_osso_ic_make_request(), icd_osso_ui_retry(), icd_policy_api_make_request(), icd_request_connect(), and icd_request_try_iap_cb().
static gpointer icd_request_make_check_duplicate | ( | struct icd_request * | request, | |
gpointer | user_data | |||
) | [static] |
Find out wheter the request already exists in the icd context request list
request | a request from the list | |
user_data | the request to be added |
Referenced by icd_request_make().
gboolean icd_request_merge | ( | struct icd_request * | merge_request, | |
struct icd_request * | existing | |||
) |
Merge two requets
merge_request | request that is to be merged and freed | |
existing | the request to merge with |
References icd_policy_request::attrs, icd_policy_api_request_cancel(), ICD_POLICY_ATTRIBUTE_ALWAYS_ONLINE_CHANGE, ICD_POLICY_ATTRIBUTE_BACKGROUND, ICD_POLICY_ATTRIBUTE_CONN_UI, ICD_POLICY_ATTRIBUTE_CONNECTIONS_FAILED, ICD_POLICY_ATTRIBUTE_HAS_CONNECTIONS, ICD_POLICY_ATTRIBUTE_NO_INTERACTION, ICD_REQUEST_CONNECTING_IAPS, icd_request_free(), icd_request_free_iaps(), ICD_REQUEST_MERGED, ICD_REQUEST_POLICY_PENDING, icd_request_send_ack(), icd_request_status_names, ICD_REQUEST_SUCCEEDED, icd_request_tracking_info_add(), icd_request_tracking_info_free(), icd_request_tracking_info_remove(), icd_request_update_status(), ICD_REQUEST_WAITING, icd_tracking_info_new(), ILOG_CRIT, ILOG_DEBUG, ILOG_ERR, ILOG_WARN, icd_tracking_info::interface, req, icd_tracking_info::request, icd_tracking_info::sender, state, try_iaps, and users.
Referenced by icd_dbus_api_connect_req(), icd_osso_ic_make_request(), icd_osso_ui_retry(), icd_policy_api_merge_requests(), icd_request_connect(), and icd_request_try_iap_cb().
struct icd_request * icd_request_new | ( | guint | policy_attrs, | |
const gchar * | service_type, | |||
const guint | service_attrs, | |||
const gchar * | service_id, | |||
const gchar * | network_type, | |||
const guint | network_attrs, | |||
const gchar * | network_id | |||
) | [read] |
Request a connection. ICd policy will be consulted and any number of IAPs may be created in response.
policy_attrs | ICD_POLICY_ATTRIBUTE_* attributes | |
service_type | service type | |
service_attrs | service attributes | |
service_id | service id | |
network_type | network type to connect | |
network_attrs | network attributes | |
network_id | network id uniquely identifies the connection to the network module in question |
References icd_policy_request::attrs, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_priority, icd_policy_request::network_type, req, icd_policy_request::request_token, icd_policy_request::service_attrs, icd_policy_request::service_id, and icd_policy_request::service_type.
Referenced by icd_dbus_api_connect_req(), icd_dbus_api_select_req(), icd_osso_ic_make_request(), icd_osso_ui_retry(), icd_policy_api_make_request(), icd_request_connect(), and icd_request_try_iap_cb().
static void icd_request_retry_cb | ( | gboolean | success, | |
gpointer | user_data | |||
) | [static] |
Callback for requesting retry UI dialog
success | TRUE if the UI dialog was successfully requested, FALSE otherwise | |
user_data | the request that was retried |
References ICD_REQUEST_DISCONNECTED, icd_request_free(), icd_request_free_iaps(), icd_request_send_nack(), icd_request_update_status(), ILOG_DEBUG, and ILOG_WARN.
Referenced by icd_request_try_iap_cb().
void icd_request_send_ack | ( | struct icd_request * | request, | |
struct icd_iap * | iap | |||
) |
Send an ACK to all D-Bus listeners
request | the request to ack | |
iap | the IAP to ack |
References icd_iap::connection, icd_dbus_api_send_ack(), icd_dbus_api_send_nack(), icd_osso_ic_send_ack(), ICD_REQUEST_DISCONNECTED, icd_policy_request::network_id, state, and users.
Referenced by icd_request_merge(), and icd_request_try_iap_cb().
void icd_request_send_nack | ( | struct icd_request * | request | ) |
Send a NACK to all D-Bus listeners
request | the request to NACK |
References icd_dbus_api_send_nack(), icd_osso_ic_send_nack(), and users.
Referenced by icd_osso_ic_activate(), icd_osso_ui_retry(), icd_request_connect_iaps(), icd_request_make(), icd_request_retry_cb(), and icd_request_try_iap_cb().
static gboolean icd_request_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_request_find_foreach().
void icd_request_tracking_info_add | ( | struct icd_request * | request, | |
struct icd_tracking_info * | track | |||
) |
Add tracking info to a request
request | the request | |
track | tracking info |
References icd_name_owner_add_filter(), ILOG_DEBUG, icd_tracking_info::request, icd_tracking_info::sender, and users.
Referenced by icd_dbus_api_connect_req(), icd_dbus_api_select_req(), icd_osso_ic_disconnect(), icd_osso_ic_make_request(), and icd_request_merge().
gboolean icd_request_tracking_info_delete | ( | const gchar * | sender | ) |
Delete a tracked user by D-Bus id
sender | the D-Bus sender |
References icd_request_foreach(), icd_request_tracking_info_delete_foreach(), and ILOG_ERR.
Referenced by icd_name_owner_filter().
static gpointer icd_request_tracking_info_delete_foreach | ( | struct icd_request * | request, | |
gpointer | user_data | |||
) | [static] |
Iterator function for removal by D-Bus sender id
request | the request | |
user_data | user data passed to icd_request_tracking_info_delete(). |
References icd_name_owner_remove_filter(), icd_tracking_info_free(), ILOG_ERR, icd_tracking_info::sender, and users.
Referenced by icd_request_tracking_info_delete().
static void icd_request_tracking_info_free | ( | struct icd_request * | request | ) | [static] |
Free all tracking info associated with a request
request | the request |
References icd_tracking_info_free(), and users.
Referenced by icd_request_merge(), and icd_request_try_iap_cb().
void icd_request_tracking_info_remove | ( | struct icd_request * | request, | |
struct icd_tracking_info * | track | |||
) |
Remove tracking info to a request
request | the request | |
track | tracking info |
References users.
Referenced by icd_request_merge().
static gboolean icd_request_try_iap | ( | struct icd_request * | request | ) | [static] |
Check policy and try to connect IAP
request | the request |
References icd_iap::connection, icd_iap_connect(), icd_iap_free(), ICD_POLICY_ACCEPTED, icd_policy_api_iap_connect(), ICD_REQUEST_CONNECTING_IAPS, icd_request_try_iap_cb(), icd_request_update_status(), icd_status_connect(), ILOG_DEBUG, ILOG_INFO, and try_iaps.
Referenced by icd_request_connect(), and icd_request_try_iap_cb().
static void icd_request_try_iap_cb | ( | enum icd_iap_status | status, | |
struct icd_iap * | iap, | |||
gpointer | user_data | |||
) | [static] |
IAP creation callback. Adds the IAP to the iap context list on success, frees the IAP and tries with a next one if the IAP failed.
status | status of the IAP creation | |
iap | the iap that was tried; the IAP must not be freed in this callback | |
user_data | the request |
References icd_policy_request::attrs, icd_iap::busy, icd_iap::connection, icd_iap::err_str, icd_context_get(), icd_ctx, ICD_IAP_BUSY, ICD_IAP_CREATED, icd_iap_disconnect(), ICD_IAP_DISCONNECTED, ICD_IAP_FAILED, icd_iap_foreach(), icd_iap_free(), icd_osso_ui_send_retry(), icd_policy_api_iap_disconnected(), icd_policy_api_iap_succeeded(), ICD_POLICY_ATTRIBUTE_BACKGROUND, ICD_POLICY_ATTRIBUTE_NO_INTERACTION, ICD_REQUEST_CHANGETO, icd_request_connect(), ICD_REQUEST_DISCONNECTED, icd_request_find_changeto(), icd_request_find_iap_by_module(), icd_request_foreach(), icd_request_free(), icd_request_free_iaps(), icd_request_make(), icd_request_merge(), icd_request_new(), icd_request_retry_cb(), icd_request_send_ack(), icd_request_send_nack(), ICD_REQUEST_SUCCEEDED, icd_request_tracking_info_free(), icd_request_try_iap(), icd_request_update_status(), ICD_REQUEST_WAITING, icd_status_connected(), icd_status_disconnected(), icd_iap::id, icd_iap::id_is_local, ILOG_DEBUG, ILOG_INFO, ILOG_WARN, multi_iaps, icd_policy_request::network_id, req, icd_context::shutting_down, state, try_iaps, and icd_iap::user_interaction_done.
Referenced by icd_request_try_iap().
static void icd_request_update_status | ( | enum icd_request_status | status, | |
struct icd_request * | request | |||
) | [static] |
Notify the caller with the status of the request. The callback will not be called after ICD_REQUEST_DISCONNECTED or ICD_REQUEST_DENIED has been reported
status | the status of the request to pass to the callback | |
request | the request whose processing is finished |
References icd_request_status_names, ILOG_DEBUG, and state.
Referenced by icd_request_cancel(), icd_request_connect_iaps(), icd_request_make(), icd_request_merge(), icd_request_retry_cb(), icd_request_try_iap(), and icd_request_try_iap_cb().
const gchar* icd_request_status_names[ICD_REQUEST_MAX] |
Initial value:
{ "ICD_REQUEST_POLICY_PENDING", "ICD_REQUEST_WAITING", "ICD_REQUEST_CHANGETO", "ICD_REQUEST_MERGED", "ICD_REQUEST_CONNECTING_IAPS", "ICD_REQUEST_SUCCEEDED", "ICD_REQUEST_DENIED", "ICD_REQUEST_DISCONNECTED" }
Referenced by icd_request_merge(), and icd_request_update_status().