Added a basic TUN, testing the implementation.

This commit is contained in:
2025-11-13 08:31:46 +01:00
parent aebca5cd7e
commit 5c8409b312
15 changed files with 310 additions and 52 deletions

View File

@@ -13,6 +13,8 @@
#include <array>
#include <algorithm>
#include <vector>
#include <columnlynx/common/net/protocol_structs.hpp>
#include <columnlynx/common/net/virtual_interface.hpp>
using asio::ip::tcp;
@@ -25,7 +27,8 @@ namespace ColumnLynx::Net::TCP {
Utils::LibSodiumWrapper* sodiumWrapper,
std::array<uint8_t, 32>* aesKey,
uint64_t* sessionIDRef,
bool* insecureMode)
bool* insecureMode,
VirtualInterface* tun = nullptr)
:
mResolver(ioContext),
mSocket(ioContext),
@@ -70,5 +73,7 @@ namespace ColumnLynx::Net::TCP {
std::chrono::steady_clock::time_point mLastHeartbeatSent;
int mMissedHeartbeats = 0;
bool mIsHostDomain;
Protocol::TunConfig mTunConfig;
VirtualInterface* mTun = nullptr;
};
}