SOLA
Loading...
Searching...
No Matches
update_neighbors.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_UPDATE_NEIGHBORS_H_
8#define MINHTON_MESSAGE_UPDATE_NEIGHBORS_H_
9
10#include "minhton/message/message.h"
11#include "solanet/serializer/serialize.h"
12
13using NeighborsAndRelationships =
14 std::vector<std::tuple<minhton::NodeInfo, minhton::NeighborRelationship>>;
15
16namespace minhton {
20class MessageUpdateNeighbors : public MinhtonMessage<MessageUpdateNeighbors> {
21public:
25 NeighborsAndRelationships neighbors_and_relationships,
26 bool should_acknowledge = false);
27
28 NeighborsAndRelationships getNeighborsToUpdate() const;
29 bool getShouldAcknowledge() const;
30
31 SERIALIZE(header_, neighbors_and_relationships_, should_acknowledge_);
32
33 MessageUpdateNeighbors() = default;
34
35private:
36 friend MinhtonMessage;
37
40
42 bool validateImpl() const;
43
45 NeighborsAndRelationships neighbors_and_relationships_;
46
47 bool should_acknowledge_ = false;
48};
49} // namespace minhton
50
51#endif
Usage: Informing a node about a new or updated neighbor. Used mainly in the join accept and leave pro...
Definition update_neighbors.h:20
Definition message_header.h:24
Definition message.h:28
Definition minhton_watchdog_ns3.cpp:24