SOLA
Loading...
Searching...
No Matches
join.h
1// Copyright The SOLA Contributors
2//
3// Licensed under the MIT License.
4// For details on the licensing terms, see the LICENSE file.
5// SPDX-License-Identifier: MIT
6
7#ifndef MINHTON_MESSAGE_JOIN_H_
8#define MINHTON_MESSAGE_JOIN_H_
9
10#include "minhton/message/find_end.h"
11#include "minhton/message/message.h"
12#include "solanet/serializer/serialize.h"
13
14namespace minhton {
19class MessageJoin : public MinhtonMessage<MessageJoin> {
20public:
21 MessageJoin(MinhtonMessageHeader header, NodeInfo entering_node,
22 SearchProgress search_progress = SearchProgress::kNone, uint16_t hop_count = 0);
23
24 NodeInfo getEnteringNode() const;
25 SearchProgress getSearchProgress() const;
26 uint16_t getHopCount() const;
27
28 SERIALIZE(header_, entering_node_, search_progress_, hop_count_);
29
30 MessageJoin() = default;
31
32private:
33 friend MinhtonMessage;
34
37
39 bool validateImpl() const;
40
42 NodeInfo entering_node_;
43
45 SearchProgress search_progress_ = SearchProgress::kNone;
46
48 uint16_t hop_count_ = 0;
49};
50} // namespace minhton
51
52#endif
Usage: When a node wants to join the network, it sends a MessageJoin to one node in the network....
Definition join.h:19
Definition message_header.h:24
Definition message.h:28
Definition node_info.h:24
Definition minhton_watchdog_ns3.cpp:24
SearchProgress
Used by the minhton join & leave algorithm to save the progress of the position finding.
Definition find_end.h:12