mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
46 lines
798 B
C++
46 lines
798 B
C++
#ifndef LLARP_ROUTING_MESSAGE_HPP
|
|
#define LLARP_ROUTING_MESSAGE_HPP
|
|
|
|
#include <constants/proto.hpp>
|
|
#include <path/path_types.hpp>
|
|
#include <util/buffer.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
struct AbstractRouter;
|
|
namespace routing
|
|
{
|
|
struct IMessageHandler;
|
|
|
|
struct IMessage
|
|
{
|
|
PathID_t from;
|
|
uint64_t S;
|
|
uint64_t version = LLARP_PROTO_VERSION;
|
|
|
|
IMessage() : S(0)
|
|
{
|
|
}
|
|
|
|
virtual ~IMessage()
|
|
{
|
|
}
|
|
|
|
virtual bool
|
|
BEncode(llarp_buffer_t* buf) const = 0;
|
|
|
|
virtual bool
|
|
DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) = 0;
|
|
|
|
virtual bool
|
|
HandleMessage(IMessageHandler* h, AbstractRouter* r) const = 0;
|
|
|
|
virtual void
|
|
Clear() = 0;
|
|
};
|
|
|
|
} // namespace routing
|
|
} // namespace llarp
|
|
|
|
#endif
|