wifi: Add support for autoscan request
[framework/connectivity/connman.git] / tools / supplicant.h
index 1489919..556dc7d 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  Connection Manager
  *
- *  Copyright (C) 2007-2009  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2007-2012  Intel Corporation. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
 #define SUPPLICANT_EAP_METHOD_GTC      (1 << 5)
 #define SUPPLICANT_EAP_METHOD_OTP      (1 << 6)
 #define SUPPLICANT_EAP_METHOD_LEAP     (1 << 7)
+#define SUPPLICANT_EAP_METHOD_WSC      (1 << 8)
+
+#define SUPPLICANT_CAPABILITY_KEYMGMT_NONE     (1 << 0)
+#define SUPPLICANT_CAPABILITY_KEYMGMT_IEEE8021X        (1 << 1)
+#define SUPPLICANT_CAPABILITY_KEYMGMT_WPA_NONE (1 << 2)
+#define SUPPLICANT_CAPABILITY_KEYMGMT_WPA_PSK  (1 << 3)
+#define SUPPLICANT_CAPABILITY_KEYMGMT_WPA_EAP  (1 << 4)
+#define SUPPLICANT_CAPABILITY_KEYMGMT_WPS      (1 << 5)
+
+#define SUPPLICANT_CAPABILITY_AUTHALG_OPEN     (1 << 0)
+#define SUPPLICANT_CAPABILITY_AUTHALG_SHARED   (1 << 1)
+#define SUPPLICANT_CAPABILITY_AUTHALG_LEAP     (1 << 2)
+
+#define SUPPLICANT_CAPABILITY_PROTO_WPA                (1 << 0)
+#define SUPPLICANT_CAPABILITY_PROTO_RSN                (1 << 1)
+
+#define SUPPLICANT_CAPABILITY_GROUP_WEP40      (1 << 0)
+#define SUPPLICANT_CAPABILITY_GROUP_WEP104     (1 << 1)
+#define SUPPLICANT_CAPABILITY_GROUP_TKIP       (1 << 2)
+#define SUPPLICANT_CAPABILITY_GROUP_CCMP       (1 << 3)
+
+#define SUPPLICANT_CAPABILITY_PAIRWISE_NONE    (1 << 0)
+#define SUPPLICANT_CAPABILITY_PAIRWISE_TKIP    (1 << 1)
+#define SUPPLICANT_CAPABILITY_PAIRWISE_CCMP    (1 << 2)
 
 #define SUPPLICANT_CAPABILITY_SCAN_ACTIVE      (1 << 0)
 #define SUPPLICANT_CAPABILITY_SCAN_PASSIVE     (1 << 1)
 #define SUPPLICANT_CAPABILITY_SCAN_SSID                (1 << 2)
 
+#define SUPPLICANT_CAPABILITY_MODE_INFRA       (1 << 0)
+#define SUPPLICANT_CAPABILITY_MODE_IBSS                (1 << 1)
+#define SUPPLICANT_CAPABILITY_MODE_AP          (1 << 2)
+
 enum supplicant_mode {
        SUPPLICANT_MODE_UNKNOWN,
        SUPPLICANT_MODE_INFRA,
@@ -61,7 +89,31 @@ enum supplicant_state {
 
 struct supplicant_interface;
 
+typedef void (* supplicant_interface_create_callback) (int result,
+                               struct supplicant_interface *interface,
+                                                       void *user_data);
+typedef void (* supplicant_interface_remove_callback) (int result,
+                                                       void *user_data);
+typedef void (* supplicant_interface_scan_callback) (int result,
+                                                       void *user_data);
+typedef void (* supplicant_interface_disconnect_callback) (int result,
+                                                       void *user_data);
+
+int supplicant_interface_create(const char *ifname, const char *driver,
+                       supplicant_interface_create_callback callback,
+                                                       void *user_data);
+int supplicant_interface_remove(struct supplicant_interface *interface,
+                       supplicant_interface_remove_callback callback,
+                                                       void *user_data);
+int supplicant_interface_scan(struct supplicant_interface *interface,
+                       supplicant_interface_scan_callback callback,
+                                                       void *user_data);
+int supplicant_interface_disconnect(struct supplicant_interface *interface,
+                       supplicant_interface_disconnect_callback callback,
+                                                       void *user_data);
+
 const char *supplicant_interface_get_ifname(struct supplicant_interface *interface);
+const char *supplicant_interface_get_driver(struct supplicant_interface *interface);
 
 struct supplicant_network;
 
@@ -71,11 +123,17 @@ const char *supplicant_network_get_identifier(struct supplicant_network *network
 enum supplicant_mode supplicant_network_get_mode(struct supplicant_network *network);
 
 struct supplicant_callbacks {
+       void (*system_ready) (void);
+       void (*system_killed) (void);
        void (*interface_added) (struct supplicant_interface *interface);
        void (*interface_removed) (struct supplicant_interface *interface);
+       void (*scan_started) (struct supplicant_interface *interface);
+       void (*scan_finished) (struct supplicant_interface *interface);
        void (*network_added) (struct supplicant_network *network);
        void (*network_removed) (struct supplicant_network *network);
 };
 
 int supplicant_register(const struct supplicant_callbacks *callbacks);
 void supplicant_unregister(const struct supplicant_callbacks *callbacks);
+
+void supplicant_set_debug_level(unsigned int level);