2018-06-22 13:59:28 +00:00
|
|
|
#ifndef LLARP_ROUTING_HANDLER_HPP
|
|
|
|
#define LLARP_ROUTING_HANDLER_HPP
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
2019-02-11 19:45:42 +00:00
|
|
|
struct AbstractRouter;
|
|
|
|
|
|
|
|
namespace dht
|
|
|
|
{
|
|
|
|
struct IMessage;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace service
|
|
|
|
{
|
|
|
|
struct ProtocolFrame;
|
|
|
|
}
|
|
|
|
|
2018-06-22 13:59:28 +00:00
|
|
|
namespace routing
|
|
|
|
{
|
2018-09-11 15:28:36 +00:00
|
|
|
struct DataDiscardMessage;
|
2019-02-11 19:45:42 +00:00
|
|
|
struct GrantExitMessage;
|
|
|
|
struct ObtainExitMessage;
|
|
|
|
struct RejectExitMessage;
|
|
|
|
struct TransferTrafficMessage;
|
|
|
|
struct UpdateExitMessage;
|
|
|
|
struct UpdateExitVerifyMessage;
|
|
|
|
struct CloseExitMessage;
|
|
|
|
struct PathTransferMessage;
|
|
|
|
struct PathConfirmMessage;
|
|
|
|
struct PathLatencyMessage;
|
2018-09-11 15:28:36 +00:00
|
|
|
|
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-11-12 16:43:40 +00:00
|
|
|
virtual bool
|
|
|
|
HandleObtainExitMessage(const ObtainExitMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-11-12 16:43:40 +00:00
|
|
|
|
|
|
|
virtual bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleGrantExitMessage(const GrantExitMessage *msg,
|
|
|
|
AbstractRouter *r) = 0;
|
2018-11-12 16:43:40 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
HandleRejectExitMessage(const RejectExitMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-11-12 16:43:40 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
HandleTransferTrafficMessage(const TransferTrafficMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-11-12 16:43:40 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
HandleUpdateExitMessage(const UpdateExitMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-11-12 16:43:40 +00:00
|
|
|
|
2018-11-14 12:23:08 +00:00
|
|
|
virtual bool
|
|
|
|
HandleUpdateExitVerifyMessage(const UpdateExitVerifyMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-11-14 12:23:08 +00:00
|
|
|
|
2018-11-12 16:43:40 +00:00
|
|
|
virtual bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleCloseExitMessage(const CloseExitMessage *msg,
|
|
|
|
AbstractRouter *r) = 0;
|
2018-11-12 16:43:40 +00:00
|
|
|
|
2018-09-11 15:28:36 +00:00
|
|
|
virtual bool
|
|
|
|
HandleDataDiscardMessage(const DataDiscardMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-09-11 15:28:36 +00:00
|
|
|
|
2018-06-23 00:00:44 +00:00
|
|
|
virtual bool
|
2018-07-09 03:34:29 +00:00
|
|
|
HandlePathTransferMessage(const PathTransferMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *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,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-06-25 15:12:08 +00:00
|
|
|
|
|
|
|
virtual bool
|
2018-07-09 03:34:29 +00:00
|
|
|
HandlePathLatencyMessage(const PathLatencyMessage *msg,
|
2019-02-11 19:45:42 +00:00
|
|
|
AbstractRouter *r) = 0;
|
2018-06-26 16:23:43 +00:00
|
|
|
virtual bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleDHTMessage(const dht::IMessage *msg, AbstractRouter *r) = 0;
|
2018-06-22 13:59:28 +00:00
|
|
|
};
|
|
|
|
} // namespace routing
|
|
|
|
} // namespace llarp
|
|
|
|
|
2018-09-11 15:28:36 +00:00
|
|
|
#endif
|