Any connection -policy
[Policy modules]


Classes

struct  policy_scan_data
struct  policy_any_data
struct  policy_any_network

Functions

static gboolean policy_any_string_equal (const gchar *a, const gchar *b)
static struct policy_scan_datapolicy_any_scan_data_new (struct policy_any_data *any_data, struct icd_policy_request *new_request, icd_policy_request_new_cb_fn policy_done_cb, gpointer policy_token)
static gint policy_any_sort_network (gconstpointer a, gconstpointer b)
static void policy_any_scan_cb (const guint status, const gchar *service_name, const gchar *service_type, const guint service_attrs, const gchar *service_id, gint service_priority, const gchar *network_name, const gchar *network_type, const guint network_attrs, const gchar *network_id, const gint network_priority, const enum icd_nw_levels signal, gpointer user_data)
static GSList * policy_any_get_types (void)
static gint policy_any_get_prio (const GSList *existing_requests)
static void policy_any_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_any_cancel_request (struct icd_policy_request *request, gpointer *private)
static void policy_any_destruct (gpointer *private)

Function Documentation

static void policy_any_cancel_request ( struct icd_policy_request request,
gpointer *  private 
) [static]

Clean up internal policy module data structures for a request that has previously reported ICD_POLICY_WAITING.

Parameters:
request the request that is to be removed or NULL for all
private private data for the module

static void policy_any_destruct ( gpointer *  private  )  [static]

Policy module destruction function. Will be called before unloading the module.

Parameters:
private a reference to the private data

static gint policy_any_get_prio ( const GSList *  existing_requests  )  [static]

Get the highest priority in the existing requests if change while connected is on

Parameters:
existing_requests existing requests
Returns:
the highest priority found or -1 if change while connected not set

static GSList* policy_any_get_types ( void   )  [static]

Get a list of network types to scan

Returns:
list of network types that caller needs to free

static void policy_any_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]

New connection request policy function.

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 token to pass to the callback
private the private memeber of the icd_request_api structure

Todo:
here we should make a new ASK request and merge with that

static void policy_any_scan_cb ( const guint  status,
const gchar *  service_name,
const gchar *  service_type,
const guint  service_attrs,
const gchar *  service_id,
gint  service_priority,
const gchar *  network_name,
const gchar *  network_type,
const guint  network_attrs,
const gchar *  network_id,
const gint  network_priority,
const enum icd_nw_levels  signal,
gpointer  user_data 
) [static]

Callback function for network scan.

Parameters:
status network scan status with ICD_POLICY_SCAN_* values
service_name service provider name, see srv_provider_api.h
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
service_priority service priority within a service_type
network_name network name, see network_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 between different network_type
signal signal leve, see network_api.h
user_data user data passed to icd_policy_scan_start_fn

Todo:
actually we should wait until all networks have completed one round of scanning and only then remove all scan requests

static struct policy_scan_data* policy_any_scan_data_new ( struct policy_any_data any_data,
struct icd_policy_request new_request,
icd_policy_request_new_cb_fn  policy_done_cb,
gpointer  policy_token 
) [static]

Create a new scan data structure and add it to the list of ongoing scans.

Parameters:
any_data module data
new_request the new connection request
policy_done_cb callback to call when policy has been decided
policy_token policy token
Returns:
scan data structure

static gint policy_any_sort_network ( gconstpointer  a,
gconstpointer  b 
) [static]

Sort new network according to priority and signal strength

Parameters:
a network A
b network B
Returns:
< 0 if A comes before B, 0 on equality, > 0 if A comes after B

static gboolean policy_any_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

Parameters:
a string A
b string B
Returns:
TRUE if equal, FALSE if unequal


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