• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
  • tdehw
  • networkbackends
  • network-manager
network-manager.h
1/* This file is part of the TDE libraries
2 Copyright (C) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18#ifndef _TDENETWORKBACKEND_NETWORKMANAGER_H
19#define _TDENETWORKBACKEND_NETWORKMANAGER_H
20
21#include "tdenetworkconnections.h"
22
23//====================================================================================================
24// General NetworkManager DBUS service paths
25//====================================================================================================
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"
30
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"
40//====================================================================================================
41
42//====================================================================================================
43// These defines MUST be kept in sync with their respective introspection XML files
44//====================================================================================================
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
58//====================================================================================================
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
67//====================================================================================================
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
81//====================================================================================================
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
90//====================================================================================================
91#define NM_DEVICE_CAP_NONE 0
92#define NM_DEVICE_CAP_NM_SUPPORTED 1
93#define NM_DEVICE_CAP_CARRIER_DETECT 2
94//====================================================================================================
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
99//====================================================================================================
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
104//====================================================================================================
105#define NM_ACCESS_POINT_CAP_NONE 0x0
106#define NM_ACCESS_POINT_CAP_PRIVACY 0x1
107//====================================================================================================
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
119//====================================================================================================
120#define NM_WEP_TYPE_HEXADECIMAL 1
121#define NM_WEP_TYPE_PASSPHRASE 2
122//====================================================================================================
123#define NM_VLAN_REORDER_PACKET_HEADERS 0x01
124#define NM_VLAN_USE_GVRP 0x02
125#define NM_VLAN_LOOSE_BINDING 0x04
126//====================================================================================================
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
132//====================================================================================================
133#define NM_802_11_MODE_UNKNOWN 0
134#define NM_802_11_MODE_ADHOC 1
135#define NM_802_11_MODE_INFRASTRUCTURE 2
136//====================================================================================================
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
144//====================================================================================================
145#define NM_PLUGIN_SERVICE_DIR "/etc/NetworkManager/VPN"
146//====================================================================================================
147
148//====================================================================================================
149// Device state change reason codes
150// Taken from NetworkManager.h
151//====================================================================================================
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
207//====================================================================================================
208
209class TQT_DBusObjectPath;
210class TDENetworkConnectionManager_BackendNMPrivate;
211
212class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkConnectionManager
213{
214 TQ_OBJECT
215
216 public:
217 TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice);
218 ~TDENetworkConnectionManager_BackendNM();
219
220 virtual TQString backendName();
221 virtual TDENetworkDeviceType::TDENetworkDeviceType deviceType();
222 virtual TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags backendStatus();
223 virtual TDENetworkDeviceInformation deviceInformation();
224 virtual TDENetworkDeviceInformation deviceStatus();
225
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);
232
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();
237
238 virtual TDENetworkHWNeighborList* siteSurvey();
239 virtual TQStringList connectionPhysicalDeviceUUIDs(TQString uuid);
240 virtual TDENetworkVPNTypeList availableVPNTypes();
241
242 virtual bool networkingEnabled();
243 virtual bool wiFiHardwareEnabled();
244
245 virtual bool enableNetworking(bool enable);
246 virtual bool enableWiFi(bool enable);
247 virtual bool wiFiEnabled();
248
249 virtual TQStringList defaultNetworkDevices();
250
251 private:
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);
258
259 private:
260 TDENetworkConnectionManager_BackendNMPrivate* d;
261 friend class TDENetworkConnectionManager_BackendNMPrivate;
262};
263
264#endif // _TDENETWORKBACKEND_NETWORKMANAGER_H

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.