Refactoring

This commit is contained in:
pokamest 2021-01-06 17:12:24 +03:00
parent 13f9764853
commit 5eede71667
21 changed files with 566 additions and 220 deletions

56
client/core/defs.h Normal file
View file

@ -0,0 +1,56 @@
#ifndef DEFS_H
#define DEFS_H
#include <QObject>
namespace amnezia {
enum class Protocol {
Any,
OpenVpn,
ShadowSocks,
WireGuard
};
struct ServerCredentials
{
QString hostName;
QString userName;
QString password;
int port = 22;
};
enum ErrorCode
{
// General error codes
NoError = 0,
UnknownError,
InternalError,
NotImplementedError,
// Server errorz
ServerCheckFailed,
// Ssh connection errors
SshSocketError, SshTimeoutError, SshProtocolError,
SshHostKeyError, SshKeyFileError, SshAuthenticationError,
SshClosedByServerError, SshInternalError,
// Ssh remote process errors
SshRemoteProcessCreationError,
FailedToStartRemoteProcessError, RemoteProcessCrashError,
// Local errors
FailedToSaveConfigData,
OpenVpnConfigMissing,
OpenVpnManagementServerError,
// Distro errors
AmneziaServiceConnectionFailed,
OpenVpnExecutableMissing,
EasyRsaExecutableMissing
};
} // namespace amnezia
#endif // DEFS_H