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
|
|
|
|
2023-08-31 16:28:02 +00:00
|
|
|
namespace llarp::routing
|
2018-06-26 16:23:43 +00:00
|
|
|
{
|
2023-08-31 16:28:02 +00:00
|
|
|
struct PathTransferMessage final : public AbstractRoutingMessage
|
2018-06-26 16:23:43 +00:00
|
|
|
{
|
2023-08-31 16:28:02 +00:00
|
|
|
PathID_t path_id;
|
|
|
|
service::ProtocolFrameMessage protocol_frame_msg;
|
|
|
|
TunnelNonce nonce;
|
|
|
|
|
|
|
|
PathTransferMessage() = default;
|
|
|
|
PathTransferMessage(const service::ProtocolFrameMessage& f, const PathID_t& p)
|
|
|
|
: path_id(p), protocol_frame_msg(f)
|
|
|
|
{
|
|
|
|
nonce.Randomize();
|
|
|
|
}
|
|
|
|
~PathTransferMessage() override = default;
|
|
|
|
|
|
|
|
bool
|
|
|
|
decode_key(const llarp_buffer_t& key, llarp_buffer_t* val) override;
|
|
|
|
|
|
|
|
std::string
|
|
|
|
bt_encode() const override;
|
|
|
|
|
|
|
|
bool
|
2023-09-15 14:55:32 +00:00
|
|
|
handle_message(AbstractRoutingMessageHandler*, Router* r) const override;
|
2023-08-31 16:28:02 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
clear() override
|
2018-06-26 16:23:43 +00:00
|
|
|
{
|
2023-08-31 16:28:02 +00:00
|
|
|
path_id.Zero();
|
|
|
|
protocol_frame_msg.clear();
|
|
|
|
nonce.Zero();
|
|
|
|
version = 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace llarp::routing
|