---
title: llarp::vpn::Platform
summary: a vpn platform responsible for obtaining vpn interfaces 

---

# llarp::vpn::Platform



a vpn platform responsible for obtaining vpn interfaces 


`#include <vpn.hpp>`

Inherited by [llarp::apple::VPNPlatform](Classes/classllarp_1_1apple_1_1VPNPlatform.md), [llarp::vpn::AndroidPlatform](Classes/classllarp_1_1vpn_1_1AndroidPlatform.md), [llarp::vpn::LinuxPlatform](Classes/classllarp_1_1vpn_1_1LinuxPlatform.md), [llarp::win32::VPNPlatform](Classes/classllarp_1_1win32_1_1VPNPlatform.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[Platform](Classes/classllarp_1_1vpn_1_1Platform.md#function-platform)**() =default |
| | **[Platform](Classes/classllarp_1_1vpn_1_1Platform.md#function-platform)**(const [Platform](Classes/classllarp_1_1vpn_1_1Platform.md) & ) =delete |
| | **[Platform](Classes/classllarp_1_1vpn_1_1Platform.md#function-platform)**([Platform](Classes/classllarp_1_1vpn_1_1Platform.md) && ) =delete |
| virtual | **[~Platform](Classes/classllarp_1_1vpn_1_1Platform.md#function-~platform)**() =default |
| std::shared_ptr< [NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md) > | **[CreateInterface](Classes/classllarp_1_1vpn_1_1Platform.md#function-createinterface)**([InterfaceInfo](Classes/structllarp_1_1vpn_1_1InterfaceInfo.md) info, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * router)<br>create and start a network interface  |
| virtual [IRouteManager](Classes/classllarp_1_1vpn_1_1IRouteManager.md) & | **[RouteManager](Classes/classllarp_1_1vpn_1_1Platform.md#function-routemanager)**() =0<br>get owned ip route manager for managing routing table  |
| virtual std::shared_ptr< [I_PacketIntercepter](Classes/classllarp_1_1vpn_1_1I__PacketIntercepter.md) > | **[make_packet_intercepter](Classes/classllarp_1_1vpn_1_1Platform.md#function-make-packet-intercepter)**(unsigned int index)<br>create a packet intercepter that will intercept and optionally hook / reinject ip packets.  |

## Protected Functions

|                | Name           |
| -------------- | -------------- |
| virtual std::shared_ptr< [NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md) > | **[ObtainInterface](Classes/classllarp_1_1vpn_1_1Platform.md#function-obtaininterface)**([InterfaceInfo](Classes/structllarp_1_1vpn_1_1InterfaceInfo.md) info, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * router) =0<br>get a new network interface fully configured given the interface info blocks until ready, throws on error  |

## Public Functions Documentation

### function Platform

```cpp
Platform() =default
```


### function Platform

```cpp
Platform(
    const Platform & 
) =delete
```


### function Platform

```cpp
Platform(
    Platform && 
) =delete
```


### function ~Platform

```cpp
virtual ~Platform() =default
```


### function CreateInterface

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

create and start a network interface 

### function RouteManager

```cpp
virtual IRouteManager & RouteManager() =0
```

get owned ip route manager for managing routing table 

**Reimplemented by**: [llarp::apple::VPNPlatform::RouteManager](Classes/classllarp_1_1apple_1_1VPNPlatform.md#function-routemanager), [llarp::vpn::AndroidPlatform::RouteManager](Classes/classllarp_1_1vpn_1_1AndroidPlatform.md#function-routemanager), [llarp::vpn::LinuxPlatform::RouteManager](Classes/classllarp_1_1vpn_1_1LinuxPlatform.md#function-routemanager), [llarp::win32::VPNPlatform::RouteManager](Classes/classllarp_1_1win32_1_1VPNPlatform.md#function-routemanager)


### function make_packet_intercepter

```cpp
inline virtual std::shared_ptr< I_PacketIntercepter > make_packet_intercepter(
    unsigned int index
)
```

create a packet intercepter that will intercept and optionally hook / reinject ip packets. 

**Parameters**: 

  * **index** the interface index of the network interface to snoop on or 0 for all interfaces on the system 


**Reimplemented by**: [llarp::win32::VPNPlatform::make_packet_intercepter](Classes/classllarp_1_1win32_1_1VPNPlatform.md#function-make-packet-intercepter)


throws on failure 


## Protected Functions Documentation

### function ObtainInterface

```cpp
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](Classes/classllarp_1_1vpn_1_1AndroidPlatform.md#function-obtaininterface), [llarp::vpn::LinuxPlatform::ObtainInterface](Classes/classllarp_1_1vpn_1_1LinuxPlatform.md#function-obtaininterface), [llarp::win32::VPNPlatform::ObtainInterface](Classes/classllarp_1_1win32_1_1VPNPlatform.md#function-obtaininterface), [llarp::apple::VPNPlatform::ObtainInterface](Classes/classllarp_1_1apple_1_1VPNPlatform.md#function-obtaininterface)


-------------------------------

Updated on 2022-09-01 at 18:16:54 +0000