Compatibility functions providing OSSO IC D-Bus API
[ICd internal functions]


Classes

struct  icd_osso_ic_handler
struct  icd_osso_ic_mcall_data
struct  icd_osso_ic_ipdata
struct  icd_osso_ic_stats_data
struct  icd_osso_ic_get_state_data

Defines

#define ICD_OSSO_UI_REQUEST_TIMEOUT   4 * 1000

Typedefs

typedef DBusMessage *(*) icd_osso_ic_message_handler (DBusMessage *request, void *user_data)
typedef void(*) icd_osso_ui_cb_fn (gboolean success, gpointer user_data)

Functions

static gchar * icd_osso_ic_get_type (const gchar *iap_name)
static void icd_osso_ic_ui_pending (DBusPendingCall *pending, void *user_data)
static gpointer icd_osso_ic_ipinfo_get_first (struct icd_request *request, gpointer user_data)
static void icd_osso_ic_connstats_error (DBusMessage *method_call)
static void icd_osso_ic_ipinfo_cb (const gpointer addr_info_cb_token, const gchar *network_type, const guint network_attrs, const gchar *network_id, gchar *ip_address, gchar *ip_netmask, gchar *ip_gateway, gchar *ip_dns1, gchar *ip_dns2, gchar *ip_dns3)
static DBusMessage * icd_osso_ic_ipinfo (DBusMessage *method_call, void *user_data)
static void icd_osso_ic_connstats_ip_cb (const gpointer ip_stats_cb_token, const gchar *network_type, const guint network_attrs, const gchar *network_id, guint time_active, guint rx_bytes, guint tx_bytes)
static void icd_osso_ic_connstats_link_post_cb (const gpointer link_post_stats_cb_token, const gchar *network_type, const guint network_attrs, const gchar *network_id, guint time_active, guint rx_bytes, guint tx_bytes)
static void icd_osso_ic_connstats_link_cb (const gpointer link_stats_cb_token, const gchar *network_type, const guint network_attrs, const gchar *network_id, guint time_active, gint signal, gchar *station_id, gint dB, guint rx_bytes, guint tx_bytes)
static void icd_osso_ic_connstats_link_get (struct icd_iap *iap, DBusMessage *method_call)
static gpointer icd_osso_ic_connstats_get_first (struct icd_request *request, gpointer user_data)
static DBusMessage * icd_osso_ic_connstats (DBusMessage *method_call, void *user_data)
static gpointer icd_osso_ic_get_state_foreach (struct icd_request *request, gpointer user_data)
static DBusMessage * icd_osso_ic_get_state (DBusMessage *method_call, void *user_data)
void icd_osso_ic_send_ack (GSList *tracking_list, const gchar *iap_name)
void icd_osso_ic_send_nack (GSList *tracking_list)
static DBusMessage * icd_osso_ic_disconnect (DBusMessage *method_call, void *user_data)
static DBusMessage * icd_osso_ic_shutdown (DBusMessage *request, void *user_data)
static DBusMessage * icd_osso_ic_make_request (struct icd_request *merge_request, struct icd_tracking_info *track, DBusMessage *message, const gchar *requested_iap, const guint flags)
static DBusMessage * icd_osso_ic_connect (DBusMessage *method_call, void *user_data)
static DBusMessage * icd_osso_ic_activate (DBusMessage *method_call, void *user_data)
static DBusMessage * icd_osso_ic_bg_killed (DBusMessage *method_call, void *user_data)
static icd_osso_ic_message_handler icd_osso_ic_find_handler (DBusMessage *msg, struct icd_osso_ic_handler *handlers)
static DBusHandlerResult icd_osso_ic_request (DBusConnection *connection, DBusMessage *message, void *user_data)
void icd_osso_ui_send_retry (const gchar *iap_name, const gchar *error, icd_osso_ui_cb_fn cb, gpointer user_data)
void icd_osso_ui_send_save_cancel (gpointer send_save_token)
gpointer icd_osso_ui_send_save (const gchar *iap_name, icd_osso_ui_cb_fn cb, gpointer user_data)
static DBusMessage * icd_osso_ui_retry (DBusMessage *signal, void *user_data)
static DBusMessage * icd_osso_ui_disconnect (DBusMessage *signal, void *user_data)
static DBusMessage * icd_osso_ui_save (DBusMessage *signal, void *user_data)
static DBusHandlerResult icd_osso_ui_signal (DBusConnection *connection, DBusMessage *message, void *user_data)
gboolean icd_osso_ic_init (struct icd_context *icd_ctx)
void icd_osso_ic_deinit (void)

Variables

static struct icd_osso_ic_handler icd_osso_ic_htable []
static struct icd_osso_ic_handler icd_osso_ui_htable []

Define Documentation

#define ICD_OSSO_UI_REQUEST_TIMEOUT   4 * 1000

milliseconds to wait for UI to respond to requests; used only for log message printing for now


Typedef Documentation

typedef DBusMessage*(*) icd_osso_ic_message_handler(DBusMessage *request, void *user_data)

Function that handles an incoming OSSO IC API request

Parameters:
request the D-Bus message
user_data user data
Returns:
the D-Bus reply or NULL if a reply is sent later

typedef void(*) icd_osso_ui_cb_fn(gboolean success, gpointer user_data)

Callback function called when a UI retry or save request has completed

Parameters:
success TRUE on success, FALSE on failure
user_data user data passed to retry or save function


Function Documentation

static DBusMessage* icd_osso_ic_activate ( DBusMessage *  method_call,
void *  user_data 
) [static]

IAP activation requested by the 'Select connection' UI dialog or Connection Manager, i.e. a connection request from connectivity components without any reference counting

Parameters:
method_call the D-Bus request message
user_data user data
Returns:
a D-Bus reply to the request

Todo:
OSSO_IAP_ASK merging should be done somewhere else

static DBusMessage* icd_osso_ic_bg_killed ( DBusMessage *  method_call,
void *  user_data 
) [static]

Desktop background killing application

Parameters:
method_call the D-Bus request message
user_data user data
Returns:
a D-Bus reply to the request

static DBusMessage* icd_osso_ic_connect ( DBusMessage *  method_call,
void *  user_data 
) [static]

IAP activation via connectivity libraries.

Parameters:
method_call the D-Bus request message
user_data user data
Returns:
a D-Bus reply to the request

static DBusMessage* icd_osso_ic_connstats ( DBusMessage *  method_call,
void *  user_data 
) [static]

Get connection statistics info for the latest connection

Parameters:
method_call the D-Bus request message
user_data user data
Returns:
an D-Bus reply to the request

static void icd_osso_ic_connstats_error ( DBusMessage *  method_call  )  [static]

Send connection statistics error

Parameters:
method_call the method call to reply to

static gpointer icd_osso_ic_connstats_get_first ( struct icd_request request,
gpointer  user_data 
) [static]

Find the first connected request that has an iap which can return statistics

Parameters:
request request to examine
user_data connection statistics data structure
Returns:
iap which returned ip statistics, NULL otherwise

static void icd_osso_ic_connstats_ip_cb ( const gpointer  ip_stats_cb_token,
const gchar *  network_type,
const guint  network_attrs,
const gchar *  network_id,
guint  time_active,
guint  rx_bytes,
guint  tx_bytes 
) [static]

Receive ip statistics based on network type, attributes and id. Values are set to zero or NULL if statistics are not available or applicable

Parameters:
ip_stats_cb_token token passed to the request function
network_type network type
network_attrs attributes, such as type of network_id, security, etc.
network_id network id
time_active time active, if applicable
signal signal level
station_id base station id, e.g. WLAN access point MAC address
dB raw signal strength; depends on the type of network
rx_bytes bytes received on the link, if applicable
tx_bytes bytes sent on the link, if applicable
private a reference to the icd_nw_api private memeber

static void icd_osso_ic_connstats_link_cb ( const gpointer  link_stats_cb_token,
const gchar *  network_type,
const guint  network_attrs,
const gchar *  network_id,
guint  time_active,
gint  signal,
gchar *  station_id,
gint  dB,
guint  rx_bytes,
guint  tx_bytes 
) [static]

Receive link statistics based on network type, attributes and id. Values are set to zero or NULL if statistics are not available or applicable

Parameters:
link_stats_cb_token token passed to the request function
network_type network type
network_attrs attributes, such as type of network_id, security, etc.
network_id network id
time_active time active, if applicable
signal signal level
station_id base station id, e.g. WLAN access point MAC address
dB raw signal strength; depends on the type of network
rx_bytes bytes received on the link, if applicable
tx_bytes bytes sent on the link, if applicable
private a reference to the icd_nw_api private memeber

static void icd_osso_ic_connstats_link_get ( struct icd_iap iap,
DBusMessage *  method_call 
) [static]

Get connection statistics for an IAP

Parameters:
iap IAP
method_call the method call requesting statistics

static void icd_osso_ic_connstats_link_post_cb ( const gpointer  link_post_stats_cb_token,
const gchar *  network_type,
const guint  network_attrs,
const gchar *  network_id,
guint  time_active,
guint  rx_bytes,
guint  tx_bytes 
) [static]

Receive link post up statistics based on network type, attributes and id. Values are set to zero or NULL if statistics are not available or applicable

Parameters:
link_post_stats_cb_token token passed to the request function
network_type network type
network_attrs attributes, such as type of network_id, security, etc.
network_id network id
time_active time active, if applicable
signal signal level
station_id base station id, e.g. WLAN access point MAC address
dB raw signal strength; depends on the type of network
rx_bytes bytes received on the link, if applicable
tx_bytes bytes sent on the link, if applicable
private a reference to the icd_nw_api private memeber

void icd_osso_ic_deinit ( void   ) 

Deinitialize OSSO IC API

Parameters:
icd_ctx icd context

static DBusMessage* icd_osso_ic_disconnect ( DBusMessage *  method_call,
void *  user_data 
) [static]

Disconnection requested by application

Parameters:
method_call the D-Bus request message
user_data user data
Returns:
an D-Bus reply to the request

static icd_osso_ic_message_handler icd_osso_ic_find_handler ( DBusMessage *  msg,
struct icd_osso_ic_handler handlers 
) [static]

Search a handler function for given D-BUS message.

Parameters:
msg D-BUS message that needs handler.
handlers Pointer to list of handler functions and method descriptions.
Returns:
Pointer to handler function or NULL on error.

static DBusMessage* icd_osso_ic_get_state ( DBusMessage *  method_call,
void *  user_data 
) [static]

Get state for all connections

Parameters:
method_call the D-Bus request message
user_data user data
Returns:
an D-Bus reply to the request

static gpointer icd_osso_ic_get_state_foreach ( struct icd_request request,
gpointer  user_data 
) [static]

Report state for all connections

Parameters:
request request to examine
user_data get state data structure
Returns:
NULL

static gchar* icd_osso_ic_get_type ( const gchar *  iap_name  )  [static]

Helper function for fetching the IAP type from gconf

Parameters:
iap_name name of the IAP
Returns:
IAP type that is to be freed by the caller

gboolean icd_osso_ic_init ( struct icd_context icd_ctx  ) 

Initialize the OSSO IC API

Parameters:
icd_ctx icd context
Returns:
TRUE on success, FALSE on failure

static DBusMessage* icd_osso_ic_ipinfo ( DBusMessage *  method_call,
void *  user_data 
) [static]

Get IPv4 address info for the latest connection

Parameters:
method_call the D-Bus request message
user_data user data
Returns:
an D-Bus reply to the request

static void icd_osso_ic_ipinfo_cb ( const gpointer  addr_info_cb_token,
const gchar *  network_type,
const guint  network_attrs,
const gchar *  network_id,
gchar *  ip_address,
gchar *  ip_netmask,
gchar *  ip_gateway,
gchar *  ip_dns1,
gchar *  ip_dns2,
gchar *  ip_dns3 
) [static]

Receive IP address configuration information based on network type, attributes and id.

Parameters:
addr_info_cb_token token passed to the request function
network_type network type
network_attrs attributes, such as type of network_id, security, etc.
network_id IAP name or local id, e.g. SSID
private a reference to the icd_nw_api private memeber
ip_address IP address string or NULL if no such value
ip_netmask IP netmask string which or NULL if no such value
ip_gateway IP gateway string which or NULL if no such value
ip_dns1 DNS server IP address string or NULL if no such value
ip_dns2 DNS server IP address string or NULL if no such value
ip_dns3 DNS server IP address string or NULL if no such value
Returns:
TRUE if some of the values are returned, FALSE if no values assigned

static gpointer icd_osso_ic_ipinfo_get_first ( struct icd_request request,
gpointer  user_data 
) [static]

Find the first connected request which has an iap that can give us ip address information

Parameters:
request request to examine
user_data ip data structure
Returns:
iap which returned ip data, NULL otherwise

static DBusMessage* icd_osso_ic_make_request ( struct icd_request merge_request,
struct icd_tracking_info track,
DBusMessage *  message,
const gchar *  requested_iap,
const guint  flags 
) [static]

Make a new request

Parameters:
merge_request request to merge with this one or NULL
track new tracking info or NULL
message the D-Bus request message to send errors to
requested_iap the requested IAP name
flags ICD_POLICY_ATTRIBUTE_* flags to add to the request
Returns:
a D-Bus error on failure, NULL on success

static DBusHandlerResult icd_osso_ic_request ( DBusConnection *  connection,
DBusMessage *  message,
void *  user_data 
) [static]

Callback function for OSSO IC API requests

Parameters:
connection the D-Bus connection
message the D-Bus message
user_data user data
Returns:
DBUS_HANDLER_RESULT_HANDLED

void icd_osso_ic_send_ack ( GSList *  tracking_list,
const gchar *  iap_name 
)

Send acks for connect and disconnect requests

Parameters:
tracking_list list of applications to track
iap_name iap name to return to the application

void icd_osso_ic_send_nack ( GSList *  tracking_list  ) 

Send nacks for connect and disconnect requests; free tracking info

Parameters:
tracking_list list of applications to track

static DBusMessage* icd_osso_ic_shutdown ( DBusMessage *  request,
void *  user_data 
) [static]

Connection disconnection requested by Connectivity UIs; request disconnect confirmation

Parameters:
request the D-Bus request message
user_data user data
Returns:
an D-Bus reply to the request

static void icd_osso_ic_ui_pending ( DBusPendingCall *  pending,
void *  user_data 
) [static]

Generic pending call callback that prints out wheter the UI D-Bus request succeeded or not

Parameters:
pending the pending call
user_data the requested UI D-Bus method call

static DBusMessage* icd_osso_ui_disconnect ( DBusMessage *  signal,
void *  user_data 
) [static]

Disconnect received from UI; disconnect the last request as this way we can cancel a new connecting connection

Parameters:
signal the D-Bus request message
user_data not used
Returns:
NULL, as there received signal does not need a reply

static DBusMessage* icd_osso_ui_retry ( DBusMessage *  signal,
void *  user_data 
) [static]

Retry signal received from UI

Parameters:
signal the D-Bus request message
user_data not used
Returns:
NULL, as there received signal does not need a reply

static DBusMessage* icd_osso_ui_save ( DBusMessage *  signal,
void *  user_data 
) [static]

Save connection received from the UI

Parameters:
signal the D-Bus request message
user_data not used
Returns:
NULL, as there received signal does not need a reply

void icd_osso_ui_send_retry ( const gchar *  iap_name,
const gchar *  error,
icd_osso_ui_cb_fn  cb,
gpointer  user_data 
)

Request UI to show a retry dialog

Parameters:
iap_name name of the IAP to retry
error ICD_DBUS_ERROR_* error string
cb callback function
user_data callback user data

gpointer icd_osso_ui_send_save ( const gchar *  iap_name,
icd_osso_ui_cb_fn  cb,
gpointer  user_data 
)

Request the UI to show a save dialog

Parameters:
iap_name name of the IAP to save
cb callback function
user_data callback user data
Returns:
opaque token that can be used to cancel the save dialog request

void icd_osso_ui_send_save_cancel ( gpointer  send_save_token  ) 

Cancel save dialog pending call

Parameters:
send_save_token the opaque token returned from icd_osso_ui_send_save()

static DBusHandlerResult icd_osso_ui_signal ( DBusConnection *  connection,
DBusMessage *  message,
void *  user_data 
) [static]

UI signal handler

Parameters:
connection The D-Bus connection
message D-Bus message
user_data user data


Variable Documentation

struct icd_osso_ic_handler icd_osso_ic_htable[] [static]

Initial value:

 {
  { ICD_DBUS_INTERFACE, ICD_ACTIVATE_REQ, "s", icd_osso_ic_activate },
  { ICD_DBUS_INTERFACE, ICD_SHUTDOWN_REQ, "", icd_osso_ic_shutdown },
  { ICD_DBUS_INTERFACE, ICD_CONNECT_REQ, "su", icd_osso_ic_connect },
  { ICD_DBUS_INTERFACE, ICD_DISCONNECT_REQ, "s", icd_osso_ic_disconnect },
  { ICD_DBUS_INTERFACE, ICD_GET_IPINFO_REQ, "", icd_osso_ic_ipinfo },
  { ICD_DBUS_INTERFACE, ICD_GET_STATISTICS_REQ, "", icd_osso_ic_connstats },
  { ICD_DBUS_INTERFACE, ICD_GET_STATISTICS_REQ, "s", icd_osso_ic_connstats },
  { ICD_DBUS_INTERFACE, ICD_GET_STATE_REQ, "", icd_osso_ic_get_state },
  { ICD_DBUS_INTERFACE, "background_killing_application", "ss",
    icd_osso_ic_bg_killed },
  { NULL }
}
OSSO IC API method call handlers

struct icd_osso_ic_handler icd_osso_ui_htable[] [static]

Initial value:

 {
  { ICD_UI_DBUS_INTERFACE, ICD_UI_DISCONNECT_SIG, "b",
    icd_osso_ui_disconnect },
  { ICD_UI_DBUS_INTERFACE, ICD_UI_RETRY_SIG, "sb", icd_osso_ui_retry },
  { ICD_UI_DBUS_INTERFACE, ICD_UI_RETRY_SIG, "sbb", icd_osso_ui_retry },
  { ICD_UI_DBUS_INTERFACE, ICD_UI_SAVE_SIG, "ss", icd_osso_ui_save },
  { NULL }
}
UI signal handlers


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