2018-06-26 16:23:43 +00:00
|
|
|
#ifndef LLARP_MESSAGES_PATH_TRANSFER_HPP
|
|
|
|
#define LLARP_MESSAGES_PATH_TRANSFER_HPP
|
|
|
|
|
2019-01-13 22:39:10 +00:00
|
|
|
#include <crypto/encrypted.hpp>
|
2019-01-13 16:30:07 +00:00
|
|
|
#include <crypto/types.hpp>
|
2018-12-12 02:04:32 +00:00
|
|
|
#include <routing/message.hpp>
|
2018-12-12 02:15:08 +00:00
|
|
|
#include <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
|
|
|
|
|
2018-09-11 15:28:36 +00:00
|
|
|
#endif
|