lomiri-connectivity-api
openvpn-connection.h
Go to the documentation of this file.
1/*
2 * Copyright © 2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Pete Woods <pete.woods@canonical.com>
18 */
19
20#pragma once
21
23
24namespace connectivityqt
25{
26
27class Q_DECL_EXPORT OpenvpnConnection : public VpnConnection
28{
29 Q_OBJECT
30
31public:
33
34 Q_ENUMS(ConnectionType)
42
43 Q_ENUMS(DevType)
45 {
48 };
49
50 Q_ENUMS(Cipher)
71
72 Q_ENUMS(Auth)
86
87 Q_ENUMS(TlsType)
89 {
92 };
93
94 Q_ENUMS(KeyDir)
95 enum KeyDir
96 {
100 };
101
102 Q_ENUMS(ProxyType)
109
110 OpenvpnConnection(const QDBusObjectPath& path, const QDBusConnection& connection);
111
112 virtual ~OpenvpnConnection();
113
114 Type type() const override;
115
116 // Basic properties
117
118 Q_PROPERTY(QString ca READ ca WRITE setCa NOTIFY caChanged)
119 QString ca() const;
120
121 Q_PROPERTY(QString cert READ cert WRITE setCert NOTIFY certChanged)
122 QString cert() const;
123
124 Q_PROPERTY(QString certPass READ certPass WRITE setCertPass NOTIFY certPassChanged)
125 QString certPass() const;
126
129
130 Q_PROPERTY(QString key READ key WRITE setKey NOTIFY keyChanged)
131 QString key() const;
132
133 Q_PROPERTY(QString localIp READ localIp WRITE setLocalIp NOTIFY localIpChanged)
134 QString localIp() const;
135
136 Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
137 QString password() const;
138
139 Q_PROPERTY(QString remote READ remote WRITE setRemote NOTIFY remoteChanged)
140 QString remote() const;
141
142 Q_PROPERTY(QString remoteIp READ remoteIp WRITE setRemoteIp NOTIFY remoteIpChanged)
143 QString remoteIp() const;
144
145 Q_PROPERTY(QString staticKey READ staticKey WRITE setStaticKey NOTIFY staticKeyChanged)
146 QString staticKey() const;
147
150
151 Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged)
152 QString username() const;
153
154 // Advanced general properties
155
156 Q_PROPERTY(int port READ port WRITE setPort NOTIFY portChanged)
157 int port() const;
158
159 Q_PROPERTY(bool portSet READ portSet WRITE setPortSet NOTIFY portSetChanged)
160 bool portSet() const;
161
163 int renegSeconds() const;
164
166 bool renegSecondsSet() const;
167
168 Q_PROPERTY(bool compLzo READ compLzo WRITE setCompLzo NOTIFY compLzoChanged)
169 bool compLzo() const;
170
171 Q_PROPERTY(bool protoTcp READ protoTcp WRITE setProtoTcp NOTIFY protoTcpChanged)
172 bool protoTcp() const;
173
174 Q_PROPERTY(QString dev READ dev WRITE setDev NOTIFY devChanged)
175 QString dev() const;
176
177 Q_PROPERTY(DevType devType READ devType WRITE setDevType NOTIFY devTypeChanged)
179
180 Q_PROPERTY(bool devTypeSet READ devTypeSet WRITE setDevTypeSet NOTIFY devTypeSetChanged)
181 bool devTypeSet() const;
182
183 Q_PROPERTY(int tunnelMtu READ tunnelMtu WRITE setTunnelMtu NOTIFY tunnelMtuChanged)
184 int tunnelMtu() const;
185
187 bool tunnelMtuSet() const;
188
190 int fragmentSize() const;
191
193 bool fragmentSizeSet() const;
194
195 Q_PROPERTY(bool mssFix READ mssFix WRITE setMssFix NOTIFY mssFixChanged)
196 bool mssFix() const;
197
199 bool remoteRandom() const;
200
201 // Advanced security properties
202
203 Q_PROPERTY(Cipher cipher READ cipher WRITE setCipher NOTIFY cipherChanged)
204 Cipher cipher() const;
205
206 Q_PROPERTY(int keysize READ keysize WRITE setKeysize NOTIFY keysizeChanged)
207 int keysize() const;
208
209 Q_PROPERTY(bool keysizeSet READ keysizeSet WRITE setKeysizeSet NOTIFY keysizeSetChanged)
210 bool keysizeSet() const;
211
212 Q_PROPERTY(Auth auth READ auth WRITE setAuth NOTIFY authChanged)
213 Auth auth() const;
214
215 // Advanced TLS auth properties
216
217 Q_PROPERTY(QString tlsRemote READ tlsRemote WRITE setTlsRemote NOTIFY tlsRemoteChanged)
218 QString tlsRemote() const;
219
222
224 bool remoteCertTlsSet() const;
225
226 Q_PROPERTY(QString ta READ ta WRITE setTa NOTIFY taChanged)
227 QString ta() const;
228
229 Q_PROPERTY(KeyDir taDir READ taDir WRITE setTaDir NOTIFY taDirChanged)
230 KeyDir taDir() const;
231
232 Q_PROPERTY(bool taSet READ taSet WRITE setTaSet NOTIFY taSetChanged)
233 bool taSet() const;
234
235 // Advanced proxy settings
236
239
240 Q_PROPERTY(QString proxyServer READ proxyServer WRITE setProxyServer NOTIFY proxyServerChanged)
241 QString proxyServer() const;
242
243 Q_PROPERTY(int proxyPort READ proxyPort WRITE setProxyPort NOTIFY proxyPortChanged)
244 int proxyPort() const;
245
246 Q_PROPERTY(bool proxyRetry READ proxyRetry WRITE setProxyRetry NOTIFY proxyRetryChanged)
247 bool proxyRetry() const;
248
250 QString proxyUsername() const;
251
253 QString proxyPassword() const;
254
255public Q_SLOTS:
256 // Basic properties
257
258 void setCa(const QString &value);
259
260 void setCert(const QString &value);
261
262 void setCertPass(const QString &value);
263
265
266 void setKey(const QString &value);
267
268 void setLocalIp(const QString &value);
269
270 void setPassword(const QString &value);
271
272 void setRemote(const QString &value);
273
274 void setRemoteIp(const QString &value);
275
276 void setStaticKey(const QString &value);
277
279
280 void setUsername(const QString &value);
281
282 // Advanced general properties
283
284 void setPort(int value);
285
286 void setPortSet(bool value);
287
288 void setRenegSeconds(int value);
289
290 void setRenegSecondsSet(bool value);
291
292 void setCompLzo(bool value);
293
294 void setProtoTcp(bool value);
295
296 void setDev(const QString &value);
297
298 void setDevType(DevType value);
299
300 void setDevTypeSet(bool value);
301
302 void setTunnelMtu(int value);
303
304 void setTunnelMtuSet(bool value);
305
306 void setFragmentSize(int value);
307
308 void setFragmentSizeSet(bool value);
309
310 void setMssFix(bool value);
311
312 void setRemoteRandom(bool value);
313
314 // Advanced security properties
315
316 void setCipher(Cipher value);
317
318 void setKeysize(int value);
319
320 void setKeysizeSet(bool value);
321
322 void setAuth(Auth value);
323
324 // Advanced TLS auth properties
325
326 void setTlsRemote(const QString &value);
327
329
330 void setRemoteCertTlsSet(bool value);
331
332 void setTa(const QString &value);
333
334 void setTaDir(KeyDir value);
335
336 void setTaSet(bool value);
337
338 // Advanced proxy settings
339
341
342 void setProxyServer(const QString &value);
343
344 void setProxyPort(int value);
345
346 void setProxyRetry(bool value);
347
348 void setProxyUsername(const QString &value);
349
350 void setProxyPassword(const QString &value);
351
352Q_SIGNALS:
353 // Basic properties
354
355 void caChanged(const QString &value);
356
357 void certChanged(const QString &value);
358
359 void certPassChanged(const QString &value);
360
362
363 void keyChanged(const QString &value);
364
365 void localIpChanged(const QString &value);
366
367 void passwordChanged(const QString &value);
368
369 void remoteChanged(const QString &value);
370
371 void remoteIpChanged(const QString &value);
372
373 void staticKeyChanged(const QString &value);
374
376
377 void usernameChanged(const QString &value);
378
379 // Advanced general properties
380
381 void portChanged(int value);
382
383 void portSetChanged(bool value);
384
385 void renegSecondsChanged(int value);
386
387 void renegSecondsSetChanged(bool value);
388
389 void compLzoChanged(bool value);
390
391 void protoTcpChanged(bool value);
392
393 void devChanged(const QString &value);
394
396
397 void devTypeSetChanged(bool value);
398
399 void tunnelMtuChanged(int value);
400
401 void tunnelMtuSetChanged(bool value);
402
403 void fragmentSizeChanged(int value);
404
405 void fragmentSizeSetChanged(bool value);
406
407 void mssFixChanged(bool value);
408
409 void remoteRandomChanged(bool value);
410
411 // Advanced security properties
412
414
415 void keysizeChanged(int value);
416
417 void keysizeSetChanged(bool value);
418
419 void authChanged(Auth value);
420
421 // Advanced TLS auth properties
422
423 void tlsRemoteChanged(const QString &value);
424
426
427 void remoteCertTlsSetChanged(bool value);
428
429 void taChanged(const QString &value);
430
431 void taDirChanged(KeyDir value);
432
433 void taSetChanged(bool value);
434
435 // Advanced proxy tings
436
438
439 void proxyServerChanged(const QString &value);
440
441 void proxyPortChanged(int value);
442
443 void proxyRetryChanged(bool value);
444
445 void proxyUsernameChanged(const QString &value);
446
447 void proxyPasswordChanged(const QString &value);
448
449protected:
450 class Priv;
451 std::shared_ptr<Priv> d;
452};
453
454}
Definition openvpn-connection.h:28
int port
Definition openvpn-connection.h:156
void certPassChanged(const QString &value)
void setCa(const QString &value)
void staticKeyDirectionChanged(KeyDir value)
void setTa(const QString &value)
void setCertPass(const QString &value)
Auth auth
Definition openvpn-connection.h:212
std::shared_ptr< Priv > d
Definition openvpn-connection.h:451
QString cert
Definition openvpn-connection.h:121
Auth
Definition openvpn-connection.h:74
@ RSA_MD4
Definition openvpn-connection.h:77
@ SHA1
Definition openvpn-connection.h:79
@ SHA384
Definition openvpn-connection.h:82
@ DEFAULT_AUTH
Definition openvpn-connection.h:75
@ SHA224
Definition openvpn-connection.h:80
@ MD5
Definition openvpn-connection.h:78
@ RIPEMD160
Definition openvpn-connection.h:84
@ SHA512
Definition openvpn-connection.h:83
@ NONE
Definition openvpn-connection.h:76
@ SHA256
Definition openvpn-connection.h:81
QString staticKey
Definition openvpn-connection.h:145
void proxyPasswordChanged(const QString &value)
KeyDir staticKeyDirection
Definition openvpn-connection.h:148
void setProxyPassword(const QString &value)
int proxyPort
Definition openvpn-connection.h:243
void fragmentSizeSetChanged(bool value)
void remoteCertTlsSetChanged(bool value)
QString remoteIp
Definition openvpn-connection.h:142
void setCert(const QString &value)
int keysize
Definition openvpn-connection.h:206
void cipherChanged(Cipher value)
void passwordChanged(const QString &value)
void setConnectionType(ConnectionType connectionType)
bool mssFix
Definition openvpn-connection.h:195
QString proxyServer
Definition openvpn-connection.h:240
void setRemoteIp(const QString &value)
void devChanged(const QString &value)
bool fragmentSizeSet
Definition openvpn-connection.h:192
void remoteRandomChanged(bool value)
void remoteChanged(const QString &value)
void setDev(const QString &value)
void setRemote(const QString &value)
void keyChanged(const QString &value)
void tunnelMtuSetChanged(bool value)
TlsType
Definition openvpn-connection.h:89
@ CLIENT
Definition openvpn-connection.h:91
@ SERVER
Definition openvpn-connection.h:90
QString certPass
Definition openvpn-connection.h:124
bool keysizeSet
Definition openvpn-connection.h:209
bool remoteCertTlsSet
Definition openvpn-connection.h:223
void setTlsRemote(const QString &value)
bool protoTcp
Definition openvpn-connection.h:171
DevType
Definition openvpn-connection.h:45
@ TAP
Definition openvpn-connection.h:47
@ TUN
Definition openvpn-connection.h:46
QString dev
Definition openvpn-connection.h:174
void taChanged(const QString &value)
void renegSecondsSetChanged(bool value)
bool tunnelMtuSet
Definition openvpn-connection.h:186
void connectionTypeChanged(ConnectionType connectionType)
ProxyType
Definition openvpn-connection.h:104
@ NOT_REQUIRED
Definition openvpn-connection.h:105
@ SOCKS
Definition openvpn-connection.h:107
@ HTTP
Definition openvpn-connection.h:106
TlsType remoteCertTls
Definition openvpn-connection.h:220
void proxyUsernameChanged(const QString &value)
int tunnelMtu
Definition openvpn-connection.h:183
void remoteIpChanged(const QString &value)
DevType devType
Definition openvpn-connection.h:177
ConnectionType connectionType
Definition openvpn-connection.h:127
bool portSet
Definition openvpn-connection.h:159
bool proxyRetry
Definition openvpn-connection.h:246
QString proxyUsername
Definition openvpn-connection.h:249
void setProxyUsername(const QString &value)
void caChanged(const QString &value)
void tlsRemoteChanged(const QString &value)
QString remote
Definition openvpn-connection.h:139
void setDevType(DevType value)
KeyDir
Definition openvpn-connection.h:96
@ ZERO
Definition openvpn-connection.h:98
@ ONE
Definition openvpn-connection.h:99
@ KEY_NONE
Definition openvpn-connection.h:97
void proxyServerChanged(const QString &value)
void staticKeyChanged(const QString &value)
void setUsername(const QString &value)
bool taSet
Definition openvpn-connection.h:232
void setKey(const QString &value)
void localIpChanged(const QString &value)
QString proxyPassword
Definition openvpn-connection.h:252
QString password
Definition openvpn-connection.h:136
void setPassword(const QString &value)
void usernameChanged(const QString &value)
bool compLzo
Definition openvpn-connection.h:168
bool renegSecondsSet
Definition openvpn-connection.h:165
KeyDir taDir
Definition openvpn-connection.h:229
QString localIp
Definition openvpn-connection.h:133
QString ta
Definition openvpn-connection.h:226
void remoteCertTlsChanged(TlsType value)
void setRemoteCertTlsSet(bool value)
void setStaticKeyDirection(KeyDir value)
ProxyType proxyType
Definition openvpn-connection.h:237
Cipher
Definition openvpn-connection.h:52
@ AES_128_CBC
Definition openvpn-connection.h:61
@ RC2_40_CBC
Definition openvpn-connection.h:59
@ DES_EDE3_CBC
Definition openvpn-connection.h:57
@ RC2_CBC
Definition openvpn-connection.h:55
@ DESX_CBC
Definition openvpn-connection.h:58
@ AES_128_CBC_HMAC_SHA1
Definition openvpn-connection.h:68
@ CAMELLIA_192_CBC
Definition openvpn-connection.h:65
@ SEED_CBC
Definition openvpn-connection.h:67
@ AES_256_CBC_HMAC_SHA1
Definition openvpn-connection.h:69
@ DES_CBC
Definition openvpn-connection.h:54
@ DEFAULT_CIPHER
Definition openvpn-connection.h:53
@ AES_256_CBC
Definition openvpn-connection.h:63
@ AES_192_CBC
Definition openvpn-connection.h:62
@ DES_EDE_CBC
Definition openvpn-connection.h:56
@ CAST5_CBC
Definition openvpn-connection.h:60
@ CAMELLIA_256_CBC
Definition openvpn-connection.h:66
@ CAMELLIA_128_CBC
Definition openvpn-connection.h:64
void setProxyServer(const QString &value)
ConnectionType
Definition openvpn-connection.h:36
@ TLS
Definition openvpn-connection.h:37
@ PASSWORD_TLS
Definition openvpn-connection.h:39
@ STATIC_KEY
Definition openvpn-connection.h:40
@ PASSWORD
Definition openvpn-connection.h:38
QString tlsRemote
Definition openvpn-connection.h:217
void setProxyType(ProxyType value)
Cipher cipher
Definition openvpn-connection.h:203
int fragmentSize
Definition openvpn-connection.h:189
void setLocalIp(const QString &value)
void certChanged(const QString &value)
bool devTypeSet
Definition openvpn-connection.h:180
void proxyTypeChanged(ProxyType value)
QString username
Definition openvpn-connection.h:151
QString key
Definition openvpn-connection.h:130
bool remoteRandom
Definition openvpn-connection.h:198
QString ca
Definition openvpn-connection.h:118
void setRemoteCertTls(TlsType value)
OpenvpnConnection(const QDBusObjectPath &path, const QDBusConnection &connection)
Definition openvpn-connection.cpp:148
LOMIRI_DEFINES_PTRS(OpenvpnConnection)
void setStaticKey(const QString &value)
int renegSeconds
Definition openvpn-connection.h:162
void devTypeChanged(DevType value)
VpnConnection(const QDBusObjectPath &path, const QDBusConnection &connection, QObject *parent=0)
Definition vpn-connection.cpp:70
Definition connectivity.cpp:37