lokinet/include/llarp/messages/relay_ack.hpp

47 lines
865 B
C++
Raw Normal View History

2018-06-08 13:12:17 +00:00
#ifndef LLARP_MESSAGES_RELAY_ACK_HPP
#define LLARP_MESSAGES_RELAY_ACK_HPP
2018-06-12 16:45:12 +00:00
#include <llarp/crypto.hpp>
#include <llarp/encrypted_frame.hpp>
2018-06-08 13:12:17 +00:00
#include <llarp/link_message.hpp>
2018-06-12 16:45:12 +00:00
#include <llarp/path_types.hpp>
2018-06-08 13:12:17 +00:00
namespace llarp
{
2018-06-12 16:45:12 +00:00
struct LR_AckRecord
{
PubKey pubkey;
TunnelNonce nonce;
PathID_t rxPathID;
uint64_t version = 0;
bool
BEncode(llarp_buffer_t* buf) const;
bool
BDecode(llarp_buffer_t* buf);
};
2018-06-08 13:12:17 +00:00
struct LR_AckMessage : public ILinkMessage
{
2018-06-12 16:45:12 +00:00
std::vector< EncryptedFrame > acks;
EncryptedFrame lasthopFrame;
PathID_t txPathID;
uint64_t version = 0;
2018-06-08 13:12:17 +00:00
LR_AckMessage(const RouterID& from);
~LR_AckMessage();
bool
DecodeKey(llarp_buffer_t key, llarp_buffer_t* buf);
bool
BEncode(llarp_buffer_t* buf) const;
bool
HandleMessage(llarp_router* router) const;
};
}
#endif