A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ie-dot11s-prep.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 WIFI_PREP_INFORMATION_ELEMENT_H
10#define WIFI_PREP_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 See 7.3.2.97 of 802.11s draft 2.07
22 */
24{
25 public:
26 IePrep();
27 ~IePrep() override;
28 /**
29 * Set flags function
30 * \param flags the flags to set
31 */
32 void SetFlags(uint8_t flags);
33 /**
34 * Set hop count function
35 * \param hopcount the hop count
36 */
37 void SetHopcount(uint8_t hopcount);
38 /**
39 * Set TTL function
40 * \param ttl the TTL
41 */
42 void SetTtl(uint8_t ttl);
43 /**
44 * Set destination address function
45 * \param dest_address
46 */
47 void SetDestinationAddress(Mac48Address dest_address);
48 /**
49 * Set destination sequence number function
50 * \param dest_seq_number the destination sequence number
51 */
52 void SetDestinationSeqNumber(uint32_t dest_seq_number);
53 /**
54 * Set lifetime function
55 * \param lifetime the lifetime
56 */
57 void SetLifetime(uint32_t lifetime);
58 /**
59 * Set metric function
60 * \param metric the metric to set
61 */
62 void SetMetric(uint32_t metric);
63 /**
64 * Set originator address function
65 * \param originator_address the originator address
66 */
67 void SetOriginatorAddress(Mac48Address originator_address);
68 /**
69 * Set originator sequence number function
70 * \param originator_seq_number the originator sequence number
71 */
72 void SetOriginatorSeqNumber(uint32_t originator_seq_number);
73
74 /**
75 * Get flags function
76 * \returns the flags
77 */
78 uint8_t GetFlags() const;
79 /**
80 * Get hop count function
81 * \returns the hop count
82 */
83 uint8_t GetHopcount() const;
84 /**
85 * Get TTL function
86 * \returns the TTL
87 */
88 uint32_t GetTtl() const;
89 /**
90 * Get destination address function
91 * \returns the destination MAC address
92 */
94 /**
95 * Get destination sequence number function
96 * \returns the destination sequence number
97 */
99 /**
100 * Get lifetime function
101 * \returns the lifetime
102 */
103 uint32_t GetLifetime() const;
104 /**
105 * Get metric function
106 * \returns the metric
107 */
108 uint32_t GetMetric() const;
109 /**
110 * Get originator address function
111 * \returns the MAC address of the originator
112 */
114 /**
115 * Get originator sequence number
116 * \returns the originator sequence number
117 */
119
120 /// Decrement TTL function
121 void DecrementTtl();
122 /**
123 * Increment metric function
124 * \param metric the metric to increment
125 */
126 void IncrementMetric(uint32_t metric);
127
128 // Inherited from WifiInformationElement
129 WifiInformationElementId ElementId() const override;
130 void SerializeInformationField(Buffer::Iterator i) const override;
131 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
132 uint16_t GetInformationFieldSize() const override;
133 void Print(std::ostream& os) const override;
134
135 private:
136 uint8_t m_flags; ///< flags
137 uint8_t m_hopcount; ///< hop count
138 uint8_t m_ttl; ///< TTL
139 Mac48Address m_destinationAddress; ///< destination address
140 uint32_t m_destSeqNumber; ///< destination sequence number
141 uint32_t m_lifetime; ///< lifetime
142 uint32_t m_metric; ///< metric
143 Mac48Address m_originatorAddress; ///< originator address
144 uint32_t m_originatorSeqNumber; ///< originator sequence number
145 /**
146 * equality operator
147 *
148 * \param a lhs
149 * \param b rhs
150 * \returns true if equal
151 */
152 friend bool operator==(const IePrep& a, const IePrep& b);
153};
154
155bool operator==(const IePrep& a, const IePrep& b);
156std::ostream& operator<<(std::ostream& os, const IePrep& prep);
157} // namespace dot11s
158} // namespace ns3
159#endif
iterator in a Buffer instance
Definition buffer.h:89
an EUI-48 address
Information element, as defined in 802.11-2007 standard.
See 7.3.2.97 of 802.11s draft 2.07.
uint32_t GetMetric() const
Get metric function.
void SerializeInformationField(Buffer::Iterator i) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetTtl(uint8_t ttl)
Set TTL function.
uint32_t m_lifetime
lifetime
void SetDestinationSeqNumber(uint32_t dest_seq_number)
Set destination sequence number function.
uint32_t m_destSeqNumber
destination sequence number
uint8_t GetFlags() const
Get flags function.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Mac48Address GetDestinationAddress() const
Get destination address function.
void SetFlags(uint8_t flags)
Set flags function.
void SetHopcount(uint8_t hopcount)
Set hop count function.
uint8_t m_hopcount
hop count
uint32_t m_originatorSeqNumber
originator sequence number
void IncrementMetric(uint32_t metric)
Increment metric function.
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 GetLifetime() const
Get lifetime function.
uint32_t GetOriginatorSeqNumber() const
Get originator sequence number.
friend bool operator==(const IePrep &a, const IePrep &b)
equality operator
void SetOriginatorAddress(Mac48Address originator_address)
Set originator address function.
void SetMetric(uint32_t metric)
Set metric function.
void SetDestinationAddress(Mac48Address dest_address)
Set destination address function.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint32_t m_metric
metric
void SetLifetime(uint32_t lifetime)
Set lifetime function.
Mac48Address GetOriginatorAddress() const
Get originator address function.
uint32_t GetTtl() const
Get TTL function.
void DecrementTtl()
Decrement TTL function.
void SetOriginatorSeqNumber(uint32_t originator_seq_number)
Set originator sequence number function.
Mac48Address m_originatorAddress
originator address
uint32_t GetDestinationSeqNumber() const
Get destination sequence number function.
Mac48Address m_destinationAddress
destination address
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint8_t GetHopcount() const
Get hop count function.
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.