Use better network identifier in supplicant test program
[platform/upstream/connman.git] / tools / supplicant.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2009  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #define SUPPLICANT_EAP_METHOD_MD5       (1 << 0)
23 #define SUPPLICANT_EAP_METHOD_TLS       (1 << 1)
24 #define SUPPLICANT_EAP_METHOD_MSCHAPV2  (1 << 2)
25 #define SUPPLICANT_EAP_METHOD_PEAP      (1 << 3)
26 #define SUPPLICANT_EAP_METHOD_TTLS      (1 << 4)
27 #define SUPPLICANT_EAP_METHOD_GTC       (1 << 5)
28 #define SUPPLICANT_EAP_METHOD_OTP       (1 << 6)
29 #define SUPPLICANT_EAP_METHOD_LEAP      (1 << 7)
30
31 #define SUPPLICANT_CAPABILITY_SCAN_ACTIVE       (1 << 0)
32 #define SUPPLICANT_CAPABILITY_SCAN_PASSIVE      (1 << 1)
33 #define SUPPLICANT_CAPABILITY_SCAN_SSID         (1 << 2)
34
35 enum supplicant_mode {
36         SUPPLICANT_MODE_UNKNOWN,
37         SUPPLICANT_MODE_INFRA,
38         SUPPLICANT_MODE_IBSS,
39 };
40
41 enum supplicant_security {
42         SUPPLICANT_SECURITY_UNKNOWN,
43         SUPPLICANT_SECURITY_NONE,
44         SUPPLICANT_SECURITY_WEP,
45         SUPPLICANT_SECURITY_PSK,
46         SUPPLICANT_SECURITY_IEEE8021X,
47 };
48
49 enum supplicant_state {
50         SUPPLICANT_STATE_UNKNOWN,
51         SUPPLICANT_STATE_DISCONNECTED,
52         SUPPLICANT_STATE_INACTIVE,
53         SUPPLICANT_STATE_SCANNING,
54         SUPPLICANT_STATE_AUTHENTICATING,
55         SUPPLICANT_STATE_ASSOCIATING,
56         SUPPLICANT_STATE_ASSOCIATED,
57         SUPPLICANT_STATE_4WAY_HANDSHAKE,
58         SUPPLICANT_STATE_GROUP_HANDSHAKE,
59         SUPPLICANT_STATE_COMPLETED,
60 };
61
62 struct supplicant_interface;
63
64 const char *supplicant_interface_get_ifname(struct supplicant_interface *interface);
65
66 struct supplicant_network;
67
68 struct supplicant_interface *supplicant_network_get_interface(struct supplicant_network *network);
69 const char *supplicant_network_get_name(struct supplicant_network *network);
70 const char *supplicant_network_get_identifier(struct supplicant_network *network);
71 enum supplicant_mode supplicant_network_get_mode(struct supplicant_network *network);
72
73 struct supplicant_callbacks {
74         void (*interface_added) (struct supplicant_interface *interface);
75         void (*interface_removed) (struct supplicant_interface *interface);
76         void (*network_added) (struct supplicant_network *network);
77         void (*network_removed) (struct supplicant_network *network);
78 };
79
80 int supplicant_register(const struct supplicant_callbacks *callbacks);
81 void supplicant_unregister(const struct supplicant_callbacks *callbacks);