1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/llarp/vpn/packet_intercept.hpp
Jason Rhinelander 7a0d4a905e
fix speeling
2022-09-19 20:26:37 -03:00

27 lines
712 B
C++

#pragma once
#include <functional>
#include <vector>
#include <llarp/util/types.hpp>
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