2021-03-09 22:24:35 +00:00
|
|
|
#pragma once
|
2018-06-26 16:23:43 +00:00
|
|
|
|
2021-03-09 22:24:35 +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
|
|
|
|
{
|
2018-11-05 11:27:12 +00:00
|
|
|
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;
|
2018-06-29 14:25:09 +00:00
|
|
|
|
2019-06-15 14:55:13 +00:00
|
|
|
PathTransferMessage() = default;
|
2020-04-07 18:38:56 +00:00
|
|
|
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;
|
2018-06-29 14:25:09 +00:00
|
|
|
|
|
|
|
bool
|
2019-02-05 00:41:33 +00:00
|
|
|
DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* val) override;
|
2018-06-29 14:25:09 +00:00
|
|
|
|
|
|
|
bool
|
2018-11-05 11:27:12 +00:00
|
|
|
BEncode(llarp_buffer_t* buf) const override;
|
2018-06-29 14:25:09 +00:00
|
|
|
|
|
|
|
bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleMessage(IMessageHandler*, AbstractRouter* r) const override;
|
2018-12-27 14:32:37 +00:00
|
|
|
|
2018-12-29 15:45:33 +00:00
|
|
|
void
|
|
|
|
Clear() override
|
2018-12-27 14:32:37 +00:00
|
|
|
{
|
2018-12-29 15:45:33 +00:00
|
|
|
P.Zero();
|
2018-12-27 14:32:37 +00:00
|
|
|
T.Clear();
|
2018-12-29 15:45:33 +00:00
|
|
|
Y.Zero();
|
2019-11-03 15:31:01 +00:00
|
|
|
version = 0;
|
2018-12-27 14:32:37 +00:00
|
|
|
}
|
2018-06-26 16:23:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace routing
|
|
|
|
} // namespace llarp
|