2018-06-22 13:59:28 +00:00
|
|
|
#ifndef LLARP_ROUTING_MESSAGE_HPP
|
|
|
|
#define LLARP_ROUTING_MESSAGE_HPP
|
|
|
|
|
2019-01-11 01:19:36 +00:00
|
|
|
#include <path/path_types.hpp>
|
2019-01-10 19:41:51 +00:00
|
|
|
#include <util/bencode.hpp>
|
2019-02-02 23:12:42 +00:00
|
|
|
#include <util/buffer.hpp>
|
2018-06-22 13:59:28 +00:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
2019-02-11 19:45:42 +00:00
|
|
|
struct AbstractRouter;
|
2018-06-22 13:59:28 +00:00
|
|
|
namespace routing
|
|
|
|
{
|
|
|
|
struct IMessageHandler;
|
|
|
|
|
2018-06-23 00:00:44 +00:00
|
|
|
struct IMessage : public llarp::IBEncodeMessage
|
2018-06-22 13:59:28 +00:00
|
|
|
{
|
2019-02-11 19:45:42 +00:00
|
|
|
PathID_t from;
|
2019-01-02 01:04:04 +00:00
|
|
|
uint64_t S;
|
2018-09-17 15:32:37 +00:00
|
|
|
|
2019-01-02 01:04:04 +00:00
|
|
|
IMessage() : llarp::IBEncodeMessage(), S(0)
|
2018-09-17 15:32:37 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-09-17 16:12:42 +00:00
|
|
|
virtual ~IMessage(){};
|
2018-09-17 15:32:37 +00:00
|
|
|
|
2018-06-22 13:59:28 +00:00
|
|
|
virtual bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleMessage(IMessageHandler* h, AbstractRouter* r) const = 0;
|
2018-06-22 13:59:28 +00:00
|
|
|
|
2019-01-02 01:04:04 +00:00
|
|
|
virtual void
|
2018-12-27 14:32:37 +00:00
|
|
|
Clear() = 0;
|
2018-06-22 13:59:28 +00:00
|
|
|
};
|
2018-12-27 14:32:37 +00:00
|
|
|
|
2018-06-22 13:59:28 +00:00
|
|
|
} // namespace routing
|
|
|
|
} // namespace llarp
|
|
|
|
|
2018-09-17 15:32:37 +00:00
|
|
|
#endif
|