2018-06-08 13:12:17 +00:00
|
|
|
#ifndef LLARP_MESSAGES_RELAY_HPP
|
|
|
|
#define LLARP_MESSAGES_RELAY_HPP
|
|
|
|
|
2018-12-12 00:38:58 +00:00
|
|
|
#include <crypto.hpp>
|
2018-12-12 02:52:51 +00:00
|
|
|
#include <encrypted.hpp>
|
2018-12-12 01:32:10 +00:00
|
|
|
#include <link_message.hpp>
|
2018-12-12 02:52:51 +00:00
|
|
|
#include <path_types.hpp>
|
2018-12-12 01:32:10 +00:00
|
|
|
|
2018-06-22 00:25:30 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2018-06-08 13:12:17 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
struct RelayUpstreamMessage : public ILinkMessage
|
|
|
|
{
|
2018-06-22 00:25:30 +00:00
|
|
|
PathID_t pathid;
|
2018-12-20 16:49:05 +00:00
|
|
|
Encrypted< MAX_LINK_MSG_SIZE - 128 > X;
|
2018-06-22 00:25:30 +00:00
|
|
|
TunnelNonce Y;
|
|
|
|
|
|
|
|
RelayUpstreamMessage();
|
2018-09-02 18:25:42 +00:00
|
|
|
RelayUpstreamMessage(ILinkSession* from);
|
2018-06-08 13:12:17 +00:00
|
|
|
~RelayUpstreamMessage();
|
|
|
|
|
|
|
|
bool
|
2018-12-20 16:49:05 +00:00
|
|
|
DecodeKey(llarp_buffer_t key, llarp_buffer_t* buf) override;
|
2018-06-08 13:12:17 +00:00
|
|
|
|
|
|
|
bool
|
2018-12-20 16:49:05 +00:00
|
|
|
BEncode(llarp_buffer_t* buf) const override;
|
2018-06-08 13:12:17 +00:00
|
|
|
|
|
|
|
bool
|
2018-12-20 16:49:05 +00:00
|
|
|
HandleMessage(llarp::Router* router) const override;
|
|
|
|
|
|
|
|
void
|
|
|
|
Clear() override;
|
2018-06-08 13:12:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct RelayDownstreamMessage : public ILinkMessage
|
|
|
|
{
|
2018-06-22 00:25:30 +00:00
|
|
|
PathID_t pathid;
|
2018-12-20 16:49:05 +00:00
|
|
|
Encrypted< MAX_LINK_MSG_SIZE - 128 > X;
|
2018-06-22 00:25:30 +00:00
|
|
|
TunnelNonce Y;
|
|
|
|
RelayDownstreamMessage();
|
2018-09-02 18:25:42 +00:00
|
|
|
RelayDownstreamMessage(ILinkSession* from);
|
2018-06-08 13:12:17 +00:00
|
|
|
~RelayDownstreamMessage();
|
|
|
|
|
|
|
|
bool
|
2018-12-20 16:49:05 +00:00
|
|
|
DecodeKey(llarp_buffer_t key, llarp_buffer_t* buf) override;
|
2018-06-08 13:12:17 +00:00
|
|
|
|
|
|
|
bool
|
2018-12-20 16:49:05 +00:00
|
|
|
BEncode(llarp_buffer_t* buf) const override;
|
2018-06-08 13:12:17 +00:00
|
|
|
|
|
|
|
bool
|
2018-12-20 16:49:05 +00:00
|
|
|
HandleMessage(llarp::Router* router) const override;
|
|
|
|
|
|
|
|
void
|
|
|
|
Clear() override;
|
2018-06-08 13:12:17 +00:00
|
|
|
};
|
2018-06-22 00:25:30 +00:00
|
|
|
} // namespace llarp
|
2018-06-08 13:12:17 +00:00
|
|
|
|
|
|
|
#endif
|