00001 #ifndef ICD_REQUEST_H 00002 #define ICD_REQUEST_H 00003 00016 #include <dbus/dbus.h> 00017 #include <glib.h> 00018 #include "policy_api.h" 00019 #include "icd_tracking_info.h" 00020 #include "icd_iap.h" 00021 00023 enum icd_request_status { 00025 ICD_REQUEST_POLICY_PENDING = 0, 00028 ICD_REQUEST_WAITING, 00030 ICD_REQUEST_CHANGETO, 00032 ICD_REQUEST_MERGED, 00034 ICD_REQUEST_CONNECTING_IAPS, 00036 ICD_REQUEST_SUCCEEDED, 00038 ICD_REQUEST_DENIED, 00041 ICD_REQUEST_DISCONNECTED, 00042 00044 ICD_REQUEST_MAX 00045 }; 00046 00051 typedef void (*icd_request_cb_fn) (enum icd_request_status status, 00052 gpointer user_data); 00053 00056 struct icd_request { 00058 enum icd_request_status state; 00060 GSList *users; 00063 gboolean multi_iaps; 00065 GSList *try_iaps; 00067 struct icd_policy_request req; 00068 }; 00069 00076 typedef gpointer (*icd_request_foreach_fn) (struct icd_request *request, 00077 gpointer user_data); 00078 00079 gpointer icd_request_foreach (icd_request_foreach_fn fn, 00080 gpointer user_data); 00081 void icd_request_free_iaps (struct icd_request *request); 00082 struct icd_request *icd_request_find (const gchar *network_type, 00083 const guint network_attrs, 00084 const gchar *network_id); 00085 struct icd_request *icd_request_find_by_iap (const gchar *network_type, 00086 const guint network_attrs, 00087 const gchar *network_id); 00088 struct icd_request *icd_request_find_by_iap_id (const gchar *iap_id, 00089 const gboolean is_local); 00090 void icd_request_send_ack (struct icd_request *request, 00091 struct icd_iap *iap); 00092 void icd_request_send_nack (struct icd_request *request); 00093 void icd_request_add_iap (struct icd_request *request, 00094 gchar *service_type, 00095 guint service_attrs, 00096 gchar *service_id, 00097 gchar *network_type, 00098 guint network_attrs, 00099 gchar *network_id, 00100 gint network_priority); 00101 struct icd_request *icd_request_new (guint policy_attrs, 00102 const gchar *service_type, 00103 const guint service_attrs, 00104 const gchar *service_id, 00105 const gchar *network_type, 00106 const guint network_attrs, 00107 const gchar *network_id); 00108 void icd_request_make (struct icd_request *request); 00109 gboolean icd_request_merge (struct icd_request *merge_request, 00110 struct icd_request *existing); 00111 void icd_request_cancel (struct icd_request *request, guint policy_attrs); 00112 void icd_request_tracking_info_remove (struct icd_request *request, 00113 struct icd_tracking_info *track); 00114 gboolean icd_request_tracking_info_delete (const gchar *sender); 00115 void icd_request_tracking_info_add (struct icd_request *request, 00116 struct icd_tracking_info *track); 00117 00118 00121 #endif