5 * Apple80211 framework definitions
6 * This is an undocumented interface and the definitions here are based on
7 * information from MacStumbler (http://www.macstumbler.com/Apple80211.h) and
8 * whatever related information can be found with google and experiments ;-).
11 typedef struct __WirelessRef
*WirelessRef
;
12 typedef SInt32 WirelessError
;
13 #define errWirelessNoError 0
15 typedef struct WirelessInfo
{
29 typedef struct WirelessInfo2
{
30 /* TODO - these are probably not in correct order or complete */
35 typedef struct WirelessNetworkInfo
{
44 } WirelessNetworkInfo
;
46 typedef int wirelessKeyType
; /* TODO */
48 int WirelessIsAvailable(void);
49 WirelessError
WirelessAttach(WirelessRef
*ref
, UInt32 res
);
50 WirelessError
WirelessDetach(WirelessRef ref
);
51 WirelessError
WirelessPrivate(WirelessRef ref
, void *in_ptr
, int in_bytes
,
52 void *out_ptr
, int out_bytes
);
53 WirelessError
WirelessSetEnabled(WirelessRef ref
, UInt8 enabled
);
54 WirelessError
WirelessGetEnabled(WirelessRef ref
, UInt8
*enabled
);
55 WirelessError
WirelessSetPower(WirelessRef ref
, UInt8 power
);
56 WirelessError
WirelessGetPower(WirelessRef ref
, UInt8
*power
);
57 WirelessError
WirelessGetInfo(WirelessRef ref
, WirelessInfo
*info
);
58 WirelessError
WirelessGetInfo2(WirelessRef ref
, WirelessInfo2
*info
);
59 WirelessError
WirelessScan(WirelessRef ref
, CFArrayRef
*results
,
61 WirelessError
WirelessScanSplit(WirelessRef ref
, CFArrayRef
*ap_results
,
62 CFArrayRef
*ibss_results
, UInt32 strip_dups
);
63 WirelessError
WirelessDirectedScan(WirelessRef ref
, CFArrayRef
*results
,
64 UInt32 strip_dups
, CFStringRef ssid
);
65 WirelessError
WirelessDirectedScan2(WirelessRef ref
, CFDataRef ssid
,
66 UInt32 strip_dups
, CFArrayRef
*results
);
67 WirelessError
WirelessJoin(WirelessRef ref
, CFStringRef ssid
);
68 WirelessError
WirelessJoinWEP(WirelessRef ref
, CFStringRef ssid
,
70 WirelessError
WirelessJoin8021x(WirelessRef ref
, CFStringRef ssid
);
73 * ref: wireless reference from WirelessAttach()
76 * key_len: 13 for WEP-104 or 0 for clearing the key
77 * key: Pointer to the key or %NULL if key_len = 0
79 WirelessError
WirelessSetKey(WirelessRef ref
, wirelessKeyType type
,
80 int key_idx
, int key_len
,
81 const unsigned char *key
);
83 * Set WPA key (e.g., PMK for 4-way handshake)
84 * ref: wireless reference from WirelessAttach()
86 * key_len: 16, 32, or 0
87 * key: Pointer to the key or %NULL if key_len = 0
89 WirelessError
WirelessSetWPAKey(WirelessRef ref
, wirelessKeyType type
,
90 int key_len
, const unsigned char *key
);
91 WirelessError
WirelessAssociate(WirelessRef ref
, int type
, CFDataRef ssid
,
93 WirelessError
WirelessAssociate2(WirelessRef ref
, CFDictionaryRef scan_res
,
95 WirelessError
WirelessDisassociate(WirelessRef ref
);
98 * Get a copy of scan results for the given SSID
99 * The returned dictionary includes following entries:
100 * beaconInterval: CFNumber(kCFNumberSInt32Type)
101 * SSID: CFData buffer of the SSID
102 * isWPA: CFNumber(kCFNumberSInt32Type); 0 = not used, 1 = WPA, -128 = WPA2
103 * name: Name of the network (SSID string)
104 * BSSID: CFData buffer of the BSSID
105 * channel: CFNumber(kCFNumberSInt32Type)
106 * signal: CFNumber(kCFNumberSInt32Type)
108 * noise: CFNumber(kCFNumberSInt32Type)
109 * capability: CFNumber(kCFNumberSInt32Type)
110 * uniCipher: CFArray of CFNumber(kCFNumberSInt32Type)
111 * appleIE_Version: CFNumber(kCFNumberSInt32Type)
112 * appleIE_Robust: CFBoolean
113 * scanWasDirected: CFBoolean
114 * appleIE_Product: CFNumber(kCFNumberSInt32Type)
115 * authModes: CFArray of CFNumber(kCFNumberSInt32Type)
116 * multiCipher: CFNumber(kCFNumberSInt32Type)
118 CFDictionaryRef
WirelessSafeDirectedScanCopy(WirelessRef ref
, CFDataRef ssid
);
121 * Get information about the current association
122 * The returned dictionary includes following entries:
123 * keyData: CFData buffer of the key (e.g., 32-octet PSK)
124 * multiCipher: CFNumber(kCFNumberSInt32Type); 0 = none, 5 = CCMP?
125 * channel: CFNumber(kCFNumberSInt32Type)
127 * authMode: CFNumber(kCFNumberSInt32Type); 2 = WPA-Personal; 3 = open,
128 * 129 = WPA2-Enterprise
129 * isWPA: CFNumber(kCFNumberSInt32Type); 0 = not used, 1 = WPA, -128 == WPA2
130 * SSID: CFData buffer of the SSID
131 * cipherMode: CFNumber(kCFNumberSInt32Type); 0 = none, 4 = CCMP?
133 CFDictionaryRef
WirelessGetAssociationInfo(WirelessRef ref
);
135 WirelessError
WirelessConfigure(WirelessRef ref
);
138 * Get ASP information
139 * The returned dictionary includes following entries:
140 * Version: version number (e.g., 3.0)
141 * Channel: channel (e.g., 1)
142 * Vendor: vendor (e.g., 2)
144 CFDictionaryRef
WirelessGetInfoASP(void);
147 * Get a copy of the interface dictionary
148 * The returned dictionary has a key,value pairs for wireless interfaces.
149 * The key is the interface name and the value is the driver identifier, e.g.,
150 * en1: com.apple.driver.AirPort.Atheros
152 CFDictionaryRef
WirelessCopyInterfaceDict(void);
154 #endif /* APPLE80211_H */