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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Kirill Andreev <andreev@iitp.ru>
18 */
19
20#ifndef RANN_INFORMATION_ELEMENT_H
21#define RANN_INFORMATION_ELEMENT_H
22
23#include "ns3/mac48-address.h"
24#include "ns3/mesh-information-element-vector.h"
25
26namespace ns3
27{
28namespace dot11s
29{
30/**
31 * \ingroup dot11s
32 * \brief Root announcement (RANN) element
33 */
35{
36 public:
37 IeRann();
38 ~IeRann() override;
39 /**
40 * Set flags field
41 * \param flags the flags value to set
42 */
43 void SetFlags(uint8_t flags);
44 /**
45 * Set hop count value to number of hops from the originating root mesh
46 * STA to the mesh STA transmitting this element
47 * \param hopcount the hop count
48 */
49 void SetHopcount(uint8_t hopcount);
50 /**
51 * Set TTL value to the remaining number of hops allowed
52 * \param ttl the TTL
53 */
54 void SetTTL(uint8_t ttl);
55 /**
56 * Set originator address value
57 * \param originator_address the originator MAC address
58 */
59 void SetOriginatorAddress(Mac48Address originator_address);
60 /**
61 * Set destination sequence number value
62 * \param dest_seq_number the destination sequence number
63 */
64 void SetDestSeqNumber(uint32_t dest_seq_number);
65 /**
66 * Set metric value to cumulative metric from originating root mesh STA
67 * to the mesh STA transmitting the announcement
68 * \param metric the metric to set
69 */
70 void SetMetric(uint32_t metric);
71 /**
72 * Get flags value
73 * \returns the flags
74 */
75 uint8_t GetFlags() const;
76 /**
77 * Get hop count value
78 * \returns the hop count
79 */
80 uint8_t GetHopcount() const;
81 /**
82 * Get TTL value
83 * \returns the TTL
84 */
85 uint8_t GetTtl() const;
86 /**
87 * Get originator address value
88 * \returns the MAC address of the originator
89 */
91 /**
92 * Get destination sequence number value
93 * \returns the destination sequence number
94 */
96 /**
97 * Get metric value
98 * \returns the metric
99 */
100 uint32_t GetMetric() const;
101 /// Decrement TTL function
102 void DecrementTtl();
103 /**
104 * Increment metric
105 * \param metric the value to increment
106 */
107 void IncrementMetric(uint32_t metric);
108
109 // Inherited from WifiInformationElement
110 WifiInformationElementId ElementId() const override;
111 void SerializeInformationField(Buffer::Iterator i) const override;
112 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
113 uint16_t GetInformationFieldSize() const override;
114 void Print(std::ostream& os) const override;
115
116 private:
117 uint8_t m_flags; ///< flags
118 uint8_t m_hopcount; ///< hop count
119 uint8_t m_ttl; ///< TTL
120 Mac48Address m_originatorAddress; ///< originator address
121 uint32_t m_destSeqNumber; ///< destination sequence number
122 uint32_t m_metric; ///< metric
123
124 /**
125 * equality operator
126 *
127 * \param a lhs
128 * \param b rhs
129 * \returns true if equal
130 */
131 friend bool operator==(const IeRann& a, const IeRann& b);
132};
133
134bool operator==(const IeRann& a, const IeRann& b);
135std::ostream& operator<<(std::ostream& os, const IeRann& rann);
136} // namespace dot11s
137} // namespace ns3
138
139#endif
iterator in a Buffer instance
Definition: buffer.h:100
an EUI-48 address
Definition: mac48-address.h:46
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)
uint8_t m_flags
flags
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.