llarp::vpn::Platform

a vpn platform responsible for obtaining vpn interfaces

#include <platform.hpp>

Inherited by llarp::vpn::AndroidPlatform, llarp::vpn::ApplePlatform, llarp::vpn::LinuxPlatform, llarp::win32::VPNPlatform

Public Functions

Name
Platform() =default
Platform(const Platform & ) =delete
Platform(Platform && ) =delete
virtual ~Platform() =default
std::shared_ptr< NetworkInterface > CreateInterface(InterfaceInfo info, AbstractRouter * router)
create and start a network interface
std::shared_ptr< NetworkInterface > CreateDummyInterface(InterfaceInfo )
create a network interface that doesn't actually write packets to the OS but instead only replies to icmp.
virtual IRouteManager & RouteManager() =0
get owned ip route manager for managing routing table
virtual std::shared_ptr< I_Packet_IO > create_packet_io(unsigned int ifindex, const std::optional< SockAddr > & dns_upstream_src)
create a packet io that will read (and optionally write) packets on a network interface the lokinet process does not own

Protected Functions

Name
virtual std::shared_ptr< NetworkInterface > ObtainInterface(InterfaceInfo info, AbstractRouter * router) =0
get a new network interface fully configured given the interface info blocks until ready, throws on error

Public Functions Documentation

function Platform

Platform() =default

function Platform

Platform(
    const Platform & 
) =delete

function Platform

Platform(
    Platform && 
) =delete

function ~Platform

virtual ~Platform() =default

function CreateInterface

inline std::shared_ptr< NetworkInterface > CreateInterface(
    InterfaceInfo info,
    AbstractRouter * router
)

create and start a network interface

function CreateDummyInterface

std::shared_ptr< NetworkInterface > CreateDummyInterface(
    InterfaceInfo 
)

create a network interface that doesn't actually write packets to the OS but instead only replies to icmp.

function RouteManager

virtual IRouteManager & RouteManager() =0

get owned ip route manager for managing routing table

Reimplemented by: llarp::vpn::AndroidPlatform::RouteManager, llarp::vpn::ApplePlatform::RouteManager, llarp::vpn::LinuxPlatform::RouteManager, llarp::win32::VPNPlatform::RouteManager

function create_packet_io

inline virtual std::shared_ptr< I_Packet_IO > create_packet_io(
    unsigned int ifindex,
    const std::optional< SockAddr > & dns_upstream_src
)

create a packet io that will read (and optionally write) packets on a network interface the lokinet process does not own

Parameters:

  • index the interface index of the network interface to use or 0 for all interfaces on the system

Reimplemented by: llarp::win32::VPNPlatform::create_packet_io

Protected Functions Documentation

function ObtainInterface

virtual std::shared_ptr< NetworkInterface > ObtainInterface(
    InterfaceInfo info,
    AbstractRouter * router
) =0

get a new network interface fully configured given the interface info blocks until ready, throws on error

Reimplemented by: llarp::vpn::AndroidPlatform::ObtainInterface, llarp::vpn::ApplePlatform::ObtainInterface, llarp::vpn::LinuxPlatform::ObtainInterface, llarp::win32::VPNPlatform::ObtainInterface


Updated on 2026-01-10 at 22:49:45 +0000