lokinet/llarp/messages/link_message.hpp

42 lines
737 B
C++
Raw Normal View History

#ifndef LLARP_LINK_MESSAGE_HPP
#define LLARP_LINK_MESSAGE_HPP
2018-12-12 01:32:10 +00:00
#include <link/session.hpp>
#include <router_id.hpp>
#include <util/bencode.hpp>
#include <vector>
namespace llarp
{
struct ILinkSession;
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
{
/// 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;
virtual ~ILinkMessage()
{
}
2018-06-01 14:08:54 +00:00
virtual bool
HandleMessage(AbstractRouter* router) const = 0;
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-12-20 16:49:05 +00:00
2018-06-23 00:00:44 +00:00
} // namespace llarp
#endif