A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ie-dot11s-id.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 MESH_ID_H
10#define MESH_ID_H
11
12#include "ns3/buffer.h"
13#include "ns3/mesh-information-element-vector.h"
14
15#include <stdint.h>
16
17namespace ns3
18{
19namespace dot11s
20{
21
22/**
23 * \brief a IEEE 802.11 Mesh ID element (Section 8.4.2.101 of IEEE 802.11-2012)
24 */
26{
27 public:
28 // broadcast meshId
29 IeMeshId();
30 /**
31 * Constructor
32 *
33 * \param s reference id
34 */
35 IeMeshId(std::string s);
36
37 /**
38 * Equality test
39 * \param o another IeMeshId
40 * \returns true if equal
41 */
42 bool IsEqual(const IeMeshId& o) const;
43 /**
44 * Return true if broadcast (if first octet of Mesh ID is zero)
45 * \returns true if broadcast
46 */
47 bool IsBroadcast() const;
48 // uint32_t GetLength () const;
49 /**
50 * Peek the IeMeshId as a string value
51 * \returns the mesh ID as a string
52 */
53 char* PeekString() const;
54
55 // Inherited from WifiInformationElement
56 WifiInformationElementId ElementId() const override;
57 void SerializeInformationField(Buffer::Iterator i) const override;
58 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
59 void Print(std::ostream& os) const override;
60 uint16_t GetInformationFieldSize() const override;
61
62 private:
63 uint8_t m_meshId[33]; ///< mesh ID
64 /**
65 * equality operator
66 *
67 * \param a lhs
68 * \param b lhs
69 * \returns true if equal
70 */
71 friend bool operator==(const IeMeshId& a, const IeMeshId& b);
72};
73
74/**
75 * \brief Stream insertion operator.
76 *
77 * \param [in] os The reference to the output stream.
78 * \param [in] meshId The IeMeshId object.
79 * \returns The reference to the output stream.
80 */
81std::ostream& operator<<(std::ostream& os, const IeMeshId& meshId);
82
83} // namespace dot11s
84} // namespace ns3
85#endif /* MESH_ID_H */
iterator in a Buffer instance
Definition buffer.h:89
Information element, as defined in 802.11-2007 standard.
a IEEE 802.11 Mesh ID element (Section 8.4.2.101 of IEEE 802.11-2012)
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
bool IsBroadcast() const
Return true if broadcast (if first octet of Mesh ID is zero)
void Print(std::ostream &os) const override
Generate human-readable form of IE.
bool IsEqual(const IeMeshId &o) const
Equality test.
friend bool operator==(const IeMeshId &a, const IeMeshId &b)
equality operator
uint8_t m_meshId[33]
mesh ID
void SerializeInformationField(Buffer::Iterator i) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
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)
char * PeekString() const
Peek the IeMeshId as a string value.
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.