mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
719 B
C++
23 lines
719 B
C++
3 years ago
|
#include "vpn_platform.hpp"
|
||
|
#include "context.hpp"
|
||
|
|
||
|
namespace llarp::apple
|
||
|
{
|
||
|
VPNPlatform::VPNPlatform(
|
||
|
Context& ctx,
|
||
|
VPNInterface::packet_write_callback packet_writer,
|
||
|
VPNInterface::on_readable_callback on_readable,
|
||
|
llarp_route_callbacks route_callbacks,
|
||
|
void* callback_context)
|
||
|
: m_Context{ctx}
|
||
|
, m_RouteManager{ctx, std::move(route_callbacks), callback_context}
|
||
|
, m_PacketWriter{std::move(packet_writer)}
|
||
|
, m_OnReadable{std::move(on_readable)}
|
||
|
{}
|
||
|
|
||
|
std::shared_ptr<vpn::NetworkInterface> VPNPlatform::ObtainInterface(vpn::InterfaceInfo)
|
||
|
{
|
||
|
return std::make_shared<VPNInterface>(m_Context, m_PacketWriter, m_OnReadable);
|
||
|
}
|
||
|
} // namespace llarp::apple
|