mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
7caa87862e
All #ifndef guards on headers have been removed, I think, in favor of #pragma once Headers are now included as `#include "filename"` if the included file resides in the same directory as the file including it, or any subdirectory therein. Otherwise they are included as `#include <project/top/dir/relative/path/filename>` The above does not include system/os headers.
44 lines
801 B
C++
44 lines
801 B
C++
#pragma once
|
|
#include <llarp/net/ip_packet.hpp>
|
|
#include <llarp/util/thread/queue.hpp>
|
|
#include <llarp.hpp>
|
|
#include <functional>
|
|
|
|
struct llarp_main;
|
|
struct llarp_vpn_io;
|
|
|
|
struct llarp_vpn_pkt_queue
|
|
{
|
|
using Packet_t = llarp::net::IPPacket;
|
|
llarp::thread::Queue<Packet_t> queue;
|
|
|
|
llarp_vpn_pkt_queue() : queue(1024){};
|
|
~llarp_vpn_pkt_queue() = default;
|
|
};
|
|
|
|
struct llarp_vpn_pkt_writer : public llarp_vpn_pkt_queue
|
|
{};
|
|
|
|
struct llarp_vpn_pkt_reader : public llarp_vpn_pkt_queue
|
|
{};
|
|
|
|
struct llarp_vpn_io_impl
|
|
{
|
|
llarp_vpn_io_impl(llarp::Context* c, llarp_vpn_io* io) : ctx(c), parent(io)
|
|
{}
|
|
~llarp_vpn_io_impl() = default;
|
|
|
|
llarp::Context* ctx;
|
|
llarp_vpn_io* parent;
|
|
|
|
llarp_vpn_pkt_writer writer;
|
|
llarp_vpn_pkt_reader reader;
|
|
|
|
void
|
|
AsyncClose();
|
|
|
|
private:
|
|
void
|
|
Expunge();
|
|
};
|