gsupplicant: Set WPA protocol
[platform/upstream/connman.git] / gsupplicant / gsupplicant.h
index c408c6f..5c453aa 100644 (file)
@@ -61,6 +61,9 @@ extern "C" {
 #define G_SUPPLICANT_KEYMGMT_WPA_EAP_256       (1 << 8)
 #define G_SUPPLICANT_KEYMGMT_WPS               (1 << 9)
 
+#define G_SUPPLICANT_PROTO_WPA         (1 << 0)
+#define G_SUPPLICANT_PROTO_RSN         (1 << 1)
+
 #define G_SUPPLICANT_GROUP_WEP40               (1 << 0)
 #define G_SUPPLICANT_GROUP_WEP104              (1 << 1)
 #define G_SUPPLICANT_GROUP_TKIP                (1 << 2)
@@ -74,6 +77,7 @@ typedef enum {
        G_SUPPLICANT_MODE_UNKNOWN,
        G_SUPPLICANT_MODE_INFRA,
        G_SUPPLICANT_MODE_IBSS,
+       G_SUPPLICANT_MODE_MASTER,
 } GSupplicantMode;
 
 typedef enum {
@@ -97,11 +101,22 @@ typedef enum {
        G_SUPPLICANT_STATE_COMPLETED,
 } GSupplicantState;
 
+typedef enum {
+       G_SUPPLICANT_WPS_STATE_UNKNOWN,
+       G_SUPPLICANT_WPS_STATE_SUCCESS,
+       G_SUPPLICANT_WPS_STATE_FAIL,
+} GSupplicantWpsState;
+
 struct _GSupplicantSSID {
        const void *ssid;
        unsigned int ssid_len;
+       unsigned int scan_ssid;
        GSupplicantMode mode;
        GSupplicantSecurity security;
+       unsigned int protocol;
+       unsigned int pairwise_cipher;
+       unsigned int group_cipher;
+       unsigned int freq;
        const char *eap;
        const char *passphrase;
        const char *identity;
@@ -110,10 +125,19 @@ struct _GSupplicantSSID {
        const char *private_key_path;
        const char *private_key_passphrase;
        const char *phase2_auth;
+       dbus_bool_t use_wps;
+       const char *pin_wps;
 };
 
 typedef struct _GSupplicantSSID GSupplicantSSID;
 
+/* global API */
+typedef void (*GSupplicantCountryCallback) (void *user_data);
+
+int g_supplicant_set_country(const char *alpha2,
+                               GSupplicantCountryCallback callback,
+                                               const void *user_data);
+
 /* Interface API */
 struct _GSupplicantInterface;
 
@@ -124,6 +148,7 @@ typedef void (*GSupplicantInterfaceCallback) (int result,
                                                        void *user_data);
 
 int g_supplicant_interface_create(const char *ifname, const char *driver,
+                                       const char *bridge,
                                        GSupplicantInterfaceCallback callback,
                                                        void *user_data);
 int g_supplicant_interface_remove(GSupplicantInterface *interface,
@@ -142,12 +167,20 @@ int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
                                        GSupplicantInterfaceCallback callback,
                                                        void *user_data);
 
+int g_supplicant_interface_set_apscan(GSupplicantInterface *interface,
+                                                       unsigned int ap_scan);
+
 void g_supplicant_interface_set_data(GSupplicantInterface *interface,
                                                                void *data);
-const void *g_supplicant_interface_get_data(GSupplicantInterface *interface);
+void *g_supplicant_interface_get_data(GSupplicantInterface *interface);
 const char *g_supplicant_interface_get_ifname(GSupplicantInterface *interface);
 const char *g_supplicant_interface_get_driver(GSupplicantInterface *interface);
 GSupplicantState g_supplicant_interface_get_state(GSupplicantInterface *interface);
+const char *g_supplicant_interface_get_wps_key(GSupplicantInterface *interface);
+const void *g_supplicant_interface_get_wps_ssid(GSupplicantInterface *interface,
+                                                       unsigned int *ssid_len);
+GSupplicantWpsState g_supplicant_interface_get_wps_state(GSupplicantInterface *interface);
+unsigned int g_supplicant_interface_get_mode(GSupplicantInterface *interface);
 
 /* Network API */
 struct _GSupplicantNetwork;
@@ -163,6 +196,7 @@ const void *g_supplicant_network_get_ssid(GSupplicantNetwork *network,
 const char *g_supplicant_network_get_mode(GSupplicantNetwork *network);
 const char *g_supplicant_network_get_security(GSupplicantNetwork *network);
 dbus_int16_t g_supplicant_network_get_signal(GSupplicantNetwork *network);
+dbus_bool_t g_supplicant_network_get_wps(GSupplicantNetwork *network);
 
 struct _GSupplicantCallbacks {
        void (*system_ready) (void);