2018-06-08 13:12:17 +00:00
|
|
|
#ifndef LLARP_MESSAGES_RELAY_HPP
|
|
|
|
#define LLARP_MESSAGES_RELAY_HPP
|
|
|
|
#include <llarp/link_message.hpp>
|
|
|
|
|
2018-06-22 00:25:30 +00:00
|
|
|
#include <llarp/crypto.hpp>
|
|
|
|
#include <llarp/encrypted.hpp>
|
|
|
|
#include <llarp/path_types.hpp>
|
|
|
|
#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;
|
|
|
|
Encrypted X;
|
|
|
|
TunnelNonce Y;
|
|
|
|
|
|
|
|
RelayUpstreamMessage();
|
2018-09-02 18:25:42 +00:00
|
|
|
RelayUpstreamMessage(ILinkSession* from);
|
2018-06-08 13:12:17 +00:00
|
|
|
~RelayUpstreamMessage();
|
|
|
|
|
|
|
|
bool
|
|
|
|
DecodeKey(llarp_buffer_t key, llarp_buffer_t* buf);
|
|
|
|
|
|
|
|
bool
|
|
|
|
BEncode(llarp_buffer_t* buf) const;
|
|
|
|
|
|
|
|
bool
|
|
|
|
HandleMessage(llarp_router* router) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RelayDownstreamMessage : public ILinkMessage
|
|
|
|
{
|
2018-06-22 00:25:30 +00:00
|
|
|
PathID_t pathid;
|
|
|
|
Encrypted X;
|
|
|
|
TunnelNonce Y;
|
|
|
|
RelayDownstreamMessage();
|
2018-09-02 18:25:42 +00:00
|
|
|
RelayDownstreamMessage(ILinkSession* from);
|
2018-06-08 13:12:17 +00:00
|
|
|
~RelayDownstreamMessage();
|
|
|
|
|
|
|
|
bool
|
|
|
|
DecodeKey(llarp_buffer_t key, llarp_buffer_t* buf);
|
|
|
|
|
|
|
|
bool
|
|
|
|
BEncode(llarp_buffer_t* buf) const;
|
|
|
|
|
|
|
|
bool
|
|
|
|
HandleMessage(llarp_router* router) const;
|
|
|
|
};
|
2018-06-22 00:25:30 +00:00
|
|
|
} // namespace llarp
|
2018-06-08 13:12:17 +00:00
|
|
|
|
|
|
|
#endif
|