Change to another connection
[Policy modules]


Classes

struct  policy_change_data

Defines

#define POLICY_CHANGE_CALL_TIMEOUT   10 * 1000
#define POLICY_CHANGE_EXTRA_FILTER   "member='" ICD_UI_CHANGE_SIG "'"

Functions

void icd_policy_init (struct icd_policy_api *policy_api, icd_policy_nw_add_fn add_network, icd_policy_request_merge_fn merge_requests, icd_policy_request_make_new_fn make_request, icd_policy_scan_start_fn scan_start, icd_policy_scan_stop_fn scan_stop)
static void policy_change_delete_data (struct policy_change_data *data)
static void policy_change_do_cb (enum icd_policy_status status, struct policy_change_data *data)
static DBusHandlerResult policy_change_done (DBusConnection *connection, DBusMessage *message, void *user_data)
static void policy_change_confirm_cb (DBusPendingCall *pending, void *user_data)
static gboolean policy_change_confirm (struct policy_change_data *data)
static void policy_change_new_request (struct icd_policy_request *new_request, const GSList *existing_requests, icd_policy_request_new_cb_fn policy_done_cb, gpointer policy_token, gpointer *private)
static void policy_change_destruct (gpointer *private)

Define Documentation

#define POLICY_CHANGE_CALL_TIMEOUT   10 * 1000

D-Bus timeout for the change UI dialog

Referenced by policy_change_confirm().

#define POLICY_CHANGE_EXTRA_FILTER   "member='" ICD_UI_CHANGE_SIG "'"

Extra D-Bus signal filter string

Referenced by icd_policy_init(), and policy_change_destruct().


Function Documentation

void icd_policy_init ( struct icd_policy_api policy_api,
icd_policy_nw_add_fn  add_network,
icd_policy_request_merge_fn  merge_requests,
icd_policy_request_make_new_fn  make_request,
icd_policy_scan_start_fn  scan_start,
icd_policy_scan_stop_fn  scan_stop 
)

Policy module initialization function.

Parameters:
policy_api policy API structure to be filled in by the module
add_network function to add a network in response to a policy
merge_requests function to merge requests
make_request function for creating a new request
scan_networks function for scanning networks

References icd_policy_api::destruct, icd_dbus_connect_system_bcast_signal(), icd_policy_api::new_request, policy_change_destruct(), policy_change_done(), POLICY_CHANGE_EXTRA_FILTER, policy_change_new_request(), and icd_policy_api::private.

static gboolean policy_change_confirm ( struct policy_change_data data  )  [static]

Request a change connection dialog which the UI does not anymore/currently support...

Parameters:
data module data
Returns:
TRUE if the D-Bus method call was sent, FALSE on error

References policy_change_data::change_call, policy_change_data::change_from, policy_change_data::change_to, icd_dbus_send_system_mcall(), policy_change_data::is_changing, POLICY_CHANGE_CALL_TIMEOUT, and policy_change_confirm_cb().

Referenced by policy_change_new_request().

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

Callback for the disconnect confirmation method call

Parameters:
pending pending D-Bus method call
user_data module data

Todo:
make a compile-time define for this, as UI is/has been buggy?

References policy_change_data::change_call, policy_change_data::change_from, policy_change_data::change_to, ICD_POLICY_REJECTED, ILOG_INFO, ILOG_WARN, and policy_change_do_cb().

Referenced by policy_change_confirm().

static void policy_change_delete_data ( struct policy_change_data data  )  [static]

Free allocated data structure members and cancel ongoing pending call; leave data needed for calling the callback

Parameters:
data policy change data

References policy_change_data::change_call, policy_change_data::change_from, and policy_change_data::change_to.

Referenced by policy_change_destruct(), and policy_change_do_cb().

static void policy_change_destruct ( gpointer *  private  )  [static]

Policy module destruction function.

Parameters:
private a reference to the private data

References icd_dbus_disconnect_system_bcast_signal(), policy_change_delete_data(), policy_change_done(), and POLICY_CHANGE_EXTRA_FILTER.

Referenced by icd_policy_init().

static void policy_change_do_cb ( enum icd_policy_status  status,
struct policy_change_data data 
) [static]

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

Handle UI changed signal

Parameters:
connection D-Bus connection
message D-Bus message
user_data policy change data structure
Returns:
DBUS_HANDLER_RESULT_NOT_YET_HANDLED

References policy_change_data::change_from, policy_change_data::change_to, ICD_POLICY_ACCEPTED, ICD_POLICY_REJECTED, ILOG_DEBUG, ILOG_ERR, ILOG_WARN, and policy_change_do_cb().

Referenced by icd_policy_init(), and policy_change_destruct().

static void policy_change_new_request ( struct icd_policy_request new_request,
const GSList *  existing_requests,
icd_policy_request_new_cb_fn  policy_done_cb,
gpointer  policy_token,
gpointer *  private 
) [static]

Allow one connection at a time; request a change dialog if one exists

Parameters:
new_request the new connection request
existing_requests currently existing requests
policy_done_cb callback to call when policy has been decided
policy_token the policy token to return in the callback
private the private memeber of the icd_request_api structure

References icd_policy_request::attrs, policy_change_data::change_from, policy_change_data::change_to, policy_change_data::done_cb, policy_change_data::done_token, ICD_POLICY_ACCEPTED, ICD_POLICY_ATTRIBUTE_ALWAYS_ONLINE_CHANGE, ICD_POLICY_ATTRIBUTE_BACKGROUND, ICD_POLICY_ATTRIBUTE_CONN_UI, ICD_POLICY_ATTRIBUTE_NO_INTERACTION, ICD_POLICY_REJECTED, ILOG_DEBUG, ILOG_ERR, ILOG_INFO, policy_change_data::is_changing, icd_policy_request::network_id, policy_change_data::new_request, policy_change_confirm(), and policy_change_do_cb().

Referenced by icd_policy_init().


Generated on Thu Mar 11 09:04:50 2010 for ICd2 by  doxygen 1.5.6