75
75
* simplicity, states from several different layers are present -
76
76
* this is a high level view
78
enum State { UnknownState = 0, Unmanaged = 10, Unavailable = 20, Disconnected = 30 , Preparing = 40,
79
ConfiguringHardware = 50 , NeedAuth = 60, ConfiguringIp = 70, CheckingIp = 80, WaitingForSecondaries = 90, Activated = 100, Deactivating = 110, Failed = 120
79
UnknownState = 0, /**< The device is in an unknown state */
80
Unmanaged = 10, /**< The device is recognized but not managed by NetworkManager */
81
Unavailable = 20, /**< The device cannot be used (carrier off, rfkill, etc) */
82
Disconnected = 30, /**< The device is not connected */
83
Preparing = 40, /**< The device is preparing to connect */
84
ConfiguringHardware = 50, /**< The device is being configured */
85
NeedAuth = 60, /**< The device is awaiting secrets necessary to continue connection */
86
ConfiguringIp = 70, /**< The IP settings of the device are being requested and configured */
87
CheckingIp = 80, /**< The device's IP connectivity ability is being determined */
88
WaitingForSecondaries = 90, /**< The device is waiting for secondary connections to be activated */
89
Activated = 100, /**< The device is active */
90
Deactivating = 110, /**< The device's network connection is being torn down */
91
Failed = 120 /**< The device is in a failure state following an attempt to activate it */
83
95
* Enums describing the reason for a connection state change
105
* Possible Device capabilities
106
* - IsManageable: denotes that the device can be controlled by this API
107
* - SupportsCarrierDetect: the device informs us when it is plugged in to the medium
117
* Possible device capabilities
109
119
enum Capability {
111
SupportsCarrierDetect = 0x2
120
IsManageable = 0x1, /**< denotes that the device can be controlled by this API */
121
SupportsCarrierDetect = 0x2 /**< the device informs us when it is plugged in to the medium */
113
123
Q_DECLARE_FLAGS(Capabilities, Capability)
116
* Device medium types
117
* - Ethernet: Ieee8023 wired ethernet
118
* - Wifi: the Ieee80211 family of wireless networks
119
* - Bluetooth: network bluetooth device (usually a cell phone)
120
* - Modem: POTS, GSM, CDMA or LTE modems
121
* - OlpcMesh: OLPC Mesh networking device
122
* - Wimax: WiMax WWAN technology
129
UnknownType, /**< Unknown device type */
130
Ethernet, /**< Ieee8023 wired ethernet */
131
Wifi, /**< the Ieee80211 family of wireless networks */
132
Unused1, /**< Currently unused */
133
Unused2, /**< Currently unused */
134
Bluetooth, /**< network bluetooth device (usually a cell phone) */
135
OlpcMesh, /**< OLPC Mesh networking device */
136
Wimax, /**< WiMax WWAN technology */
137
Modem, /**< POTS, GSM, CDMA or LTE modems */
138
InfiniBand, /**< Infiniband network device */
139
Bond, /**< Bond virtual device */
140
Vlan, /**< Vlan virtual device */
141
Adsl, /**< ADSL modem device */
142
Bridge /**< Bridge virtual device */
140
144
Q_DECLARE_FLAGS(Types, Type)
143
* Creates a new NetworkInterface object.
147
* Creates a new device object.
145
149
* @param path UNI of the device
147
151
explicit Device(const QString &path, QObject *parent = 0);
148
152
Device(DevicePrivate &dd, QObject *parent);
150
* Destroys a NetworkInterface object.
154
* Destroys a device object.
152
156
virtual ~Device();
159
163
virtual Type type() const;
161
* Retrieves the Unique Network Identifier (UNI) of the NetworkInterface.
165
* Retrieves the Unique Network Identifier (UNI) of the device.
162
166
* This identifier is unique for each network and network interface in the system.
164
* @returns the Unique Network Identifier of the current network
168
* @returns the Unique Network Identifier of the current device
166
170
QString uni() const;
168
* The current active connection for this interface.
172
* The current active connection for this device
170
174
* @returns A valid ActiveConnection object or NULL if no active connection was found