---
title: llarp::apple::VPNPlatform

---

# llarp::apple::VPNPlatform





Inherits from [llarp::vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[VPNPlatform](Classes/classllarp_1_1apple_1_1VPNPlatform.md#function-vpnplatform)**([Context](Classes/structllarp_1_1apple_1_1Context.md) & ctx, VPNInterface::packet_write_callback packet_writer, VPNInterface::on_readable_callback on_readable, llarp_route_callbacks route_callbacks, void * callback_context) |
| virtual std::shared_ptr< [vpn::NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md) > | **[ObtainInterface](Classes/classllarp_1_1apple_1_1VPNPlatform.md#function-obtaininterface)**([vpn::InterfaceInfo](Classes/structllarp_1_1vpn_1_1InterfaceInfo.md) info, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * router) override<br>get a new network interface fully configured given the interface info blocks until ready, throws on error  |
| virtual [vpn::IRouteManager](Classes/classllarp_1_1vpn_1_1IRouteManager.md) & | **[RouteManager](Classes/classllarp_1_1apple_1_1VPNPlatform.md#function-routemanager)**() override<br>get owned ip route manager for managing routing table  |

## Additional inherited members

**Public Functions inherited from [llarp::vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md)**

|                | 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 std::shared_ptr< [I_Packet_IO](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md) > | **[create_packet_io](Classes/classllarp_1_1vpn_1_1Platform.md#function-create-packet-io)**(] unsigned int ifindex, ] const std::optional< [SockAddr](Classes/structllarp_1_1SockAddr.md) > & dns_upstream_src)<br>create a packet io that will read (and optionally write) packets on a network interface the lokinet process does not own  |


## Public Functions Documentation

### function VPNPlatform

```cpp
explicit VPNPlatform(
    Context & ctx,
    VPNInterface::packet_write_callback packet_writer,
    VPNInterface::on_readable_callback on_readable,
    llarp_route_callbacks route_callbacks,
    void * callback_context
)
```


### function ObtainInterface

```cpp
virtual std::shared_ptr< vpn::NetworkInterface > ObtainInterface(
    vpn::InterfaceInfo info,
    AbstractRouter * router
) override
```

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

**Reimplements**: [llarp::vpn::Platform::ObtainInterface](Classes/classllarp_1_1vpn_1_1Platform.md#function-obtaininterface)


### function RouteManager

```cpp
inline virtual vpn::IRouteManager & RouteManager() override
```

get owned ip route manager for managing routing table 

**Reimplements**: [llarp::vpn::Platform::RouteManager](Classes/classllarp_1_1vpn_1_1Platform.md#function-routemanager)


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

Updated on 2023-02-01 at 20:39:32 +0000