lokinet/llarp/routing/path_transfer_message.hpp

46 lines
958 B
C++
Raw Normal View History

#pragma once
2018-06-26 16:23:43 +00:00
#include <llarp/crypto/encrypted.hpp>
#include <llarp/crypto/types.hpp>
#include "message.hpp"
#include <llarp/service/protocol.hpp>
2018-06-26 16:23:43 +00:00
namespace llarp
{
namespace routing
{
struct PathTransferMessage final : public IMessage
2018-06-26 16:23:43 +00:00
{
PathID_t P;
2018-08-12 17:22:29 +00:00
service::ProtocolFrame T;
2018-06-26 16:23:43 +00:00
TunnelNonce Y;
2019-06-15 14:55:13 +00:00
PathTransferMessage() = default;
PathTransferMessage(const service::ProtocolFrame& f, const PathID_t& p) : P(p), T(f)
2018-08-12 17:22:29 +00:00
{
Y.Randomize();
}
2019-07-30 23:42:13 +00:00
~PathTransferMessage() override = default;
bool
2019-02-05 00:41:33 +00:00
DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
bool
BEncode(llarp_buffer_t* buf) const override;
bool
HandleMessage(IMessageHandler*, AbstractRouter* r) const override;
2018-12-29 15:45:33 +00:00
void
Clear() override
{
2018-12-29 15:45:33 +00:00
P.Zero();
T.Clear();
2018-12-29 15:45:33 +00:00
Y.Zero();
version = 0;
}
2018-06-26 16:23:43 +00:00
};
} // namespace routing
} // namespace llarp