1 ********* NOTE *********
2 This document is for historical reference only. The autogenerated 'spec.html' is the canonical D-Bus reference.
3 ********* NOTE *********
7 NetworkManager DBUS API (unstable)
8 ----------------------------------
10 NetworkManager (NM) exposes a DBUS service and API for two purposes: for programs to obtain information about the network state and network devices, and for programs or users to alter the network state in limited ways. This API is currently unstable and is likely to change in the future. Any methods or objects NOT described in this document are not part of the official API, are not meant for general use, and are not supported in any way.
12 There are three types of "objects" that NM allows other programs to interact with: the NetworkManager object, Device objects, and Network objects. There is only one NetworkManager object as it performs system-wide networking functions and controls each Device. There can be a arbitrary number of Devices, including no Devices at all, each of which represent a network device present in the system. A Network is the representation of a wireless network, of which each Device object may have an arbitrary number (as long as it is a wireless device).
23 The NetworkManager object
24 -------------------------
26 The following constants are used to uniquely refer to the NetworkManager object when making DBUS method calls against NetworkManager:
28 DBUS Service: "org.freedesktop.NetworkManager"
29 DBUS Object Path: "/org/freedesktop/NetworkManager"
30 DBUS Interface: "org.freedesktop.NetworkManager"
34 Name: getDevices Get the list of network devices NM knows about
36 Returns: DBUS String Array Each item in the array is the NM identifier of a Device object
39 Name: getActiveDevice Return the currently active network device
41 Returns: DBUS_TYPE_STRING The NM identifier of a Device object
44 Name: setActiveDevice Force NM to use a particular network device
45 Args: 1) Device object (DBUS_TYPE_STRING) - Network device to switch to
46 2) Wireless Network ESSID (DBUS_TYPE_STRING, optional) - ESSID of the wireless network to switch to
50 Name: status Retrieve status information about the network state
52 Returns: DBUS_TYPE_STRING "connecting" - there is a pending network connection (waiting for a
53 DHCP request to complete, waiting for an encryption
54 key/passphrase, waiting for a wireless network, etc)
55 "connected" - there is an active network connection
56 "scanning" - there is no active network connection, but NetworkManager
57 is looking for an access point to associate with
58 "disconnected" - there is no network connection
62 Name: DeviceNoLongerActive Signals that a network device is no longer active
63 Args: 1) Device object (DBUS_TYPE_STRING) - The deactivated network device
65 Name: DeviceNowActive Signals that a network device is newly activated
66 Args: 1) Device object (DBUS_TYPE_STRING) - The newly activated network device
68 Name: DeviceActivating Signals that a network device is about to become active
69 Args: 1) Device object (DBUS_TYPE_STRING) - The device about to become active
71 Name: DevicesChanged Signals that a device was either added or removed from the system
72 Args: 1) Device object (DBUS_TYPE_STRING) - The device which was added or removed
74 Name: DeviceActivationFailed Signals that activation for a device could not complete (dhcp failed or so)
75 Args: 1) Device object (DBUS_TYPE_STRING) - The device for which activation failed
76 2) Network name (DBUS_TYPE_STRING, optional) - ESSID of failed wireless network
78 Name: DeviceStrengthChanged Signals that the wireless strength percentage for the device has changed.
79 Args: 1) Device object (DBUS_TYPE_STRING) - The device for which strength changed
80 2) Strength (DBUS_TYPE_INT32) - The new strength percentage
82 NOTE: the following 3 Signals are likely to change in the near future
84 Name: DeviceIP4AddressChange Signals that a device's IPv4 address was changed
85 Args: 1) Device object (DBUS_TYPE_STRING) - The device whose IPv4 address changed
87 Name: WirelessNetworkAppeared Signals that a device found a new wireless network
88 Args: 1) Device object (DBUS_TYPE_STRING) - The device which noticed the wireless network
89 2) Network object (DBUS_TYPE_STRING) - The new wireless network's identifier
91 Name: WirelessNetworkDisappeared Signals that a device lost a new wireless network
92 Args: 1) Device object (DBUS_TYPE_STRING) - The device which lost the wireless network
93 2) Network object (DBUS_TYPE_STRING) - The no-longer-visible wireless network's identifier
101 The Device object is the NM representation of a network device. To refer to a NM Device, you must use the following constants when creating your DBUS message:
103 DBUS Service: "org.freedesktop.NetworkManager"
104 DBUS Interface: "org.freedesktop.NetworkManager.Devices"
106 Note that there is no DBUS Object Path listed above, the object path will always the NM Device identfier returned from such methods as "getActiveDevice" and "getDevices".
110 Name: getName Returns the system device name of the Device object (i.e. eth0)
112 Returns: DBUS_TYPE_STRING The system device name
115 Name: getType Returns the type of the device (ie wired, wireless, isdn, bluetooth, etc)
117 Returns: DBUS_TYPE_INT32 0 - unknown type
119 2 - Wireless (802.11a/b/g)
122 Name: getHalUdi Returns the HAL UDI of the device
124 Returns: DBUS_TYPE_STRING
127 Name: getIP4Address Returns the IPv4 address of the device
129 Returns: DBUS_TYPE_UINT32 The IPv4 address in network byte order
132 Name: getLinkActive Returns the link state of the device
134 Returns: DBUS_TYPE_BOOLEAN TRUE - the device has a valid network link
135 Wired: cable is plugged in
136 Wireless: good link to a base station
137 FALSE - the device has no network link
138 Wired: no cable plugged in
139 Wireless: no base station, or bad encryption key
141 Name: getActiveNetwork (Wireless only) Returns the Network object indentifier of the wireless network
142 this device is currently associated with, if any
144 Returns: DBUS_TYPE_STRING
147 Name: getNetworks (Wireless only) Returns a list of Network objects this device knows about
149 Returns: DBUS String Array Each item in the array is a Network object identifier
156 Each Device object that is of type 2 (Wireless device) keeps a list of Network objects that it knows about. Use the following constants to specify a Network object when creating DBUS method calls:
158 DBUS Service: "org.freedesktop.NetworkManager"
159 DBUS Interface: "org.freedesktop.NetworkManager.Devices"
161 Again, note that there is no DBUS Object Path above, since the object path used for the method call will be the Network object indentifier returned from a Device object's "getActiveNetwork" or "getNetworks" methods.
165 Name: getName Return the name of the network (ESSID)
167 Returns: DBUS_TYPE_STRING
170 Name: getAddress Returns the hardware address of the base station this wireless network belongs to.
171 NOTE: this may change in the near future to an array of addresses.
173 Returns: DBUS_TYPE_STRING
176 Name: getStrength Return the strength percentage of the current wireless network
178 Returns: DBUS_TYPE_INT32 The strength percentage of the current wireless network
181 Name: getFrequency Returns the frequency/channel this wireless network
183 Returns: DBUS_TYPE_DOUBLE A frequency in GHz (i.e. 2.417)
186 Name: getRate Returns the max data rate this wireless network supports
188 Returns: DBUS_TYPE_INT32 The max data rate in Mbps (i.e. 11)
191 Name: getEncrypted Returns whether or not this wireless network requires encryption
193 Returns: DBUS_TYPE_BOOLEAN