forked from openconnect/openconnect-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_storage.h
More file actions
127 lines (98 loc) · 3.29 KB
/
server_storage.h
File metadata and controls
127 lines (98 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* Copyright (C) 2014 Red Hat
*
* This file is part of openconnect-gui.
*
* openconnect-gui is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "keypair.h"
class StoredServer {
public:
StoredServer();
~StoredServer();
int load(QString& name);
int save();
const QString& get_username() const;
void set_username(const QString& username);
const QString& get_password() const;
void set_password(const QString& password);
const QString& get_groupname() const;
void set_groupname(const QString& groupname);
const QString& get_servername() const;
void set_servername(const QString& servername);
const QString& get_label() const;
void set_label(const QString& label);
bool get_disable_udp() const;
void set_disable_udp(bool v);
QString get_cert_file();
QString get_key_file();
QString get_key_url() const;
QString get_ca_cert_file();
void clear_cert();
void clear_key();
void clear_ca();
void clear_password();
void clear_groupname();
void clear_server_hash();
QString get_client_cert_hash();
int set_client_cert(const QString& filename);
QString get_ca_cert_hash();
int set_ca_cert(const QString& filename);
bool get_batch_mode() const;
void set_batch_mode(const bool mode);
bool get_minimize() const;
void set_minimize(const bool t);
bool get_proxy() const;
void set_proxy(const bool t);
int get_reconnect_timeout() const;
void set_reconnect_timeout(const int timeout);
int get_dtls_reconnect_timeout() const;
void set_dtls_reconnect_timeout(const int timeout);
QString get_token_str();
void set_token_str(const QString& str);
int get_token_type();
void set_token_type(const int type);
int get_protocol_id() const;
void set_protocol_id(const int id);
const char* get_protocol_name() const;
void set_protocol_name(const QString name);
unsigned get_server_hash(QByteArray& hash) const;
void get_server_hash(QString& hash) const;
void set_server_hash(const unsigned algo, const QByteArray& hash);
bool client_is_complete() const;
void set_window(QWidget* w);
int set_client_key(const QString& filename);
QString m_last_err;
private:
bool m_batch_mode;
bool m_minimize_on_connect;
bool m_proxy;
bool m_disable_udp;
int m_reconnect_timeout;
int m_dtls_attempt_period;
QString m_username;
QString m_password;
QString m_groupname;
QString m_servername;
QString m_token_string;
QString m_label;
int m_token_type;
int m_protocol_id;
QString m_protocol_name;
QByteArray m_server_hash;
unsigned m_server_hash_algo;
Cert m_ca_cert;
KeyPair m_client;
};