SOLA
Loading...
Searching...
No Matches
peer_discovery_requests.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_MINHTON_NS3_MINHTON_PEER_DISCOVERY_REQUESTS_H_
18#define DAISI_MINHTON_NS3_MINHTON_PEER_DISCOVERY_REQUESTS_H_
19
20#include <variant>
21
22#include "manager/scenariofile_component.h"
23#include "peer_discovery_general.h"
24
25namespace daisi::minhton_ns3 {
26
27/************************/
28/*** VALIDITY THRESHOLD */
29/************************/
30
32 std::variant<ConstantTime> threshold;
33
34 void parse(const YAML::Node &node);
35};
36
37/************************/
38/******** NODES *********/
39/************************/
40
41struct Absolute {
42 static std::string typeName() { return "absolute"; }
43
44 uint64_t number;
45
46 void parse(const YAML::Node &node);
47};
48
49struct RandomNode {
50 static std::string typeName() { return "random"; }
51
52 double percentage;
53
54 void parse(const YAML::Node &node);
55};
56
57struct Nodes {
58 std::variant<RandomNode, Absolute> nodes;
59
60 void parse(const YAML::Node &node);
61};
62
63/************************/
64/****** FREQUENCY *******/
65/************************/
66
67struct StaticTime {
68 static std::string typeName() { return "static"; }
69
70 uint64_t time;
71
72 void parse(const YAML::Node &node);
73};
74
75struct Frequency {
76 std::variant<Gaussian, StaticTime> frequency;
77
78 void parse(const YAML::Node &node);
79};
80
81/************************/
82/******** DEPTH *********/
83/************************/
84
85struct Static {
86 static std::string typeName() { return "static"; }
87
88 uint8_t value;
89
90 void parse(const YAML::Node &node);
91};
92
93struct Depth {
94 std::variant<Uniform, Static> depth;
95
96 void parse(const YAML::Node &node);
97};
98
99/************************/
100/****** REQUESTS ********/
101/************************/
102
103struct Requests {
104 ValidityThreshold validity_threshold;
105 Nodes nodes;
106 Frequency frequency;
107 Depth depth;
108 bool inquire_outdated;
109 bool inquire_unknown;
110
111 void parse(const YAML::Node &node);
112};
113
114} // namespace daisi::minhton_ns3
115
116#endif
Definition peer_discovery_requests.h:41
Definition peer_discovery_requests.h:93
Definition peer_discovery_requests.h:75
Definition peer_discovery_requests.h:57
Definition peer_discovery_requests.h:49
Definition peer_discovery_requests.h:103
Definition peer_discovery_requests.h:67
Definition peer_discovery_requests.h:85
Definition peer_discovery_requests.h:31