From 390f3d26b2bb996af608570468baa682e8bf70d1 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Thu, 1 Jun 2023 20:40:40 +0100 Subject: [PATCH] olsr: Move Willingness to olsr-repositories.h --- src/olsr/model/olsr-repositories.h | 18 ++++++++++++++++++ src/olsr/model/olsr-routing-protocol.cc | 2 ++ src/olsr/model/olsr-routing-protocol.h | 15 --------------- .../test/olsr-routing-protocol-test-suite.cc | 1 + 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/olsr/model/olsr-repositories.h b/src/olsr/model/olsr-repositories.h index f0e4ba05a..854a9999b 100644 --- a/src/olsr/model/olsr-repositories.h +++ b/src/olsr/model/olsr-repositories.h @@ -33,6 +33,24 @@ namespace ns3 namespace olsr { +/** + * \ingroup olsr + * + * Willingness for forwarding packets from other nodes. + * The standard defines the following set of values. + * Values 0 - 7 are allowed by the standard, but this is not enforced in the code. + * + * See \RFC{3626} section 18.8 + */ +enum Willingness : uint8_t +{ + NEVER = 0, + LOW = 1, + DEFAULT = 3, // medium + HIGH = 6, + ALWAYS = 7, +}; + /// \ingroup olsr /// An Interface Association Tuple. struct IfaceAssocTuple diff --git a/src/olsr/model/olsr-routing-protocol.cc b/src/olsr/model/olsr-routing-protocol.cc index b4589504a..9f9047730 100644 --- a/src/olsr/model/olsr-routing-protocol.cc +++ b/src/olsr/model/olsr-routing-protocol.cc @@ -34,6 +34,8 @@ #include "olsr-routing-protocol.h" +#include "olsr-repositories.h" + #include "ns3/boolean.h" #include "ns3/enum.h" #include "ns3/inet-socket-address.h" diff --git a/src/olsr/model/olsr-routing-protocol.h b/src/olsr/model/olsr-routing-protocol.h index 990b09fde..cd11c7112 100644 --- a/src/olsr/model/olsr-routing-protocol.h +++ b/src/olsr/model/olsr-routing-protocol.h @@ -76,21 +76,6 @@ struct RoutingTableEntry class RoutingProtocol; -/** - * \ingroup olsr - * - * Willingness for forwarding packets from other nodes - * See \RFC{3626} section 18.8 - */ -enum Willingness -{ - NEVER = 0, - LOW = 1, - DEFAULT = 3, // medium - HIGH = 6, - ALWAYS = 7, -}; - /// /// \ingroup olsr /// diff --git a/src/olsr/test/olsr-routing-protocol-test-suite.cc b/src/olsr/test/olsr-routing-protocol-test-suite.cc index 849b25047..a1e9b24bb 100644 --- a/src/olsr/test/olsr-routing-protocol-test-suite.cc +++ b/src/olsr/test/olsr-routing-protocol-test-suite.cc @@ -20,6 +20,7 @@ */ #include "ns3/ipv4-header.h" +#include "ns3/olsr-repositories.h" #include "ns3/olsr-routing-protocol.h" #include "ns3/test.h"