2018-06-22 13:59:28 +00:00
|
|
|
#ifndef LLARP_ROUTING_HANDLER_HPP
|
|
|
|
#define LLARP_ROUTING_HANDLER_HPP
|
|
|
|
|
2018-06-23 00:00:44 +00:00
|
|
|
#include <llarp/buffer.h>
|
2018-06-26 16:23:43 +00:00
|
|
|
#include <llarp/router.h>
|
2018-06-25 15:12:08 +00:00
|
|
|
#include <llarp/dht.hpp>
|
2018-07-23 07:38:29 +00:00
|
|
|
|
2018-06-25 15:12:08 +00:00
|
|
|
#include <llarp/messages/path_confirm.hpp>
|
|
|
|
#include <llarp/messages/path_latency.hpp>
|
2018-09-11 15:28:36 +00:00
|
|
|
|
2018-06-26 16:23:43 +00:00
|
|
|
#include <llarp/messages/path_transfer.hpp>
|
2018-06-23 00:00:44 +00:00
|
|
|
|
2018-06-22 13:59:28 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace routing
|
|
|
|
{
|
2018-09-11 15:28:36 +00:00
|
|
|
struct DataDiscardMessage;
|
|
|
|
|
2018-06-26 16:23:43 +00:00
|
|
|
// handles messages on the routing level
|
2018-06-22 13:59:28 +00:00
|
|
|
struct IMessageHandler
|
|
|
|
{
|
2018-09-11 15:28:36 +00:00
|
|
|
virtual bool
|
|
|
|
HandleDataDiscardMessage(const DataDiscardMessage *msg,
|
|
|
|
llarp_router *r) = 0;
|
|
|
|
|
2018-06-23 00:00:44 +00:00
|
|
|
virtual bool
|
2018-07-09 03:34:29 +00:00
|
|
|
HandlePathTransferMessage(const PathTransferMessage *msg,
|
|
|
|
llarp_router *r) = 0;
|
2018-06-25 15:12:08 +00:00
|
|
|
|
|
|
|
virtual bool
|
2018-08-02 00:48:43 +00:00
|
|
|
HandleHiddenServiceFrame(const service::ProtocolFrame *msg) = 0;
|
2018-06-25 15:12:08 +00:00
|
|
|
|
|
|
|
virtual bool
|
2018-07-09 03:34:29 +00:00
|
|
|
HandlePathConfirmMessage(const PathConfirmMessage *msg,
|
|
|
|
llarp_router *r) = 0;
|
2018-06-25 15:12:08 +00:00
|
|
|
|
|
|
|
virtual bool
|
2018-07-09 03:34:29 +00:00
|
|
|
HandlePathLatencyMessage(const PathLatencyMessage *msg,
|
|
|
|
llarp_router *r) = 0;
|
2018-06-26 16:23:43 +00:00
|
|
|
virtual bool
|
2018-07-09 03:34:29 +00:00
|
|
|
HandleDHTMessage(const llarp::dht::IMessage *msg, llarp_router *r) = 0;
|
2018-06-22 13:59:28 +00:00
|
|
|
};
|
|
|
|
} // namespace routing
|
|
|
|
} // namespace llarp
|
|
|
|
|
2018-09-11 15:28:36 +00:00
|
|
|
#endif
|