1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301 USA.
18 * Copyright 2007 - 2008 Novell, Inc.
19 * Copyright 2007 - 2012 Red Hat, Inc.
22 #include "nm-default.h"
25 #include <netinet/ether.h>
27 #include "nm-setting-connection.h"
28 #include "nm-setting-wireless.h"
29 #include "nm-setting-wireless-security.h"
31 #include "nm-device-wifi.h"
32 #include "nm-device-private.h"
33 #include "nm-object-private.h"
34 #include "nm-object-cache.h"
35 #include "nm-dbus-glib-types.h"
36 #include "nm-types-private.h"
38 G_DEFINE_TYPE (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE)
40 #define NM_DEVICE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIFI, NMDeviceWifiPrivate))
42 void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled);
46 NMDeviceWifiRequestScanFn callback;
54 char *perm_hw_address;
57 NMAccessPoint *active_ap;
58 NMDeviceWifiCapabilities wireless_caps;
61 DBusGProxyCall *scan_call;
62 RequestScanInfo *scan_info;
63 } NMDeviceWifiPrivate;
71 PROP_ACTIVE_ACCESS_POINT,
72 PROP_WIRELESS_CAPABILITIES,
84 static guint signals[LAST_SIGNAL] = { 0 };
87 * nm_device_wifi_error_quark:
89 * Registers an error quark for #NMDeviceWifi if necessary.
91 * Returns: the error quark used for #NMDeviceWifi errors.
94 nm_device_wifi_error_quark (void)
96 static GQuark quark = 0;
98 if (G_UNLIKELY (quark == 0))
99 quark = g_quark_from_static_string ("nm-device-wifi-error-quark");
104 * nm_device_wifi_new:
105 * @connection: the #DBusGConnection
106 * @path: the DBus object path of the device
108 * Creates a new #NMDeviceWifi.
110 * Returns: (transfer full): a new Wi-Fi device
113 nm_device_wifi_new (DBusGConnection *connection, const char *path)
117 g_return_val_if_fail (connection != NULL, NULL);
118 g_return_val_if_fail (path != NULL, NULL);
120 device = g_object_new (NM_TYPE_DEVICE_WIFI,
121 NM_OBJECT_DBUS_CONNECTION, connection,
122 NM_OBJECT_DBUS_PATH, path,
124 _nm_object_ensure_inited (NM_OBJECT (device));
129 * nm_device_wifi_get_hw_address:
130 * @device: a #NMDeviceWifi
132 * Gets the actual hardware (MAC) address of the #NMDeviceWifi
134 * Returns: the actual hardware address. This is the internal string used by the
135 * device, and must not be modified.
138 nm_device_wifi_get_hw_address (NMDeviceWifi *device)
140 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
142 _nm_object_ensure_inited (NM_OBJECT (device));
143 return NM_DEVICE_WIFI_GET_PRIVATE (device)->hw_address;
147 * nm_device_wifi_get_permanent_hw_address:
148 * @device: a #NMDeviceWifi
150 * Gets the permanent hardware (MAC) address of the #NMDeviceWifi
152 * Returns: the permanent hardware address. This is the internal string used by the
153 * device, and must not be modified.
156 nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device)
158 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
160 _nm_object_ensure_inited (NM_OBJECT (device));
161 return NM_DEVICE_WIFI_GET_PRIVATE (device)->perm_hw_address;
165 * nm_device_wifi_get_mode:
166 * @device: a #NMDeviceWifi
168 * Gets the #NMDeviceWifi mode.
173 nm_device_wifi_get_mode (NMDeviceWifi *device)
175 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
177 _nm_object_ensure_inited (NM_OBJECT (device));
178 return NM_DEVICE_WIFI_GET_PRIVATE (device)->mode;
182 * nm_device_wifi_get_bitrate:
183 * @device: a #NMDeviceWifi
185 * Gets the bit rate of the #NMDeviceWifi in kbit/s.
187 * Returns: the bit rate (kbit/s)
190 nm_device_wifi_get_bitrate (NMDeviceWifi *device)
194 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
196 state = nm_device_get_state (NM_DEVICE (device));
198 case NM_DEVICE_STATE_IP_CONFIG:
199 case NM_DEVICE_STATE_IP_CHECK:
200 case NM_DEVICE_STATE_SECONDARIES:
201 case NM_DEVICE_STATE_ACTIVATED:
202 case NM_DEVICE_STATE_DEACTIVATING:
208 _nm_object_ensure_inited (NM_OBJECT (device));
209 return NM_DEVICE_WIFI_GET_PRIVATE (device)->rate;
213 * nm_device_wifi_get_capabilities:
214 * @device: a #NMDeviceWifi
216 * Gets the Wi-Fi capabilities of the #NMDeviceWifi.
218 * Returns: the capabilities
220 NMDeviceWifiCapabilities
221 nm_device_wifi_get_capabilities (NMDeviceWifi *device)
223 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
225 _nm_object_ensure_inited (NM_OBJECT (device));
226 return NM_DEVICE_WIFI_GET_PRIVATE (device)->wireless_caps;
230 * nm_device_wifi_get_active_access_point:
231 * @device: a #NMDeviceWifi
233 * Gets the active #NMAccessPoint.
235 * Returns: (transfer none): the access point or %NULL if none is active
238 nm_device_wifi_get_active_access_point (NMDeviceWifi *device)
242 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
244 state = nm_device_get_state (NM_DEVICE (device));
246 case NM_DEVICE_STATE_PREPARE:
247 case NM_DEVICE_STATE_CONFIG:
248 case NM_DEVICE_STATE_NEED_AUTH:
249 case NM_DEVICE_STATE_IP_CONFIG:
250 case NM_DEVICE_STATE_IP_CHECK:
251 case NM_DEVICE_STATE_SECONDARIES:
252 case NM_DEVICE_STATE_ACTIVATED:
253 case NM_DEVICE_STATE_DEACTIVATING:
260 _nm_object_ensure_inited (NM_OBJECT (device));
261 return NM_DEVICE_WIFI_GET_PRIVATE (device)->active_ap;
265 * nm_device_wifi_get_access_points:
266 * @device: a #NMDeviceWifi
268 * Gets all the scanned access points of the #NMDeviceWifi.
270 * Returns: (element-type NMAccessPoint): a #GPtrArray containing all the
271 * scanned #NMAccessPoints.
272 * The returned array is owned by the client and should not be modified.
275 nm_device_wifi_get_access_points (NMDeviceWifi *device)
277 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
279 _nm_object_ensure_inited (NM_OBJECT (device));
280 return handle_ptr_array_return (NM_DEVICE_WIFI_GET_PRIVATE (device)->aps);
284 * nm_device_wifi_get_access_point_by_path:
285 * @device: a #NMDeviceWifi
286 * @path: the object path of the access point
288 * Gets a #NMAccessPoint by path.
290 * Returns: (transfer none): the access point or %NULL if none is found.
293 nm_device_wifi_get_access_point_by_path (NMDeviceWifi *device,
296 const GPtrArray *aps;
298 NMAccessPoint *ap = NULL;
300 g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
301 g_return_val_if_fail (path != NULL, NULL);
303 aps = nm_device_wifi_get_access_points (device);
307 for (i = 0; i < aps->len; i++) {
308 NMAccessPoint *candidate = g_ptr_array_index (aps, i);
309 if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), path)) {
319 request_scan_cb (DBusGProxy *proxy,
320 DBusGProxyCall *call,
323 RequestScanInfo *info = user_data;
324 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (info->device);
325 GError *error = NULL;
327 dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
330 info->callback (info->device, error, info->user_data);
332 g_clear_error (&error);
333 g_slice_free (RequestScanInfo, info);
335 priv->scan_call = NULL;
336 priv->scan_info = NULL;
340 * nm_device_wifi_request_scan_simple:
341 * @device: a #NMDeviceWifi
342 * @callback: (scope async) (allow-none): the function to call when the call is done
343 * @user_data: (closure): user data to pass to the callback function
345 * Request NM to scan for access points on the #NMDeviceWifi. This function only
346 * instructs NM to perform scanning. Use nm_device_wifi_get_access_points()
347 * to get available access points.
352 nm_device_wifi_request_scan_simple (NMDeviceWifi *device,
353 NMDeviceWifiRequestScanFn callback,
356 RequestScanInfo *info;
358 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
360 g_return_if_fail (NM_IS_DEVICE_WIFI (device));
362 /* If a scan is in progress, just return */
366 options = g_hash_table_new (g_str_hash, g_str_equal);
368 info = g_slice_new0 (RequestScanInfo);
369 info->device = device;
370 info->callback = callback;
371 info->user_data = user_data;
373 priv->scan_info = info;
374 priv->scan_call = dbus_g_proxy_begin_call (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy, "RequestScan",
375 request_scan_cb, info, NULL,
376 DBUS_TYPE_G_MAP_OF_VARIANT, options,
379 g_hash_table_unref (options);
383 clean_up_aps (NMDeviceWifi *self, gboolean notify)
385 NMDeviceWifiPrivate *priv;
387 g_return_if_fail (NM_IS_DEVICE_WIFI (self));
389 priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
391 if (priv->active_ap) {
392 g_object_unref (priv->active_ap);
393 priv->active_ap = NULL;
397 while (priv->aps->len) {
398 NMAccessPoint *ap = NM_ACCESS_POINT (g_ptr_array_index (priv->aps, 0));
401 g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
402 g_ptr_array_remove (priv->aps, ap);
405 g_ptr_array_free (priv->aps, TRUE);
411 * _nm_device_wifi_set_wireless_enabled:
412 * @device: a #NMDeviceWifi
413 * @enabled: %TRUE to enable the device
415 * Enables or disables the wireless device.
418 _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device,
421 g_return_if_fail (NM_IS_DEVICE_WIFI (device));
424 clean_up_aps (device, TRUE);
427 #define WPA_CAPS (NM_WIFI_DEVICE_CAP_CIPHER_TKIP | \
428 NM_WIFI_DEVICE_CAP_CIPHER_CCMP | \
429 NM_WIFI_DEVICE_CAP_WPA | \
430 NM_WIFI_DEVICE_CAP_RSN)
432 #define RSN_CAPS (NM_WIFI_DEVICE_CAP_CIPHER_CCMP | NM_WIFI_DEVICE_CAP_RSN)
435 has_proto (NMSettingWirelessSecurity *s_wsec, const char *proto)
439 for (i = 0; i < nm_setting_wireless_security_get_num_protos (s_wsec); i++) {
440 if (g_strcmp0 (proto, nm_setting_wireless_security_get_proto (s_wsec, i)) == 0)
447 connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
449 NMSettingConnection *s_con;
450 NMSettingWireless *s_wifi;
451 NMSettingWirelessSecurity *s_wsec;
453 const GByteArray *mac;
455 struct ether_addr *hw_mac;
456 NMDeviceWifiCapabilities wifi_caps;
457 const char *key_mgmt;
459 s_con = nm_connection_get_setting_connection (connection);
462 ctype = nm_setting_connection_get_connection_type (s_con);
463 if (strcmp (ctype, NM_SETTING_WIRELESS_SETTING_NAME) != 0) {
464 g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_NOT_WIFI_CONNECTION,
465 "The connection was not a Wi-Fi connection.");
469 s_wifi = nm_connection_get_setting_wireless (connection);
471 g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_INVALID_WIFI_CONNECTION,
472 "The connection was not a valid Wi-Fi connection.");
476 /* Check MAC address */
477 hw_str = nm_device_wifi_get_permanent_hw_address (NM_DEVICE_WIFI (device));
479 hw_mac = ether_aton (hw_str);
481 g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_INVALID_DEVICE_MAC,
482 "Invalid device MAC address.");
485 mac = nm_setting_wireless_get_mac_address (s_wifi);
486 if (mac && hw_mac && memcmp (mac->data, hw_mac->ether_addr_octet, ETH_ALEN)) {
487 g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_MAC_MISMATCH,
488 "The MACs of the device and the connection didn't match.");
493 /* Check device capabilities; we assume all devices can do WEP at least */
494 wifi_caps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device));
496 s_wsec = nm_connection_get_setting_wireless_security (connection);
498 /* Connection has security, verify it against the device's capabilities */
499 key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec);
500 if ( !g_strcmp0 (key_mgmt, "wpa-none")
501 || !g_strcmp0 (key_mgmt, "wpa-psk")
502 || !g_strcmp0 (key_mgmt, "wpa-eap")) {
504 /* Is device only WEP capable? */
505 if (!(wifi_caps & WPA_CAPS)) {
506 g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_WPA_CAPS,
507 "The device missed WPA capabilities required by the connection.");
511 /* Make sure WPA2/RSN-only connections don't get chosen for WPA-only cards */
512 if (has_proto (s_wsec, "rsn") && !has_proto (s_wsec, "wpa") && !(wifi_caps & RSN_CAPS)) {
513 g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_RSN_CAPS,
514 "The device missed WPA2/RSN capabilities required by the connection.");
520 return NM_DEVICE_CLASS (nm_device_wifi_parent_class)->connection_compatible (device, connection, error);
524 get_setting_type (NMDevice *device)
526 return NM_TYPE_SETTING_WIRELESS;
530 get_hw_address (NMDevice *device)
532 return nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device));
535 /**************************************************************/
538 nm_device_wifi_init (NMDeviceWifi *device)
540 _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_WIFI);
544 get_property (GObject *object,
549 NMDeviceWifi *self = NM_DEVICE_WIFI (object);
551 _nm_object_ensure_inited (NM_OBJECT (object));
554 case PROP_HW_ADDRESS:
555 g_value_set_string (value, nm_device_wifi_get_hw_address (self));
557 case PROP_PERM_HW_ADDRESS:
558 g_value_set_string (value, nm_device_wifi_get_permanent_hw_address (self));
561 g_value_set_uint (value, nm_device_wifi_get_mode (self));
564 g_value_set_uint (value, nm_device_wifi_get_bitrate (self));
566 case PROP_ACTIVE_ACCESS_POINT:
567 g_value_set_object (value, nm_device_wifi_get_active_access_point (self));
569 case PROP_WIRELESS_CAPABILITIES:
570 g_value_set_uint (value, nm_device_wifi_get_capabilities (self));
572 case PROP_ACCESS_POINTS:
573 g_value_set_boxed (value, nm_device_wifi_get_access_points (self));
576 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
582 state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
584 NMDeviceWifi *self = NM_DEVICE_WIFI (device);
585 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
587 switch (nm_device_get_state (device)) {
588 case NM_DEVICE_STATE_UNKNOWN:
589 case NM_DEVICE_STATE_UNMANAGED:
590 case NM_DEVICE_STATE_UNAVAILABLE:
591 case NM_DEVICE_STATE_DISCONNECTED:
592 case NM_DEVICE_STATE_FAILED:
593 /* Just clear active AP; don't clear the AP list unless wireless is disabled completely */
594 if (priv->active_ap) {
595 g_object_unref (priv->active_ap);
596 priv->active_ap = NULL;
598 _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT);
600 _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_BITRATE);
608 register_properties (NMDeviceWifi *device)
610 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
611 const NMPropertiesInfo property_info[] = {
612 { NM_DEVICE_WIFI_HW_ADDRESS, &priv->hw_address },
613 { NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, &priv->perm_hw_address },
614 { NM_DEVICE_WIFI_MODE, &priv->mode },
615 { NM_DEVICE_WIFI_BITRATE, &priv->rate },
616 { NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, &priv->active_ap, NULL, NM_TYPE_ACCESS_POINT },
617 { NM_DEVICE_WIFI_CAPABILITIES, &priv->wireless_caps },
618 { NM_DEVICE_WIFI_ACCESS_POINTS, &priv->aps, NULL, NM_TYPE_ACCESS_POINT, "access-point" },
622 _nm_object_register_properties (NM_OBJECT (device),
628 access_point_removed (NMDeviceWifi *self, NMAccessPoint *ap)
630 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
632 if (ap == priv->active_ap) {
633 g_object_unref (priv->active_ap);
634 priv->active_ap = NULL;
635 _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT);
638 _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_BITRATE);
643 constructed (GObject *object)
645 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
647 G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructed (object);
649 priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIRELESS);
650 register_properties (NM_DEVICE_WIFI (object));
652 g_signal_connect (NM_DEVICE (object),
653 "notify::" NM_DEVICE_STATE,
654 G_CALLBACK (state_changed_cb),
659 dispose (GObject *object)
661 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
662 GError *error = NULL;
664 if (priv->scan_call) {
665 g_set_error_literal (&error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_UNKNOWN,
666 "Wi-Fi device was destroyed");
667 if (priv->scan_info) {
668 if (priv->scan_info->callback)
669 priv->scan_info->callback (NULL, error, priv->scan_info->user_data);
670 g_slice_free (RequestScanInfo, priv->scan_info);
671 priv->scan_info = NULL;
673 g_clear_error (&error);
675 dbus_g_proxy_cancel_call (priv->proxy, priv->scan_call);
676 priv->scan_call = NULL;
679 clean_up_aps (NM_DEVICE_WIFI (object), FALSE);
680 g_clear_object (&priv->proxy);
682 G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object);
686 finalize (GObject *object)
688 NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
690 g_free (priv->hw_address);
691 g_free (priv->perm_hw_address);
693 G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object);
697 nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class)
699 GObjectClass *object_class = G_OBJECT_CLASS (wifi_class);
700 NMDeviceClass *device_class = NM_DEVICE_CLASS (wifi_class);
702 g_type_class_add_private (wifi_class, sizeof (NMDeviceWifiPrivate));
704 /* virtual methods */
705 object_class->constructed = constructed;
706 object_class->get_property = get_property;
707 object_class->dispose = dispose;
708 object_class->finalize = finalize;
709 device_class->connection_compatible = connection_compatible;
710 device_class->get_setting_type = get_setting_type;
711 device_class->get_hw_address = get_hw_address;
712 wifi_class->access_point_removed = access_point_removed;
717 * NMDeviceWifi:hw-address:
719 * The hardware (MAC) address of the device.
721 g_object_class_install_property
722 (object_class, PROP_HW_ADDRESS,
723 g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, "", "",
726 G_PARAM_STATIC_STRINGS));
729 * NMDeviceWifi:perm-hw-address:
731 * The hardware (MAC) address of the device.
733 g_object_class_install_property
734 (object_class, PROP_PERM_HW_ADDRESS,
735 g_param_spec_string (NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, "", "",
738 G_PARAM_STATIC_STRINGS));
743 * The mode of the device.
745 g_object_class_install_property
746 (object_class, PROP_MODE,
747 g_param_spec_uint (NM_DEVICE_WIFI_MODE, "", "",
748 NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_AP, NM_802_11_MODE_INFRA,
750 G_PARAM_STATIC_STRINGS));
753 * NMDeviceWifi:bitrate:
755 * The bit rate of the device in kbit/s.
757 g_object_class_install_property
758 (object_class, PROP_BITRATE,
759 g_param_spec_uint (NM_DEVICE_WIFI_BITRATE, "", "",
762 G_PARAM_STATIC_STRINGS));
765 * NMDeviceWifi:active-access-point:
767 * The active #NMAccessPoint of the device.
769 g_object_class_install_property
770 (object_class, PROP_ACTIVE_ACCESS_POINT,
771 g_param_spec_object (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, "", "",
772 NM_TYPE_ACCESS_POINT,
774 G_PARAM_STATIC_STRINGS));
777 * NMDeviceWifi:wireless-capabilities:
779 * The wireless capabilities of the device.
781 g_object_class_install_property
782 (object_class, PROP_WIRELESS_CAPABILITIES,
783 g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES, "", "",
786 G_PARAM_STATIC_STRINGS));
789 * NMDeviceWifi:access-points:
791 * List of all Wi-Fi access points the device can see.
795 g_object_class_install_property
796 (object_class, PROP_ACCESS_POINTS,
797 g_param_spec_boxed (NM_DEVICE_WIFI_ACCESS_POINTS, "", "",
798 NM_TYPE_OBJECT_ARRAY,
800 G_PARAM_STATIC_STRINGS));
805 * NMDeviceWifi::access-point-added:
806 * @device: the Wi-Fi device that received the signal
807 * @ap: the new access point
809 * Notifies that a #NMAccessPoint is added to the Wi-Fi device.
811 signals[ACCESS_POINT_ADDED] =
812 g_signal_new ("access-point-added",
813 G_OBJECT_CLASS_TYPE (object_class),
815 G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added),
817 g_cclosure_marshal_VOID__OBJECT,
822 * NMDeviceWifi::access-point-removed:
823 * @device: the Wi-Fi device that received the signal
824 * @ap: the removed access point
826 * Notifies that a #NMAccessPoint is removed from the Wi-Fi device.
828 signals[ACCESS_POINT_REMOVED] =
829 g_signal_new ("access-point-removed",
830 G_OBJECT_CLASS_TYPE (object_class),
832 G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_removed),
834 g_cclosure_marshal_VOID__OBJECT,