• 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 "config.h"
22 #include "tdenetworkconnections.h"
23 
24 //====================================================================================================
25 // General NetworkManager DBUS service paths
26 //====================================================================================================
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"
31 
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"
41 //====================================================================================================
42 
43 //====================================================================================================
44 // These defines MUST be kept in sync with their respective introspection XML files
45 //====================================================================================================
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
59 //====================================================================================================
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
68 //====================================================================================================
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
82 //====================================================================================================
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
91 //====================================================================================================
92 #define NM_DEVICE_CAP_NONE 0
93 #define NM_DEVICE_CAP_NM_SUPPORTED 1
94 #define NM_DEVICE_CAP_CARRIER_DETECT 2
95 //====================================================================================================
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
100 //====================================================================================================
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
105 //====================================================================================================
106 #define NM_ACCESS_POINT_CAP_NONE 0x0
107 #define NM_ACCESS_POINT_CAP_PRIVACY 0x1
108 //====================================================================================================
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
120 //====================================================================================================
121 #define NM_WEP_TYPE_HEXADECIMAL 1
122 #define NM_WEP_TYPE_PASSPHRASE 2
123 //====================================================================================================
124 #define NM_VLAN_REORDER_PACKET_HEADERS 0x01
125 #define NM_VLAN_USE_GVRP 0x02
126 #define NM_VLAN_LOOSE_BINDING 0x04
127 //====================================================================================================
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
133 //====================================================================================================
134 #define NM_802_11_MODE_UNKNOWN 0
135 #define NM_802_11_MODE_ADHOC 1
136 #define NM_802_11_MODE_INFRASTRUCTURE 2
137 //====================================================================================================
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
145 //====================================================================================================
146 #define NM_PLUGIN_SERVICE_DIR_ETC "/etc/NetworkManager/VPN" // old plugin location
147 #define NM_PLUGIN_SERVICE_DIR_LIB NM_VPN_SERVICE_DIR // new plugin location
148 //====================================================================================================
149 
150 //====================================================================================================
151 // Device state change reason codes
152 // Taken from NetworkManager.h
153 //====================================================================================================
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
209 //====================================================================================================
210 
211 class TQT_DBusObjectPath;
212 class TDENetworkConnectionManager_BackendNMPrivate;
213 
214 class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkConnectionManager
215 {
216  TQ_OBJECT
217 
218  public:
219  TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice);
220  ~TDENetworkConnectionManager_BackendNM();
221 
222  virtual TQString backendName();
223  virtual TDENetworkDeviceType::TDENetworkDeviceType deviceType();
224  virtual TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags backendStatus();
225  virtual TDENetworkDeviceInformation deviceInformation();
226  virtual TDENetworkDeviceInformation deviceStatus();
227 
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);
234 
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();
239 
240  virtual TDENetworkHWNeighborList* siteSurvey();
241  virtual TQStringList connectionPhysicalDeviceUUIDs(TQString uuid);
242  virtual TDENetworkVPNTypeList availableVPNTypes();
243 
244  virtual bool networkingEnabled();
245  virtual bool wiFiHardwareEnabled();
246 
247  virtual bool enableNetworking(bool enable);
248  virtual bool enableWiFi(bool enable);
249  virtual bool wiFiEnabled();
250 
251  virtual TQStringList defaultNetworkDevices();
252 
253  private:
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);
260 
261  private:
262  TDENetworkConnectionManager_BackendNMPrivate* d;
263  friend class TDENetworkConnectionManager_BackendNMPrivate;
264 };
265 
266 #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.8.13
This website is maintained by Timothy Pearson.