Add support for exporting the WiFi network mode
[connman] / plugins / supplicant.h
index ed753a8..2afd003 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  Connection Manager
  *
- *  Copyright (C) 2007  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2007-2008  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
  *
  */
 
-#include <connman/iface.h>
+#include <connman/element.h>
 
-int __supplicant_start(struct connman_iface *iface);
-int __supplicant_stop(struct connman_iface *iface);
+#define SUPPLICANT_NAME  "fi.epitest.hostap.WPASupplicant"
+#define SUPPLICANT_INTF  "fi.epitest.hostap.WPASupplicant"
+#define SUPPLICANT_PATH  "/fi/epitest/hostap/WPASupplicant"
 
-int __supplicant_connect(struct connman_iface *iface);
+enum supplicant_state {
+       STATE_INACTIVE,
+       STATE_SCANNING,
+       STATE_ASSOCIATING,
+       STATE_ASSOCIATED,
+       STATE_4WAY_HANDSHAKE,
+       STATE_GROUP_HANDSHAKE,
+       STATE_COMPLETED,
+       STATE_DISCONNECTED,
+};
+
+struct supplicant_network {
+       gchar *identifier;
+       guint8 *ssid;
+       guint ssid_len;
+       guint16 capabilities;
+       gboolean adhoc;
+       gboolean has_wep;
+       gboolean has_wpa;
+       gboolean has_rsn;
+       gint32 quality;
+       gint32 noise;
+       gint32 level;
+       gint32 maxrate;
+};
+
+struct supplicant_callback {
+       void (*state_change) (struct connman_element *element,
+                                               enum supplicant_state state);
+       void (*clear_results) (struct connman_element *element);
+       void (*scan_result) (struct connman_element *element,
+                                       struct supplicant_network *network);
+};
+
+void __supplicant_activate(DBusConnection *conn);
+
+int __supplicant_init(DBusConnection *conn);
+void __supplicant_exit(void);
+
+int __supplicant_start(struct connman_element *element,
+                                       struct supplicant_callback *callback);
+int __supplicant_stop(struct connman_element *element);
+
+int __supplicant_scan(struct connman_element *element);
+
+int __supplicant_connect(struct connman_element *element,
+                               const unsigned char *ssid, int ssid_len,
+                               const char *security, const char *passphrase);
+int __supplicant_disconnect(struct connman_element *element);