2018-05-25 17:52:10 +00:00
|
|
|
#ifndef LLARP_LINK_MESSAGE_HPP
|
|
|
|
#define LLARP_LINK_MESSAGE_HPP
|
|
|
|
|
2018-12-12 01:32:10 +00:00
|
|
|
#include <link/session.hpp>
|
2018-12-12 02:52:51 +00:00
|
|
|
#include <router_id.hpp>
|
2019-01-10 19:41:51 +00:00
|
|
|
#include <util/bencode.hpp>
|
2018-05-25 17:52:10 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
2018-09-02 18:25:42 +00:00
|
|
|
struct ILinkSession;
|
2019-02-11 19:45:42 +00:00
|
|
|
struct AbstractRouter;
|
2018-06-01 14:08:54 +00:00
|
|
|
|
|
|
|
/// parsed link layer message
|
2018-06-23 00:00:44 +00:00
|
|
|
struct ILinkMessage : public IBEncodeMessage
|
2018-05-25 17:52:10 +00:00
|
|
|
{
|
2018-09-02 18:25:42 +00:00
|
|
|
/// who did this message come from or is going to
|
2018-12-20 16:49:05 +00:00
|
|
|
ILinkSession* session = nullptr;
|
|
|
|
uint64_t version = 0;
|
2018-06-01 14:08:54 +00:00
|
|
|
|
2018-12-20 16:49:05 +00:00
|
|
|
ILinkMessage() = default;
|
2018-09-02 18:25:42 +00:00
|
|
|
|
|
|
|
virtual ~ILinkMessage()
|
|
|
|
{
|
|
|
|
}
|
2018-06-01 14:08:54 +00:00
|
|
|
|
|
|
|
virtual bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleMessage(AbstractRouter* router) const = 0;
|
2018-05-25 17:52:10 +00:00
|
|
|
|
2018-12-20 16:49:05 +00:00
|
|
|
virtual void
|
|
|
|
Clear() = 0;
|
2019-03-26 20:04:41 +00:00
|
|
|
|
|
|
|
// the name of this kind of message
|
|
|
|
virtual const char*
|
|
|
|
Name() const = 0;
|
2018-05-25 17:52:10 +00:00
|
|
|
};
|
2018-12-20 16:49:05 +00:00
|
|
|
|
2018-06-23 00:00:44 +00:00
|
|
|
} // namespace llarp
|
2018-05-25 17:52:10 +00:00
|
|
|
|
|
|
|
#endif
|