18#ifndef _TDENETWORKBACKEND_NETWORKMANAGER_H
19#define _TDENETWORKBACKEND_NETWORKMANAGER_H
21#include "tdenetworkconnections.h"
26#define NM_DBUS_PATH "/org/freedesktop/NetworkManager"
27#define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManager/Settings"
28#define NM_DBUS_PATH_SETTINGS_CONNECTION "/org/freedesktop/NetworkManager/Settings/Connection"
29#define NM_VPN_DBUS_PLUGIN_PATH "/org/freedesktop/NetworkManager/VPN/Plugin"
31#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
32#define NM_DBUS_ACTIVE_CONNECTION_SERVICE "org.freedesktop.NetworkManager.Connection.Active"
33#define NM_DBUS_DEVICE_SERVICE "org.freedesktop.NetworkManager.Device"
34#define NM_DBUS_WIRED_DEVICE_SERVICE "org.freedesktop.NetworkManager.Device.Wired"
35#define NM_DBUS_WIRELESS_DEVICE_SERVICE "org.freedesktop.NetworkManager.Device.Wireless"
36#define NM_DBUS_SETTINGS_SERVICE "org.freedesktop.NetworkManager.Settings"
37#define NM_DBUS_SETTINGS_CONNECTION_SERVICE "org.freedesktop.NetworkManager.Settings.Connection"
38#define NM_VPN_DBUS_PLUGIN_SERVICE "org.freedesktop.NetworkManager.VPN.Plugin"
39#define NM_VPN_DBUS_CONNECTION_SERVICE "org.freedesktop.NetworkManager.VPN.Connection"
45#define NM_DEVICE_TYPE_UNKNOWN 0
46#define NM_DEVICE_TYPE_ETHERNET 1
47#define NM_DEVICE_TYPE_WIFI 2
48#define NM_DEVICE_TYPE_UNUSED1 3
49#define NM_DEVICE_TYPE_UNUSED2 4
50#define NM_DEVICE_TYPE_BT 5
51#define NM_DEVICE_TYPE_OLPC_MESH 6
52#define NM_DEVICE_TYPE_WIMAX 7
53#define NM_DEVICE_TYPE_MODEM 8
54#define NM_DEVICE_TYPE_INFINIBAND 9
55#define NM_DEVICE_TYPE_BOND 10
56#define NM_DEVICE_TYPE_VLAN 11
57#define NM_DEVICE_TYPE_ADSL 12
59#define NM_STATE_UNKNOWN 0
60#define NM_STATE_ASLEEP 10
61#define NM_STATE_DISCONNECTED 20
62#define NM_STATE_DISCONNECTING 30
63#define NM_STATE_CONNECTING 40
64#define NM_STATE_CONNECTED_LOCAL 50
65#define NM_STATE_CONNECTED_SITE 60
66#define NM_STATE_CONNECTED_GLOBAL 70
68#define NM_DEVICE_STATE_UNKNOWN 0
69#define NM_DEVICE_STATE_UNMANAGED 10
70#define NM_DEVICE_STATE_UNAVAILABLE 20
71#define NM_DEVICE_STATE_DISCONNECTED 30
72#define NM_DEVICE_STATE_PREPARE 40
73#define NM_DEVICE_STATE_CONFIG 50
74#define NM_DEVICE_STATE_NEED_AUTH 60
75#define NM_DEVICE_STATE_IP_CONFIG 70
76#define NM_DEVICE_STATE_IP_CHECK 80
77#define NM_DEVICE_STATE_SECONDARIES 90
78#define NM_DEVICE_STATE_ACTIVATED 100
79#define NM_DEVICE_STATE_DEACTIVATING 110
80#define NM_DEVICE_STATE_FAILED 120
82#define NM_VPN_STATE_UNKNOWN 0
83#define NM_VPN_STATE_PREPARE 1
84#define NM_VPN_STATE_NEED_AUTH 2
85#define NM_VPN_STATE_CONNECT 3
86#define NM_VPN_STATE_IP_CONFIG_GET 4
87#define NM_VPN_STATE_ACTIVATED 5
88#define NM_VPN_STATE_FAILED 6
89#define NM_VPN_STATE_DISCONNECTED 7
91#define NM_DEVICE_CAP_NONE 0
92#define NM_DEVICE_CAP_NM_SUPPORTED 1
93#define NM_DEVICE_CAP_CARRIER_DETECT 2
95#define NM_EAP_FAST_PROVISIONING_DISABLED 0
96#define NM_EAP_FAST_PROVISIONING_UNAUTHONLY 1
97#define NM_EAP_FAST_PROVISIONING_AUTHONLY 2
98#define NM_EAP_FAST_PROVISIONING_BOTH 3
100#define NM_PASSWORD_SECRET_NONE 0
101#define NM_PASSWORD_SECRET_AGENTOWNED 1
102#define NM_PASSWORD_SECRET_NOTSAVED 2
103#define NM_PASSWORD_SECRET_NOTREQUIRED 4
105#define NM_ACCESS_POINT_CAP_NONE 0x0
106#define NM_ACCESS_POINT_CAP_PRIVACY 0x1
108#define NM_ACCESS_POINT_SEC_NONE 0x0
109#define NM_ACCESS_POINT_SEC_PAIR_WEP40 0x1
110#define NM_ACCESS_POINT_SEC_PAIR_WEP104 0x2
111#define NM_ACCESS_POINT_SEC_PAIR_TKIP 0x4
112#define NM_ACCESS_POINT_SEC_PAIR_CCMP 0x8
113#define NM_ACCESS_POINT_SEC_GROUP_WEP40 0x10
114#define NM_ACCESS_POINT_SEC_GROUP_WEP104 0x20
115#define NM_ACCESS_POINT_SEC_GROUP_TKIP 0x40
116#define NM_ACCESS_POINT_SEC_GROUP_CCMP 0x80
117#define NM_ACCESS_POINT_SEC_KEY_MGMT_PSK 0x100
118#define NM_ACCESS_POINT_SEC_KEY_MGMT_802_1X 0x200
120#define NM_WEP_TYPE_HEXADECIMAL 1
121#define NM_WEP_TYPE_PASSPHRASE 2
123#define NM_VLAN_REORDER_PACKET_HEADERS 0x01
124#define NM_VLAN_USE_GVRP 0x02
125#define NM_VLAN_LOOSE_BINDING 0x04
127#define NM_GSM_3G_ALL -1
128#define NM_GSM_3G_ONLY 0
129#define NM_GSM_GPRS_EDGE_ONLY 1
130#define NM_GSM_PREFER_3G 2
131#define NM_GSM_PREFER_2G 3
133#define NM_802_11_MODE_UNKNOWN 0
134#define NM_802_11_MODE_ADHOC 1
135#define NM_802_11_MODE_INFRASTRUCTURE 2
137#define NM_802_11_DEVICE_CAP_NONE 0x0
138#define NM_802_11_DEVICE_CAP_CIPHER_WEP40 0x1
139#define NM_802_11_DEVICE_CAP_CIPHER_WEP104 0x2
140#define NM_802_11_DEVICE_CAP_CIPHER_TKIP 0x4
141#define NM_802_11_DEVICE_CAP_CIPHER_CCMP 0x8
142#define NM_802_11_DEVICE_CAP_WPA 0x10
143#define NM_802_11_DEVICE_CAP_RSN 0x20
145#define NM_PLUGIN_SERVICE_DIR "/etc/NetworkManager/VPN"
152#define NM_DEVICE_STATE_REASON_NONE 0
153#define NM_DEVICE_STATE_REASON_UNKNOWN 1
154#define NM_DEVICE_STATE_REASON_NOW_MANAGED 2
155#define NM_DEVICE_STATE_REASON_NOW_UNMANAGED 3
156#define NM_DEVICE_STATE_REASON_CONFIG_FAILED 4
157#define NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE 5
158#define NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED 6
159#define NM_DEVICE_STATE_REASON_NO_SECRETS 7
160#define NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT 8
161#define NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED 9
162#define NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED 10
163#define NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT 11
164#define NM_DEVICE_STATE_REASON_PPP_START_FAILED 12
165#define NM_DEVICE_STATE_REASON_PPP_DISCONNECT 13
166#define NM_DEVICE_STATE_REASON_PPP_FAILED 14
167#define NM_DEVICE_STATE_REASON_DHCP_START_FAILED 15
168#define NM_DEVICE_STATE_REASON_DHCP_ERROR 16
169#define NM_DEVICE_STATE_REASON_DHCP_FAILED 17
170#define NM_DEVICE_STATE_REASON_SHARED_START_FAILED 18
171#define NM_DEVICE_STATE_REASON_SHARED_FAILED 19
172#define NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED 20
173#define NM_DEVICE_STATE_REASON_AUTOIP_ERROR 21
174#define NM_DEVICE_STATE_REASON_AUTOIP_FAILED 22
175#define NM_DEVICE_STATE_REASON_MODEM_BUSY 23
176#define NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE 24
177#define NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER 25
178#define NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT 26
179#define NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED 27
180#define NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED 28
181#define NM_DEVICE_STATE_REASON_GSM_APN_FAILED 29
182#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING 30
183#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED 31
184#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT 32
185#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED 33
186#define NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED 34
187#define NM_DEVICE_STATE_REASON_FIRMWARE_MISSING 35
188#define NM_DEVICE_STATE_REASON_REMOVED 36
189#define NM_DEVICE_STATE_REASON_SLEEPING 37
190#define NM_DEVICE_STATE_REASON_CONNECTION_REMOVED 38
191#define NM_DEVICE_STATE_REASON_USER_REQUESTED 39
192#define NM_DEVICE_STATE_REASON_CARRIER 40
193#define NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED 41
194#define NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE 42
195#define NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND 43
196#define NM_DEVICE_STATE_REASON_BT_FAILED 44
197#define NM_DEVICE_STATE_REASON_GSM_SIM_NOT_INSERTED 45
198#define NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED 46
199#define NM_DEVICE_STATE_REASON_GSM_SIM_PUK_REQUIRED 47
200#define NM_DEVICE_STATE_REASON_GSM_SIM_WRONG 48
201#define NM_DEVICE_STATE_REASON_INFINIBAND_MODE 49
202#define NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED 50
203#define NM_DEVICE_STATE_REASON_BR2684_FAILED 51
204#define NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE 52
205#define NM_DEVICE_STATE_REASON_SSID_NOT_FOUND 53
206#define NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED 54
209class TQT_DBusObjectPath;
210class TDENetworkConnectionManager_BackendNMPrivate;
212class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM :
public TDENetworkConnectionManager
217 TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice);
218 ~TDENetworkConnectionManager_BackendNM();
220 virtual TQString backendName();
221 virtual TDENetworkDeviceType::TDENetworkDeviceType deviceType();
222 virtual TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags backendStatus();
223 virtual TDENetworkDeviceInformation deviceInformation();
224 virtual TDENetworkDeviceInformation deviceStatus();
226 virtual void loadConnectionInformation();
227 virtual void loadConnectionAllowedValues(TDENetworkConnection* connection);
228 virtual bool loadConnectionSecrets(TQString uuid);
229 virtual bool saveConnection(TDENetworkConnection* connection);
230 virtual bool deleteConnection(TQString uuid);
231 virtual bool verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type=NULL, TDENetworkErrorStringMap* reason=NULL);
233 virtual TDENetworkConnectionStatus::TDENetworkConnectionStatus initiateConnection(TQString uuid);
234 virtual TDENetworkConnectionStatus::TDENetworkConnectionStatus checkConnectionStatus(TQString uuid);
235 virtual TDENetworkConnectionStatus::TDENetworkConnectionStatus deactivateConnection(TQString uuid);
236 virtual TQStringList validSettings();
238 virtual TDENetworkHWNeighborList* siteSurvey();
239 virtual TQStringList connectionPhysicalDeviceUUIDs(TQString uuid);
240 virtual TDENetworkVPNTypeList availableVPNTypes();
242 virtual bool networkingEnabled();
243 virtual bool wiFiHardwareEnabled();
245 virtual bool enableNetworking(
bool enable);
246 virtual bool enableWiFi(
bool enable);
247 virtual bool wiFiEnabled();
249 virtual TQStringList defaultNetworkDevices();
252 TDENetworkDeviceType::TDENetworkDeviceType nmDeviceTypeToTDEDeviceType(TQ_UINT32 nmType);
253 TQString deviceInterfaceString(TQString deviceNode);
254 bool loadConnectionSecretsForGroup(TQString uuid, TQString group);
255 TDENetworkWiFiAPInfo* getAccessPointDetails(TQString dbusPath);
256 TDENetworkConnectionType::TDENetworkConnectionType connectionType(TQString dbusPath);
257 TQT_DBusObjectPath getActiveConnectionPath(TQString uuid);
260 TDENetworkConnectionManager_BackendNMPrivate* d;
261 friend class TDENetworkConnectionManager_BackendNMPrivate;