1 // Copyright 2008, Google Inc.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met:
6 // 1. Redistributions of source code must retain the above copyright notice,
7 // this list of conditions and the following disclaimer.
8 // 2. Redistributions in binary form must reproduce the above copyright notice,
9 // this list of conditions and the following disclaimer in the documentation
10 // and/or other materials provided with the distribution.
11 // 3. Neither the name of Google Inc. nor the names of its contributors may be
12 // used to endorse or promote products derived from this software without
13 // specific prior written permission.
15 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 // The contents of this file are taken from Apple80211.h from the iStumbler
27 // project (http://www.istumbler.net). This project is released under the BSD
28 // license with the following restrictions.
30 // Copyright (c) 02006, Alf Watt (alf@istumbler.net). All rights reserved.
32 // Redistribution and use in source and binary forms, with or without
33 // modification, are permitted provided that the following conditions
36 // * Redistributions of source code must retain the above copyright
37 // notice, this list of conditions and the following disclaimer.
39 // * Redistributions in binary form must reproduce the above copyright
40 // notice, this list of conditions and the following disclaimer in the
41 // documentation and/or other materials provided with the distribution.
43 // * Neither the name of iStumbler nor the names of its contributors may be
44 // used to endorse or promote products derived from this software without
45 // specific prior written permission.
47 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
48 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
49 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
50 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
51 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
52 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
53 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
54 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
55 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
56 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
57 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 // This is the reverse engineered header for the Apple80211 private framework.
60 // The framework can be found at
61 // /System/Library/PrivateFrameworks/Apple80211.framework.
63 #ifndef GEARS_GEOLOCATION_OSX_WIFI_H__
64 #define GEARS_GEOLOCATION_OSX_WIFI_H__
66 #include <CoreFoundation/CoreFoundation.h>
72 // A WirelessContext should be created using WirelessAttach
73 // before any other Wireless functions are called. WirelessDetach
74 // is used to dispose of a WirelessContext.
75 typedef struct __WirelessContext
* WirelessContextPtr
;
79 // This should be called before all other wireless functions.
80 typedef WIErr (*WirelessAttachFunction
)(WirelessContextPtr
* outContext
,
85 // This should be called after all other wireless functions.
86 typedef WIErr (*WirelessDetachFunction
)(WirelessContextPtr inContext
);
88 typedef UInt16 WINetworkInfoFlags
;
90 struct WirelessNetworkInfo
{
91 UInt16 channel
; // Channel for the network.
92 SInt16 noise
; // Noise for the network. 0 for Adhoc.
93 SInt16 signal
; // Signal strength of the network. 0 for Adhoc.
94 UInt8 macAddress
[6]; // MAC address of the wireless access point.
95 UInt16 beaconInterval
; // Beacon interval in milliseconds
96 WINetworkInfoFlags flags
; // Flags for the network
103 // WirelessScanSplit scans for available wireless networks. It will allocate 2
104 // CFArrays to store a list of managed and adhoc networks. The arrays hold
105 // CFData objects which contain WirelessNetworkInfo structures.
107 // Note: An adhoc network created on the computer the scan is running on will
108 // not be found. WirelessGetInfo can be used to find info about a local adhoc
111 // If stripDups != 0 only one bases tation for each SSID will be returned.
112 typedef WIErr (*WirelessScanSplitFunction
)(WirelessContextPtr inContext
,
114 CFArrayRef
* adhocList
,
115 const UInt32 stripDups
);
119 #endif // GEARS_GEOLOCATION_OSX_WIFI_H__