SOLA
Loading...
Searching...
No Matches
constants.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_CORE_CONSTANTS_H_
8#define MINHTON_CORE_CONSTANTS_H_
9
10#include <cstdint>
11#include <string>
12#include <unordered_map>
13
17
18namespace minhton {
19
20const uint32_t kTreeMapperRootValue = 100;
21
22const uint16_t kFanoutMinimum = 2;
23const uint16_t kFanoutMaximum = 255;
24const uint16_t kFanoutDefault = 2;
25
27const int kBootstrapRepeats = 1;
28
30const int kMulticastPort = 11999;
31
33const std::string kMulticastAddress = "224.1.1.1";
34
35const uint16_t kDefaultIpPort = 2000;
36
37// timeouts in ms
38const uint16_t kDefaultTimeoutLength = 2500;
39
40// for logging
41enum class SearchExactTestEntryTypes : uint8_t { kStart = 0, kHop = 1, kSuccess = 2, kFailure = 3 };
42
43// for logging
44enum class MessageProcessingModes : uint8_t { kReceiving = 0, kSending = 1 };
45
46// for logging
47enum class NeighborRelationship : uint8_t {
48 kParent = 0,
49 kChild = 1,
50 kAdjacentLeft = 2,
51 kAdjacentRight = 3,
52 kRoutingTableNeighbor = 4,
53 kRoutingTableNeighborChild = 5,
54 kUnknownRelationship = 6,
55};
56
57// for logging
58enum class EventType : uint8_t {
59 kJoinEvent = 0,
60 kLeaveEvent = 1,
61 kFindQueryEvent = 3,
62 kRequestCountdownStart = 4,
63};
64
65// for logging
66enum class ContentStatus : uint8_t {
67 kContentInsertUpdate = 0,
68 kContentRemove = 1,
69};
70
71// for fsm
72enum class SignalType : uint8_t {
73 kJoinNetwork = 0,
74 kLeaveNetwork = 1,
75 kCleanupSignal = 2,
76};
77
78// for fsm
79enum class TimeoutType : uint8_t {
80 kBootstrapResponseTimeout = 0,
81 kJoinAcceptResponseTimeout = 1,
82 kJoinAcceptAckResponseTimeout = 2,
83 kReplacementAckResponseTimeout = 3,
84 kReplacementOfferResponseTimeout = 4,
85 kDsnAggregationTimeout = 5,
86 kInquiryAggregationTimeout = 6,
87 kSelfDepartureRetry = 7,
88 kJoinRetry = 8,
89};
90
91// for fsm
92enum FSMState : int {
93 kIdle,
94 kWaitForBootstrapResponse,
95 kWaitForJoinAccept,
96 kConnected,
97 kConnectedAcceptingChild,
98 kConnectedReplacing,
99 kWaitForReplacementOffer,
100 kErrorState,
101 kConnectedWaitingParentResponse,
102 kSignOffFromInlevelNeighbors,
103 kConnectedWaitingParentResponseDirectLeaveWoReplacement,
104 kSignOffFromInlevelNeighborsDirectLeaveWoReplacement,
105 kJoinFailed,
106};
107
108enum class JoinAlgorithms {
109 kJoinMinhton,
110};
111
112enum class LeaveAlgorithms {
113 kLeaveMinhton,
114};
115
116enum class SearchExactAlgorithms {
117 kSearchExactMinhton,
118};
119
120enum class ResponseAlgorithms {
121 kResponseGeneral,
122};
123
124enum class BootstrapAlgorithms {
125 kBootstrapGeneral,
126};
127} // namespace minhton
128#endif
Definition minhton_watchdog_ns3.cpp:24
const std::string kMulticastAddress
UDP Multicast Bootstrap Address.
Definition constants.h:33
const int kBootstrapRepeats
Bootstrap UDP Multicast Settings.
Definition constants.h:27
const int kMulticastPort
UDP Multicast Bootstrap Port.
Definition constants.h:30