xref: /titanic_41/usr/src/cmd/cmd-inet/usr.lib/wpad/driver.h (revision ef287aad55c36c55e43651ee7ec7aa169b89408d)
1 /*
2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*
7  * Copyright (c) 2003-2004, Jouni Malinen <jkmaline@cc.hut.fi>
8  * Sun elects to license this software under the BSD license.
9  * See README for more details.
10  */
11 #ifndef __DRIVER_H
12 #define	__DRIVER_H
13 
14 #include <libdlwlan.h>
15 #include <libdllink.h>
16 
17 #ifdef	__cplusplus
18 extern "C" {
19 #endif
20 
21 typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg;
22 typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
23 	CIPHER_WEP104 } wpa_cipher;
24 typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE } wpa_key_mgmt;
25 
26 struct wpa_driver_ops {
27 	int (*get_bssid)(dladm_handle_t, datalink_id_t, char *);
28 	int (*get_ssid)(dladm_handle_t, datalink_id_t, char *);
29 	int (*set_wpa)(dladm_handle_t, datalink_id_t, boolean_t);
30 	int (*set_key)(dladm_handle_t, datalink_id_t, wpa_alg, uint8_t *,
31 	    int, boolean_t, uint8_t *, uint32_t, uint8_t *, uint32_t);
32 	int (*scan)(dladm_handle_t, datalink_id_t);
33 	int (*get_scan_results)(dladm_handle_t, datalink_id_t,
34 	    dladm_wlan_ess_t *, uint32_t);
35 	int (*disassociate)(dladm_handle_t, datalink_id_t, int);
36 	int (*associate)(dladm_handle_t, datalink_id_t, const char *, uint8_t *,
37 	    uint32_t);
38 };
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* __DRIVER_H */
45