lokinet/include/llarp/messages/relay.hpp

53 lines
1.0 KiB
C++
Raw Normal View History

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();
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();
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