NetworkManager/include/NetworkManager.h

391 lines
12 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 - 2010 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_INTERFACE_DEVICE_BLUETOOTH NM_DBUS_INTERFACE_DEVICE ".Bluetooth"
#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_INTERFACE_DHCP4_CONFIG NM_DBUS_INTERFACE ".DHCP4Config"
#define NM_DBUS_INTERFACE_IP6_CONFIG NM_DBUS_INTERFACE ".IP6Config"
2010-01-15 12:40:19 -08:00
#define NM_DBUS_INTERFACE_DHCP6_CONFIG NM_DBUS_INTERFACE ".DHCP6Config"
#define NM_DBUS_IFACE_SETTINGS "org.freedesktop.NetworkManager.Settings"
#define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManager/Settings"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION "org.freedesktop.NetworkManager.Settings.Connection"
#define NM_DBUS_PATH_SETTINGS_CONNECTION "/org/freedesktop/NetworkManager/Settings/Connection"
#define NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS "org.freedesktop.NetworkManager.Settings.Connection.Secrets"
#define NM_DBUS_INTERFACE_AGENT_MANAGER NM_DBUS_INTERFACE ".AgentManager"
#define NM_DBUS_PATH_AGENT_MANAGER "/org/freedesktop/NetworkManager/AgentManager"
/*
* 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,
NM_DEVICE_TYPE_BT, /* Bluetooth */
NM_DEVICE_TYPE_OLPC_MESH
} 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
*/
#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
*/
#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
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 AP and Station modes
*
*/
typedef enum {
NM_802_11_MODE_UNKNOWN = 0,
NM_802_11_MODE_ADHOC,
NM_802_11_MODE_INFRA
} NM80211Mode;
/**
* NMBluetoothCapabilities:
* @NM_BT_CAPABILITY_NONE: device has no usable capabilities
* @NM_BT_CAPABILITY_DUN: device provides Dial-Up Networking capability
* @NM_BT_CAPABILITY_PAN: device provides Personal Area Networking capability
*
* #NMBluetoothCapabilities values indicate the usable capabilities of a
* Bluetooth device.
*/
typedef enum {
NM_BT_CAPABILITY_NONE = 0x00000000,
NM_BT_CAPABILITY_DUN = 0x00000001,
NM_BT_CAPABILITY_NAP = 0x00000002,
} NMBluetoothCapabilities;
/*
* 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 = 1,
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 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 = 2,
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 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 = 3,
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 = 4,
NM_DEVICE_STATE_CONFIG = 5,
NM_DEVICE_STATE_NEED_AUTH = 6,
NM_DEVICE_STATE_IP_CONFIG = 7,
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 = 8,
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 = 9
} NMDeviceState;
/*
* Device state change reason codes
*/
typedef enum {
/* No reason given */
NM_DEVICE_STATE_REASON_NONE = 0,
/* Unknown error */
NM_DEVICE_STATE_REASON_UNKNOWN = 1,
/* Device is now managed */
NM_DEVICE_STATE_REASON_NOW_MANAGED = 2,
/* Device is now unmanaged */
NM_DEVICE_STATE_REASON_NOW_UNMANAGED = 3,
/* The device could not be readied for configuration */
NM_DEVICE_STATE_REASON_CONFIG_FAILED = 4,
/* IP configuration could not be reserved (no available address, timeout, etc) */
NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE = 5,
/* The IP config is no longer valid */
NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED = 6,
/* Secrets were required, but not provided */
NM_DEVICE_STATE_REASON_NO_SECRETS = 7,
/* 802.1x supplicant disconnected */
NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT = 8,
/* 802.1x supplicant configuration failed */
NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED = 9,
/* 802.1x supplicant failed */
NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED = 10,
/* 802.1x supplicant took too long to authenticate */
NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT = 11,
/* PPP service failed to start */
NM_DEVICE_STATE_REASON_PPP_START_FAILED = 12,
/* PPP service disconnected */
NM_DEVICE_STATE_REASON_PPP_DISCONNECT = 13,
/* PPP failed */
NM_DEVICE_STATE_REASON_PPP_FAILED = 14,
/* DHCP client failed to start */
NM_DEVICE_STATE_REASON_DHCP_START_FAILED = 15,
/* DHCP client error */
NM_DEVICE_STATE_REASON_DHCP_ERROR = 16,
/* DHCP client failed */
NM_DEVICE_STATE_REASON_DHCP_FAILED = 17,
/* Shared connection service failed to start */
NM_DEVICE_STATE_REASON_SHARED_START_FAILED = 18,
/* Shared connection service failed */
NM_DEVICE_STATE_REASON_SHARED_FAILED = 19,
/* AutoIP service failed to start */
NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED = 20,
/* AutoIP service error */
NM_DEVICE_STATE_REASON_AUTOIP_ERROR = 21,
/* AutoIP service failed */
NM_DEVICE_STATE_REASON_AUTOIP_FAILED = 22,
/* The line is busy */
NM_DEVICE_STATE_REASON_MODEM_BUSY = 23,
/* No dial tone */
NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE = 24,
/* No carrier could be established */
NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER = 25,
/* The dialing request timed out */
NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT = 26,
/* The dialing attempt failed */
NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED = 27,
/* Modem initialization failed */
NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED = 28,
/* Failed to select the specified APN */
NM_DEVICE_STATE_REASON_GSM_APN_FAILED = 29,
/* Not searching for networks */
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING = 30,
/* Network registration denied */
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED = 31,
/* Network registration timed out */
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT = 32,
/* Failed to register with the requested network */
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED = 33,
/* PIN check failed */
NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED = 34,
/* Necessary firmware for the device may be missing */
NM_DEVICE_STATE_REASON_FIRMWARE_MISSING = 35,
/* The device was removed */
NM_DEVICE_STATE_REASON_REMOVED = 36,
/* NetworkManager went to sleep */
NM_DEVICE_STATE_REASON_SLEEPING = 37,
/* The device's active connection disappeared */
NM_DEVICE_STATE_REASON_CONNECTION_REMOVED = 38,
/* Device disconnected by user or client */
NM_DEVICE_STATE_REASON_USER_REQUESTED = 39,
/* Carrier/link changed */
NM_DEVICE_STATE_REASON_CARRIER = 40,
/* The device's existing connection was assumed */
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED = 41,
/* The supplicant is now available */
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE = 42,
2010-01-28 11:21:53 -08:00
/* The modem could not be found */
NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND = 43,
2010-01-28 11:21:53 -08:00
/* The Bluetooth connection failed or timed out */
NM_DEVICE_STATE_REASON_BT_FAILED = 44,
/* Unused */
NM_DEVICE_STATE_REASON_LAST = 0xFFFF
} NMDeviceStateReason;
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 */