initial import
[libicd-wpa] / supp.h
diff --git a/supp.h b/supp.h
new file mode 100644 (file)
index 0000000..0314d57
--- /dev/null
+++ b/supp.h
@@ -0,0 +1,49 @@
+#ifndef _SUPP_H_
+#define _SUPP_H_
+
+int supp_enable();
+void supp_disable();
+
+#define WPAS_DBUS_OBJECT_PATH_MAX 150
+
+#define WPAS_DBUS_SERVICE      "fi.epitest.hostap.WPASupplicant"
+#define WPAS_DBUS_PATH         "/fi/epitest/hostap/WPASupplicant"
+#define WPAS_DBUS_INTERFACE    "fi.epitest.hostap.WPASupplicant"
+
+#define WPAS_STATE_CHANGE_SIG  "StateChange"
+
+#define WPAS_DBUS_PATH_INTERFACES      WPAS_DBUS_PATH "/Interfaces"
+#define WPAS_DBUS_IFACE_INTERFACE      WPAS_DBUS_INTERFACE ".Interface"
+
+#define WPAS_DBUS_NETWORKS_PART "Networks"
+#define WPAS_DBUS_IFACE_NETWORK        WPAS_DBUS_INTERFACE ".Network"
+
+#define WPAS_DBUS_BSSIDS_PART  "BSSIDs"
+#define WPAS_DBUS_IFACE_BSSID  WPAS_DBUS_INTERFACE ".BSSID"
+
+#define WPAS_SET_NETWORK_METHOD                "set"
+#define WPAS_ENABLE_NETWORK_METHOD     "enable"
+
+enum supp_status {
+       SUPP_STATUS_KILLED = -2,
+       SUPP_STATUS_ERROR = -1,
+       SUPP_STATUS_DISCONNECTED = 0,
+       SUPP_STATUS_CONNECTED
+};
+
+typedef void (*supp_cb_fn)(enum supp_status status, const char * data,
+       gpointer user_data);
+
+void supp_set_callback(supp_cb_fn cb, gpointer user_data);
+void supp_set_interface(const char * iface);
+void supp_set_network_id(const char * network_id);
+
+void supp_unset_interface(void);
+void supp_unset_network_id(void);
+
+int supp_is_active(void);
+
+void supp_handle_signal(gchar* old_state, gchar* new_state);
+void supp_handle_killed(void);
+
+#endif