supplicant: convert add/remove to new supplicant dbus interface

This commit is contained in:
Dan Williams 2010-11-18 17:02:04 -06:00
parent 3992c7db50
commit 02a1da41c6
3 changed files with 18 additions and 12 deletions

View file

@ -37,7 +37,7 @@
#define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID"
#define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network"
#define WPAS_ERROR_INVALID_IFACE WPAS_DBUS_INTERFACE ".InvalidInterface"
#define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".ExistsError"
#define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".InterfaceExists"
static void wpas_iface_handle_state_change (DBusGProxy *proxy,
@ -580,7 +580,7 @@ interface_get (NMSupplicantInterface *self)
DBusGProxyCall *call;
info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls);
call = dbus_g_proxy_begin_call (priv->wpas_proxy, "getInterface",
call = dbus_g_proxy_begin_call (priv->wpas_proxy, "GetInterface",
interface_get_cb,
info,
nm_supplicant_info_destroy,
@ -622,7 +622,7 @@ interface_add (NMSupplicantInterface *self, gboolean is_wireless)
DBusGProxyCall *call;
NMSupplicantInfo *info;
GHashTable *hash;
GValue *driver;
GValue *driver, *ifname;
/* Can only start the interface from INIT state */
g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT);
@ -639,24 +639,30 @@ interface_add (NMSupplicantInterface *self, gboolean is_wireless)
info = nm_supplicant_info_new (self, priv->wpas_proxy, priv->other_pcalls);
hash = g_hash_table_new (g_str_hash, g_str_equal);
driver = g_new0 (GValue, 1);
g_value_init (driver, G_TYPE_STRING);
g_value_set_string (driver, is_wireless ? "wext" : "wired");
g_value_set_string (driver, is_wireless ? "nl80211,wext" : "wired");
g_hash_table_insert (hash, "Driver", driver);
hash = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (hash, "driver", driver);
ifname = g_new0 (GValue, 1);
g_value_init (ifname, G_TYPE_STRING);
g_value_set_string (ifname, priv->dev);
g_hash_table_insert (hash, "Ifname", ifname);
call = dbus_g_proxy_begin_call (priv->wpas_proxy, "addInterface",
call = dbus_g_proxy_begin_call (priv->wpas_proxy, "CreateInterface",
interface_add_cb,
info,
nm_supplicant_info_destroy,
G_TYPE_STRING, priv->dev,
DBUS_TYPE_G_MAP_OF_VARIANT, hash,
G_TYPE_INVALID);
g_hash_table_destroy (hash);
g_value_unset (driver);
g_free (driver);
g_value_unset (ifname);
g_free (ifname);
nm_supplicant_info_set_call (info, call);
}

View file

@ -114,7 +114,7 @@ nm_supplicant_manager_iface_release (NMSupplicantManager *self,
/* Ask wpa_supplicant to remove this interface */
op = nm_supplicant_interface_get_object_path (iface);
if (priv->running && priv->proxy && op) {
dbus_g_proxy_call_no_reply (priv->proxy, "removeInterface",
dbus_g_proxy_call_no_reply (priv->proxy, "RemoveInterface",
DBUS_TYPE_G_OBJECT_PATH, op,
G_TYPE_INVALID);
}

View file

@ -26,9 +26,9 @@
#include "nm-supplicant-types.h"
#include "nm-device.h"
#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_DBUS_SERVICE "fi.w1.wpa_supplicant1"
#define WPAS_DBUS_PATH "/fi/w1/wpa_supplicant1"
#define WPAS_DBUS_INTERFACE "fi.w1.wpa_supplicant1"
G_BEGIN_DECLS