A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ie-dot11s-rann.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008,2009 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Kirill Andreev <andreev@iitp.ru>
7 */
8
9#ifndef RANN_INFORMATION_ELEMENT_H
10#define RANN_INFORMATION_ELEMENT_H
11
12#include "ns3/mac48-address.h"
13#include "ns3/mesh-information-element-vector.h"
14
15namespace ns3
16{
17namespace dot11s
18{
19/**
20 * \ingroup dot11s
21 * \brief Root announcement (RANN) element
22 */
24{
25 public:
26 IeRann();
27 ~IeRann() override;
28 /**
29 * Set flags field
30 * \param flags the flags value to set
31 */
32 void SetFlags(uint8_t flags);
33 /**
34 * Set hop count value to number of hops from the originating root mesh
35 * STA to the mesh STA transmitting this element
36 * \param hopcount the hop count
37 */
38 void SetHopcount(uint8_t hopcount);
39 /**
40 * Set TTL value to the remaining number of hops allowed
41 * \param ttl the TTL
42 */
43 void SetTTL(uint8_t ttl);
44 /**
45 * Set originator address value
46 * \param originator_address the originator MAC address
47 */
48 void SetOriginatorAddress(Mac48Address originator_address);
49 /**
50 * Set destination sequence number value
51 * \param dest_seq_number the destination sequence number
52 */
53 void SetDestSeqNumber(uint32_t dest_seq_number);
54 /**
55 * Set metric value to cumulative metric from originating root mesh STA
56 * to the mesh STA transmitting the announcement
57 * \param metric the metric to set
58 */
59 void SetMetric(uint32_t metric);
60 /**
61 * Get flags value
62 * \returns the flags
63 */
64 uint8_t GetFlags() const;
65 /**
66 * Get hop count value
67 * \returns the hop count
68 */
69 uint8_t GetHopcount() const;
70 /**
71 * Get TTL value
72 * \returns the TTL
73 */
74 uint8_t GetTtl() const;
75 /**
76 * Get originator address value
77 * \returns the MAC address of the originator
78 */
80 /**
81 * Get destination sequence number value
82 * \returns the destination sequence number
83 */
85 /**
86 * Get metric value
87 * \returns the metric
88 */
89 uint32_t GetMetric() const;
90 /// Decrement TTL function
91 void DecrementTtl();
92 /**
93 * Increment metric
94 * \param metric the value to increment
95 */
96 void IncrementMetric(uint32_t metric);
97
98 // Inherited from WifiInformationElement
99 WifiInformationElementId ElementId() const override;
100 void SerializeInformationField(Buffer::Iterator i) const override;
101 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
102 uint16_t GetInformationFieldSize() const override;
103 void Print(std::ostream& os) const override;
104
105 private:
106 uint8_t m_flags; ///< flags
107 uint8_t m_hopcount; ///< hop count
108 uint8_t m_ttl; ///< TTL
109 Mac48Address m_originatorAddress; ///< originator address
110 uint32_t m_destSeqNumber; ///< destination sequence number
111 uint32_t m_metric; ///< metric
112
113 /**
114 * equality operator
115 *
116 * \param a lhs
117 * \param b rhs
118 * \returns true if equal
119 */
120 friend bool operator==(const IeRann& a, const IeRann& b);
121};
122
123bool operator==(const IeRann& a, const IeRann& b);
124std::ostream& operator<<(std::ostream& os, const IeRann& rann);
125} // namespace dot11s
126} // namespace ns3
127
128#endif
iterator in a Buffer instance
Definition buffer.h:89
an EUI-48 address
Information element, as defined in 802.11-2007 standard.
Root announcement (RANN) element.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
void SetMetric(uint32_t metric)
Set metric value to cumulative metric from originating root mesh STA to the mesh STA transmitting the...
void SerializeInformationField(Buffer::Iterator i) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Mac48Address m_originatorAddress
originator address
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
friend bool operator==(const IeRann &a, const IeRann &b)
equality operator
uint8_t GetFlags() const
Get flags value.
void SetTTL(uint8_t ttl)
Set TTL value to the remaining number of hops allowed.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t GetTtl() const
Get TTL value.
void IncrementMetric(uint32_t metric)
Increment metric.
uint8_t m_hopcount
hop count
uint32_t GetDestSeqNumber() const
Get destination sequence number value.
uint32_t m_destSeqNumber
destination sequence number
uint32_t GetMetric() const
Get metric value.
void DecrementTtl()
Decrement TTL function.
void SetHopcount(uint8_t hopcount)
Set hop count value to number of hops from the originating root mesh STA to the mesh STA transmitting...
void SetOriginatorAddress(Mac48Address originator_address)
Set originator address value.
uint8_t GetHopcount() const
Get hop count value.
void SetDestSeqNumber(uint32_t dest_seq_number)
Set destination sequence number value.
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint32_t m_metric
metric
void SetFlags(uint8_t flags)
Set flags field.
Mac48Address GetOriginatorAddress()
Get originator address value.
bool operator==(const MeshHeader &a, const MeshHeader &b)
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.