A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ssid.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
9#ifndef SSID_H
10#define SSID_H
11
13
14namespace ns3
15{
16
17/**
18 * @ingroup wifi
19 *
20 * The IEEE 802.11 SSID Information Element
21 *
22 * @see attribute_Ssid
23 */
25{
26 public:
27 /**
28 * Create SSID with broadcast SSID
29 */
30 Ssid();
31 /**
32 * Create SSID from a given string
33 *
34 * @param s SSID in string
35 */
36 Ssid(std::string s);
37
38 // Implementations of pure virtual methods of WifiInformationElement
39 WifiInformationElementId ElementId() const override;
40 void Print(std::ostream& os) const override;
41
42 /**
43 * Check if the two SSIDs are equal.
44 *
45 * @param o SSID to compare to
46 *
47 * @return true if the two SSIDs are equal,
48 * false otherwise
49 */
50 bool IsEqual(const Ssid& o) const;
51 /**
52 * Check if the SSID is broadcast.
53 *
54 * @return true if the SSID is broadcast,
55 * false otherwise
56 */
57 bool IsBroadcast() const;
58
59 /**
60 * Peek the SSID.
61 *
62 * @return a pointer to SSID string
63 */
64 char* PeekString() const;
65
66 private:
67 uint16_t GetInformationFieldSize() const override;
68 void SerializeInformationField(Buffer::Iterator start) const override;
69 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
70
71 uint8_t m_ssid[33]; //!< Raw SSID value
72 uint8_t m_length; //!< Length of the SSID
73};
74
75/**
76 * Serialize from the given istream to this SSID.
77 *
78 * @param is the input stream
79 * @param ssid the SSID
80 *
81 * @return std::istream
82 */
83std::istream& operator>>(std::istream& is, Ssid& ssid);
84
86
87} // namespace ns3
88
89#endif /* SSID_H */
iterator in a Buffer instance
Definition buffer.h:89
The IEEE 802.11 SSID Information Element.
Definition ssid.h:25
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Definition ssid.cc:81
bool IsEqual(const Ssid &o) const
Check if the two SSIDs are equal.
Definition ssid.cc:50
uint8_t m_length
Length of the SSID.
Definition ssid.h:72
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
Definition ssid.cc:75
char * PeekString() const
Peek the SSID.
Definition ssid.cc:67
bool IsBroadcast() const
Check if the SSID is broadcast.
Definition ssid.cc:61
void Print(std::ostream &os) const override
Generate human-readable form of IE.
Definition ssid.cc:44
uint8_t m_ssid[33]
Raw SSID value.
Definition ssid.h:71
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)
Definition ssid.cc:94
Ssid()
Create SSID with broadcast SSID.
Definition ssid.cc:14
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition ssid.cc:87
Information element, as defined in 802.11-2007 standard.
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::istream & operator>>(std::istream &is, Angles &a)
Definition angles.cc:172
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.