netwerk/wifi/osx_wifi.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial