author | Alexander Krotov <krotov@iitp.ru> |
Sat, 04 Aug 2018 20:02:47 +0300 | |
changeset 13716 | 0b3abcc6f68f |
parent 13121 | ea348e2f0a5e |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7141
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2006 INRIA |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11141
diff
changeset
|
20 |
|
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#ifndef SSID_H |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#define SSID_H |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
|
12433
89cdf2a76202
wifi: Clean includes
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
24 |
#include "wifi-information-element.h" |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
|
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
namespace ns3 { |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
2930
bbe74014af44
add doxygen documentation to avoid doxygen warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
28 |
/** |
7139
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
29 |
* \ingroup wifi |
2930
bbe74014af44
add doxygen documentation to avoid doxygen warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
30 |
* |
7139
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
31 |
* The IEEE 802.11 SSID Information Element |
11036
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10507
diff
changeset
|
32 |
* |
1e03af4311bd
[Doxygen] Attribute implementations.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10507
diff
changeset
|
33 |
* \see attribute_Ssid |
2930
bbe74014af44
add doxygen documentation to avoid doxygen warnings.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
34 |
*/ |
6381
cbc1b93b298a
Bug 881: Make Ssid and SupportedRates derive from WifiInformationElement
Dean Armstrong <deanarm@gmail.com>
parents:
5819
diff
changeset
|
35 |
class Ssid : public WifiInformationElement |
1938
f7e9802ea8e3
add serialization/deserialization support to Ssid/SupportedRates
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1937
diff
changeset
|
36 |
{ |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
public: |
1937
996383a87ae3
add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1888
diff
changeset
|
38 |
// broadcast ssid |
996383a87ae3
add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1888
diff
changeset
|
39 |
Ssid (); |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
40 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
41 |
* Create SSID from a given string |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
42 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
43 |
* \param s SSID in string |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
44 |
*/ |
3587
53e2e87aebd0
use std::string instead of raw string
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3094
diff
changeset
|
45 |
Ssid (std::string s); |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
47 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
48 |
* Check if the two SSIDs are equal. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
49 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
50 |
* \param o SSID to compare to |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11141
diff
changeset
|
51 |
* |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
52 |
* \return true if the two SSIDs are equal, |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
53 |
* false otherwise |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
54 |
*/ |
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
3587
diff
changeset
|
55 |
bool IsEqual (const Ssid& o) const; |
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
56 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
57 |
* Check if the SSID is broadcast. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
58 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
59 |
* \return true if the SSID is broadcast, |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
60 |
* false otherwise |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
61 |
*/ |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
bool IsBroadcast (void) const; |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
63 |
|
10483
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
64 |
/** |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
65 |
* Peek the SSID. |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
66 |
* |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
67 |
* \return a pointer to SSID string |
e3a02ed14587
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
7385
diff
changeset
|
68 |
*/ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
69 |
char* PeekString (void) const; |
1938
f7e9802ea8e3
add serialization/deserialization support to Ssid/SupportedRates
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1937
diff
changeset
|
70 |
|
13048
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
71 |
/** |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
72 |
* Get the ElementID. |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
73 |
* |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
74 |
* \returns the element ID |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
75 |
*/ |
6381
cbc1b93b298a
Bug 881: Make Ssid and SupportedRates derive from WifiInformationElement
Dean Armstrong <deanarm@gmail.com>
parents:
5819
diff
changeset
|
76 |
WifiInformationElementId ElementId () const; |
13048
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
77 |
|
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
78 |
/** |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
79 |
* Get the information field size. |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
80 |
* |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
81 |
* \returns the information field size |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
82 |
*/ |
6382
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
83 |
uint8_t GetInformationFieldSize () const; |
13048
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
84 |
|
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
85 |
/** |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
86 |
* Get the information field size. |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
87 |
* |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
88 |
* \param start the information field iterator |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
89 |
*/ |
6382
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
90 |
void SerializeInformationField (Buffer::Iterator start) const; |
13048
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
91 |
|
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
92 |
/** |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
93 |
* Get the information field size. |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
94 |
* |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
95 |
* \param start the information field iterator |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
96 |
* \param length the size of the information field |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
97 |
* \returns the size of the field read |
c00059ef50e4
wifi: Additional Doxygen fixes
Robert Ammon <ammo6818@vandals.uidaho.edu>
parents:
12433
diff
changeset
|
98 |
*/ |
6382
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
99 |
uint8_t DeserializeInformationField (Buffer::Iterator start, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
100 |
uint8_t length); |
2527
75df305d02d9
give Attribute powers to ssid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2015
diff
changeset
|
101 |
|
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
102 |
private: |
10507
2081aa152526
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10483
diff
changeset
|
103 |
uint8_t m_ssid[33]; //!< Raw SSID value |
2081aa152526
[doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10483
diff
changeset
|
104 |
uint8_t m_length; //!< Length of the SSID |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
105 |
}; |
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
106 |
|
1938
f7e9802ea8e3
add serialization/deserialization support to Ssid/SupportedRates
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1937
diff
changeset
|
107 |
std::ostream &operator << (std::ostream &os, const Ssid &ssid); |
2527
75df305d02d9
give Attribute powers to ssid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2015
diff
changeset
|
108 |
std::istream &operator >> (std::istream &is, Ssid &ssid); |
75df305d02d9
give Attribute powers to ssid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2015
diff
changeset
|
109 |
|
3094
6e787ec9c8aa
ATTRIBUTE_HELPER_HEADER_2 -> ATTRIBUTE_HELPER_HEADER
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3093
diff
changeset
|
110 |
ATTRIBUTE_HELPER_HEADER (Ssid); |
1938
f7e9802ea8e3
add serialization/deserialization support to Ssid/SupportedRates
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1937
diff
changeset
|
111 |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11141
diff
changeset
|
112 |
} //namespace ns3 |
1888
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
113 |
|
dbeef4fcff5a
add ssid to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
114 |
#endif /* SSID_H */ |