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