00001 #ifndef SRV_PROVIDER_API_H
00002 #define SRV_PROVIDER_API_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00072 #ifdef __cplusplus
00073 extern "C" {
00074 #endif
00075
00076 #include <sys/types.h>
00077 #include <unistd.h>
00078 #include <glib.h>
00079
00080 #include <dbus_api.h>
00081 #include <network_api.h>
00082
00084 #define ICD_SRV_MODULE_VERSION ICD_NW_MODULE_VERSION
00085
00087 enum icd_srv_status {
00090 ICD_SRV_SUCCESS = 0,
00094 ICD_SRV_RESTART = 1,
00096 ICD_SRV_ERROR = 2
00097 };
00098
00100 enum icd_srv_identify_status {
00102 ICD_SRV_UNKNOWN = 0,
00104 ICD_SRV_IDENTIFIED = 1,
00106 ICD_SRV_CONTINUE = 8,
00107 };
00108
00121 typedef void
00122 (*icd_srv_identify_cb_fn) (const enum icd_srv_identify_status status,
00123 const gchar *service_type,
00124 const gchar *service_name,
00125 const guint service_attrs,
00126 const gchar *service_id,
00127 const gint service_priority,
00128 const gchar *network_type,
00129 const guint network_attrs,
00130 const gchar *network_id,
00131 gpointer identify_cb_token);
00148 typedef void (*icd_srv_identify_fn) (enum icd_scan_status status,
00149 const gchar *network_type,
00150 const gchar *network_name,
00151 const guint network_attrs,
00152 const gchar *network_id,
00153 const guint network_priority,
00154 enum icd_nw_levels signal,
00155 const gchar *station_id,
00156 const gint dB,
00157 icd_srv_identify_cb_fn identify_cb,
00158 gpointer identify_cb_token,
00159 gpointer *private);
00160
00165 typedef void (*icd_srv_disconnect_cb_fn) (enum icd_srv_status status,
00166 gpointer disconnect_cb_token);
00179 typedef void (*icd_srv_disconnect_fn) (const gchar *service_type,
00180 const guint service_attrs,
00181 const gchar *service_id,
00182 const gchar *network_type,
00183 const guint network_attrs,
00184 const gchar *network_id,
00185 const gchar *interface_name,
00186 icd_srv_disconnect_cb_fn disconnect_cb,
00187 gpointer disconnect_cb_token,
00188 gpointer *private);
00189
00196 typedef void (*icd_srv_connect_cb_fn) (enum icd_srv_status status,
00197 const gchar *err_str,
00198 gpointer connect_cb_token);
00211 typedef void (*icd_srv_connect_fn) (const gchar *service_type,
00212 const guint service_attrs,
00213 const gchar *service_id,
00214 const gchar *network_type,
00215 const guint network_attrs,
00216 const gchar *network_id,
00217 const gchar *interface_name,
00218 icd_srv_connect_cb_fn connect_cb,
00219 gpointer connect_cb_token,
00220 gpointer *private);
00221
00227 typedef void (*icd_srv_child_exit_fn) (const pid_t pid,
00228 const gint exit_status,
00229 gpointer *private);
00230
00237 typedef void (*icd_srv_destruct_fn) (gpointer *private);
00238
00241 struct icd_srv_api {
00242
00245 const gchar *version;
00246
00248 gpointer private;
00249
00251 icd_srv_connect_fn connect;
00252
00254 icd_srv_disconnect_fn disconnect;
00255
00257 icd_srv_identify_fn identify;
00258
00260 icd_srv_child_exit_fn child_exit;
00261
00263 icd_srv_destruct_fn srv_destruct;
00264 };
00265
00266
00273 typedef void (*icd_srv_watch_pid_fn) (const pid_t pid,
00274 gpointer watch_cb_token);
00275
00290 typedef void (*icd_srv_close_fn) (enum icd_srv_status status,
00291 const gchar *err_str,
00292 const gchar *service_type,
00293 const guint service_attrs,
00294 const gchar *service_id,
00295 const gchar *network_type,
00296 const guint network_attrs,
00297 const gchar *network_id);
00298
00301 enum icd_srv_limited_conn_status {
00303 ICD_SRV_LIMITED_CONN_DISABLED = 0,
00305 ICD_SRV_LIMITED_CONN_ENABLED = 1
00306 };
00321 typedef void
00322 (*icd_srv_limited_conn_fn) (const enum icd_srv_limited_conn_status conn_status,
00323 const gchar *service_type,
00324 const guint service_attrs,
00325 const gchar *service_id,
00326 const gchar *network_type,
00327 const guint network_attrs,
00328 const gchar *network_id);
00329
00341 typedef gboolean (*icd_srv_init_fn) (struct icd_srv_api *srv_api,
00342 icd_srv_watch_pid_fn watch_cb,
00343 gpointer watch_cb_token,
00344 icd_srv_close_fn close,
00345 icd_srv_limited_conn_fn limited_conn);
00346
00349 #ifdef __cplusplus
00350 }
00351 #endif
00352
00353 #endif