michael@0: // Copyright 2008, Google Inc. michael@0: // michael@0: // Redistribution and use in source and binary forms, with or without michael@0: // modification, are permitted provided that the following conditions are met: michael@0: // michael@0: // 1. Redistributions of source code must retain the above copyright notice, michael@0: // this list of conditions and the following disclaimer. michael@0: // 2. Redistributions in binary form must reproduce the above copyright notice, michael@0: // this list of conditions and the following disclaimer in the documentation michael@0: // and/or other materials provided with the distribution. michael@0: // 3. Neither the name of Google Inc. nor the names of its contributors may be michael@0: // used to endorse or promote products derived from this software without michael@0: // specific prior written permission. michael@0: // michael@0: // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED michael@0: // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@0: // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO michael@0: // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@0: // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, michael@0: // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; michael@0: // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, michael@0: // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR michael@0: // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF michael@0: // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: // michael@0: // The contents of this file are taken from Apple80211.h from the iStumbler michael@0: // project (http://www.istumbler.net). This project is released under the BSD michael@0: // license with the following restrictions. michael@0: // michael@0: // Copyright (c) 02006, Alf Watt (alf@istumbler.net). All rights reserved. michael@0: // michael@0: // Redistribution and use in source and binary forms, with or without michael@0: // modification, are permitted provided that the following conditions michael@0: // are met: michael@0: // michael@0: // * Redistributions of source code must retain the above copyright michael@0: // notice, this list of conditions and the following disclaimer. michael@0: // michael@0: // * Redistributions in binary form must reproduce the above copyright michael@0: // notice, this list of conditions and the following disclaimer in the michael@0: // documentation and/or other materials provided with the distribution. michael@0: // michael@0: // * Neither the name of iStumbler nor the names of its contributors may be michael@0: // used to endorse or promote products derived from this software without michael@0: // specific prior written permission. michael@0: // michael@0: // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS michael@0: // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED michael@0: // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A michael@0: // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER michael@0: // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, michael@0: // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, michael@0: // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR michael@0: // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF michael@0: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING michael@0: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS michael@0: // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: // michael@0: // This is the reverse engineered header for the Apple80211 private framework. michael@0: // The framework can be found at michael@0: // /System/Library/PrivateFrameworks/Apple80211.framework. michael@0: michael@0: #ifndef GEARS_GEOLOCATION_OSX_WIFI_H__ michael@0: #define GEARS_GEOLOCATION_OSX_WIFI_H__ michael@0: michael@0: #include michael@0: michael@0: extern "C" { michael@0: michael@0: typedef SInt32 WIErr; michael@0: michael@0: // A WirelessContext should be created using WirelessAttach michael@0: // before any other Wireless functions are called. WirelessDetach michael@0: // is used to dispose of a WirelessContext. michael@0: typedef struct __WirelessContext *WirelessContextPtr; michael@0: michael@0: // WirelessAttach michael@0: // michael@0: // This should be called before all other wireless functions. michael@0: typedef WIErr (*WirelessAttachFunction)(WirelessContextPtr *outContext, michael@0: const UInt32); michael@0: michael@0: // WirelessDetach michael@0: // michael@0: // This should be called after all other wireless functions. michael@0: typedef WIErr (*WirelessDetachFunction)(WirelessContextPtr inContext); michael@0: michael@0: typedef UInt16 WINetworkInfoFlags; michael@0: michael@0: struct WirelessNetworkInfo michael@0: { michael@0: UInt16 channel; // Channel for the network. michael@0: SInt16 noise; // Noise for the network. 0 for Adhoc. michael@0: SInt16 signal; // Signal strength of the network. 0 for Adhoc. michael@0: UInt8 macAddress[6]; // MAC address of the wireless access point. michael@0: UInt16 beaconInterval; // Beacon interval in milliseconds michael@0: WINetworkInfoFlags flags; // Flags for the network michael@0: UInt16 nameLen; michael@0: SInt8 name[32]; michael@0: }; michael@0: michael@0: // WirelessScanSplit michael@0: // michael@0: // WirelessScanSplit scans for available wireless networks. It will allocate 2 michael@0: // CFArrays to store a list of managed and adhoc networks. The arrays hold michael@0: // CFData objects which contain WirelessNetworkInfo structures. michael@0: // michael@0: // Note: An adhoc network created on the computer the scan is running on will michael@0: // not be found. WirelessGetInfo can be used to find info about a local adhoc michael@0: // network. michael@0: // michael@0: // If stripDups != 0 only one bases tation for each SSID will be returned. michael@0: typedef WIErr (*WirelessScanSplitFunction)(WirelessContextPtr inContext, michael@0: CFArrayRef *apList, michael@0: CFArrayRef *adhocList, michael@0: const UInt32 stripDups); michael@0: michael@0: } // extern "C" michael@0: michael@0: #endif // GEARS_GEOLOCATION_OSX_WIFI_H__