ikev2 winapi test solution
This commit is contained in:
parent
8c679a08c4
commit
b4007038fb
3 changed files with 397 additions and 97 deletions
|
|
@ -11,20 +11,26 @@
|
|||
#include "core/ipcclient.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <ras.h>
|
||||
#include <Ras.h>
|
||||
#include <raserror.h>
|
||||
#include <shlwapi.h>
|
||||
|
||||
#include <wincrypt.h>
|
||||
|
||||
#pragma comment(lib, "shlwapi.lib")
|
||||
#pragma comment(lib, "rasapi32.lib")
|
||||
#pragma comment(lib, "Crypt32.lib")
|
||||
|
||||
#define RASBUFFER 0x1000
|
||||
#define RASMAXENUM 0x100
|
||||
#endif
|
||||
|
||||
class Ikev2Protocol : public VpnProtocol
|
||||
|
|
@ -43,14 +49,39 @@ public:
|
|||
private:
|
||||
void readIkev2Configuration(const QJsonObject &configuration);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
//certificates variables
|
||||
|
||||
#endif
|
||||
private:
|
||||
QJsonObject m_config;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
HRASCONN g_h;
|
||||
int g_done = 0;
|
||||
//RAS functions and parametrs
|
||||
HRASCONN hRasConn{nullptr};
|
||||
// bool create_new_vpn(const QString & vpn_name,
|
||||
// const QString & serv_addr);
|
||||
bool delete_vpn_connection(const QString &vpn_name);
|
||||
|
||||
bool connect_to_vpn(const QString & vpn_name);
|
||||
bool disconnect_vpn();
|
||||
static void WINAPI RasDialFuncCallback(UINT unMsg,
|
||||
RASCONNSTATE rasconnstate,
|
||||
DWORD dwError );
|
||||
|
||||
|
||||
std::unique_ptr<std::thread> _thr{nullptr};
|
||||
void _ikev2_states();
|
||||
std::atomic_bool _stoped{false};
|
||||
|
||||
std::unique_ptr<std::thread>_th_conn_state{nullptr};
|
||||
void conn_state();
|
||||
signals:
|
||||
//void Ikev2_connected();
|
||||
//void Ikev2_disconnected();
|
||||
//void Ikev2_state(int);
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue