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 * 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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19
20#ifndef SSID_H
21#define SSID_H
22
24
25namespace ns3
26{
27
28/**
29 * \ingroup wifi
30 *
31 * The IEEE 802.11 SSID Information Element
32 *
33 * \see attribute_Ssid
34 */
36{
37 public:
38 /**
39 * Create SSID with broadcast SSID
40 */
41 Ssid();
42 /**
43 * Create SSID from a given string
44 *
45 * \param s SSID in string
46 */
47 Ssid(std::string s);
48
49 // Implementations of pure virtual methods of WifiInformationElement
50 WifiInformationElementId ElementId() const override;
51 void Print(std::ostream& os) const override;
52
53 /**
54 * Check if the two SSIDs are equal.
55 *
56 * \param o SSID to compare to
57 *
58 * \return true if the two SSIDs are equal,
59 * false otherwise
60 */
61 bool IsEqual(const Ssid& o) const;
62 /**
63 * Check if the SSID is broadcast.
64 *
65 * \return true if the SSID is broadcast,
66 * false otherwise
67 */
68 bool IsBroadcast() const;
69
70 /**
71 * Peek the SSID.
72 *
73 * \return a pointer to SSID string
74 */
75 char* PeekString() const;
76
77 private:
78 uint16_t GetInformationFieldSize() const override;
79 void SerializeInformationField(Buffer::Iterator start) const override;
80 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
81
82 uint8_t m_ssid[33]; //!< Raw SSID value
83 uint8_t m_length; //!< Length of the SSID
84};
85
86/**
87 * Serialize from the given istream to this SSID.
88 *
89 * \param is the input stream
90 * \param ssid the SSID
91 *
92 * \return std::istream
93 */
94std::istream& operator>>(std::istream& is, Ssid& ssid);
95
97
98} // namespace ns3
99
100#endif /* SSID_H */
iterator in a Buffer instance
Definition: buffer.h:100
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
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:92
bool IsEqual(const Ssid &o) const
Check if the two SSIDs are equal.
Definition: ssid.cc:61
uint8_t m_length
Length of the SSID.
Definition: ssid.h:83
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
Definition: ssid.cc:86
char * PeekString() const
Peek the SSID.
Definition: ssid.cc:78
bool IsBroadcast() const
Check if the SSID is broadcast.
Definition: ssid.cc:72
void Print(std::ostream &os) const override
Generate human-readable form of IE.
Definition: ssid.cc:55
uint8_t m_ssid[33]
Raw SSID value.
Definition: ssid.h:82
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:105
Ssid()
Create SSID with broadcast SSID.
Definition: ssid.cc:25
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:98
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:183
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.