about summary refs log tree commit diff
path: root/src/supplicant-manager/nm-supplicant-interface.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-05-04 21:35:41 +0200
committerMichael Biebl <biebl@debian.org>2011-05-04 21:35:41 +0200
commit9f806e97a24bba61417ae312fcc0da40914266fb (patch)
tree4a25723414ceac11b4cba0558aa16f6f4b459f4b /src/supplicant-manager/nm-supplicant-interface.h
parent8baa1aca8dfd35e3190d7d5655eb83b5b901e263 (diff)
Imported Upstream version 0.8.999 upstream/0.8.999
Diffstat (limited to 'src/supplicant-manager/nm-supplicant-interface.h')
-rw-r--r--src/supplicant-manager/nm-supplicant-interface.h78
1 files changed, 27 insertions, 51 deletions
diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h
index bee5436f..e32411d7 100644
--- a/src/supplicant-manager/nm-supplicant-interface.h
+++ b/src/supplicant-manager/nm-supplicant-interface.h
@@ -15,7 +15,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Copyright (C) 2006 - 2008 Red Hat, Inc.
+ * Copyright (C) 2006 - 2010 Red Hat, Inc.
  * Copyright (C) 2007 - 2008 Novell, Inc.
  */
 
@@ -26,47 +26,27 @@
 #include <dbus/dbus.h>
 #include "nm-supplicant-types.h"
 
-G_BEGIN_DECLS
-
 /*
  * Supplicant interface states
- *   The states are linear, ie INIT -> READY -> DOWN and state may only be
- *   changed in one direction.  If an interface reaches the DOWN state, it
- *   cannot be re-initialized; it must be torn down and a new one created.
- *
- * INIT:  interface has been created, but cannot be used yet; it is waiting
- *             for pending requests of the supplicant to complete.
- * READY: interface is ready for use
- * DOWN:  interface has been removed or has otherwise been made invalid; it
- *             must be torn down.
- *
- * Note: LAST is an invalid state and only used for boundary checking.
+ *   A mix of wpa_supplicant interface states and internal states.
  */
 enum {
 	NM_SUPPLICANT_INTERFACE_STATE_INIT = 0,
 	NM_SUPPLICANT_INTERFACE_STATE_STARTING,
 	NM_SUPPLICANT_INTERFACE_STATE_READY,
+	NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED,
+	NM_SUPPLICANT_INTERFACE_STATE_INACTIVE,
+	NM_SUPPLICANT_INTERFACE_STATE_SCANNING,
+	NM_SUPPLICANT_INTERFACE_STATE_AUTHENTICATING,
+	NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING,
+	NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED,
+	NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE,
+	NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE,
+	NM_SUPPLICANT_INTERFACE_STATE_COMPLETED,
 	NM_SUPPLICANT_INTERFACE_STATE_DOWN,
 	NM_SUPPLICANT_INTERFACE_STATE_LAST
 };
 
-
-/*
- * Supplicant interface connection states
- *   The wpa_supplicant state for the connection.
- */
-enum {
-	NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED = 0,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED,
-	NM_SUPPLICANT_INTERFACE_CON_STATE_LAST
-};
-
 #define NM_TYPE_SUPPLICANT_INTERFACE            (nm_supplicant_interface_get_type ())
 #define NM_SUPPLICANT_INTERFACE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterface))
 #define NM_SUPPLICANT_INTERFACE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass))
@@ -74,6 +54,12 @@ enum {
 #define NM_IS_SUPPLICANT_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  NM_TYPE_SUPPLICANT_INTERFACE))
 #define NM_SUPPLICANT_INTERFACE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass))
 
+#define NM_SUPPLICANT_INTERFACE_STATE            "state"
+#define NM_SUPPLICANT_INTERFACE_REMOVED          "removed"
+#define NM_SUPPLICANT_INTERFACE_NEW_BSS          "new-bss"
+#define NM_SUPPLICANT_INTERFACE_SCAN_DONE        "scan-done"
+#define NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR "connection-error"
+
 struct _NMSupplicantInterface {
 	GObject parent;
 };
@@ -91,23 +77,14 @@ typedef struct {
 	/* interface was removed by the supplicant */
 	void (*removed)          (NMSupplicantInterface * iface);
 
-	/* interface saw a new access point from a scan */
-	void (*scanned_ap)       (NMSupplicantInterface * iface,
-	                          DBusMessage * message);
+	/* interface saw a new BSS */
+	void (*new_bss)          (NMSupplicantInterface *iface,
+	                          GHashTable *props);
 
-	/* result of a wireless scan request */
-	void (*scan_req_result)  (NMSupplicantInterface * iface,
+	/* wireless scan is done */
+	void (*scan_done)        (NMSupplicantInterface *iface,
 	                          gboolean success);
 
-	/* scan results returned from supplicant */
-	void (*scan_results)     (NMSupplicantInterface * iface,
-	                          guint num_bssids);
-
-	/* link state of the device's connection */
-	void (*connection_state) (NMSupplicantInterface * iface,
-	                          guint32 new_state,
-	                          guint32 old_state);
-
 	/* an error occurred during a connection request */
 	void (*connection_error) (NMSupplicantInterface * iface,
 	                          const char * name,
@@ -119,7 +96,8 @@ GType nm_supplicant_interface_get_type (void);
 
 NMSupplicantInterface * nm_supplicant_interface_new (NMSupplicantManager * smgr,
                                                      const char *ifname,
-                                                     gboolean is_wireless);
+                                                     gboolean is_wireless,
+                                                     gboolean start_now);
 
 gboolean nm_supplicant_interface_set_config (NMSupplicantInterface * iface,
                                              NMSupplicantConfig * cfg);
@@ -128,18 +106,16 @@ void nm_supplicant_interface_disconnect (NMSupplicantInterface * iface);
 
 const char * nm_supplicant_interface_get_device (NMSupplicantInterface * iface);
 
+const char *nm_supplicant_interface_get_object_path (NMSupplicantInterface * iface);
+
 gboolean nm_supplicant_interface_request_scan (NMSupplicantInterface * self);
 
 guint32 nm_supplicant_interface_get_state (NMSupplicantInterface * self);
 
-guint32 nm_supplicant_interface_get_connection_state (NMSupplicantInterface * self);
-
 const char *nm_supplicant_interface_state_to_string (guint32 state);
 
-const char *nm_supplicant_interface_connection_state_to_string (guint32 state);
-
 gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self);
 
-G_END_DECLS
+const char *nm_supplicant_interface_get_ifname (NMSupplicantInterface *self);
 
 #endif	/* NM_SUPPLICANT_INTERFACE_H */