2929import com .sun .jna .Structure ;
3030import com .sun .jna .ptr .IntByReference ;
3131import com .sun .jna .ptr .PointerByReference ;
32+ import com .sun .jna .win32 .W32APITypeMapper ;
3233
3334/**
3435 * Module Name:
4142public interface WlanApi extends Library {
4243 WlanApi INSTANCE = Native .load ("wlanapi" , WlanApi .class );
4344 int WLAN_MAX_NAME_LENGTH = 256 ;
44- int DOT11_SSID_MAX_LENGTH = 32 ; // 32 bytes
4545
4646 @ Structure .FieldOrder ({"dwNumberOfItems" , "dwIndex" , "InterfaceInfo" })
4747 class WLAN_INTERFACE_INFO_LIST extends Structure {
@@ -138,16 +138,16 @@ interface WLAN_CONNECTION_MODE {
138138 @ Structure .FieldOrder ({"dot11Ssid" , "dot11BssType" , "dot11Bssid" , "dot11PhyType" , "uDot11PhyIndex" ,
139139 "wlanSignalQuality" , "ulRxRate" , "ulTxRate" })
140140 class WLAN_ASSOCIATION_ATTRIBUTES extends Structure {
141- public DOT11_SSID dot11Ssid ;
141+ public Windot11 . DOT11_SSID dot11Ssid ;
142142
143143 /**
144- * See {@link DOT11_BSS_TYPE} for possible values
144+ * See {@link Windot11. DOT11_BSS_TYPE} for possible values
145145 */
146146 public int dot11BssType ;
147- public DOT11_MAC_ADDRESS dot11Bssid ;
147+ public Windot11 . DOT11_MAC_ADDRESS dot11Bssid ;
148148
149149 /**
150- * See {@link DOT11_PHY_TYPE } for possible values
150+ * See {@link Windot11.DOT11_BSS_TYPE } for possible values
151151 */
152152 public int dot11PhyType ;
153153 public WinDef .ULONG uDot11PhyIndex ;
@@ -160,78 +160,24 @@ public WLAN_ASSOCIATION_ATTRIBUTES(Pointer p) {
160160 }
161161 }
162162
163- interface DOT11_BSS_TYPE {
164- int dot11_BSS_type_infrastructure = 1 ;
165- int dot11_BSS_type_independent = 2 ;
166- int dot11_BSS_type_any = 3 ;
167- }
168-
169- @ Structure .FieldOrder ({"uSSIDLength" , "ucSSID" })
170- class DOT11_SSID extends Structure {
171- public WinDef .ULONG uSSIDLength ;
172- public byte [] ucSSID = new byte [DOT11_SSID_MAX_LENGTH ];
173- }
174-
175- @ Structure .FieldOrder ("ucDot11MacAddress" )
176- class DOT11_MAC_ADDRESS extends Structure {
177- public WinDef .UCHAR [] ucDot11MacAddress = new WinDef .UCHAR [6 ];
178- }
179-
180- interface DOT11_PHY_TYPE {
181- int dot11_phy_type_unknown = 0 ;
182- int dot11_phy_type_any = dot11_phy_type_unknown ;
183- int dot11_phy_type_fhss = 1 ;
184- int dot11_phy_type_dsss = 2 ;
185- int dot11_phy_type_irbaseband = 3 ;
186- int dot11_phy_type_ofdm = 4 ;
187- int dot11_phy_type_hrdsss = 5 ;
188- int dot11_phy_type_erp = 6 ;
189- int dot11_phy_type_ht = 7 ;
190- int dot11_phy_type_IHV_start = 0x80000000 ;
191- int dot11_phy_type_IHV_end = 0xffffffff ;
192- }
193-
194163 @ Structure .FieldOrder ({"bSecurityEnabled" , "bOneXEnabled" , "dot11AuthAlgorithm" , "dot11CipherAlgorithm" })
195164 class WLAN_SECURITY_ATTRIBUTES extends Structure {
196165 public boolean bSecurityEnabled ;
197166 public boolean bOneXEnabled ;
198167
199168 /**
200- * See {@link DOT11_AUTH_ALGORITHM} for possible values
169+ * See {@link Windot11. DOT11_AUTH_ALGORITHM} for possible values
201170 */
202171 public int dot11AuthAlgorithm ;
203172
204173 /**
205- * See {@link DOT11_CIPHER_ALGORITHM} for possible values
174+ * See {@link Windot11. DOT11_CIPHER_ALGORITHM} for possible values
206175 */
207176 public int dot11CipherAlgorithm ;
208- }
209177
210- // DOT11_AUTH_ALGO_LIST
211- interface DOT11_AUTH_ALGORITHM {
212- int DOT11_AUTH_ALGO_80211_OPEN = 1 ;
213- int DOT11_AUTH_ALGO_80211_SHARED_KEY = 2 ;
214- int DOT11_AUTH_ALGO_WPA = 3 ;
215- int DOT11_AUTH_ALGO_WPA_PSK = 4 ;
216- int DOT11_AUTH_ALGO_WPA_NONE = 5 ; // used in NatSTA only
217- int DOT11_AUTH_ALGO_RSNA = 6 ;
218- int DOT11_AUTH_ALGO_RSNA_PSK = 7 ;
219- int DOT11_AUTH_ALGO_IHV_START = 0x80000000 ;
220- int DOT11_AUTH_ALGO_IHV_END = 0xffffffff ;
221- }
222-
223- // Cipher algorithm Ids (for little endian platform)
224- interface DOT11_CIPHER_ALGORITHM {
225- int DOT11_CIPHER_ALGO_NONE = 0x00 ;
226- int DOT11_CIPHER_ALGO_WEP40 = 0x01 ;
227- int DOT11_CIPHER_ALGO_TKIP = 0x02 ;
228- int DOT11_CIPHER_ALGO_CCMP = 0x04 ;
229- int DOT11_CIPHER_ALGO_WEP104 = 0x05 ;
230- int DOT11_CIPHER_ALGO_WPA_USE_GROUP = 0x100 ;
231- int DOT11_CIPHER_ALGO_RSN_USE_GROUP = 0x100 ;
232- int DOT11_CIPHER_ALGO_WEP = 0x101 ;
233- int DOT11_CIPHER_ALGO_IHV_START = 0x80000000 ;
234- int DOT11_CIPHER_ALGO_IHV_END = 0xffffffff ;
178+ public WLAN_SECURITY_ATTRIBUTES () {
179+ super (W32APITypeMapper .UNICODE );
180+ }
235181 }
236182
237183 /**
0 commit comments