1 NAS is a minimal VxWorks and Linux compatible Network Authentication
2 Server that implements 802.1X port authentication (RADIUS only) and
3 Wi-Fi Protected Access (WPA) for 802.11 networks (Broadcom drivers only).
5 The code base is split between common code (nas.c and wpa.c), driver
6 specific code (nas_wl.c), application specific code (nas_wksp.c), and
7 OS specific code (nas_vx.c and nas_linux.c).
9 Major features yet to be implemented include:
11 * RADIUS Accounting. See 802.1X Internet Draft 20.
12 * Mutual authentication (802.11 IBSS mode).
13 * Limited network access (e.g., via 802.1Q VLAN)
18 NAS and the Broadcom driver communicate using two mechanisms: ioctls and
19 802.3/SNAP frames. Ioctls are used by NAS to query or setup driver states.
20 802.3/SNAP frames are generated by the driver when it needs to asynchronously
21 indicate information to NAS. 802.3/SNAP frames are also used to encapsulate
22 802.1x frames starting from release 3.41.xx. NAS listens on a socket for
23 these indications and encapsulated 802.1x frames.
26 The following ioctls are used by NAS:
33 per interface initialization:
35 WLC_SET_EAP_RESTRICT (true)
36 WLC_SET_WEP_RESTRICT* (true)
37 WLC_SET_KEY (clear all default keys)
38 WLC_SCB_DEAUTHORIZE (broadcast addr)
41 WLC_GET_WSEC (verify that SET took)
44 during authentication:
49 WLC_SCB_DEAUTHENTICATE_FOR_REASON
50 WLC_TKIP_COUNTERMEASURES (toggle on or off)
53 WLC_SET_EAP_RESTRICT (false)
54 WLC_SET_WEP_RESTRICT* (false)
55 WLC_SET_KEY (clear all default keys)
56 WLC_SCB_DEAUTHORIZE (broadcast addr)
59 WLC_WDS_GET_REMOTE_HWADDR
64 *These are followed by gratuitous WLC_GET_SSID/WLC_SET_SSID pair.
68 Details of the ioctls:
70 Most ioctl calls use wl_ioctl(), defined e.g. in src/router/shared/wl_vx.c as:
72 int wl_ioctl(char *pDevName, int cmd, void *buf, int len)
74 "buf" is a structure which is specific to each call. Any portion of buf not
75 explicitly set on input should be zero. Structures and values not explicitly
76 defined below are defined in src/include/wlioctl.h.
98 unit number/network interface instance
109 require 802.1X authentication before STA can pass data frames
111 allow STA to pass data frames without 802.1X authentication
125 require all data frames to be encrypted
127 allow unencrypted data frames
140 buf.index = key index (0-3)
141 buf.ea = address of STA (if pairwise key)
142 buf.flags = WSEC_PRIMARY_KEY
143 key is for transmit and receive
145 key is for receive only
146 buf.len = key length in bytes
157 -1 invalid key index or interface currently disabled
164 buf = address of STA to be deauthorized
177 buf = any combination of TKIP_ENABLED, AES_ENABLED, WEP_ENABLED
184 -1 unsupported algorithm
194 buf = any combination of TKIP_ENABLED, AES_ENABLED, WEP_ENABLED
204 buf = one of WPA_AUTH_DISABLED, WPA_AUTH_PSK, or WPA_AUTH_UNSPECIFIED
217 buf = address of STA to authorize
233 buf.index = index of key to query (0-MAXKEYS)
236 buf.iv = current value of the transmit sequence counter for key
237 specified by buf.index
243 WLC_SCB_DEAUTHENTICATE_FOR_REASON
248 buf.val = reason code
249 buf.ea = address of STA to be deauthenticated
257 WLC_TKIP_COUNTERMEASURES
263 start countermeasures
272 -1 TKIP not currently enabled
274 WLC_WDS_GET_REMOTE_HWADDR
282 buf = wireless bridge's remote endpoint's mac address
286 -1 the interface is not WDS
293 buf = wireless bridge's remote endpoint's mac address
298 role: 0 - local endpoint is WPA supplicant
299 1 - local endpoint is WPA authenticator
303 -1 the interface is not a wireless bridge
305 get "wds_wpa_role" (using WLC_GET_VAR ioctl)
310 buf = "wds_wpa_role<null><6 bytes remote endpoint's mac address>"
315 role: 0 - local endpoint is WPA supplicant
316 1 - local endpoint is WPA authenticator
321 set "wds_wpa_role" (using WLC_SET_VAR ioctl)
326 buf = "wds_wpa_role<null><6 bytes remote endpoint's mac address><1 byte role>"
327 role: 0 - local endpoint is WPA supplicant
328 1 - local endpoint is WPA authenticator
329 255 - endpoint with lower mac address is WPA supplicant
338 Driver communicates the indication messages to the NAS, message format is
340 Actual message data follows the header:
342 Data = (char *(wlc_secpvt_data + 1));
344 Ethernet protocol type used is ETHER_TYPE_BRCM (0x886c). Frames exchanged are ETHERNET II frames.
346 (this data structure is defined in include/wlioctl.h)
348 typedef struct wl_secpvt_data {
349 struct ether_header eth; /*Regular ethernet header with proto type 0x886c */
350 bcmeth_bcm_hdr_t bcm_hdr;
351 /* user specific Data*/
354 char ifname[WL_WPA_MSG_IFNAME_MAX]; /* name of the packet incoming interface*/
357 (this common data structure is defined in proto/bcmeth.h)
359 typedef struct bcmeth_bcm_hdr
361 uint16 subtype; /* Vendor specific..32769*/
363 uint8 version; /* Version is 0*/
364 uint8 oui[3]; /* Broadcom OUI*/
365 /* user specific Data */
367 } PACKED bcmeth_bcm_hdr_t;
369 vendor_long is defined as 32769 . to specify this as a vendor specific subtype.
370 length field indicates the length of the actual frame from this field.
371 version field is set to 0 BCMILCP_BCM_SUBTYPEHDR_VERSION
372 oui is broadcom OUI. 0x00/0x10/0x18
373 sub_type defined in bcmeth_bcm_hdr data structure identifies different messages.
375 #define BCMILCP_BCM_SUBTYPE_RESERVED 0
376 #define BCMILCP_BCM_SUBTYPE_WPA 1
377 #define BCMILCP_BCM_SUBTYPE_EAPOL 2
378 #define BCMILCP_BCM_SUBTYPE_SES 3
380 once the sub_type is identified,
382 version: indicates the version of this user specific data.
384 msg_type: this has meaning only when sub_type is BCMILCP_BCM_SUBTYPE_WPA
386 /* Type field values for the WL WPA subtype driver messages */
387 #define WLC_ASSOC_MSG 1
388 #define WLC_DISASSOC_MSG 2
389 #define WLC_PTK_MIC_MSG 3
390 #define WLC_GTK_MIC_MSG 4