00001 /* 00002 * This file is part of connectionMgr. 00003 * 00004 * connectionMgr is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * connectionMgr is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00026 #ifndef __SCANTHREAD__H__ 00027 #define __SCANTHREAD__H__ 00028 00029 #include <gtk/gtk.h> 00030 #include <glib.h> 00031 #include <liberregxml/erregapi.h> 00032 00033 typedef enum 00034 { 00035 SCAN_IDLE = 0, // scan-thread not running 00036 SCAN_RUNNING, // scan-thread started and connecting to server 00037 SCAN_ABORTING, // scan-thread running but not wanted anymore 00038 SCAN_UNDEFINED 00039 } scan_status_t; 00040 00041 typedef struct 00042 { 00043 gchar* ssid; 00044 wireless_encr_type_t encryption; 00045 int quality; 00046 } network_spec_t; 00047 00048 typedef struct 00049 { 00050 gchar* ssid; // ssid to scan for, amongst others 00051 network_spec_t* networks; // networks found 00052 guint networks_num; // input: number of entries in networks[] 00053 guint networks_found; // output: number of entries 00054 // filled in networks[] 00055 GtkWidget* scanStatus; // label widget to store scan status in 00056 } scan_thread_parms; 00057 00058 #ifdef __cplusplus 00059 extern "C" 00060 { 00061 #endif /* __cplusplus */ 00062 00063 gboolean scanThread_start(scan_thread_parms* scan_parms); 00064 gboolean scanThread_stop(void); 00065 gboolean scanThread_wait(int timeout_sec); 00066 gboolean scanThread_stopped(void); 00067 00068 // datatypes functions 00069 void free_network_spec(network_spec_t* pNetwork); 00070 network_spec_t *dup_network_spec(network_spec_t* pNetwork); 00071 00072 #ifdef __cplusplus 00073 } 00074 #endif /* __cplusplus */ 00075 00076 #endif //__SCANTHREAD_H__