Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / wpa / src / drivers / Apple80211.h
blobf72b9b907932424a210d14acd8e58cd563d439a8
1 #ifndef APPLE80211_H
2 #define APPLE80211_H
4 /*
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 ;-).
9 */
11 typedef struct __WirelessRef *WirelessRef;
12 typedef SInt32 WirelessError;
13 #define errWirelessNoError 0
15 typedef struct WirelessInfo {
16 UInt16 link_qual;
17 UInt16 comms_qual;
18 UInt16 signal;
19 UInt16 noise;
20 UInt16 port_stat;
21 UInt16 client_mode;
22 UInt16 res1;
23 UInt16 power;
24 UInt16 res2;
25 UInt8 bssID[6];
26 UInt8 ssid[34];
27 } WirelessInfo;
29 typedef struct WirelessInfo2 {
30 /* TODO - these are probably not in correct order or complete */
31 WirelessInfo info1;
32 UInt8 macAddress[6];
33 } WirelessInfo2;
35 typedef struct WirelessNetworkInfo {
36 UInt16 channel;
37 UInt16 noise;
38 UInt16 signal;
39 UInt8 bssid[6];
40 UInt16 beacon_int;
41 UInt16 capability;
42 UInt16 ssid_len;
43 UInt8 ssid[32];
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,
60 UInt32 strip_dups);
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,
69 CFStringRef passwd);
70 WirelessError WirelessJoin8021x(WirelessRef ref, CFStringRef ssid);
72 * Set WEP key
73 * ref: wireless reference from WirelessAttach()
74 * type: ?
75 * key_idx: 0..3
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()
85 * type: 0..4; 1 = PMK
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,
92 CFStringRef key);
93 WirelessError WirelessAssociate2(WirelessRef ref, CFDictionaryRef scan_res,
94 CFStringRef key);
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)
107 * appleIE: CFData
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)
126 * isIBSS: CFBoolean
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 */