2018-06-01 14:08:54 +00:00
|
|
|
#ifndef LLARP_MESSAGES_LINK_INTRO_HPP
|
|
|
|
#define LLARP_MESSAGES_LINK_INTRO_HPP
|
2018-12-12 01:55:30 +00:00
|
|
|
|
2019-01-13 16:30:07 +00:00
|
|
|
#include <crypto/types.hpp>
|
2019-01-14 21:46:07 +00:00
|
|
|
#include <messages/link_message.hpp>
|
2018-12-12 01:55:30 +00:00
|
|
|
#include <router_contact.hpp>
|
|
|
|
|
2018-06-01 14:08:54 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
2018-09-02 18:25:42 +00:00
|
|
|
struct ILinkSession;
|
|
|
|
|
2018-06-01 14:08:54 +00:00
|
|
|
struct LinkIntroMessage : public ILinkMessage
|
|
|
|
{
|
2018-09-08 15:53:20 +00:00
|
|
|
static constexpr size_t MaxSize = MAX_RC_SIZE + 256;
|
|
|
|
|
2018-09-04 19:15:06 +00:00
|
|
|
LinkIntroMessage() : ILinkMessage()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-09-02 18:25:42 +00:00
|
|
|
RouterContact rc;
|
2018-09-04 12:41:25 +00:00
|
|
|
KeyExchangeNonce N;
|
2018-09-08 15:53:20 +00:00
|
|
|
Signature Z;
|
|
|
|
uint64_t P;
|
|
|
|
|
2018-06-01 14:08:54 +00:00
|
|
|
bool
|
2019-02-01 01:58:06 +00:00
|
|
|
DecodeKey(const llarp_buffer_t& key, llarp_buffer_t* buf) override;
|
2018-06-01 14:08:54 +00:00
|
|
|
|
|
|
|
bool
|
2018-12-23 13:29:11 +00:00
|
|
|
BEncode(llarp_buffer_t* buf) const override;
|
2018-06-01 14:08:54 +00:00
|
|
|
|
|
|
|
bool
|
2019-02-11 19:45:42 +00:00
|
|
|
HandleMessage(AbstractRouter* router) const override;
|
2018-09-08 15:53:20 +00:00
|
|
|
|
|
|
|
bool
|
2019-02-01 01:58:06 +00:00
|
|
|
Sign(std::function< bool(Signature&, const llarp_buffer_t&) > signer);
|
2018-09-08 15:53:20 +00:00
|
|
|
|
|
|
|
bool
|
2019-05-28 19:45:08 +00:00
|
|
|
Verify() const;
|
2018-12-20 16:49:05 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
Clear() override;
|
2019-03-26 20:04:41 +00:00
|
|
|
|
|
|
|
const char*
|
|
|
|
Name() const override
|
|
|
|
{
|
|
|
|
return "LinkIntro";
|
|
|
|
}
|
2020-01-17 16:33:37 +00:00
|
|
|
|
|
|
|
// always first
|
|
|
|
uint16_t
|
|
|
|
Priority() const override
|
|
|
|
{
|
|
|
|
return std::numeric_limits< uint16_t >::max();
|
|
|
|
}
|
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
|