lokinet/include/llarp/routing/handler.hpp

74 lines
2.1 KiB
C++
Raw Normal View History

#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>
#include <llarp/dht.hpp>
#include <llarp/messages/path_confirm.hpp>
#include <llarp/messages/path_latency.hpp>
2018-06-26 16:23:43 +00:00
#include <llarp/messages/path_transfer.hpp>
#include <llarp/messages/exit.hpp>
#include <llarp/messages/transfer_traffic.hpp>
2018-06-23 00:00:44 +00:00
namespace llarp
{
namespace routing
{
struct DataDiscardMessage;
2018-06-26 16:23:43 +00:00
// handles messages on the routing level
struct IMessageHandler
{
virtual bool
HandleObtainExitMessage(const ObtainExitMessage *msg,
llarp_router *r) = 0;
virtual bool
HandleGrantExitMessage(const GrantExitMessage *msg, llarp_router *r) = 0;
virtual bool
HandleRejectExitMessage(const RejectExitMessage *msg,
llarp_router *r) = 0;
virtual bool
HandleTransferTrafficMessage(const TransferTrafficMessage *msg,
llarp_router *r) = 0;
virtual bool
HandleUpdateExitMessage(const UpdateExitMessage *msg,
llarp_router *r) = 0;
2018-11-14 12:23:08 +00:00
virtual bool
HandleUpdateExitVerifyMessage(const UpdateExitVerifyMessage *msg,
llarp_router *r) = 0;
virtual bool
HandleCloseExitMessage(const CloseExitMessage *msg, llarp_router *r) = 0;
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;
virtual bool
HandleHiddenServiceFrame(const service::ProtocolFrame *msg) = 0;
virtual bool
2018-07-09 03:34:29 +00:00
HandlePathConfirmMessage(const PathConfirmMessage *msg,
llarp_router *r) = 0;
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;
};
} // namespace routing
} // namespace llarp
#endif