lokinet/llarp/messages/path_transfer.hpp

49 lines
984 B
C++
Raw Normal View History

2018-06-26 16:23:43 +00:00
#ifndef LLARP_MESSAGES_PATH_TRANSFER_HPP
#define LLARP_MESSAGES_PATH_TRANSFER_HPP
#include <crypto/encrypted.hpp>
#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
{
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;
PathTransferMessage();
2018-08-12 17:22:29 +00:00
PathTransferMessage(const service::ProtocolFrame& f, const PathID_t& p)
: P(p), T(f)
{
Y.Randomize();
}
~PathTransferMessage();
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*, llarp::Router* 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();
}
2018-06-26 16:23:43 +00:00
};
} // namespace routing
} // namespace llarp
#endif