scan.h
00001 /* 00002 * Based on code from 'iw': 00003 * 00004 * Copyright (c) 2007, 2008 Johannes Berg 00005 * Copyright (c) 2007 Andy Lutomirski 00006 * Copyright (c) 2007 Mike Kershaw 00007 * Copyright (c) 2008-2009 Luis R. Rodriguez 00008 * 00009 * Permission to use, copy, modify, and/or distribute this software for any 00010 * purpose with or without fee is hereby granted, provided that the above 00011 * copyright notice and this permission notice appear in all copies. 00012 * 00013 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 00014 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 00015 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 00016 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 00017 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 00018 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 00019 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00020 * 00021 */ 00022 00023 /* 00024 * Integration as a player driver was done by Michael Bienia. 00025 * 00026 * Copyright © 2010 Michael Bienia <m.bienia@stud.fh-dortmund.de> 00027 * 00028 */ 00029 00030 #ifndef WLANSCAN_SCAN_H 00031 #define WLANSCAN_SCAN_H 00032 00033 #include <libplayerinterface/player.h> 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 struct nl80211_state { 00040 struct nl_handle *nl_handle; 00041 struct nl_cache *nl_cache; 00042 struct genl_family *nl80211; 00043 }; 00044 00045 struct interface { 00046 const char *ifname; 00047 unsigned int ifindex; 00048 }; 00049 00050 extern int nl80211_init(struct nl80211_state *state); 00051 extern void nl80211_cleanup(struct nl80211_state *state); 00052 00053 extern int trigger_scan(struct nl80211_state *state, 00054 unsigned int passive, struct interface *netif); 00055 extern unsigned int wait_scan(struct nl80211_state *state, 00056 struct interface *netif); 00057 extern int get_scan_results(struct nl80211_state *state, 00058 struct interface *netif, 00059 player_wifi_data_t *wifi_data); 00060 00061 #ifdef __cplusplus 00062 } 00063 #endif 00064 #endif

