---
title: llarp::apple::Context

---

# llarp::apple::Context





Inherits from [llarp::Context](Classes/structllarp_1_1Context.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| virtual std::shared_ptr< [vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md) > | **[makeVPNPlatform](Classes/structllarp_1_1apple_1_1Context.md#function-makevpnplatform)**() override<br>create the vpn platform for use in creating network interfaces  |
| virtual std::shared_ptr< [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) > | **[makeRouter](Classes/structllarp_1_1apple_1_1Context.md#function-makerouter)**(const std::shared_ptr< [EventLoop](Classes/classllarp_1_1EventLoop.md) > & loop) override<br>Creates a router.  |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| packet_write_callback | **[write_packet](Classes/structllarp_1_1apple_1_1Context.md#variable-write-packet)**  |
| on_readable_callback | **[on_readable](Classes/structllarp_1_1apple_1_1Context.md#variable-on-readable)**  |
| llarp_route_callbacks | **[route_callbacks](Classes/structllarp_1_1apple_1_1Context.md#variable-route-callbacks)**  |
| void * | **[callback_context](Classes/structllarp_1_1apple_1_1Context.md#variable-callback-context)**  |

## Additional inherited members

**Public Functions inherited from [llarp::Context](Classes/structllarp_1_1Context.md)**

|                | Name           |
| -------------- | -------------- |
| | **[Context](Classes/structllarp_1_1Context.md#function-context)**() |
| virtual | **[~Context](Classes/structllarp_1_1Context.md#function-~context)**() =default |
| void | **[Setup](Classes/structllarp_1_1Context.md#function-setup)**(const [RuntimeOptions](Classes/structllarp_1_1RuntimeOptions.md) & opts) |
| int | **[Run](Classes/structllarp_1_1Context.md#function-run)**(const [RuntimeOptions](Classes/structllarp_1_1RuntimeOptions.md) & opts) |
| void | **[HandleSignal](Classes/structllarp_1_1Context.md#function-handlesignal)**(int sig) |
| void | **[Configure](Classes/structllarp_1_1Context.md#function-configure)**(std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > conf)<br>Configure given the specified config.  |
| void | **[Reload](Classes/structllarp_1_1Context.md#function-reload)**()<br>handle SIGHUP  |
| bool | **[IsUp](Classes/structllarp_1_1Context.md#function-isup)**() const |
| bool | **[LooksAlive](Classes/structllarp_1_1Context.md#function-looksalive)**() const |
| bool | **[IsStopping](Classes/structllarp_1_1Context.md#function-isstopping)**() const |
| void | **[CloseAsync](Classes/structllarp_1_1Context.md#function-closeasync)**()<br>close async  |
| void | **[Wait](Classes/structllarp_1_1Context.md#function-wait)**()<br>wait until closed and done  |
| bool | **[CallSafe](Classes/structllarp_1_1Context.md#function-callsafe)**(std::function< void(void)> f)<br>call a function in logic thread return true if queued for calling return false if not queued for calling  |
| virtual std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > | **[makeNodeDB](Classes/structllarp_1_1Context.md#function-makenodedb)**()<br>create the nodedb given our current configs  |

**Public Attributes inherited from [llarp::Context](Classes/structllarp_1_1Context.md)**

|                | Name           |
| -------------- | -------------- |
| std::shared_ptr< [Crypto](Classes/structllarp_1_1Crypto.md) > | **[crypto](Classes/structllarp_1_1Context.md#variable-crypto)**  |
| std::shared_ptr< [CryptoManager](Classes/structllarp_1_1CryptoManager.md) > | **[cryptoManager](Classes/structllarp_1_1Context.md#variable-cryptomanager)**  |
| std::shared_ptr< [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) > | **[router](Classes/structllarp_1_1Context.md#variable-router)**  |
| std::shared_ptr< [EventLoop](Classes/classllarp_1_1EventLoop.md) > | **[loop](Classes/structllarp_1_1Context.md#variable-loop)**  |
| std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > | **[nodedb](Classes/structllarp_1_1Context.md#variable-nodedb)**  |
| int | **[androidFD](Classes/structllarp_1_1Context.md#variable-androidfd)**  |

**Protected Attributes inherited from [llarp::Context](Classes/structllarp_1_1Context.md)**

|                | Name           |
| -------------- | -------------- |
| std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > | **[config](Classes/structllarp_1_1Context.md#variable-config)**  |


## Public Functions Documentation

### function makeVPNPlatform

```cpp
inline virtual std::shared_ptr< vpn::Platform > makeVPNPlatform() override
```

create the vpn platform for use in creating network interfaces 

**Reimplements**: [llarp::Context::makeVPNPlatform](Classes/structllarp_1_1Context.md#function-makevpnplatform)


### function makeRouter

```cpp
inline virtual std::shared_ptr< AbstractRouter > makeRouter(
    const std::shared_ptr< EventLoop > & loop
) override
```

Creates a router. 

**Reimplements**: [llarp::Context::makeRouter](Classes/structllarp_1_1Context.md#function-makerouter)


Can be overridden to allow a different class of router to be created instead. Defaults to [llarp::Router](Classes/structllarp_1_1Router.md). 


## Public Attributes Documentation

### variable write_packet

```cpp
packet_write_callback write_packet;
```


### variable on_readable

```cpp
on_readable_callback on_readable;
```


### variable route_callbacks

```cpp
llarp_route_callbacks route_callbacks {};
```


### variable callback_context

```cpp
void * callback_context = nullptr;
```


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

Updated on 2023-04-27 at 04:17:17 +0000