lokinet/llarp/vpn/packet_intercept.hpp
dr7ana f574cd798f Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
2024-01-31 07:54:12 -08:00

29 lines
713 B
C++

#pragma once
#include <llarp/util/types.hpp>
#include <functional>
#include <vector>
namespace llarp::vpn
{
using PacketSendFunc_t = std::function<void(std::vector<byte_t>)>;
using PacketInterceptFunc_t = std::function<void(std::vector<byte_t>, PacketSendFunc_t)>;
class I_PacketInterceptor
{
public:
virtual ~I_PacketInterceptor() = default;
/// start intercepting packets and call a callback for each one we get
/// the callback passes in an ip packet and a function that we can use to send an ip packet to
/// its origin
virtual void
start(PacketInterceptFunc_t f) = 0;
/// stop intercepting packets
virtual void
stop() = 0;
};
} // namespace llarp::vpn