2008-06-10 Dan Williams <dcbw@redhat.com>
The grand 802-11-wireless rename. Get rid of the 802-11/80211/802_11 bits and use "wifi" everwhere instead. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3742 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2008-06-10 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
The grand 802-11-wireless rename. Get rid of the 802-11/80211/802_11 bits
|
||||||
|
and use "wifi" everwhere instead.
|
||||||
|
|
||||||
2008-06-10 Dan Williams <dcbw@redhat.com>
|
2008-06-10 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
The grand 802-3-ethernet rename. Get rid of the 802-3/8023/802_3 bits.
|
The grand 802-3-ethernet rename. Get rid of the 802-3/8023/802_3 bits.
|
||||||
|
@@ -95,13 +95,13 @@ typedef enum NMDeviceType
|
|||||||
|
|
||||||
|
|
||||||
/* 802.11 wireless device-specific capabilities */
|
/* 802.11 wireless device-specific capabilities */
|
||||||
#define NM_802_11_DEVICE_CAP_NONE 0x00000000
|
#define NM_WIFI_DEVICE_CAP_NONE 0x00000000
|
||||||
#define NM_802_11_DEVICE_CAP_CIPHER_WEP40 0x00000001
|
#define NM_WIFI_DEVICE_CAP_CIPHER_WEP40 0x00000001
|
||||||
#define NM_802_11_DEVICE_CAP_CIPHER_WEP104 0x00000002
|
#define NM_WIFI_DEVICE_CAP_CIPHER_WEP104 0x00000002
|
||||||
#define NM_802_11_DEVICE_CAP_CIPHER_TKIP 0x00000004
|
#define NM_WIFI_DEVICE_CAP_CIPHER_TKIP 0x00000004
|
||||||
#define NM_802_11_DEVICE_CAP_CIPHER_CCMP 0x00000008
|
#define NM_WIFI_DEVICE_CAP_CIPHER_CCMP 0x00000008
|
||||||
#define NM_802_11_DEVICE_CAP_WPA 0x00000010
|
#define NM_WIFI_DEVICE_CAP_WPA 0x00000010
|
||||||
#define NM_802_11_DEVICE_CAP_RSN 0x00000020
|
#define NM_WIFI_DEVICE_CAP_RSN 0x00000020
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
nm-access-point.xml \
|
nm-access-point.xml \
|
||||||
nm-device-802-11-wireless.xml \
|
nm-device-wifi.xml \
|
||||||
nm-device-ethernet.xml \
|
nm-device-ethernet.xml \
|
||||||
nm-device-cdma.xml \
|
nm-device-cdma.xml \
|
||||||
nm-device-gsm.xml \
|
nm-device-gsm.xml \
|
||||||
|
@@ -28,8 +28,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</
|
|||||||
<xi:include href="nm-manager.xml"/>
|
<xi:include href="nm-manager.xml"/>
|
||||||
<xi:include href="nm-access-point.xml"/>
|
<xi:include href="nm-access-point.xml"/>
|
||||||
<xi:include href="nm-device.xml"/>
|
<xi:include href="nm-device.xml"/>
|
||||||
<xi:include href="nm-device-802-3-ethernet.xml"/>
|
<xi:include href="nm-device-ethernet.xml"/>
|
||||||
<xi:include href="nm-device-802-11-wireless.xml"/>
|
<xi:include href="nm-device-wifi.xml"/>
|
||||||
<xi:include href="nm-device-cdma.xml"/>
|
<xi:include href="nm-device-cdma.xml"/>
|
||||||
<xi:include href="nm-device-gsm.xml"/>
|
<xi:include href="nm-device-gsm.xml"/>
|
||||||
<xi:include href="nm-device-serial.xml"/>
|
<xi:include href="nm-device-serial.xml"/>
|
||||||
|
@@ -8,7 +8,7 @@ BUILT_SOURCES = \
|
|||||||
nm-client-bindings.h \
|
nm-client-bindings.h \
|
||||||
nm-device-bindings.h \
|
nm-device-bindings.h \
|
||||||
nm-device-ethernet-bindings.h \
|
nm-device-ethernet-bindings.h \
|
||||||
nm-device-802-11-wireless-bindings.h \
|
nm-device-wifi-bindings.h \
|
||||||
nm-exported-connection-glue.h \
|
nm-exported-connection-glue.h \
|
||||||
nm-exported-connection-bindings.h \
|
nm-exported-connection-bindings.h \
|
||||||
nm-settings-glue.h \
|
nm-settings-glue.h \
|
||||||
@@ -35,7 +35,7 @@ libnminclude_HEADERS = \
|
|||||||
nm-client.h \
|
nm-client.h \
|
||||||
nm-device.h \
|
nm-device.h \
|
||||||
nm-device-ethernet.h \
|
nm-device-ethernet.h \
|
||||||
nm-device-802-11-wireless.h \
|
nm-device-wifi.h \
|
||||||
nm-access-point.h \
|
nm-access-point.h \
|
||||||
nm-ip4-config.h \
|
nm-ip4-config.h \
|
||||||
nm-settings.h \
|
nm-settings.h \
|
||||||
@@ -60,7 +60,7 @@ libnm_glib_la_SOURCES = \
|
|||||||
nm-device.c \
|
nm-device.c \
|
||||||
nm-device-private.h \
|
nm-device-private.h \
|
||||||
nm-device-ethernet.c \
|
nm-device-ethernet.c \
|
||||||
nm-device-802-11-wireless.c \
|
nm-device-wifi.c \
|
||||||
nm-access-point.c \
|
nm-access-point.c \
|
||||||
nm-ip4-config.c \
|
nm-ip4-config.c \
|
||||||
nm-settings.c \
|
nm-settings.c \
|
||||||
@@ -106,8 +106,8 @@ nm-device-bindings.h: $(top_srcdir)/introspection/nm-device.xml
|
|||||||
nm-device-ethernet-bindings.h: $(top_srcdir)/introspection/nm-device-ethernet.xml
|
nm-device-ethernet-bindings.h: $(top_srcdir)/introspection/nm-device-ethernet.xml
|
||||||
dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-client --output=nm-device-ethernet-bindings.h $(top_srcdir)/introspection/nm-device-ethernet.xml
|
dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-client --output=nm-device-ethernet-bindings.h $(top_srcdir)/introspection/nm-device-ethernet.xml
|
||||||
|
|
||||||
nm-device-802-11-wireless-bindings.h: $(top_srcdir)/introspection/nm-device-802-11-wireless.xml
|
nm-device-wifi-bindings.h: $(top_srcdir)/introspection/nm-device-wifi.xml
|
||||||
dbus-binding-tool --prefix=nm_device_802_11_wireless --mode=glib-client --output=nm-device-802-11-wireless-bindings.h $(top_srcdir)/introspection/nm-device-802-11-wireless.xml
|
dbus-binding-tool --prefix=nm_device_wifi --mode=glib-client --output=nm-device-wifi-bindings.h $(top_srcdir)/introspection/nm-device-wifi.xml
|
||||||
|
|
||||||
nm-access-point-bindings.h: $(top_srcdir)/introspection/nm-access-point.xml
|
nm-access-point-bindings.h: $(top_srcdir)/introspection/nm-access-point.xml
|
||||||
dbus-binding-tool --prefix=nm_access_point --mode=glib-client --output=nm-access-point-bindings.h $(top_srcdir)/introspection/nm-access-point.xml
|
dbus-binding-tool --prefix=nm_access_point --mode=glib-client --output=nm-access-point-bindings.h $(top_srcdir)/introspection/nm-access-point.xml
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#include "nm-client.h"
|
#include "nm-client.h"
|
||||||
#include "nm-device.h"
|
#include "nm-device.h"
|
||||||
#include "nm-device-ethernet.h"
|
#include "nm-device-ethernet.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-active-connection.h"
|
#include "nm-active-connection.h"
|
||||||
#include "nm-setting-ip4-config.h"
|
#include "nm-setting-ip4-config.h"
|
||||||
@@ -137,20 +137,20 @@ dump_access_point (NMAccessPoint *ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dump_wireless (NMDevice80211Wireless *device)
|
dump_wireless (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
const GPtrArray *aps;
|
const GPtrArray *aps;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
g_print ("Mode: %d\n", nm_device_802_11_wireless_get_mode (device));
|
g_print ("Mode: %d\n", nm_device_wifi_get_mode (device));
|
||||||
g_print ("Bitrate: %d\n", nm_device_802_11_wireless_get_bitrate (device));
|
g_print ("Bitrate: %d\n", nm_device_wifi_get_bitrate (device));
|
||||||
|
|
||||||
str = nm_device_802_11_wireless_get_hw_address (device);
|
str = nm_device_wifi_get_hw_address (device);
|
||||||
g_print ("MAC: %s\n", str);
|
g_print ("MAC: %s\n", str);
|
||||||
|
|
||||||
g_print ("AccessPoints:\n");
|
g_print ("AccessPoints:\n");
|
||||||
aps = nm_device_802_11_wireless_get_access_points (device);
|
aps = nm_device_wifi_get_access_points (device);
|
||||||
for (i = 0; i < aps->len; i++) {
|
for (i = 0; i < aps->len; i++) {
|
||||||
dump_access_point (NM_ACCESS_POINT (g_ptr_array_index (aps, i)));
|
dump_access_point (NM_ACCESS_POINT (g_ptr_array_index (aps, i)));
|
||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
@@ -197,8 +197,8 @@ dump_device (NMDevice *device)
|
|||||||
|
|
||||||
if (NM_IS_DEVICE_ETHERNET (device))
|
if (NM_IS_DEVICE_ETHERNET (device))
|
||||||
dump_wired (NM_DEVICE_ETHERNET (device));
|
dump_wired (NM_DEVICE_ETHERNET (device));
|
||||||
else if (NM_IS_DEVICE_802_11_WIRELESS (device))
|
else if (NM_IS_DEVICE_WIFI (device))
|
||||||
dump_wireless (NM_DEVICE_802_11_WIRELESS (device));
|
dump_wireless (NM_DEVICE_WIFI (device));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "nm-client.h"
|
#include "nm-client.h"
|
||||||
#include "nm-device-ethernet.h"
|
#include "nm-device-ethernet.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "nm-gsm-device.h"
|
#include "nm-gsm-device.h"
|
||||||
#include "nm-cdma-device.h"
|
#include "nm-cdma-device.h"
|
||||||
#include "nm-device-private.h"
|
#include "nm-device-private.h"
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "nm-client-bindings.h"
|
#include "nm-client-bindings.h"
|
||||||
|
|
||||||
void nm_device_802_11_wireless_set_wireless_enabled (NMDevice80211Wireless *device, gboolean enabled);
|
void nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMClient, nm_client, NM_TYPE_OBJECT)
|
G_DEFINE_TYPE (NMClient, nm_client, NM_TYPE_OBJECT)
|
||||||
@@ -87,8 +87,8 @@ poke_wireless_devices_with_rf_status (NMClient *client)
|
|||||||
for (i = 0; priv->devices && (i < priv->devices->len); i++) {
|
for (i = 0; priv->devices && (i < priv->devices->len); i++) {
|
||||||
NMDevice *device = g_ptr_array_index (priv->devices, i);
|
NMDevice *device = g_ptr_array_index (priv->devices, i);
|
||||||
|
|
||||||
if (NM_IS_DEVICE_802_11_WIRELESS (device))
|
if (NM_IS_DEVICE_WIFI (device))
|
||||||
nm_device_802_11_wireless_set_wireless_enabled (NM_DEVICE_802_11_WIRELESS (device), priv->wireless_enabled);
|
nm_device_wifi_set_wireless_enabled (NM_DEVICE_WIFI (device), priv->wireless_enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,51 +0,0 @@
|
|||||||
#ifndef NM_DEVICE_802_11_WIRELESS_H
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_H
|
|
||||||
|
|
||||||
#include "nm-device.h"
|
|
||||||
#include "nm-access-point.h"
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define NM_TYPE_DEVICE_802_11_WIRELESS (nm_device_802_11_wireless_get_type ())
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211Wireless))
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211WirelessClass))
|
|
||||||
#define NM_IS_DEVICE_802_11_WIRELESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_802_11_WIRELESS))
|
|
||||||
#define NM_IS_DEVICE_802_11_WIRELESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_802_11_WIRELESS))
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211WirelessClass))
|
|
||||||
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_HW_ADDRESS "hw-address"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_MODE "mode"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_BITRATE "bitrate"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT "active-access-point"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_CAPABILITIES "wireless-capabilities"
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NMDevice parent;
|
|
||||||
} NMDevice80211Wireless;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NMDeviceClass parent;
|
|
||||||
|
|
||||||
/* Signals */
|
|
||||||
void (*access_point_added) (NMDevice80211Wireless *device, NMAccessPoint *ap);
|
|
||||||
void (*access_point_removed) (NMDevice80211Wireless *device, NMAccessPoint *ap);
|
|
||||||
} NMDevice80211WirelessClass;
|
|
||||||
|
|
||||||
GType nm_device_802_11_wireless_get_type (void);
|
|
||||||
|
|
||||||
GObject *nm_device_802_11_wireless_new (DBusGConnection *connection, const char *path);
|
|
||||||
|
|
||||||
const char * nm_device_802_11_wireless_get_hw_address (NMDevice80211Wireless *device);
|
|
||||||
NM80211Mode nm_device_802_11_wireless_get_mode (NMDevice80211Wireless *device);
|
|
||||||
guint32 nm_device_802_11_wireless_get_bitrate (NMDevice80211Wireless *device);
|
|
||||||
guint32 nm_device_802_11_wireless_get_capabilities (NMDevice80211Wireless *device);
|
|
||||||
NMAccessPoint * nm_device_802_11_wireless_get_active_access_point (NMDevice80211Wireless *device);
|
|
||||||
|
|
||||||
NMAccessPoint * nm_device_802_11_wireless_get_access_point_by_path (NMDevice80211Wireless *device,
|
|
||||||
const char *path);
|
|
||||||
|
|
||||||
const GPtrArray *nm_device_802_11_wireless_get_access_points (NMDevice80211Wireless *device);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* NM_DEVICE_802_11_WIRELESS_H */
|
|
@@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "nm-device-private.h"
|
#include "nm-device-private.h"
|
||||||
#include "nm-object-private.h"
|
#include "nm-object-private.h"
|
||||||
#include "nm-object-cache.h"
|
#include "nm-object-cache.h"
|
||||||
#include "nm-dbus-glib-types.h"
|
#include "nm-dbus-glib-types.h"
|
||||||
#include "nm-types-private.h"
|
#include "nm-types-private.h"
|
||||||
|
|
||||||
#include "nm-device-802-11-wireless-bindings.h"
|
#include "nm-device-wifi-bindings.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMDevice80211Wireless, nm_device_802_11_wireless, NM_TYPE_DEVICE)
|
G_DEFINE_TYPE (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE)
|
||||||
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211WirelessPrivate))
|
#define NM_DEVICE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIFI, NMDeviceWifiPrivate))
|
||||||
|
|
||||||
static gboolean demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field);
|
static gboolean demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field);
|
||||||
|
|
||||||
void nm_device_802_11_wireless_set_wireless_enabled (NMDevice80211Wireless *device, gboolean enabled);
|
void nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gboolean disposed;
|
gboolean disposed;
|
||||||
@@ -32,7 +32,7 @@ typedef struct {
|
|||||||
GPtrArray *aps;
|
GPtrArray *aps;
|
||||||
|
|
||||||
gboolean wireless_enabled;
|
gboolean wireless_enabled;
|
||||||
} NMDevice80211WirelessPrivate;
|
} NMDeviceWifiPrivate;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
@@ -61,25 +61,25 @@ enum {
|
|||||||
static guint signals[LAST_SIGNAL] = { 0 };
|
static guint signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
GObject *
|
GObject *
|
||||||
nm_device_802_11_wireless_new (DBusGConnection *connection, const char *path)
|
nm_device_wifi_new (DBusGConnection *connection, const char *path)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (connection != NULL, NULL);
|
g_return_val_if_fail (connection != NULL, NULL);
|
||||||
g_return_val_if_fail (path != NULL, NULL);
|
g_return_val_if_fail (path != NULL, NULL);
|
||||||
|
|
||||||
return g_object_new (NM_TYPE_DEVICE_802_11_WIRELESS,
|
return g_object_new (NM_TYPE_DEVICE_WIFI,
|
||||||
NM_OBJECT_DBUS_CONNECTION, connection,
|
NM_OBJECT_DBUS_CONNECTION, connection,
|
||||||
NM_OBJECT_DBUS_PATH, path,
|
NM_OBJECT_DBUS_PATH, path,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
nm_device_802_11_wireless_get_hw_address (NMDevice80211Wireless *device)
|
nm_device_wifi_get_hw_address (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_802_11_WIRELESS (device), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
|
||||||
if (!priv->hw_address) {
|
if (!priv->hw_address) {
|
||||||
priv->hw_address = nm_object_get_string_property (NM_OBJECT (device),
|
priv->hw_address = nm_object_get_string_property (NM_OBJECT (device),
|
||||||
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
||||||
@@ -90,13 +90,13 @@ nm_device_802_11_wireless_get_hw_address (NMDevice80211Wireless *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
NM80211Mode
|
NM80211Mode
|
||||||
nm_device_802_11_wireless_get_mode (NMDevice80211Wireless *device)
|
nm_device_wifi_get_mode (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_802_11_WIRELESS (device), 0);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
|
||||||
if (!priv->mode) {
|
if (!priv->mode) {
|
||||||
priv->mode = nm_object_get_uint_property (NM_OBJECT (device),
|
priv->mode = nm_object_get_uint_property (NM_OBJECT (device),
|
||||||
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
||||||
@@ -107,12 +107,12 @@ nm_device_802_11_wireless_get_mode (NMDevice80211Wireless *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
nm_device_802_11_wireless_get_bitrate (NMDevice80211Wireless *device)
|
nm_device_wifi_get_bitrate (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
NMDeviceState state;
|
NMDeviceState state;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_802_11_WIRELESS (device), 0);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
|
||||||
|
|
||||||
state = nm_device_get_state (NM_DEVICE (device));
|
state = nm_device_get_state (NM_DEVICE (device));
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@@ -127,7 +127,7 @@ nm_device_802_11_wireless_get_bitrate (NMDevice80211Wireless *device)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
|
||||||
if (!priv->rate) {
|
if (!priv->rate) {
|
||||||
priv->rate = nm_object_get_uint_property (NM_OBJECT (device),
|
priv->rate = nm_object_get_uint_property (NM_OBJECT (device),
|
||||||
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
||||||
@@ -138,13 +138,13 @@ nm_device_802_11_wireless_get_bitrate (NMDevice80211Wireless *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
nm_device_802_11_wireless_get_capabilities (NMDevice80211Wireless *device)
|
nm_device_wifi_get_capabilities (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_802_11_WIRELESS (device), 0);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
|
||||||
if (!priv->wireless_caps) {
|
if (!priv->wireless_caps) {
|
||||||
priv->wireless_caps = nm_object_get_uint_property (NM_OBJECT (device),
|
priv->wireless_caps = nm_object_get_uint_property (NM_OBJECT (device),
|
||||||
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
|
||||||
@@ -155,14 +155,14 @@ nm_device_802_11_wireless_get_capabilities (NMDevice80211Wireless *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
NMAccessPoint *
|
NMAccessPoint *
|
||||||
nm_device_802_11_wireless_get_active_access_point (NMDevice80211Wireless *self)
|
nm_device_wifi_get_active_access_point (NMDeviceWifi *self)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
NMDeviceState state;
|
NMDeviceState state;
|
||||||
char *path;
|
char *path;
|
||||||
GValue value = { 0, };
|
GValue value = { 0, };
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_802_11_WIRELESS (self), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (self), NULL);
|
||||||
|
|
||||||
state = nm_device_get_state (NM_DEVICE (self));
|
state = nm_device_get_state (NM_DEVICE (self));
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@@ -177,7 +177,7 @@ nm_device_802_11_wireless_get_active_access_point (NMDevice80211Wireless *self)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
if (priv->active_ap)
|
if (priv->active_ap)
|
||||||
return priv->active_ap;
|
return priv->active_ap;
|
||||||
if (priv->null_active_ap)
|
if (priv->null_active_ap)
|
||||||
@@ -197,17 +197,17 @@ nm_device_802_11_wireless_get_active_access_point (NMDevice80211Wireless *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const GPtrArray *
|
const GPtrArray *
|
||||||
nm_device_802_11_wireless_get_access_points (NMDevice80211Wireless *self)
|
nm_device_wifi_get_access_points (NMDeviceWifi *self)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
DBusGConnection *connection;
|
DBusGConnection *connection;
|
||||||
GValue value = { 0, };
|
GValue value = { 0, };
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GPtrArray *temp;
|
GPtrArray *temp;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_802_11_WIRELESS (self), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (self), NULL);
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
if (priv->aps)
|
if (priv->aps)
|
||||||
return handle_ptr_array_return (priv->aps);
|
return handle_ptr_array_return (priv->aps);
|
||||||
|
|
||||||
@@ -227,17 +227,17 @@ nm_device_802_11_wireless_get_access_points (NMDevice80211Wireless *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
NMAccessPoint *
|
NMAccessPoint *
|
||||||
nm_device_802_11_wireless_get_access_point_by_path (NMDevice80211Wireless *self,
|
nm_device_wifi_get_access_point_by_path (NMDeviceWifi *self,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
const GPtrArray *aps;
|
const GPtrArray *aps;
|
||||||
int i;
|
int i;
|
||||||
NMAccessPoint *ap = NULL;
|
NMAccessPoint *ap = NULL;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_DEVICE_802_11_WIRELESS (self), NULL);
|
g_return_val_if_fail (NM_IS_DEVICE_WIFI (self), NULL);
|
||||||
g_return_val_if_fail (path != NULL, NULL);
|
g_return_val_if_fail (path != NULL, NULL);
|
||||||
|
|
||||||
aps = nm_device_802_11_wireless_get_access_points (self);
|
aps = nm_device_wifi_get_access_points (self);
|
||||||
if (!aps)
|
if (!aps)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@@ -255,17 +255,17 @@ nm_device_802_11_wireless_get_access_point_by_path (NMDevice80211Wireless *self,
|
|||||||
static void
|
static void
|
||||||
access_point_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
|
access_point_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
|
||||||
{
|
{
|
||||||
NMDevice80211Wireless *self = NM_DEVICE_802_11_WIRELESS (user_data);
|
NMDeviceWifi *self = NM_DEVICE_WIFI (user_data);
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
GObject *ap;
|
GObject *ap;
|
||||||
|
|
||||||
g_return_if_fail (self != NULL);
|
g_return_if_fail (self != NULL);
|
||||||
|
|
||||||
ap = G_OBJECT (nm_device_802_11_wireless_get_access_point_by_path (self, path));
|
ap = G_OBJECT (nm_device_wifi_get_access_point_by_path (self, path));
|
||||||
if (!ap) {
|
if (!ap) {
|
||||||
DBusGConnection *connection = nm_object_get_connection (NM_OBJECT (self));
|
DBusGConnection *connection = nm_object_get_connection (NM_OBJECT (self));
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
ap = G_OBJECT (nm_object_cache_get (path));
|
ap = G_OBJECT (nm_object_cache_get (path));
|
||||||
if (ap) {
|
if (ap) {
|
||||||
g_ptr_array_add (priv->aps, g_object_ref (ap));
|
g_ptr_array_add (priv->aps, g_object_ref (ap));
|
||||||
@@ -283,13 +283,13 @@ access_point_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
|
|||||||
static void
|
static void
|
||||||
access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
|
access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
|
||||||
{
|
{
|
||||||
NMDevice80211Wireless *self = NM_DEVICE_802_11_WIRELESS (user_data);
|
NMDeviceWifi *self = NM_DEVICE_WIFI (user_data);
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
NMAccessPoint *ap;
|
NMAccessPoint *ap;
|
||||||
|
|
||||||
g_return_if_fail (self != NULL);
|
g_return_if_fail (self != NULL);
|
||||||
|
|
||||||
ap = nm_device_802_11_wireless_get_access_point_by_path (self, path);
|
ap = nm_device_wifi_get_access_point_by_path (self, path);
|
||||||
if (ap) {
|
if (ap) {
|
||||||
g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
|
g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
|
||||||
g_ptr_array_remove (priv->aps, ap);
|
g_ptr_array_remove (priv->aps, ap);
|
||||||
@@ -298,13 +298,13 @@ access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clean_up_aps (NMDevice80211Wireless *self, gboolean notify)
|
clean_up_aps (NMDeviceWifi *self, gboolean notify)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (NM_IS_DEVICE_802_11_WIRELESS (self));
|
g_return_if_fail (NM_IS_DEVICE_WIFI (self));
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
|
|
||||||
if (priv->active_ap)
|
if (priv->active_ap)
|
||||||
g_object_unref (priv->active_ap);
|
g_object_unref (priv->active_ap);
|
||||||
@@ -324,10 +324,10 @@ clean_up_aps (NMDevice80211Wireless *self, gboolean notify)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nm_device_802_11_wireless_set_wireless_enabled (NMDevice80211Wireless *device,
|
nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device,
|
||||||
gboolean enabled)
|
gboolean enabled)
|
||||||
{
|
{
|
||||||
g_return_if_fail (NM_IS_DEVICE_802_11_WIRELESS (device));
|
g_return_if_fail (NM_IS_DEVICE_WIFI (device));
|
||||||
|
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
clean_up_aps (device, TRUE);
|
clean_up_aps (device, TRUE);
|
||||||
@@ -337,9 +337,9 @@ nm_device_802_11_wireless_set_wireless_enabled (NMDevice80211Wireless *device,
|
|||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_device_802_11_wireless_init (NMDevice80211Wireless *device)
|
nm_device_wifi_init (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
|
||||||
|
|
||||||
priv->disposed = FALSE;
|
priv->disposed = FALSE;
|
||||||
}
|
}
|
||||||
@@ -350,23 +350,23 @@ get_property (GObject *object,
|
|||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMDevice80211Wireless *self = NM_DEVICE_802_11_WIRELESS (object);
|
NMDeviceWifi *self = NM_DEVICE_WIFI (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
case PROP_HW_ADDRESS:
|
||||||
g_value_set_string (value, nm_device_802_11_wireless_get_hw_address (self));
|
g_value_set_string (value, nm_device_wifi_get_hw_address (self));
|
||||||
break;
|
break;
|
||||||
case PROP_MODE:
|
case PROP_MODE:
|
||||||
g_value_set_uint (value, nm_device_802_11_wireless_get_mode (self));
|
g_value_set_uint (value, nm_device_wifi_get_mode (self));
|
||||||
break;
|
break;
|
||||||
case PROP_BITRATE:
|
case PROP_BITRATE:
|
||||||
g_value_set_uint (value, nm_device_802_11_wireless_get_bitrate (self));
|
g_value_set_uint (value, nm_device_wifi_get_bitrate (self));
|
||||||
break;
|
break;
|
||||||
case PROP_ACTIVE_ACCESS_POINT:
|
case PROP_ACTIVE_ACCESS_POINT:
|
||||||
g_value_set_object (value, nm_device_802_11_wireless_get_active_access_point (self));
|
g_value_set_object (value, nm_device_wifi_get_active_access_point (self));
|
||||||
break;
|
break;
|
||||||
case PROP_WIRELESS_CAPABILITIES:
|
case PROP_WIRELESS_CAPABILITIES:
|
||||||
g_value_set_uint (value, nm_device_802_11_wireless_get_capabilities (self));
|
g_value_set_uint (value, nm_device_wifi_get_capabilities (self));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
@@ -377,8 +377,8 @@ get_property (GObject *object,
|
|||||||
static void
|
static void
|
||||||
state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
|
state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
|
||||||
{
|
{
|
||||||
NMDevice80211Wireless *self = NM_DEVICE_802_11_WIRELESS (device);
|
NMDeviceWifi *self = NM_DEVICE_WIFI (device);
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (self);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||||
|
|
||||||
switch (nm_device_get_state (device)) {
|
switch (nm_device_get_state (device)) {
|
||||||
case NM_DEVICE_STATE_UNKNOWN:
|
case NM_DEVICE_STATE_UNKNOWN:
|
||||||
@@ -392,9 +392,9 @@ state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
|
|||||||
priv->active_ap = NULL;
|
priv->active_ap = NULL;
|
||||||
priv->null_active_ap = FALSE;
|
priv->null_active_ap = FALSE;
|
||||||
}
|
}
|
||||||
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT);
|
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT);
|
||||||
priv->rate = 0;
|
priv->rate = 0;
|
||||||
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_802_11_WIRELESS_BITRATE);
|
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_BITRATE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -404,7 +404,7 @@ state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
|
|||||||
static gboolean
|
static gboolean
|
||||||
demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
|
demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (object);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
|
||||||
const char *path;
|
const char *path;
|
||||||
NMAccessPoint *ap = NULL;
|
NMAccessPoint *ap = NULL;
|
||||||
DBusGConnection *connection;
|
DBusGConnection *connection;
|
||||||
@@ -437,20 +437,20 @@ demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointe
|
|||||||
if (ap)
|
if (ap)
|
||||||
priv->active_ap = ap;
|
priv->active_ap = ap;
|
||||||
|
|
||||||
nm_object_queue_notify (object, NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT);
|
nm_object_queue_notify (object, NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
register_for_property_changed (NMDevice80211Wireless *device)
|
register_for_property_changed (NMDeviceWifi *device)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
|
||||||
const NMPropertiesChangedInfo property_changed_info[] = {
|
const NMPropertiesChangedInfo property_changed_info[] = {
|
||||||
{ NM_DEVICE_802_11_WIRELESS_HW_ADDRESS, nm_object_demarshal_generic, &priv->hw_address },
|
{ NM_DEVICE_WIFI_HW_ADDRESS, nm_object_demarshal_generic, &priv->hw_address },
|
||||||
{ NM_DEVICE_802_11_WIRELESS_MODE, nm_object_demarshal_generic, &priv->mode },
|
{ NM_DEVICE_WIFI_MODE, nm_object_demarshal_generic, &priv->mode },
|
||||||
{ NM_DEVICE_802_11_WIRELESS_BITRATE, nm_object_demarshal_generic, &priv->rate },
|
{ NM_DEVICE_WIFI_BITRATE, nm_object_demarshal_generic, &priv->rate },
|
||||||
{ NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT, demarshal_active_ap, &priv->active_ap },
|
{ NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, demarshal_active_ap, &priv->active_ap },
|
||||||
{ NM_DEVICE_802_11_WIRELESS_CAPABILITIES, nm_object_demarshal_generic, &priv->wireless_caps },
|
{ NM_DEVICE_WIFI_CAPABILITIES, nm_object_demarshal_generic, &priv->wireless_caps },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -465,15 +465,15 @@ constructor (GType type,
|
|||||||
GObjectConstructParam *construct_params)
|
GObjectConstructParam *construct_params)
|
||||||
{
|
{
|
||||||
GObject *object;
|
GObject *object;
|
||||||
NMDevice80211WirelessPrivate *priv;
|
NMDeviceWifiPrivate *priv;
|
||||||
|
|
||||||
object = G_OBJECT_CLASS (nm_device_802_11_wireless_parent_class)->constructor (type,
|
object = G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructor (type,
|
||||||
n_construct_params,
|
n_construct_params,
|
||||||
construct_params);
|
construct_params);
|
||||||
if (!object)
|
if (!object)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (object);
|
priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
|
||||||
|
|
||||||
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
|
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
|
||||||
NM_DBUS_SERVICE,
|
NM_DBUS_SERVICE,
|
||||||
@@ -494,7 +494,7 @@ constructor (GType type,
|
|||||||
G_CALLBACK (access_point_removed_proxy),
|
G_CALLBACK (access_point_removed_proxy),
|
||||||
object, NULL);
|
object, NULL);
|
||||||
|
|
||||||
register_for_property_changed (NM_DEVICE_802_11_WIRELESS (object));
|
register_for_property_changed (NM_DEVICE_WIFI (object));
|
||||||
|
|
||||||
g_signal_connect (NM_DEVICE (object),
|
g_signal_connect (NM_DEVICE (object),
|
||||||
"notify::" NM_DEVICE_STATE,
|
"notify::" NM_DEVICE_STATE,
|
||||||
@@ -507,38 +507,38 @@ constructor (GType type,
|
|||||||
static void
|
static void
|
||||||
dispose (GObject *object)
|
dispose (GObject *object)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (object);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
|
||||||
|
|
||||||
if (priv->disposed) {
|
if (priv->disposed) {
|
||||||
G_OBJECT_CLASS (nm_device_802_11_wireless_parent_class)->dispose (object);
|
G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->disposed = TRUE;
|
priv->disposed = TRUE;
|
||||||
|
|
||||||
clean_up_aps (NM_DEVICE_802_11_WIRELESS (object), FALSE);
|
clean_up_aps (NM_DEVICE_WIFI (object), FALSE);
|
||||||
g_object_unref (priv->proxy);
|
g_object_unref (priv->proxy);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_802_11_wireless_parent_class)->dispose (object);
|
G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (object);
|
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
|
||||||
|
|
||||||
if (priv->hw_address)
|
if (priv->hw_address)
|
||||||
g_free (priv->hw_address);
|
g_free (priv->hw_address);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_802_11_wireless_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (device_class);
|
GObjectClass *object_class = G_OBJECT_CLASS (device_class);
|
||||||
|
|
||||||
g_type_class_add_private (device_class, sizeof (NMDevice80211WirelessPrivate));
|
g_type_class_add_private (device_class, sizeof (NMDeviceWifiPrivate));
|
||||||
|
|
||||||
/* virtual methods */
|
/* virtual methods */
|
||||||
object_class->constructor = constructor;
|
object_class->constructor = constructor;
|
||||||
@@ -549,7 +549,7 @@ nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
|||||||
/* properties */
|
/* properties */
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, PROP_HW_ADDRESS,
|
(object_class, PROP_HW_ADDRESS,
|
||||||
g_param_spec_string (NM_DEVICE_802_11_WIRELESS_HW_ADDRESS,
|
g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS,
|
||||||
"MAC Address",
|
"MAC Address",
|
||||||
"Hardware MAC address",
|
"Hardware MAC address",
|
||||||
NULL,
|
NULL,
|
||||||
@@ -557,7 +557,7 @@ nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
|||||||
|
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, PROP_MODE,
|
(object_class, PROP_MODE,
|
||||||
g_param_spec_uint (NM_DEVICE_802_11_WIRELESS_MODE,
|
g_param_spec_uint (NM_DEVICE_WIFI_MODE,
|
||||||
"Mode",
|
"Mode",
|
||||||
"Mode",
|
"Mode",
|
||||||
NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA,
|
NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA,
|
||||||
@@ -565,7 +565,7 @@ nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
|||||||
|
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, PROP_BITRATE,
|
(object_class, PROP_BITRATE,
|
||||||
g_param_spec_uint (NM_DEVICE_802_11_WIRELESS_BITRATE,
|
g_param_spec_uint (NM_DEVICE_WIFI_BITRATE,
|
||||||
"Bit Rate",
|
"Bit Rate",
|
||||||
"Bit Rate",
|
"Bit Rate",
|
||||||
0, G_MAXUINT32, 0,
|
0, G_MAXUINT32, 0,
|
||||||
@@ -573,7 +573,7 @@ nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
|||||||
|
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, PROP_ACTIVE_ACCESS_POINT,
|
(object_class, PROP_ACTIVE_ACCESS_POINT,
|
||||||
g_param_spec_object (NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT,
|
g_param_spec_object (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT,
|
||||||
"Active Access Point",
|
"Active Access Point",
|
||||||
"Active Access Point",
|
"Active Access Point",
|
||||||
NM_TYPE_ACCESS_POINT,
|
NM_TYPE_ACCESS_POINT,
|
||||||
@@ -581,7 +581,7 @@ nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
|||||||
|
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, PROP_WIRELESS_CAPABILITIES,
|
(object_class, PROP_WIRELESS_CAPABILITIES,
|
||||||
g_param_spec_uint (NM_DEVICE_802_11_WIRELESS_CAPABILITIES,
|
g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES,
|
||||||
"Wireless Capabilities",
|
"Wireless Capabilities",
|
||||||
"Wireless Capabilities",
|
"Wireless Capabilities",
|
||||||
0, G_MAXUINT32, 0,
|
0, G_MAXUINT32, 0,
|
||||||
@@ -592,7 +592,7 @@ nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
|||||||
g_signal_new ("access-point-added",
|
g_signal_new ("access-point-added",
|
||||||
G_OBJECT_CLASS_TYPE (object_class),
|
G_OBJECT_CLASS_TYPE (object_class),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (NMDevice80211WirelessClass, access_point_added),
|
G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
g_cclosure_marshal_VOID__OBJECT,
|
g_cclosure_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
||||||
@@ -602,7 +602,7 @@ nm_device_802_11_wireless_class_init (NMDevice80211WirelessClass *device_class)
|
|||||||
g_signal_new ("access-point-removed",
|
g_signal_new ("access-point-removed",
|
||||||
G_OBJECT_CLASS_TYPE (object_class),
|
G_OBJECT_CLASS_TYPE (object_class),
|
||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (NMDevice80211WirelessClass, access_point_removed),
|
G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_removed),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
g_cclosure_marshal_VOID__OBJECT,
|
g_cclosure_marshal_VOID__OBJECT,
|
||||||
G_TYPE_NONE, 1,
|
G_TYPE_NONE, 1,
|
51
libnm-glib/nm-device-wifi.h
Normal file
51
libnm-glib/nm-device-wifi.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef NM_DEVICE_WIFI_H
|
||||||
|
#define NM_DEVICE_WIFI_H
|
||||||
|
|
||||||
|
#include "nm-device.h"
|
||||||
|
#include "nm-access-point.h"
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define NM_TYPE_DEVICE_WIFI (nm_device_wifi_get_type ())
|
||||||
|
#define NM_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifi))
|
||||||
|
#define NM_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass))
|
||||||
|
#define NM_IS_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WIFI))
|
||||||
|
#define NM_IS_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_WIFI))
|
||||||
|
#define NM_DEVICE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass))
|
||||||
|
|
||||||
|
#define NM_DEVICE_WIFI_HW_ADDRESS "hw-address"
|
||||||
|
#define NM_DEVICE_WIFI_MODE "mode"
|
||||||
|
#define NM_DEVICE_WIFI_BITRATE "bitrate"
|
||||||
|
#define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point"
|
||||||
|
#define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NMDevice parent;
|
||||||
|
} NMDeviceWifi;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NMDeviceClass parent;
|
||||||
|
|
||||||
|
/* Signals */
|
||||||
|
void (*access_point_added) (NMDeviceWifi *device, NMAccessPoint *ap);
|
||||||
|
void (*access_point_removed) (NMDeviceWifi *device, NMAccessPoint *ap);
|
||||||
|
} NMDeviceWifiClass;
|
||||||
|
|
||||||
|
GType nm_device_wifi_get_type (void);
|
||||||
|
|
||||||
|
GObject *nm_device_wifi_new (DBusGConnection *connection, const char *path);
|
||||||
|
|
||||||
|
const char * nm_device_wifi_get_hw_address (NMDeviceWifi *device);
|
||||||
|
NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *device);
|
||||||
|
guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *device);
|
||||||
|
guint32 nm_device_wifi_get_capabilities (NMDeviceWifi *device);
|
||||||
|
NMAccessPoint * nm_device_wifi_get_active_access_point (NMDeviceWifi *device);
|
||||||
|
|
||||||
|
NMAccessPoint * nm_device_wifi_get_access_point_by_path (NMDeviceWifi *device,
|
||||||
|
const char *path);
|
||||||
|
|
||||||
|
const GPtrArray *nm_device_wifi_get_access_points (NMDeviceWifi *device);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* NM_DEVICE_WIFI_H */
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "NetworkManager.h"
|
#include "NetworkManager.h"
|
||||||
#include "nm-device-ethernet.h"
|
#include "nm-device-ethernet.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "nm-gsm-device.h"
|
#include "nm-gsm-device.h"
|
||||||
#include "nm-cdma-device.h"
|
#include "nm-cdma-device.h"
|
||||||
#include "nm-device.h"
|
#include "nm-device.h"
|
||||||
@@ -342,7 +342,7 @@ nm_device_new (DBusGConnection *connection, const char *path)
|
|||||||
dtype = NM_TYPE_DEVICE_ETHERNET;
|
dtype = NM_TYPE_DEVICE_ETHERNET;
|
||||||
break;
|
break;
|
||||||
case NM_DEVICE_TYPE_WIFI:
|
case NM_DEVICE_TYPE_WIFI:
|
||||||
dtype = NM_TYPE_DEVICE_802_11_WIRELESS;
|
dtype = NM_TYPE_DEVICE_WIFI;
|
||||||
break;
|
break;
|
||||||
case NM_DEVICE_TYPE_GSM:
|
case NM_DEVICE_TYPE_GSM:
|
||||||
dtype = NM_TYPE_GSM_DEVICE;
|
dtype = NM_TYPE_GSM_DEVICE;
|
||||||
|
@@ -622,32 +622,32 @@ device_supports_ap_ciphers (guint32 dev_caps,
|
|||||||
/* Static WEP only uses group ciphers */
|
/* Static WEP only uses group ciphers */
|
||||||
have_pair = TRUE;
|
have_pair = TRUE;
|
||||||
} else {
|
} else {
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_WEP40)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP40)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_PAIR_WEP40)
|
if (ap_flags & NM_802_11_AP_SEC_PAIR_WEP40)
|
||||||
have_pair = TRUE;
|
have_pair = TRUE;
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_WEP104)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP104)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_PAIR_WEP104)
|
if (ap_flags & NM_802_11_AP_SEC_PAIR_WEP104)
|
||||||
have_pair = TRUE;
|
have_pair = TRUE;
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_TKIP)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_PAIR_TKIP)
|
if (ap_flags & NM_802_11_AP_SEC_PAIR_TKIP)
|
||||||
have_pair = TRUE;
|
have_pair = TRUE;
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_CCMP)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_PAIR_CCMP)
|
if (ap_flags & NM_802_11_AP_SEC_PAIR_CCMP)
|
||||||
have_pair = TRUE;
|
have_pair = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Group */
|
/* Group */
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_WEP40)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP40)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_GROUP_WEP40)
|
if (ap_flags & NM_802_11_AP_SEC_GROUP_WEP40)
|
||||||
have_group = TRUE;
|
have_group = TRUE;
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_WEP104)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP104)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_GROUP_WEP104)
|
if (ap_flags & NM_802_11_AP_SEC_GROUP_WEP104)
|
||||||
have_group = TRUE;
|
have_group = TRUE;
|
||||||
if (!static_wep) {
|
if (!static_wep) {
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_TKIP)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_GROUP_TKIP)
|
if (ap_flags & NM_802_11_AP_SEC_GROUP_TKIP)
|
||||||
have_group = TRUE;
|
have_group = TRUE;
|
||||||
if (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_CCMP)
|
if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)
|
||||||
if (ap_flags & NM_802_11_AP_SEC_GROUP_CCMP)
|
if (ap_flags & NM_802_11_AP_SEC_GROUP_CCMP)
|
||||||
have_group = TRUE;
|
have_group = TRUE;
|
||||||
}
|
}
|
||||||
@@ -672,7 +672,7 @@ nm_utils_security_valid (NMUtilsSecurityType type,
|
|||||||
if ( (type == NMU_SEC_STATIC_WEP)
|
if ( (type == NMU_SEC_STATIC_WEP)
|
||||||
|| ((type == NMU_SEC_DYNAMIC_WEP) && !adhoc)
|
|| ((type == NMU_SEC_DYNAMIC_WEP) && !adhoc)
|
||||||
|| ((type == NMU_SEC_LEAP) && !adhoc)) {
|
|| ((type == NMU_SEC_LEAP) && !adhoc)) {
|
||||||
if (dev_caps & (NM_802_11_DEVICE_CAP_CIPHER_WEP40 | NM_802_11_DEVICE_CAP_CIPHER_WEP104))
|
if (dev_caps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -714,7 +714,7 @@ nm_utils_security_valid (NMUtilsSecurityType type,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NMU_SEC_WPA_PSK:
|
case NMU_SEC_WPA_PSK:
|
||||||
if (!(dev_caps & NM_802_11_DEVICE_CAP_WPA))
|
if (!(dev_caps & NM_WIFI_DEVICE_CAP_WPA))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (have_ap) {
|
if (have_ap) {
|
||||||
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
||||||
@@ -722,17 +722,17 @@ nm_utils_security_valid (NMUtilsSecurityType type,
|
|||||||
|
|
||||||
if (ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK) {
|
if (ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK) {
|
||||||
if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_TKIP)
|
if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_TKIP)
|
||||||
&& (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_TKIP))
|
&& (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_CCMP)
|
if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_CCMP)
|
||||||
&& (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_CCMP))
|
&& (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NMU_SEC_WPA2_PSK:
|
case NMU_SEC_WPA2_PSK:
|
||||||
if (!(dev_caps & NM_802_11_DEVICE_CAP_RSN))
|
if (!(dev_caps & NM_WIFI_DEVICE_CAP_RSN))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (have_ap) {
|
if (have_ap) {
|
||||||
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
||||||
@@ -740,10 +740,10 @@ nm_utils_security_valid (NMUtilsSecurityType type,
|
|||||||
|
|
||||||
if (ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK) {
|
if (ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK) {
|
||||||
if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_TKIP)
|
if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_TKIP)
|
||||||
&& (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_TKIP))
|
&& (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_CCMP)
|
if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_CCMP)
|
||||||
&& (dev_caps & NM_802_11_DEVICE_CAP_CIPHER_CCMP))
|
&& (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -752,7 +752,7 @@ nm_utils_security_valid (NMUtilsSecurityType type,
|
|||||||
case NMU_SEC_WPA_ENTERPRISE:
|
case NMU_SEC_WPA_ENTERPRISE:
|
||||||
if (adhoc)
|
if (adhoc)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!(dev_caps & NM_802_11_DEVICE_CAP_WPA))
|
if (!(dev_caps & NM_WIFI_DEVICE_CAP_WPA))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (have_ap) {
|
if (have_ap) {
|
||||||
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
||||||
@@ -767,7 +767,7 @@ nm_utils_security_valid (NMUtilsSecurityType type,
|
|||||||
case NMU_SEC_WPA2_ENTERPRISE:
|
case NMU_SEC_WPA2_ENTERPRISE:
|
||||||
if (adhoc)
|
if (adhoc)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!(dev_caps & NM_802_11_DEVICE_CAP_RSN))
|
if (!(dev_caps & NM_WIFI_DEVICE_CAP_RSN))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (have_ap) {
|
if (have_ap) {
|
||||||
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
||||||
|
@@ -30,8 +30,8 @@ NetworkManager_SOURCES = \
|
|||||||
nm-device-private.h \
|
nm-device-private.h \
|
||||||
nm-device-ethernet.c \
|
nm-device-ethernet.c \
|
||||||
nm-device-ethernet.h \
|
nm-device-ethernet.h \
|
||||||
nm-device-802-11-wireless.c \
|
nm-device-wifi.c \
|
||||||
nm-device-802-11-wireless.h \
|
nm-device-wifi.h \
|
||||||
NetworkManagerAP.c \
|
NetworkManagerAP.c \
|
||||||
NetworkManagerAP.h \
|
NetworkManagerAP.h \
|
||||||
nm-dbus-manager.h \
|
nm-dbus-manager.h \
|
||||||
@@ -84,8 +84,8 @@ nm-device-interface-glue.h: $(top_srcdir)/introspection/nm-device.xml
|
|||||||
nm-device-ethernet-glue.h: $(top_srcdir)/introspection/nm-device-ethernet.xml
|
nm-device-ethernet-glue.h: $(top_srcdir)/introspection/nm-device-ethernet.xml
|
||||||
dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-server --output=nm-device-ethernet-glue.h $(top_srcdir)/introspection/nm-device-ethernet.xml
|
dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-server --output=nm-device-ethernet-glue.h $(top_srcdir)/introspection/nm-device-ethernet.xml
|
||||||
|
|
||||||
nm-device-802-11-wireless-glue.h: $(top_srcdir)/introspection/nm-device-802-11-wireless.xml
|
nm-device-wifi-glue.h: $(top_srcdir)/introspection/nm-device-wifi.xml
|
||||||
dbus-binding-tool --prefix=nm_device_802_11_wireless --mode=glib-server --output=nm-device-802-11-wireless-glue.h $(top_srcdir)/introspection/nm-device-802-11-wireless.xml
|
dbus-binding-tool --prefix=nm_device_wifi --mode=glib-server --output=nm-device-wifi-glue.h $(top_srcdir)/introspection/nm-device-wifi.xml
|
||||||
|
|
||||||
nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml
|
nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml
|
||||||
dbus-binding-tool --prefix=nm_serial_device --mode=glib-server --output=nm-serial-device-glue.h $(top_srcdir)/introspection/nm-device-serial.xml
|
dbus-binding-tool --prefix=nm_serial_device --mode=glib-server --output=nm-serial-device-glue.h $(top_srcdir)/introspection/nm-device-serial.xml
|
||||||
@@ -107,7 +107,7 @@ built_sources = \
|
|||||||
nm-manager-glue.h \
|
nm-manager-glue.h \
|
||||||
nm-device-interface-glue.h \
|
nm-device-interface-glue.h \
|
||||||
nm-device-ethernet-glue.h \
|
nm-device-ethernet-glue.h \
|
||||||
nm-device-802-11-wireless-glue.h \
|
nm-device-wifi-glue.h \
|
||||||
nm-serial-device-glue.h \
|
nm-serial-device-glue.h \
|
||||||
nm-cdma-device-glue.h \
|
nm-cdma-device-glue.h \
|
||||||
nm-gsm-device-glue.h \
|
nm-gsm-device-glue.h \
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||||
/* NetworkManager -- Network link manager
|
/* NetworkManager -- Network link manager
|
||||||
*
|
*
|
||||||
* Dan Williams <dcbw@redhat.com>
|
* Dan Williams <dcbw@redhat.com>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-device-interface.h"
|
#include "nm-device-interface.h"
|
||||||
#include "nm-device.h"
|
#include "nm-device.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "nm-device-ethernet.h"
|
#include "nm-device-ethernet.h"
|
||||||
#include "nm-gsm-device.h"
|
#include "nm-gsm-device.h"
|
||||||
#include "nm-cdma-device.h"
|
#include "nm-cdma-device.h"
|
||||||
@@ -105,7 +105,7 @@ get_device_priority (NMDevice *dev)
|
|||||||
if (NM_IS_GSM_DEVICE (dev))
|
if (NM_IS_GSM_DEVICE (dev))
|
||||||
return 3;
|
return 3;
|
||||||
|
|
||||||
if (NM_IS_DEVICE_802_11_WIRELESS (dev))
|
if (NM_IS_DEVICE_WIFI (dev))
|
||||||
return 4;
|
return 4;
|
||||||
|
|
||||||
if (NM_IS_DEVICE_ETHERNET (dev))
|
if (NM_IS_DEVICE_ETHERNET (dev))
|
||||||
@@ -564,7 +564,7 @@ device_ip4_config_changed (NMDevice *device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wireless_networks_changed (NMDevice80211Wireless *device, NMAccessPoint *ap, gpointer user_data)
|
wireless_networks_changed (NMDeviceWifi *device, NMAccessPoint *ap, gpointer user_data)
|
||||||
{
|
{
|
||||||
schedule_activate_check ((NMPolicy *) user_data, NM_DEVICE (device));
|
schedule_activate_check ((NMPolicy *) user_data, NM_DEVICE (device));
|
||||||
}
|
}
|
||||||
@@ -604,7 +604,7 @@ device_added (NMManager *manager, NMDevice *device, gpointer user_data)
|
|||||||
policy);
|
policy);
|
||||||
policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device);
|
policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device);
|
||||||
|
|
||||||
if (NM_IS_DEVICE_802_11_WIRELESS (device)) {
|
if (NM_IS_DEVICE_WIFI (device)) {
|
||||||
id = g_signal_connect (device, "access-point-added",
|
id = g_signal_connect (device, "access-point-added",
|
||||||
G_CALLBACK (wireless_networks_changed),
|
G_CALLBACK (wireless_networks_changed),
|
||||||
policy);
|
policy);
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-device.h"
|
#include "nm-device.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "nm-device-ethernet.h"
|
#include "nm-device-ethernet.h"
|
||||||
#include "nm-dbus-manager.h"
|
#include "nm-dbus-manager.h"
|
||||||
#include "nm-dispatcher-action.h"
|
#include "nm-dispatcher-action.h"
|
||||||
@@ -125,7 +125,7 @@ nm_print_device_capabilities (NMDevice *dev)
|
|||||||
nm_device_get_iface (dev), driver);
|
nm_device_get_iface (dev), driver);
|
||||||
full_support = FALSE;
|
full_support = FALSE;
|
||||||
}
|
}
|
||||||
} else if (NM_IS_DEVICE_802_11_WIRELESS (dev)) {
|
} else if (NM_IS_DEVICE_WIFI (dev)) {
|
||||||
/* Print out WPA support */
|
/* Print out WPA support */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include "NetworkManager.h"
|
#include "NetworkManager.h"
|
||||||
#include "nm-device.h"
|
#include "nm-device.h"
|
||||||
#include "nm-device-ethernet.h"
|
#include "nm-device-ethernet.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "autoip.h"
|
#include "autoip.h"
|
||||||
@@ -227,8 +227,8 @@ gboolean get_autoip (NMDevice *dev, struct in_addr *out_ip)
|
|||||||
|
|
||||||
if (NM_IS_DEVICE_ETHERNET (dev))
|
if (NM_IS_DEVICE_ETHERNET (dev))
|
||||||
nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (dev), &addr);
|
nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (dev), &addr);
|
||||||
else if (NM_IS_DEVICE_802_11_WIRELESS (dev))
|
else if (NM_IS_DEVICE_WIFI (dev))
|
||||||
nm_device_802_11_wireless_get_address (NM_DEVICE_802_11_WIRELESS (dev), &addr);
|
nm_device_wifi_get_address (NM_DEVICE_WIFI (dev), &addr);
|
||||||
else
|
else
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@@ -1,107 +0,0 @@
|
|||||||
/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
|
|
||||||
|
|
||||||
/* NetworkManager -- Network link manager
|
|
||||||
*
|
|
||||||
* Dan Williams <dcbw@redhat.com>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*
|
|
||||||
* (C) Copyright 2005 Red Hat, Inc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef NM_DEVICE_802_11_WIRELESS_H
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_H
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
#include <dbus/dbus.h>
|
|
||||||
#include <net/ethernet.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include "nm-device.h"
|
|
||||||
#include "NetworkManagerAP.h"
|
|
||||||
|
|
||||||
struct NMAccessPointList;
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define NM_TYPE_DEVICE_802_11_WIRELESS (nm_device_802_11_wireless_get_type ())
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211Wireless))
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211WirelessClass))
|
|
||||||
#define NM_IS_DEVICE_802_11_WIRELESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_802_11_WIRELESS))
|
|
||||||
#define NM_IS_DEVICE_802_11_WIRELESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_802_11_WIRELESS))
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_802_11_WIRELESS, NMDevice80211WirelessClass))
|
|
||||||
|
|
||||||
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_HW_ADDRESS "hw-address"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_MODE "mode"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_BITRATE "bitrate"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT "active-access-point"
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_CAPABILITIES "wireless-capabilities"
|
|
||||||
|
|
||||||
#ifndef NM_DEVICE_802_11_WIRELESS_DEFINED
|
|
||||||
#define NM_DEVICE_802_11_WIRELESS_DEFINED
|
|
||||||
typedef struct _NMDevice80211Wireless NMDevice80211Wireless;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _NMDevice80211WirelessClass NMDevice80211WirelessClass;
|
|
||||||
typedef struct _NMDevice80211WirelessPrivate NMDevice80211WirelessPrivate;
|
|
||||||
|
|
||||||
struct _NMDevice80211Wireless
|
|
||||||
{
|
|
||||||
NMDevice parent;
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
NMDevice80211WirelessPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _NMDevice80211WirelessClass
|
|
||||||
{
|
|
||||||
NMDeviceClass parent;
|
|
||||||
|
|
||||||
/* Signals */
|
|
||||||
void (*access_point_added) (NMDevice80211Wireless *device, NMAccessPoint *ap);
|
|
||||||
void (*access_point_removed) (NMDevice80211Wireless *device, NMAccessPoint *ap);
|
|
||||||
void (*hidden_ap_found) (NMDevice80211Wireless *device, NMAccessPoint *ap);
|
|
||||||
void (*properties_changed) (NMDevice80211Wireless *device, GHashTable *properties);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
GType nm_device_802_11_wireless_get_type (void);
|
|
||||||
|
|
||||||
NMDevice80211Wireless *nm_device_802_11_wireless_new (const char *udi,
|
|
||||||
const char *iface,
|
|
||||||
const char *driver,
|
|
||||||
gboolean managed);
|
|
||||||
|
|
||||||
void nm_device_802_11_wireless_get_address (NMDevice80211Wireless *dev,
|
|
||||||
struct ether_addr *addr);
|
|
||||||
|
|
||||||
void nm_device_802_11_wireless_get_bssid (NMDevice80211Wireless *dev,
|
|
||||||
struct ether_addr *bssid);
|
|
||||||
|
|
||||||
const GByteArray * nm_device_802_11_wireless_get_ssid (NMDevice80211Wireless *self);
|
|
||||||
|
|
||||||
gboolean nm_device_802_11_wireless_set_mode (NMDevice80211Wireless *self,
|
|
||||||
const NM80211Mode mode);
|
|
||||||
|
|
||||||
NM80211Mode nm_device_802_11_wireless_get_mode (NMDevice80211Wireless *self);
|
|
||||||
|
|
||||||
NMAccessPoint * nm_device_802_11_wireless_get_activation_ap (NMDevice80211Wireless *self);
|
|
||||||
|
|
||||||
void nm_device_802_11_wireless_set_enabled (NMDevice80211Wireless *self, gboolean enabled);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* NM_DEVICE_802_11_WIRELESS_H */
|
|
File diff suppressed because it is too large
Load Diff
107
src/nm-device-wifi.h
Normal file
107
src/nm-device-wifi.h
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||||
|
|
||||||
|
/* NetworkManager -- Network link manager
|
||||||
|
*
|
||||||
|
* Dan Williams <dcbw@redhat.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* (C) Copyright 2005 Red Hat, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NM_DEVICE_WIFI_H
|
||||||
|
#define NM_DEVICE_WIFI_H
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <dbus/dbus.h>
|
||||||
|
#include <net/ethernet.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "nm-device.h"
|
||||||
|
#include "NetworkManagerAP.h"
|
||||||
|
|
||||||
|
struct NMAccessPointList;
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define NM_TYPE_DEVICE_WIFI (nm_device_wifi_get_type ())
|
||||||
|
#define NM_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifi))
|
||||||
|
#define NM_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass))
|
||||||
|
#define NM_IS_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WIFI))
|
||||||
|
#define NM_IS_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_WIFI))
|
||||||
|
#define NM_DEVICE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass))
|
||||||
|
|
||||||
|
|
||||||
|
#define NM_DEVICE_WIFI_HW_ADDRESS "hw-address"
|
||||||
|
#define NM_DEVICE_WIFI_MODE "mode"
|
||||||
|
#define NM_DEVICE_WIFI_BITRATE "bitrate"
|
||||||
|
#define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point"
|
||||||
|
#define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities"
|
||||||
|
|
||||||
|
#ifndef NM_DEVICE_WIFI_DEFINED
|
||||||
|
#define NM_DEVICE_WIFI_DEFINED
|
||||||
|
typedef struct _NMDeviceWifi NMDeviceWifi;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct _NMDeviceWifiClass NMDeviceWifiClass;
|
||||||
|
typedef struct _NMDeviceWifiPrivate NMDeviceWifiPrivate;
|
||||||
|
|
||||||
|
struct _NMDeviceWifi
|
||||||
|
{
|
||||||
|
NMDevice parent;
|
||||||
|
|
||||||
|
/*< private >*/
|
||||||
|
NMDeviceWifiPrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _NMDeviceWifiClass
|
||||||
|
{
|
||||||
|
NMDeviceClass parent;
|
||||||
|
|
||||||
|
/* Signals */
|
||||||
|
void (*access_point_added) (NMDeviceWifi *device, NMAccessPoint *ap);
|
||||||
|
void (*access_point_removed) (NMDeviceWifi *device, NMAccessPoint *ap);
|
||||||
|
void (*hidden_ap_found) (NMDeviceWifi *device, NMAccessPoint *ap);
|
||||||
|
void (*properties_changed) (NMDeviceWifi *device, GHashTable *properties);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
GType nm_device_wifi_get_type (void);
|
||||||
|
|
||||||
|
NMDeviceWifi *nm_device_wifi_new (const char *udi,
|
||||||
|
const char *iface,
|
||||||
|
const char *driver,
|
||||||
|
gboolean managed);
|
||||||
|
|
||||||
|
void nm_device_wifi_get_address (NMDeviceWifi *dev,
|
||||||
|
struct ether_addr *addr);
|
||||||
|
|
||||||
|
void nm_device_wifi_get_bssid (NMDeviceWifi *dev,
|
||||||
|
struct ether_addr *bssid);
|
||||||
|
|
||||||
|
const GByteArray * nm_device_wifi_get_ssid (NMDeviceWifi *self);
|
||||||
|
|
||||||
|
gboolean nm_device_wifi_set_mode (NMDeviceWifi *self,
|
||||||
|
const NM80211Mode mode);
|
||||||
|
|
||||||
|
NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *self);
|
||||||
|
|
||||||
|
NMAccessPoint * nm_device_wifi_get_activation_ap (NMDeviceWifi *self);
|
||||||
|
|
||||||
|
void nm_device_wifi_set_enabled (NMDeviceWifi *self, gboolean enabled);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* NM_DEVICE_WIFI_H */
|
@@ -11,7 +11,7 @@
|
|||||||
#include "nm-marshal.h"
|
#include "nm-marshal.h"
|
||||||
#include "nm-dbus-manager.h"
|
#include "nm-dbus-manager.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "nm-device-ethernet.h"
|
#include "nm-device-ethernet.h"
|
||||||
#include "nm-gsm-device.h"
|
#include "nm-gsm-device.h"
|
||||||
#include "nm-cdma-device.h"
|
#include "nm-cdma-device.h"
|
||||||
@@ -186,7 +186,7 @@ wireless_device_creator (NMHalManager *self, const char *udi, gboolean managed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
driver = nm_get_device_driver_name (priv->hal_ctx, udi);
|
driver = nm_get_device_driver_name (priv->hal_ctx, udi);
|
||||||
device = (GObject *) nm_device_802_11_wireless_new (udi, iface, driver, managed);
|
device = (GObject *) nm_device_wifi_new (udi, iface, driver, managed);
|
||||||
|
|
||||||
libhal_free_string (iface);
|
libhal_free_string (iface);
|
||||||
g_free (driver);
|
g_free (driver);
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#include "nm-vpn-manager.h"
|
#include "nm-vpn-manager.h"
|
||||||
#include "nm-device-interface.h"
|
#include "nm-device-interface.h"
|
||||||
#include "nm-device-private.h"
|
#include "nm-device-private.h"
|
||||||
#include "nm-device-802-11-wireless.h"
|
#include "nm-device-wifi.h"
|
||||||
#include "NetworkManagerSystem.h"
|
#include "NetworkManagerSystem.h"
|
||||||
#include "nm-properties-changed-signal.h"
|
#include "nm-properties-changed-signal.h"
|
||||||
#include "nm-setting-connection.h"
|
#include "nm-setting-connection.h"
|
||||||
@@ -1362,8 +1362,8 @@ manager_set_wireless_enabled (NMManager *manager, gboolean enabled)
|
|||||||
|
|
||||||
/* enable/disable wireless devices as required */
|
/* enable/disable wireless devices as required */
|
||||||
for (iter = priv->devices; iter; iter = iter->next) {
|
for (iter = priv->devices; iter; iter = iter->next) {
|
||||||
if (NM_IS_DEVICE_802_11_WIRELESS (iter->data))
|
if (NM_IS_DEVICE_WIFI (iter->data))
|
||||||
nm_device_802_11_wireless_set_enabled (NM_DEVICE_802_11_WIRELESS (iter->data), enabled);
|
nm_device_wifi_set_enabled (NM_DEVICE_WIFI (iter->data), enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1473,13 +1473,13 @@ hal_manager_udi_added_cb (NMHalManager *hal_mgr,
|
|||||||
/* Attach to the access-point-added signal so that the manager can fill
|
/* Attach to the access-point-added signal so that the manager can fill
|
||||||
* non-SSID-broadcasting APs with an SSID.
|
* non-SSID-broadcasting APs with an SSID.
|
||||||
*/
|
*/
|
||||||
if (NM_IS_DEVICE_802_11_WIRELESS (device)) {
|
if (NM_IS_DEVICE_WIFI (device)) {
|
||||||
g_signal_connect (device, "hidden-ap-found",
|
g_signal_connect (device, "hidden-ap-found",
|
||||||
G_CALLBACK (manager_hidden_ap_found),
|
G_CALLBACK (manager_hidden_ap_found),
|
||||||
self);
|
self);
|
||||||
|
|
||||||
/* Set initial rfkill state */
|
/* Set initial rfkill state */
|
||||||
nm_device_802_11_wireless_set_enabled (NM_DEVICE_802_11_WIRELESS (device), priv->wireless_enabled);
|
nm_device_wifi_set_enabled (NM_DEVICE_WIFI (device), priv->wireless_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
iface = nm_device_get_iface (NM_DEVICE (device));
|
iface = nm_device_get_iface (NM_DEVICE (device));
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
#include <nm-client.h>
|
#include <nm-client.h>
|
||||||
#include <nm-device.h>
|
#include <nm-device.h>
|
||||||
#include <nm-device-ethernet.h>
|
#include <nm-device-ethernet.h>
|
||||||
#include <nm-device-802-11-wireless.h>
|
#include <nm-device-wifi.h>
|
||||||
#include <nm-gsm-device.h>
|
#include <nm-gsm-device.h>
|
||||||
#include <nm-cdma-device.h>
|
#include <nm-cdma-device.h>
|
||||||
#include <nm-utils.h>
|
#include <nm-utils.h>
|
||||||
@@ -215,8 +215,8 @@ detail_device (gpointer data, gpointer user_data)
|
|||||||
/* General information */
|
/* General information */
|
||||||
if (NM_IS_DEVICE_ETHERNET (device))
|
if (NM_IS_DEVICE_ETHERNET (device))
|
||||||
print_string ("Type", "Wired");
|
print_string ("Type", "Wired");
|
||||||
else if (NM_IS_DEVICE_802_11_WIRELESS (device))
|
else if (NM_IS_DEVICE_WIFI (device))
|
||||||
print_string ("Type", "802.11 Wireless");
|
print_string ("Type", "802.11 WiFi");
|
||||||
else if (NM_IS_GSM_DEVICE (device))
|
else if (NM_IS_GSM_DEVICE (device))
|
||||||
print_string ("Type", "Mobile Broadband (GSM)");
|
print_string ("Type", "Mobile Broadband (GSM)");
|
||||||
else if (NM_IS_CDMA_DEVICE (device))
|
else if (NM_IS_CDMA_DEVICE (device))
|
||||||
@@ -245,8 +245,8 @@ detail_device (gpointer data, gpointer user_data)
|
|||||||
tmp = NULL;
|
tmp = NULL;
|
||||||
if (NM_IS_DEVICE_ETHERNET (device))
|
if (NM_IS_DEVICE_ETHERNET (device))
|
||||||
tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)));
|
tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)));
|
||||||
else if (NM_IS_DEVICE_802_11_WIRELESS (device))
|
else if (NM_IS_DEVICE_WIFI (device))
|
||||||
tmp = g_strdup (nm_device_802_11_wireless_get_hw_address (NM_DEVICE_802_11_WIRELESS (device)));
|
tmp = g_strdup (nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device)));
|
||||||
|
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
print_string ("HW Address", tmp);
|
print_string ("HW Address", tmp);
|
||||||
@@ -267,9 +267,9 @@ detail_device (gpointer data, gpointer user_data)
|
|||||||
if (NM_IS_DEVICE_ETHERNET (device)) {
|
if (NM_IS_DEVICE_ETHERNET (device)) {
|
||||||
/* Speed in Mb/s */
|
/* Speed in Mb/s */
|
||||||
speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device));
|
speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device));
|
||||||
} else if (NM_IS_DEVICE_802_11_WIRELESS (device)) {
|
} else if (NM_IS_DEVICE_WIFI (device)) {
|
||||||
/* Speed in b/s */
|
/* Speed in b/s */
|
||||||
speed = nm_device_802_11_wireless_get_bitrate (NM_DEVICE_802_11_WIRELESS (device));
|
speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device));
|
||||||
speed /= 1000;
|
speed /= 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ detail_device (gpointer data, gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Wireless specific information */
|
/* Wireless specific information */
|
||||||
if ((NM_IS_DEVICE_802_11_WIRELESS (device))) {
|
if ((NM_IS_DEVICE_WIFI (device))) {
|
||||||
guint32 wcaps;
|
guint32 wcaps;
|
||||||
NMAccessPoint *active_ap = NULL;
|
NMAccessPoint *active_ap = NULL;
|
||||||
const char *active_bssid = NULL;
|
const char *active_bssid = NULL;
|
||||||
@@ -290,23 +290,23 @@ detail_device (gpointer data, gpointer user_data)
|
|||||||
|
|
||||||
printf ("\n Wireless Settings\n");
|
printf ("\n Wireless Settings\n");
|
||||||
|
|
||||||
wcaps = nm_device_802_11_wireless_get_capabilities (NM_DEVICE_802_11_WIRELESS (device));
|
wcaps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device));
|
||||||
|
|
||||||
if (wcaps & (NM_802_11_DEVICE_CAP_CIPHER_WEP40 | NM_802_11_DEVICE_CAP_CIPHER_WEP104))
|
if (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104))
|
||||||
print_string (" WEP Encryption", "yes");
|
print_string (" WEP Encryption", "yes");
|
||||||
if (wcaps & NM_802_11_DEVICE_CAP_WPA)
|
if (wcaps & NM_WIFI_DEVICE_CAP_WPA)
|
||||||
print_string (" WPA Encryption", "yes");
|
print_string (" WPA Encryption", "yes");
|
||||||
if (wcaps & NM_802_11_DEVICE_CAP_RSN)
|
if (wcaps & NM_WIFI_DEVICE_CAP_RSN)
|
||||||
print_string (" WPA2 Encryption", "yes");
|
print_string (" WPA2 Encryption", "yes");
|
||||||
|
|
||||||
if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) {
|
if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) {
|
||||||
active_ap = nm_device_802_11_wireless_get_active_access_point (NM_DEVICE_802_11_WIRELESS (device));
|
active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device));
|
||||||
active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL;
|
active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("\n Wireless Access Points%s\n", active_ap ? "(* = Current AP)" : "");
|
printf ("\n Wireless Access Points%s\n", active_ap ? "(* = Current AP)" : "");
|
||||||
|
|
||||||
aps = nm_device_802_11_wireless_get_access_points (NM_DEVICE_802_11_WIRELESS (device));
|
aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device));
|
||||||
if (aps && aps->len)
|
if (aps && aps->len)
|
||||||
g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid);
|
g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid);
|
||||||
} else if (NM_IS_DEVICE_ETHERNET (device)) {
|
} else if (NM_IS_DEVICE_ETHERNET (device)) {
|
||||||
|
Reference in New Issue
Block a user