lokinet/include/llarp/messages/link_intro.hpp

49 lines
914 B
C++
Raw Normal View History

2018-06-01 14:08:54 +00:00
#ifndef LLARP_MESSAGES_LINK_INTRO_HPP
#define LLARP_MESSAGES_LINK_INTRO_HPP
#include <llarp/link_message.hpp>
#include <llarp/router_contact.hpp>
2018-06-01 14:08:54 +00:00
namespace llarp
{
struct ILinkSession;
2018-06-01 14:08:54 +00:00
struct LinkIntroMessage : public ILinkMessage
{
static constexpr size_t MaxSize = MAX_RC_SIZE + 256;
2018-09-04 19:15:06 +00:00
LinkIntroMessage() : ILinkMessage()
{
}
LinkIntroMessage(ILinkSession* s) : ILinkMessage(s)
2018-06-01 14:08:54 +00:00
{
}
~LinkIntroMessage();
RouterContact rc;
KeyExchangeNonce N;
Signature Z;
uint64_t P;
LinkIntroMessage&
operator=(const LinkIntroMessage& msg);
2018-06-01 14:08:54 +00:00
bool
DecodeKey(llarp_buffer_t key, llarp_buffer_t* buf);
bool
BEncode(llarp_buffer_t* buf) const;
bool
HandleMessage(llarp_router* router) const;
bool
Sign(llarp_crypto* c, const SecretKey& signKeySecret);
bool
Verify(llarp_crypto* c) const;
2018-06-01 14:08:54 +00:00
};
2018-07-09 03:34:29 +00:00
} // namespace llarp
2018-06-01 14:08:54 +00:00
#endif