icd/srv_provider_api.h

Go to the documentation of this file.
00001 #ifndef SRV_PROVIDER_API_H
00002 #define SRV_PROVIDER_API_H
00003 
00004 /*
00005  This file is part of icd2-dev, ICd2 development header files.
00006 
00007  Copyright (C) 2007-2008 Nokia Corporation. All rights reserved.
00008 
00009  Contact: Patrik Flykt <patrik.flykt@nokia.com>
00010 
00011  Redistribution and use in source and binary forms, with or without
00012  modification, are permitted provided that the following conditions are met:
00013 
00014   * Redistributions of source code must retain the above copyright notice,
00015     this list of conditions and the following disclaimer.
00016   * Redistributions in binary form must reproduce the above copyright notice,
00017     this list of conditions and the following disclaimer in the documentation
00018     and/or other materials provided with the distribution.
00019   * Neither the name of Nokia Corporation nor the names of its contributors
00020     may be used to endorse or promote products derived from this software
00021     without specific prior written permission.
00022 
00023  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00026  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00027  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00028  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00029  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00030  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00031  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00032  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00033  POSSIBILITY OF SUCH DAMAGE.
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

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