---
title: llarp/apple/context.hpp

---

# llarp/apple/context.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::apple](Namespaces/namespacellarp_1_1apple.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::apple::Context](Classes/structllarp_1_1apple_1_1Context.md)**  |




## Source code

```cpp
#pragma once

#include <llarp.hpp>
#include "vpn_platform.hpp"
#include "route_manager.hpp"

namespace llarp::apple
{
  struct Context : public llarp::Context
  {
    std::shared_ptr<vpn::Platform>
    makeVPNPlatform() override
    {
      return std::make_shared<VPNPlatform>(
          *this, m_PacketWriter, m_OnReadable, route_callbacks, callback_context);
    }

    // Callbacks that must be set for packet handling *before* calling Setup/Configure/Run; the main
    // point of these is to get passed through to VPNInterface, which will be called during setup,
    // after construction.
    VPNInterface::packet_write_callback m_PacketWriter;
    VPNInterface::on_readable_callback m_OnReadable;
    llarp_route_callbacks route_callbacks{};
    void* callback_context = nullptr;
  };

}  // namespace llarp::apple
```


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

Updated on 2022-11-08 at 16:19:49 +0000
