NetworkManager/include/NetworkManager.h

228 lines
7.5 KiB
C
Raw Normal View History

/* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* (C) Copyright 2004 Red Hat, Inc.
*/
#ifndef NETWORK_MANAGER_H
#define NETWORK_MANAGER_H
/*
* dbus services details
*/
#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
#define NM_DBUS_PATH "/org/freedesktop/NetworkManager"
#define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager"
#define NM_DBUS_INTERFACE_DEVICE NM_DBUS_INTERFACE ".Device"
#define NM_DBUS_INTERFACE_DEVICE_WIRED NM_DBUS_INTERFACE_DEVICE ".Wired"
#define NM_DBUS_INTERFACE_DEVICE_WIRELESS NM_DBUS_INTERFACE_DEVICE ".Wireless"
#define NM_DBUS_PATH_ACCESS_POINT NM_DBUS_PATH "/AccessPoint"
#define NM_DBUS_INTERFACE_ACCESS_POINT NM_DBUS_INTERFACE ".AccessPoint"
#define NM_DBUS_INTERFACE_SERIAL_DEVICE NM_DBUS_INTERFACE_DEVICE ".Serial"
#define NM_DBUS_INTERFACE_GSM_DEVICE NM_DBUS_INTERFACE_DEVICE ".Gsm"
#define NM_DBUS_INTERFACE_CDMA_DEVICE NM_DBUS_INTERFACE_DEVICE ".Cdma"
#define NM_DBUS_INTERFACE_ACTIVE_CONNECTION NM_DBUS_INTERFACE ".Connection.Active"
#define NM_DBUS_INTERFACE_IP4_CONFIG NM_DBUS_INTERFACE ".IP4Config"
#define NM_DBUS_SERVICE_USER_SETTINGS "org.freedesktop.NetworkManagerUserSettings"
#define NM_DBUS_SERVICE_SYSTEM_SETTINGS "org.freedesktop.NetworkManagerSystemSettings"
#define NM_DBUS_IFACE_SETTINGS "org.freedesktop.NetworkManagerSettings"
2008-05-05 Tambet Ingo <tambet@gmail.com> * libnm-glib/nm-dbus-settings.c (constructor): Fix the "PropertiesChanged" signal signature. * libnm-glib/nm-dbus-connection.c (constructor): Use the common GType defined in nm-dbus-glib-types.h. Don't register the connection on dbus, we're a proxy class to communicate with an already registered connection over dbus. 2008-04-30 Tambet Ingo <tambet@gmail.com> Implement new subclasses of NMSettings and NMExportedConnection to make it easier for the applet to access and modify system settings. * libnm-glib/nm-dbus-connection.[ch]: * libnm-glib/nm-dbus-settings.[ch]: * libnm-glib/nm-dbus-settings-system.[ch]: Implement. * libnm-glib/Makefile.am: Add the new files to build, generate some more bindings and glue. * include/NetworkManager.h: Define the system settings DBus interface. 2008-04-30 Tambet Ingo <tambet@gmail.com> Implement additional C API for exported connections to make them identical with the DBus API. Change the (list_connections) virtual function to be more usable from C - instead of requiring implementers to return a GPtrArray of dbus paths, return a list of connections. * libnm-glib/nm-settings.c (nm_exported_connection_class_init): Fix a typo. (nm_settings_list_connections): (nm_exported_connection_new): (nm_exported_connection_update): (nm_exported_connection_delete): Implement. (impl_settings_list_connections): (impl_exported_connection_update): (impl_exported_connection_delete): Use the new public functions to make sure the C and dbus interfaces stay in sync. * system-settings/src/dbus-settings.c (list_connections): Return a list of connections. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3630 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-05 07:07:44 +00:00
#define NM_DBUS_IFACE_SETTINGS_SYSTEM "org.freedesktop.NetworkManagerSettings.System"
#define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManagerSettings"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION "org.freedesktop.NetworkManagerSettings.Connection"
#define NM_DBUS_PATH_SETTINGS_CONNECTION "/org/freedesktop/NetworkManagerSettings/Connection"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS "org.freedesktop.NetworkManagerSettings.Connection.Secrets"
/*
* Types of NetworkManager states
*/
typedef enum NMState
{
NM_STATE_UNKNOWN = 0,
NM_STATE_ASLEEP,
NM_STATE_CONNECTING,
NM_STATE_CONNECTED,
NM_STATE_DISCONNECTED
} NMState;
/*
* Types of NetworkManager devices
*/
typedef enum NMDeviceType
{
NM_DEVICE_TYPE_UNKNOWN = 0,
NM_DEVICE_TYPE_ETHERNET,
NM_DEVICE_TYPE_WIFI,
NM_DEVICE_TYPE_GSM,
NM_DEVICE_TYPE_CDMA
} NMDeviceType;
/* DEPRECATED TYPE NAMES */
#define DEVICE_TYPE_UNKNOWN NM_DEVICE_TYPE_UNKNOWN
#define DEVICE_TYPE_802_3_ETHERNET NM_DEVICE_TYPE_ETHERNET
#define DEVICE_TYPE_802_11_WIRELESS NM_DEVICE_TYPE_WIFI
#define DEVICE_TYPE_GSM NM_DEVICE_TYPE_GSM
#define DEVICE_TYPE_CDMA NM_DEVICE_TYPE_CDMA
/*
* General device capability bits
*
*/
#define NM_DEVICE_CAP_NONE 0x00000000
#define NM_DEVICE_CAP_NM_SUPPORTED 0x00000001
#define NM_DEVICE_CAP_CARRIER_DETECT 0x00000002
2007-08-28 Dan Williams <dcbw@redhat.com> Remove NMAPSecurity objects, they are replaced with flags on the APs for each AP's capabilities, and by NMConnection/NMSettings objects for user defined connections. * include/NetworkManager.h - Redefine 802.11 security properties. There are now device capabilities and AP flags and AP security flags. It was way to unclear before. * src/Makefile.am src/nm-ap-security-leap.h src/nm-ap-security-leap.c src/nm-ap-security-wpa-eap.c src/nm-ap-security-wpa-eap.h src/nm-ap-security-private.h src/nm-ap-security-wpa-psk.c src/nm-ap-security-wpa-psk.h src/nm-ap-security-wep.c src/nm-ap-security-wep.h src/nm-ap-security.c src/nm-ap-security.h - Removed, to be replaced with NMConnection/NMSettings objects * src/nm-dbus-nmi.c src/nm-dbus-nmi.h - Removed, to be replaced by code that talks to the new info daemon interface and gets NMConnection/NMSettings objects * src/backends/NetworkManagerSuSE.c - Remove usage of NMAPSecurity; should be replaced by a system-level info-daemon that does the same thing but talks the new info-daemon D-Bus interface * src/NetworkManagerAP.h src/NetworkManagerAP.c src/NetworkManagerAPList.c libnm-glib/libnm-glib-test.c - Remove usage of NMAPSecurity objects and adjust to new flags for WPA/RSN * libnm-glib/nm-access-point.c libnm-glib/nm-access-point.h introspection/nm-access-point.xml test/nm-tool.c - Adjust to new flags for AP security * utils/nm-utils.c utils/nm-utils.h src/vpn-manager/nm-dbus-vpn.c - Remove D-Bus pending call stuff from nm-utils and put it in the VPN stuff which is the only place it's used * src/nm-device-interface.c src/nm-device-interface.h introspection/nm-device.xml src/nm-activation-request.c src/nm-activation-request.h src/nm-device.c - Add a new 'specific_object' argument that hints to NM what actual AP or other device-specific thing the connection should apply to. NMConnection objects can apply to more than one actual device/AP. * libnm-util/nm-connection.c * libnm-util/nm-connection.h - Add 'have_secrets" call stubs * libnm-util/cipher.h - Move NM_AUTH_TYPE_* defines here for now * src/nm-device-802-11-wireless.c - Remove usage of NMAPSecurity, to be replaced with NMConnection/ NMSettings objects * src/NetworkManagerDbus.c * src/NetworkManagerPolicy.c - Remove usage of update_allowed_networks, should be pushing data in a different manner git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2738 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-28 14:47:31 +00:00
/* 802.11 wireless device-specific capabilities */
#define NM_WIFI_DEVICE_CAP_NONE 0x00000000
#define NM_WIFI_DEVICE_CAP_CIPHER_WEP40 0x00000001
#define NM_WIFI_DEVICE_CAP_CIPHER_WEP104 0x00000002
#define NM_WIFI_DEVICE_CAP_CIPHER_TKIP 0x00000004
#define NM_WIFI_DEVICE_CAP_CIPHER_CCMP 0x00000008
#define NM_WIFI_DEVICE_CAP_WPA 0x00000010
#define NM_WIFI_DEVICE_CAP_RSN 0x00000020
2007-08-28 Dan Williams <dcbw@redhat.com> Remove NMAPSecurity objects, they are replaced with flags on the APs for each AP's capabilities, and by NMConnection/NMSettings objects for user defined connections. * include/NetworkManager.h - Redefine 802.11 security properties. There are now device capabilities and AP flags and AP security flags. It was way to unclear before. * src/Makefile.am src/nm-ap-security-leap.h src/nm-ap-security-leap.c src/nm-ap-security-wpa-eap.c src/nm-ap-security-wpa-eap.h src/nm-ap-security-private.h src/nm-ap-security-wpa-psk.c src/nm-ap-security-wpa-psk.h src/nm-ap-security-wep.c src/nm-ap-security-wep.h src/nm-ap-security.c src/nm-ap-security.h - Removed, to be replaced with NMConnection/NMSettings objects * src/nm-dbus-nmi.c src/nm-dbus-nmi.h - Removed, to be replaced by code that talks to the new info daemon interface and gets NMConnection/NMSettings objects * src/backends/NetworkManagerSuSE.c - Remove usage of NMAPSecurity; should be replaced by a system-level info-daemon that does the same thing but talks the new info-daemon D-Bus interface * src/NetworkManagerAP.h src/NetworkManagerAP.c src/NetworkManagerAPList.c libnm-glib/libnm-glib-test.c - Remove usage of NMAPSecurity objects and adjust to new flags for WPA/RSN * libnm-glib/nm-access-point.c libnm-glib/nm-access-point.h introspection/nm-access-point.xml test/nm-tool.c - Adjust to new flags for AP security * utils/nm-utils.c utils/nm-utils.h src/vpn-manager/nm-dbus-vpn.c - Remove D-Bus pending call stuff from nm-utils and put it in the VPN stuff which is the only place it's used * src/nm-device-interface.c src/nm-device-interface.h introspection/nm-device.xml src/nm-activation-request.c src/nm-activation-request.h src/nm-device.c - Add a new 'specific_object' argument that hints to NM what actual AP or other device-specific thing the connection should apply to. NMConnection objects can apply to more than one actual device/AP. * libnm-util/nm-connection.c * libnm-util/nm-connection.h - Add 'have_secrets" call stubs * libnm-util/cipher.h - Move NM_AUTH_TYPE_* defines here for now * src/nm-device-802-11-wireless.c - Remove usage of NMAPSecurity, to be replaced with NMConnection/ NMSettings objects * src/NetworkManagerDbus.c * src/NetworkManagerPolicy.c - Remove usage of update_allowed_networks, should be pushing data in a different manner git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2738 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-28 14:47:31 +00:00
2006-02-25 Robert Love <rml@novell.com> Add WPA Enterprise support: * gnome/applet/Makefile.am: Build the files nm-gconf-wso-wpa-eap.c and nm-gconf-wso-wpa-eap.h. * gnome/applet/nm-gconf-wso-wpa-eap.c, gnome/applet/nm-gconf-wso-wpa-eap.h: Add WPA Enterprise Gconf serialization and deserialization. * gnome/applet/nm-gconf-wso-wpa-psk.c, gnome/applet/nm-gconf-wso.c, gnome/applet/wireless-security-option.c, gnome/applet/wso-wpa-psk.c, gnome/applet/wso-wpa-psk.h: Clean up, support new defines. * gnome/applet/wireless-applet.glade: Add UI for configurating security settings related to WPA Enterprise. * gnome/applet/wireless-security-manager.c: Invoke wso_wpa_eap_new() to instantiate WPA Enterprise wireless-security-option. * gnome/applet/wso-wpa-eap.c, gnome/applet/wso-wpa-eap.h: New files. Implement WPA Enterprise wireless-security-option object. * include/NetworkManager.h: Add new NM_AUTH_TYPE_* and NM_EAP_METHOD_* defines. Cleanup. * libnm-util/cipher-wpa-psk-hex.c, libnm-util/cipher-wpa-psk-passphrase.c: Cleanup. * libnm-util/dbus-helpers.c, libnm-util/dbus-helpers.h: Add nmu_security_serialize_wpa_eap() to serialize input to DBUS method, nmu_security_serialize_wpa_eap_with_cipher() to serialize input including the cipher to DBUS method, and nmu_security_deserialize_wpa_eap() to deserialize from DBUS return to output. * src/Makefile.am: Build the files nm-ap-security-wpa-eap.c and nm-ap-security-wpa-eap.h * src/NetworkManagerAP.c: Add NM_AUTH_TYPE_WPA_EAP to NM_802_11_CAP_KEY_MGMT_802_1X cipher to capability mapping. * src/nm-ap-security-wpa-eap.c, src/nm-ap-security-wpa-eap.h: New files. Implement NMAPSecurityWPA_EAP object. * src/nm-ap-security-wpa-psk.c: Cleanup. * src/nm-ap-security.c: Support NM_AUTH_TYPE_EAP cipher and instantiate an NMAPSecurityWPA_EAP object via the method nm_ap_security_wpa_eap_new_deserialize(). * src/nm-dbus-nm.c: Cleanup. * test/nm-tool.c: Display "Enterprise" for wireless networks providing WPA Enterprise support. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1493 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-26 02:16:53 +00:00
/*
2007-08-28 Dan Williams <dcbw@redhat.com> Remove NMAPSecurity objects, they are replaced with flags on the APs for each AP's capabilities, and by NMConnection/NMSettings objects for user defined connections. * include/NetworkManager.h - Redefine 802.11 security properties. There are now device capabilities and AP flags and AP security flags. It was way to unclear before. * src/Makefile.am src/nm-ap-security-leap.h src/nm-ap-security-leap.c src/nm-ap-security-wpa-eap.c src/nm-ap-security-wpa-eap.h src/nm-ap-security-private.h src/nm-ap-security-wpa-psk.c src/nm-ap-security-wpa-psk.h src/nm-ap-security-wep.c src/nm-ap-security-wep.h src/nm-ap-security.c src/nm-ap-security.h - Removed, to be replaced with NMConnection/NMSettings objects * src/nm-dbus-nmi.c src/nm-dbus-nmi.h - Removed, to be replaced by code that talks to the new info daemon interface and gets NMConnection/NMSettings objects * src/backends/NetworkManagerSuSE.c - Remove usage of NMAPSecurity; should be replaced by a system-level info-daemon that does the same thing but talks the new info-daemon D-Bus interface * src/NetworkManagerAP.h src/NetworkManagerAP.c src/NetworkManagerAPList.c libnm-glib/libnm-glib-test.c - Remove usage of NMAPSecurity objects and adjust to new flags for WPA/RSN * libnm-glib/nm-access-point.c libnm-glib/nm-access-point.h introspection/nm-access-point.xml test/nm-tool.c - Adjust to new flags for AP security * utils/nm-utils.c utils/nm-utils.h src/vpn-manager/nm-dbus-vpn.c - Remove D-Bus pending call stuff from nm-utils and put it in the VPN stuff which is the only place it's used * src/nm-device-interface.c src/nm-device-interface.h introspection/nm-device.xml src/nm-activation-request.c src/nm-activation-request.h src/nm-device.c - Add a new 'specific_object' argument that hints to NM what actual AP or other device-specific thing the connection should apply to. NMConnection objects can apply to more than one actual device/AP. * libnm-util/nm-connection.c * libnm-util/nm-connection.h - Add 'have_secrets" call stubs * libnm-util/cipher.h - Move NM_AUTH_TYPE_* defines here for now * src/nm-device-802-11-wireless.c - Remove usage of NMAPSecurity, to be replaced with NMConnection/ NMSettings objects * src/NetworkManagerDbus.c * src/NetworkManagerPolicy.c - Remove usage of update_allowed_networks, should be pushing data in a different manner git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2738 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-28 14:47:31 +00:00
* 802.11 Access Point flags
*
2006-02-25 Robert Love <rml@novell.com> Add WPA Enterprise support: * gnome/applet/Makefile.am: Build the files nm-gconf-wso-wpa-eap.c and nm-gconf-wso-wpa-eap.h. * gnome/applet/nm-gconf-wso-wpa-eap.c, gnome/applet/nm-gconf-wso-wpa-eap.h: Add WPA Enterprise Gconf serialization and deserialization. * gnome/applet/nm-gconf-wso-wpa-psk.c, gnome/applet/nm-gconf-wso.c, gnome/applet/wireless-security-option.c, gnome/applet/wso-wpa-psk.c, gnome/applet/wso-wpa-psk.h: Clean up, support new defines. * gnome/applet/wireless-applet.glade: Add UI for configurating security settings related to WPA Enterprise. * gnome/applet/wireless-security-manager.c: Invoke wso_wpa_eap_new() to instantiate WPA Enterprise wireless-security-option. * gnome/applet/wso-wpa-eap.c, gnome/applet/wso-wpa-eap.h: New files. Implement WPA Enterprise wireless-security-option object. * include/NetworkManager.h: Add new NM_AUTH_TYPE_* and NM_EAP_METHOD_* defines. Cleanup. * libnm-util/cipher-wpa-psk-hex.c, libnm-util/cipher-wpa-psk-passphrase.c: Cleanup. * libnm-util/dbus-helpers.c, libnm-util/dbus-helpers.h: Add nmu_security_serialize_wpa_eap() to serialize input to DBUS method, nmu_security_serialize_wpa_eap_with_cipher() to serialize input including the cipher to DBUS method, and nmu_security_deserialize_wpa_eap() to deserialize from DBUS return to output. * src/Makefile.am: Build the files nm-ap-security-wpa-eap.c and nm-ap-security-wpa-eap.h * src/NetworkManagerAP.c: Add NM_AUTH_TYPE_WPA_EAP to NM_802_11_CAP_KEY_MGMT_802_1X cipher to capability mapping. * src/nm-ap-security-wpa-eap.c, src/nm-ap-security-wpa-eap.h: New files. Implement NMAPSecurityWPA_EAP object. * src/nm-ap-security-wpa-psk.c: Cleanup. * src/nm-ap-security.c: Support NM_AUTH_TYPE_EAP cipher and instantiate an NMAPSecurityWPA_EAP object via the method nm_ap_security_wpa_eap_new_deserialize(). * src/nm-dbus-nm.c: Cleanup. * test/nm-tool.c: Display "Enterprise" for wireless networks providing WPA Enterprise support. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1493 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-26 02:16:53 +00:00
*/
2007-08-28 Dan Williams <dcbw@redhat.com> Remove NMAPSecurity objects, they are replaced with flags on the APs for each AP's capabilities, and by NMConnection/NMSettings objects for user defined connections. * include/NetworkManager.h - Redefine 802.11 security properties. There are now device capabilities and AP flags and AP security flags. It was way to unclear before. * src/Makefile.am src/nm-ap-security-leap.h src/nm-ap-security-leap.c src/nm-ap-security-wpa-eap.c src/nm-ap-security-wpa-eap.h src/nm-ap-security-private.h src/nm-ap-security-wpa-psk.c src/nm-ap-security-wpa-psk.h src/nm-ap-security-wep.c src/nm-ap-security-wep.h src/nm-ap-security.c src/nm-ap-security.h - Removed, to be replaced with NMConnection/NMSettings objects * src/nm-dbus-nmi.c src/nm-dbus-nmi.h - Removed, to be replaced by code that talks to the new info daemon interface and gets NMConnection/NMSettings objects * src/backends/NetworkManagerSuSE.c - Remove usage of NMAPSecurity; should be replaced by a system-level info-daemon that does the same thing but talks the new info-daemon D-Bus interface * src/NetworkManagerAP.h src/NetworkManagerAP.c src/NetworkManagerAPList.c libnm-glib/libnm-glib-test.c - Remove usage of NMAPSecurity objects and adjust to new flags for WPA/RSN * libnm-glib/nm-access-point.c libnm-glib/nm-access-point.h introspection/nm-access-point.xml test/nm-tool.c - Adjust to new flags for AP security * utils/nm-utils.c utils/nm-utils.h src/vpn-manager/nm-dbus-vpn.c - Remove D-Bus pending call stuff from nm-utils and put it in the VPN stuff which is the only place it's used * src/nm-device-interface.c src/nm-device-interface.h introspection/nm-device.xml src/nm-activation-request.c src/nm-activation-request.h src/nm-device.c - Add a new 'specific_object' argument that hints to NM what actual AP or other device-specific thing the connection should apply to. NMConnection objects can apply to more than one actual device/AP. * libnm-util/nm-connection.c * libnm-util/nm-connection.h - Add 'have_secrets" call stubs * libnm-util/cipher.h - Move NM_AUTH_TYPE_* defines here for now * src/nm-device-802-11-wireless.c - Remove usage of NMAPSecurity, to be replaced with NMConnection/ NMSettings objects * src/NetworkManagerDbus.c * src/NetworkManagerPolicy.c - Remove usage of update_allowed_networks, should be pushing data in a different manner git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2738 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-28 14:47:31 +00:00
#define NM_802_11_AP_FLAGS_NONE 0x00000000
#define NM_802_11_AP_FLAGS_PRIVACY 0x00000001
2006-02-25 Robert Love <rml@novell.com> Add WPA Enterprise support: * gnome/applet/Makefile.am: Build the files nm-gconf-wso-wpa-eap.c and nm-gconf-wso-wpa-eap.h. * gnome/applet/nm-gconf-wso-wpa-eap.c, gnome/applet/nm-gconf-wso-wpa-eap.h: Add WPA Enterprise Gconf serialization and deserialization. * gnome/applet/nm-gconf-wso-wpa-psk.c, gnome/applet/nm-gconf-wso.c, gnome/applet/wireless-security-option.c, gnome/applet/wso-wpa-psk.c, gnome/applet/wso-wpa-psk.h: Clean up, support new defines. * gnome/applet/wireless-applet.glade: Add UI for configurating security settings related to WPA Enterprise. * gnome/applet/wireless-security-manager.c: Invoke wso_wpa_eap_new() to instantiate WPA Enterprise wireless-security-option. * gnome/applet/wso-wpa-eap.c, gnome/applet/wso-wpa-eap.h: New files. Implement WPA Enterprise wireless-security-option object. * include/NetworkManager.h: Add new NM_AUTH_TYPE_* and NM_EAP_METHOD_* defines. Cleanup. * libnm-util/cipher-wpa-psk-hex.c, libnm-util/cipher-wpa-psk-passphrase.c: Cleanup. * libnm-util/dbus-helpers.c, libnm-util/dbus-helpers.h: Add nmu_security_serialize_wpa_eap() to serialize input to DBUS method, nmu_security_serialize_wpa_eap_with_cipher() to serialize input including the cipher to DBUS method, and nmu_security_deserialize_wpa_eap() to deserialize from DBUS return to output. * src/Makefile.am: Build the files nm-ap-security-wpa-eap.c and nm-ap-security-wpa-eap.h * src/NetworkManagerAP.c: Add NM_AUTH_TYPE_WPA_EAP to NM_802_11_CAP_KEY_MGMT_802_1X cipher to capability mapping. * src/nm-ap-security-wpa-eap.c, src/nm-ap-security-wpa-eap.h: New files. Implement NMAPSecurityWPA_EAP object. * src/nm-ap-security-wpa-psk.c: Cleanup. * src/nm-ap-security.c: Support NM_AUTH_TYPE_EAP cipher and instantiate an NMAPSecurityWPA_EAP object via the method nm_ap_security_wpa_eap_new_deserialize(). * src/nm-dbus-nm.c: Cleanup. * test/nm-tool.c: Display "Enterprise" for wireless networks providing WPA Enterprise support. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1493 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-26 02:16:53 +00:00
/*
2007-08-28 Dan Williams <dcbw@redhat.com> Remove NMAPSecurity objects, they are replaced with flags on the APs for each AP's capabilities, and by NMConnection/NMSettings objects for user defined connections. * include/NetworkManager.h - Redefine 802.11 security properties. There are now device capabilities and AP flags and AP security flags. It was way to unclear before. * src/Makefile.am src/nm-ap-security-leap.h src/nm-ap-security-leap.c src/nm-ap-security-wpa-eap.c src/nm-ap-security-wpa-eap.h src/nm-ap-security-private.h src/nm-ap-security-wpa-psk.c src/nm-ap-security-wpa-psk.h src/nm-ap-security-wep.c src/nm-ap-security-wep.h src/nm-ap-security.c src/nm-ap-security.h - Removed, to be replaced with NMConnection/NMSettings objects * src/nm-dbus-nmi.c src/nm-dbus-nmi.h - Removed, to be replaced by code that talks to the new info daemon interface and gets NMConnection/NMSettings objects * src/backends/NetworkManagerSuSE.c - Remove usage of NMAPSecurity; should be replaced by a system-level info-daemon that does the same thing but talks the new info-daemon D-Bus interface * src/NetworkManagerAP.h src/NetworkManagerAP.c src/NetworkManagerAPList.c libnm-glib/libnm-glib-test.c - Remove usage of NMAPSecurity objects and adjust to new flags for WPA/RSN * libnm-glib/nm-access-point.c libnm-glib/nm-access-point.h introspection/nm-access-point.xml test/nm-tool.c - Adjust to new flags for AP security * utils/nm-utils.c utils/nm-utils.h src/vpn-manager/nm-dbus-vpn.c - Remove D-Bus pending call stuff from nm-utils and put it in the VPN stuff which is the only place it's used * src/nm-device-interface.c src/nm-device-interface.h introspection/nm-device.xml src/nm-activation-request.c src/nm-activation-request.h src/nm-device.c - Add a new 'specific_object' argument that hints to NM what actual AP or other device-specific thing the connection should apply to. NMConnection objects can apply to more than one actual device/AP. * libnm-util/nm-connection.c * libnm-util/nm-connection.h - Add 'have_secrets" call stubs * libnm-util/cipher.h - Move NM_AUTH_TYPE_* defines here for now * src/nm-device-802-11-wireless.c - Remove usage of NMAPSecurity, to be replaced with NMConnection/ NMSettings objects * src/NetworkManagerDbus.c * src/NetworkManagerPolicy.c - Remove usage of update_allowed_networks, should be pushing data in a different manner git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2738 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-28 14:47:31 +00:00
* 802.11 Access Point security flags
*
* These describe the current security requirements of the BSSID as extracted
* from various pieces of beacon information, like beacon flags and various
* information elements.
2006-02-25 Robert Love <rml@novell.com> Add WPA Enterprise support: * gnome/applet/Makefile.am: Build the files nm-gconf-wso-wpa-eap.c and nm-gconf-wso-wpa-eap.h. * gnome/applet/nm-gconf-wso-wpa-eap.c, gnome/applet/nm-gconf-wso-wpa-eap.h: Add WPA Enterprise Gconf serialization and deserialization. * gnome/applet/nm-gconf-wso-wpa-psk.c, gnome/applet/nm-gconf-wso.c, gnome/applet/wireless-security-option.c, gnome/applet/wso-wpa-psk.c, gnome/applet/wso-wpa-psk.h: Clean up, support new defines. * gnome/applet/wireless-applet.glade: Add UI for configurating security settings related to WPA Enterprise. * gnome/applet/wireless-security-manager.c: Invoke wso_wpa_eap_new() to instantiate WPA Enterprise wireless-security-option. * gnome/applet/wso-wpa-eap.c, gnome/applet/wso-wpa-eap.h: New files. Implement WPA Enterprise wireless-security-option object. * include/NetworkManager.h: Add new NM_AUTH_TYPE_* and NM_EAP_METHOD_* defines. Cleanup. * libnm-util/cipher-wpa-psk-hex.c, libnm-util/cipher-wpa-psk-passphrase.c: Cleanup. * libnm-util/dbus-helpers.c, libnm-util/dbus-helpers.h: Add nmu_security_serialize_wpa_eap() to serialize input to DBUS method, nmu_security_serialize_wpa_eap_with_cipher() to serialize input including the cipher to DBUS method, and nmu_security_deserialize_wpa_eap() to deserialize from DBUS return to output. * src/Makefile.am: Build the files nm-ap-security-wpa-eap.c and nm-ap-security-wpa-eap.h * src/NetworkManagerAP.c: Add NM_AUTH_TYPE_WPA_EAP to NM_802_11_CAP_KEY_MGMT_802_1X cipher to capability mapping. * src/nm-ap-security-wpa-eap.c, src/nm-ap-security-wpa-eap.h: New files. Implement NMAPSecurityWPA_EAP object. * src/nm-ap-security-wpa-psk.c: Cleanup. * src/nm-ap-security.c: Support NM_AUTH_TYPE_EAP cipher and instantiate an NMAPSecurityWPA_EAP object via the method nm_ap_security_wpa_eap_new_deserialize(). * src/nm-dbus-nm.c: Cleanup. * test/nm-tool.c: Display "Enterprise" for wireless networks providing WPA Enterprise support. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1493 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-02-26 02:16:53 +00:00
*/
2007-08-28 Dan Williams <dcbw@redhat.com> Remove NMAPSecurity objects, they are replaced with flags on the APs for each AP's capabilities, and by NMConnection/NMSettings objects for user defined connections. * include/NetworkManager.h - Redefine 802.11 security properties. There are now device capabilities and AP flags and AP security flags. It was way to unclear before. * src/Makefile.am src/nm-ap-security-leap.h src/nm-ap-security-leap.c src/nm-ap-security-wpa-eap.c src/nm-ap-security-wpa-eap.h src/nm-ap-security-private.h src/nm-ap-security-wpa-psk.c src/nm-ap-security-wpa-psk.h src/nm-ap-security-wep.c src/nm-ap-security-wep.h src/nm-ap-security.c src/nm-ap-security.h - Removed, to be replaced with NMConnection/NMSettings objects * src/nm-dbus-nmi.c src/nm-dbus-nmi.h - Removed, to be replaced by code that talks to the new info daemon interface and gets NMConnection/NMSettings objects * src/backends/NetworkManagerSuSE.c - Remove usage of NMAPSecurity; should be replaced by a system-level info-daemon that does the same thing but talks the new info-daemon D-Bus interface * src/NetworkManagerAP.h src/NetworkManagerAP.c src/NetworkManagerAPList.c libnm-glib/libnm-glib-test.c - Remove usage of NMAPSecurity objects and adjust to new flags for WPA/RSN * libnm-glib/nm-access-point.c libnm-glib/nm-access-point.h introspection/nm-access-point.xml test/nm-tool.c - Adjust to new flags for AP security * utils/nm-utils.c utils/nm-utils.h src/vpn-manager/nm-dbus-vpn.c - Remove D-Bus pending call stuff from nm-utils and put it in the VPN stuff which is the only place it's used * src/nm-device-interface.c src/nm-device-interface.h introspection/nm-device.xml src/nm-activation-request.c src/nm-activation-request.h src/nm-device.c - Add a new 'specific_object' argument that hints to NM what actual AP or other device-specific thing the connection should apply to. NMConnection objects can apply to more than one actual device/AP. * libnm-util/nm-connection.c * libnm-util/nm-connection.h - Add 'have_secrets" call stubs * libnm-util/cipher.h - Move NM_AUTH_TYPE_* defines here for now * src/nm-device-802-11-wireless.c - Remove usage of NMAPSecurity, to be replaced with NMConnection/ NMSettings objects * src/NetworkManagerDbus.c * src/NetworkManagerPolicy.c - Remove usage of update_allowed_networks, should be pushing data in a different manner git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2738 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-28 14:47:31 +00:00
#define NM_802_11_AP_SEC_NONE 0x00000000
#define NM_802_11_AP_SEC_PAIR_WEP40 0x00000001
#define NM_802_11_AP_SEC_PAIR_WEP104 0x00000002
#define NM_802_11_AP_SEC_PAIR_TKIP 0x00000004
#define NM_802_11_AP_SEC_PAIR_CCMP 0x00000008
#define NM_802_11_AP_SEC_GROUP_WEP40 0x00000010
#define NM_802_11_AP_SEC_GROUP_WEP104 0x00000020
#define NM_802_11_AP_SEC_GROUP_TKIP 0x00000040
#define NM_802_11_AP_SEC_GROUP_CCMP 0x00000080
#define NM_802_11_AP_SEC_KEY_MGMT_PSK 0x00000100
#define NM_802_11_AP_SEC_KEY_MGMT_802_1X 0x00000200
/*
* 802.11 AP and Station modes
*
*/
typedef enum {
NM_802_11_MODE_UNKNOWN = 0,
NM_802_11_MODE_ADHOC,
NM_802_11_MODE_INFRA
} NM80211Mode;
/*
* Device states
*/
typedef enum
{
NM_DEVICE_STATE_UNKNOWN = 0,
2008-04-07 Dan Williams <dcbw@redhat.com> * include/NetworkManager.h - Remove the DOWN and CANCELLED device states - Add UNMANAGED and UNAVAILABLE device states - Document the device states * introspection/nm-device.xml src/nm-device-interface.c src/nm-device-interface.h - Add the 'managed' property * test/nm-tool.c - (detail_device): print out device state * src/NetworkManagerSystem.h src/backends/NetworkManagerArch.c src/backends/NetworkManagerDebian.c src/backends/NetworkManagerFrugalware.c src/backends/NetworkManagerGentoo.c src/backends/NetworkManagerMandriva.c src/backends/NetworkManagerPaldo.c src/backends/NetworkManagerRedHat.c src/backends/NetworkManagerSlackware.c src/backends/NetworkManagerSuSE.c - (nm_system_device_get_system_config, nm_system_device_get_disabled nm_system_device_free_system_config): remove; they were unused and their functionality should be re-implemented in each distro's system settings service plugin * src/nm-gsm-device.c src/nm-gsm-device.h src/nm-cdma-device.c src/nm-cdma-device.h - (*_new): take the 'managed' argument * src/nm-device.c - (nm_device_set_address): remove, fold into nm_device_bring_up() - (nm_device_init): start in unmanaged state, not disconnected - (constructor): don't start device until the system settings service has had a chance to figure out if the device is managed or not - (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down): don't set device state here, let callers handle that as appropriate - (nm_device_dispose): don't touch the device if it's not managed - (set_property, get_property, nm_device_class_init): implement the 'managed' property - (nm_device_state_changed): bring the device up if its now managed, and deactivate it if it used to be active - (nm_device_get_managed, nm_device_set_managed): do the right thing with the managed state * src/nm-hal-manager.c - (wired_device_creator, wireless_device_creator, modem_device_creator): take initial managed state and pass it along to device constructors - (create_device_and_add_to_list): get managed state and pass to type creators * src/nm-device-802-11-wireless.c - (real_can_activate): fold in most of nm_device_802_11_wireless_can_activate() - (can_scan): can't scan in UNAVAILABLE or UNMANAGED - (link_timeout_cb): instead of deactivating, change device state and let the device state handler to it - (real_update_hw_address): clean up - (state_changed_cb): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device isn't rfkilled * src/nm-device-802-3-ethernet.c - (set_carrier): move above callers and get rid of prototype - (device_state_changed): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device has a carrier - (real_update_hw_address): clean up - (link_timeout_cb, ppp_state_changed): change state instead of calling deactivation directly as deactivation doesn't change state anymore * src/NetworkManagerPolicy.c - (schedule_activate_check): yay, remove wireless_enabled hack since the NMManager and wireless devices work that out themselves now - (device_state_changed): change to a switch and update for new device states - (device_carrier_changed): remove; device handles this now through state changes - (device_added): don't care about carrier any more; the initial activation check will happen when the device transitions to DISCONNECTED * src/nm-manager.c - (dispose): clear unmanaged devices - (handle_unmanaged_devices): update unmanaged device list and toggle the managed property on each device when needed - (system_settings_properties_changed_cb): handle signals from the system settings service - (system_settings_get_unmanaged_devices_cb): handle callback from getting the unmanaged device list method call - (query_unmanaged_devices): ask the system settings service for its list of unmanaged devices - (nm_manager_name_owner_changed, initial_get_connections): get unmanaged devices - (manager_set_wireless_enabled): push rfkill state down to wireless devices directly and let them handle the necessary state transitions - (manager_device_state_changed): update for new device states - (nm_manager_add_device): set initial rfkill state on wireless devices - (nm_manager_remove_device): don't touch the device if it's unmanaged - (nm_manager_activate_connection): return error if the device is unmanaged - (nm_manager_sleep): handle new device states correctly; don't change the state of unavailable/unmanaged devices * libnm-glib/nm-device-802-11-wireless.c - (state_changed_cb): update for new device states git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
/* Initial state of all devices and the only state for devices not
* managed by NetworkManager.
*
* Allowed next states:
* UNAVAILABLE: the device is now managed by NetworkManager
*/
NM_DEVICE_STATE_UNMANAGED,
/* Indicates the device is not yet ready for use, but is managed by
* NetworkManager. For Ethernet devices, the device may not have an
* active carrier. For WiFi devices, the device may not have it's radio
* enabled.
*
* Allowed next states:
* UNMANAGED: the device is no longer managed by NetworkManager
* DISCONNECTED: the device is now ready for use
*/
NM_DEVICE_STATE_UNAVAILABLE,
/* Indicates the device does not have an activate connection to anything.
*
* Allowed next states:
* UNMANAGED: the device is no longer managed by NetworkManager
* UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc)
* PREPARE: the device has started activation
*/
NM_DEVICE_STATE_DISCONNECTED,
2008-04-07 Dan Williams <dcbw@redhat.com> * include/NetworkManager.h - Remove the DOWN and CANCELLED device states - Add UNMANAGED and UNAVAILABLE device states - Document the device states * introspection/nm-device.xml src/nm-device-interface.c src/nm-device-interface.h - Add the 'managed' property * test/nm-tool.c - (detail_device): print out device state * src/NetworkManagerSystem.h src/backends/NetworkManagerArch.c src/backends/NetworkManagerDebian.c src/backends/NetworkManagerFrugalware.c src/backends/NetworkManagerGentoo.c src/backends/NetworkManagerMandriva.c src/backends/NetworkManagerPaldo.c src/backends/NetworkManagerRedHat.c src/backends/NetworkManagerSlackware.c src/backends/NetworkManagerSuSE.c - (nm_system_device_get_system_config, nm_system_device_get_disabled nm_system_device_free_system_config): remove; they were unused and their functionality should be re-implemented in each distro's system settings service plugin * src/nm-gsm-device.c src/nm-gsm-device.h src/nm-cdma-device.c src/nm-cdma-device.h - (*_new): take the 'managed' argument * src/nm-device.c - (nm_device_set_address): remove, fold into nm_device_bring_up() - (nm_device_init): start in unmanaged state, not disconnected - (constructor): don't start device until the system settings service has had a chance to figure out if the device is managed or not - (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down): don't set device state here, let callers handle that as appropriate - (nm_device_dispose): don't touch the device if it's not managed - (set_property, get_property, nm_device_class_init): implement the 'managed' property - (nm_device_state_changed): bring the device up if its now managed, and deactivate it if it used to be active - (nm_device_get_managed, nm_device_set_managed): do the right thing with the managed state * src/nm-hal-manager.c - (wired_device_creator, wireless_device_creator, modem_device_creator): take initial managed state and pass it along to device constructors - (create_device_and_add_to_list): get managed state and pass to type creators * src/nm-device-802-11-wireless.c - (real_can_activate): fold in most of nm_device_802_11_wireless_can_activate() - (can_scan): can't scan in UNAVAILABLE or UNMANAGED - (link_timeout_cb): instead of deactivating, change device state and let the device state handler to it - (real_update_hw_address): clean up - (state_changed_cb): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device isn't rfkilled * src/nm-device-802-3-ethernet.c - (set_carrier): move above callers and get rid of prototype - (device_state_changed): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device has a carrier - (real_update_hw_address): clean up - (link_timeout_cb, ppp_state_changed): change state instead of calling deactivation directly as deactivation doesn't change state anymore * src/NetworkManagerPolicy.c - (schedule_activate_check): yay, remove wireless_enabled hack since the NMManager and wireless devices work that out themselves now - (device_state_changed): change to a switch and update for new device states - (device_carrier_changed): remove; device handles this now through state changes - (device_added): don't care about carrier any more; the initial activation check will happen when the device transitions to DISCONNECTED * src/nm-manager.c - (dispose): clear unmanaged devices - (handle_unmanaged_devices): update unmanaged device list and toggle the managed property on each device when needed - (system_settings_properties_changed_cb): handle signals from the system settings service - (system_settings_get_unmanaged_devices_cb): handle callback from getting the unmanaged device list method call - (query_unmanaged_devices): ask the system settings service for its list of unmanaged devices - (nm_manager_name_owner_changed, initial_get_connections): get unmanaged devices - (manager_set_wireless_enabled): push rfkill state down to wireless devices directly and let them handle the necessary state transitions - (manager_device_state_changed): update for new device states - (nm_manager_add_device): set initial rfkill state on wireless devices - (nm_manager_remove_device): don't touch the device if it's unmanaged - (nm_manager_activate_connection): return error if the device is unmanaged - (nm_manager_sleep): handle new device states correctly; don't change the state of unavailable/unmanaged devices * libnm-glib/nm-device-802-11-wireless.c - (state_changed_cb): update for new device states git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
/* Indicate states in device activation.
*
* Allowed next states:
* UNMANAGED: the device is no longer managed by NetworkManager
* UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc)
* FAILED: an error ocurred during activation
* NEED_AUTH: authentication/secrets are needed
* ACTIVATED: (IP_CONFIG only) activation was successful
* DISCONNECTED: the device's connection is no longer valid, or NetworkManager went to sleep
*/
NM_DEVICE_STATE_PREPARE,
NM_DEVICE_STATE_CONFIG,
NM_DEVICE_STATE_NEED_AUTH,
NM_DEVICE_STATE_IP_CONFIG,
2008-04-07 Dan Williams <dcbw@redhat.com> * include/NetworkManager.h - Remove the DOWN and CANCELLED device states - Add UNMANAGED and UNAVAILABLE device states - Document the device states * introspection/nm-device.xml src/nm-device-interface.c src/nm-device-interface.h - Add the 'managed' property * test/nm-tool.c - (detail_device): print out device state * src/NetworkManagerSystem.h src/backends/NetworkManagerArch.c src/backends/NetworkManagerDebian.c src/backends/NetworkManagerFrugalware.c src/backends/NetworkManagerGentoo.c src/backends/NetworkManagerMandriva.c src/backends/NetworkManagerPaldo.c src/backends/NetworkManagerRedHat.c src/backends/NetworkManagerSlackware.c src/backends/NetworkManagerSuSE.c - (nm_system_device_get_system_config, nm_system_device_get_disabled nm_system_device_free_system_config): remove; they were unused and their functionality should be re-implemented in each distro's system settings service plugin * src/nm-gsm-device.c src/nm-gsm-device.h src/nm-cdma-device.c src/nm-cdma-device.h - (*_new): take the 'managed' argument * src/nm-device.c - (nm_device_set_address): remove, fold into nm_device_bring_up() - (nm_device_init): start in unmanaged state, not disconnected - (constructor): don't start device until the system settings service has had a chance to figure out if the device is managed or not - (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down): don't set device state here, let callers handle that as appropriate - (nm_device_dispose): don't touch the device if it's not managed - (set_property, get_property, nm_device_class_init): implement the 'managed' property - (nm_device_state_changed): bring the device up if its now managed, and deactivate it if it used to be active - (nm_device_get_managed, nm_device_set_managed): do the right thing with the managed state * src/nm-hal-manager.c - (wired_device_creator, wireless_device_creator, modem_device_creator): take initial managed state and pass it along to device constructors - (create_device_and_add_to_list): get managed state and pass to type creators * src/nm-device-802-11-wireless.c - (real_can_activate): fold in most of nm_device_802_11_wireless_can_activate() - (can_scan): can't scan in UNAVAILABLE or UNMANAGED - (link_timeout_cb): instead of deactivating, change device state and let the device state handler to it - (real_update_hw_address): clean up - (state_changed_cb): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device isn't rfkilled * src/nm-device-802-3-ethernet.c - (set_carrier): move above callers and get rid of prototype - (device_state_changed): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device has a carrier - (real_update_hw_address): clean up - (link_timeout_cb, ppp_state_changed): change state instead of calling deactivation directly as deactivation doesn't change state anymore * src/NetworkManagerPolicy.c - (schedule_activate_check): yay, remove wireless_enabled hack since the NMManager and wireless devices work that out themselves now - (device_state_changed): change to a switch and update for new device states - (device_carrier_changed): remove; device handles this now through state changes - (device_added): don't care about carrier any more; the initial activation check will happen when the device transitions to DISCONNECTED * src/nm-manager.c - (dispose): clear unmanaged devices - (handle_unmanaged_devices): update unmanaged device list and toggle the managed property on each device when needed - (system_settings_properties_changed_cb): handle signals from the system settings service - (system_settings_get_unmanaged_devices_cb): handle callback from getting the unmanaged device list method call - (query_unmanaged_devices): ask the system settings service for its list of unmanaged devices - (nm_manager_name_owner_changed, initial_get_connections): get unmanaged devices - (manager_set_wireless_enabled): push rfkill state down to wireless devices directly and let them handle the necessary state transitions - (manager_device_state_changed): update for new device states - (nm_manager_add_device): set initial rfkill state on wireless devices - (nm_manager_remove_device): don't touch the device if it's unmanaged - (nm_manager_activate_connection): return error if the device is unmanaged - (nm_manager_sleep): handle new device states correctly; don't change the state of unavailable/unmanaged devices * libnm-glib/nm-device-802-11-wireless.c - (state_changed_cb): update for new device states git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
/* Indicates the device is part of an active network connection.
*
* Allowed next states:
* UNMANAGED: the device is no longer managed by NetworkManager
* UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc)
* FAILED: a DHCP lease was not renewed, or another error
* DISCONNECTED: the device's connection is no longer valid, or NetworkManager went to sleep
*/
NM_DEVICE_STATE_ACTIVATED,
2008-04-07 Dan Williams <dcbw@redhat.com> * include/NetworkManager.h - Remove the DOWN and CANCELLED device states - Add UNMANAGED and UNAVAILABLE device states - Document the device states * introspection/nm-device.xml src/nm-device-interface.c src/nm-device-interface.h - Add the 'managed' property * test/nm-tool.c - (detail_device): print out device state * src/NetworkManagerSystem.h src/backends/NetworkManagerArch.c src/backends/NetworkManagerDebian.c src/backends/NetworkManagerFrugalware.c src/backends/NetworkManagerGentoo.c src/backends/NetworkManagerMandriva.c src/backends/NetworkManagerPaldo.c src/backends/NetworkManagerRedHat.c src/backends/NetworkManagerSlackware.c src/backends/NetworkManagerSuSE.c - (nm_system_device_get_system_config, nm_system_device_get_disabled nm_system_device_free_system_config): remove; they were unused and their functionality should be re-implemented in each distro's system settings service plugin * src/nm-gsm-device.c src/nm-gsm-device.h src/nm-cdma-device.c src/nm-cdma-device.h - (*_new): take the 'managed' argument * src/nm-device.c - (nm_device_set_address): remove, fold into nm_device_bring_up() - (nm_device_init): start in unmanaged state, not disconnected - (constructor): don't start device until the system settings service has had a chance to figure out if the device is managed or not - (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down): don't set device state here, let callers handle that as appropriate - (nm_device_dispose): don't touch the device if it's not managed - (set_property, get_property, nm_device_class_init): implement the 'managed' property - (nm_device_state_changed): bring the device up if its now managed, and deactivate it if it used to be active - (nm_device_get_managed, nm_device_set_managed): do the right thing with the managed state * src/nm-hal-manager.c - (wired_device_creator, wireless_device_creator, modem_device_creator): take initial managed state and pass it along to device constructors - (create_device_and_add_to_list): get managed state and pass to type creators * src/nm-device-802-11-wireless.c - (real_can_activate): fold in most of nm_device_802_11_wireless_can_activate() - (can_scan): can't scan in UNAVAILABLE or UNMANAGED - (link_timeout_cb): instead of deactivating, change device state and let the device state handler to it - (real_update_hw_address): clean up - (state_changed_cb): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device isn't rfkilled * src/nm-device-802-3-ethernet.c - (set_carrier): move above callers and get rid of prototype - (device_state_changed): when entering UNAVAILABLE state, schedule an idle handler to transition to DISCONNECTED if the device has a carrier - (real_update_hw_address): clean up - (link_timeout_cb, ppp_state_changed): change state instead of calling deactivation directly as deactivation doesn't change state anymore * src/NetworkManagerPolicy.c - (schedule_activate_check): yay, remove wireless_enabled hack since the NMManager and wireless devices work that out themselves now - (device_state_changed): change to a switch and update for new device states - (device_carrier_changed): remove; device handles this now through state changes - (device_added): don't care about carrier any more; the initial activation check will happen when the device transitions to DISCONNECTED * src/nm-manager.c - (dispose): clear unmanaged devices - (handle_unmanaged_devices): update unmanaged device list and toggle the managed property on each device when needed - (system_settings_properties_changed_cb): handle signals from the system settings service - (system_settings_get_unmanaged_devices_cb): handle callback from getting the unmanaged device list method call - (query_unmanaged_devices): ask the system settings service for its list of unmanaged devices - (nm_manager_name_owner_changed, initial_get_connections): get unmanaged devices - (manager_set_wireless_enabled): push rfkill state down to wireless devices directly and let them handle the necessary state transitions - (manager_device_state_changed): update for new device states - (nm_manager_add_device): set initial rfkill state on wireless devices - (nm_manager_remove_device): don't touch the device if it's unmanaged - (nm_manager_activate_connection): return error if the device is unmanaged - (nm_manager_sleep): handle new device states correctly; don't change the state of unavailable/unmanaged devices * libnm-glib/nm-device-802-11-wireless.c - (state_changed_cb): update for new device states git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3540 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-04-08 02:58:02 +00:00
/* Indicates the device's activation failed.
*
* Allowed next states:
* UNMANAGED: the device is no longer managed by NetworkManager
* UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc)
* DISCONNECTED: the device's connection is ready for activation, or NetworkManager went to sleep
*/
NM_DEVICE_STATE_FAILED
} NMDeviceState;
typedef enum {
NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0,
/* Indicates the connection is activating */
NM_ACTIVE_CONNECTION_STATE_ACTIVATING,
/* Indicates the connection is currently active */
NM_ACTIVE_CONNECTION_STATE_ACTIVATED
} NMActiveConnectionState;
#endif /* NETWORK_MANAGER_H */