1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/wifi/osx_wifi.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,120 @@ 1.4 +// Copyright 2008, Google Inc. 1.5 +// 1.6 +// Redistribution and use in source and binary forms, with or without 1.7 +// modification, are permitted provided that the following conditions are met: 1.8 +// 1.9 +// 1. Redistributions of source code must retain the above copyright notice, 1.10 +// this list of conditions and the following disclaimer. 1.11 +// 2. Redistributions in binary form must reproduce the above copyright notice, 1.12 +// this list of conditions and the following disclaimer in the documentation 1.13 +// and/or other materials provided with the distribution. 1.14 +// 3. Neither the name of Google Inc. nor the names of its contributors may be 1.15 +// used to endorse or promote products derived from this software without 1.16 +// specific prior written permission. 1.17 +// 1.18 +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 1.19 +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.20 +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 1.21 +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.22 +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1.23 +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 1.24 +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 1.25 +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 1.26 +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 1.27 +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.28 +// 1.29 +// The contents of this file are taken from Apple80211.h from the iStumbler 1.30 +// project (http://www.istumbler.net). This project is released under the BSD 1.31 +// license with the following restrictions. 1.32 +// 1.33 +// Copyright (c) 02006, Alf Watt (alf@istumbler.net). All rights reserved. 1.34 +// 1.35 +// Redistribution and use in source and binary forms, with or without 1.36 +// modification, are permitted provided that the following conditions 1.37 +// are met: 1.38 +// 1.39 +// * Redistributions of source code must retain the above copyright 1.40 +// notice, this list of conditions and the following disclaimer. 1.41 +// 1.42 +// * Redistributions in binary form must reproduce the above copyright 1.43 +// notice, this list of conditions and the following disclaimer in the 1.44 +// documentation and/or other materials provided with the distribution. 1.45 +// 1.46 +// * Neither the name of iStumbler nor the names of its contributors may be 1.47 +// used to endorse or promote products derived from this software without 1.48 +// specific prior written permission. 1.49 +// 1.50 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 1.51 +// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 1.52 +// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 1.53 +// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 1.54 +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1.55 +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1.56 +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 1.57 +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1.58 +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 1.59 +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 1.60 +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.61 +// 1.62 +// This is the reverse engineered header for the Apple80211 private framework. 1.63 +// The framework can be found at 1.64 +// /System/Library/PrivateFrameworks/Apple80211.framework. 1.65 + 1.66 +#ifndef GEARS_GEOLOCATION_OSX_WIFI_H__ 1.67 +#define GEARS_GEOLOCATION_OSX_WIFI_H__ 1.68 + 1.69 +#include <CoreFoundation/CoreFoundation.h> 1.70 + 1.71 +extern "C" { 1.72 + 1.73 +typedef SInt32 WIErr; 1.74 + 1.75 +// A WirelessContext should be created using WirelessAttach 1.76 +// before any other Wireless functions are called. WirelessDetach 1.77 +// is used to dispose of a WirelessContext. 1.78 +typedef struct __WirelessContext *WirelessContextPtr; 1.79 + 1.80 +// WirelessAttach 1.81 +// 1.82 +// This should be called before all other wireless functions. 1.83 +typedef WIErr (*WirelessAttachFunction)(WirelessContextPtr *outContext, 1.84 + const UInt32); 1.85 + 1.86 +// WirelessDetach 1.87 +// 1.88 +// This should be called after all other wireless functions. 1.89 +typedef WIErr (*WirelessDetachFunction)(WirelessContextPtr inContext); 1.90 + 1.91 +typedef UInt16 WINetworkInfoFlags; 1.92 + 1.93 +struct WirelessNetworkInfo 1.94 +{ 1.95 + UInt16 channel; // Channel for the network. 1.96 + SInt16 noise; // Noise for the network. 0 for Adhoc. 1.97 + SInt16 signal; // Signal strength of the network. 0 for Adhoc. 1.98 + UInt8 macAddress[6]; // MAC address of the wireless access point. 1.99 + UInt16 beaconInterval; // Beacon interval in milliseconds 1.100 + WINetworkInfoFlags flags; // Flags for the network 1.101 + UInt16 nameLen; 1.102 + SInt8 name[32]; 1.103 +}; 1.104 + 1.105 +// WirelessScanSplit 1.106 +// 1.107 +// WirelessScanSplit scans for available wireless networks. It will allocate 2 1.108 +// CFArrays to store a list of managed and adhoc networks. The arrays hold 1.109 +// CFData objects which contain WirelessNetworkInfo structures. 1.110 +// 1.111 +// Note: An adhoc network created on the computer the scan is running on will 1.112 +// not be found. WirelessGetInfo can be used to find info about a local adhoc 1.113 +// network. 1.114 +// 1.115 +// If stripDups != 0 only one bases tation for each SSID will be returned. 1.116 +typedef WIErr (*WirelessScanSplitFunction)(WirelessContextPtr inContext, 1.117 + CFArrayRef *apList, 1.118 + CFArrayRef *adhocList, 1.119 + const UInt32 stripDups); 1.120 + 1.121 +} // extern "C" 1.122 + 1.123 +#endif // GEARS_GEOLOCATION_OSX_WIFI_H__