OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2008,2009 IITP RAS | 3 * Copyright (c) 2008,2009 IITP RAS |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 { | 118 { |
119 for (NeighboursTimingUnitsList::iterator j = m_neighbours.begin (); j != m_nei
ghbours.end (); j++) | 119 for (NeighboursTimingUnitsList::iterator j = m_neighbours.begin (); j != m_nei
ghbours.end (); j++) |
120 { | 120 { |
121 (*j) = 0; | 121 (*j) = 0; |
122 } | 122 } |
123 m_neighbours.clear (); | 123 m_neighbours.clear (); |
124 } | 124 } |
125 uint8_t | 125 uint8_t |
126 IeBeaconTiming::GetInformationFieldSize () const | 126 IeBeaconTiming::GetInformationFieldSize () const |
127 { | 127 { |
128 return (5 * m_numOfUnits ); | 128 return static_cast<uint8_t> (5 * m_numOfUnits ); |
129 } | 129 } |
130 void | 130 void |
131 IeBeaconTiming::Print (std::ostream& os) const | 131 IeBeaconTiming::Print (std::ostream& os) const |
132 { | 132 { |
133 os << "BeaconTiming=(Number of units=" << (uint16_t) m_numOfUnits; | 133 os << "BeaconTiming=(Number of units=" << (uint16_t) m_numOfUnits; |
134 for (NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin (); j !=
m_neighbours.end (); j++) | 134 for (NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin (); j !=
m_neighbours.end (); j++) |
135 { | 135 { |
136 os << "(AID=" << (uint16_t)(*j)->GetAid () << ", Last beacon at=" << (*j)-
>GetLastBeacon () | 136 os << "(AID=" << (uint16_t)(*j)->GetAid () << ", Last beacon at=" << (*j)-
>GetLastBeacon () |
137 << ", with beacon interval=" << (*j)->GetBeaconInterval () << ")"; | 137 << ", with beacon interval=" << (*j)->GetBeaconInterval () << ")"; |
138 } | 138 } |
(...skipping 15 matching lines...) Expand all Loading... |
154 Buffer::Iterator i = start; | 154 Buffer::Iterator i = start; |
155 m_numOfUnits = length / 5; | 155 m_numOfUnits = length / 5; |
156 for (int j = 0; j < m_numOfUnits; j++) | 156 for (int j = 0; j < m_numOfUnits; j++) |
157 { | 157 { |
158 Ptr<IeBeaconTimingUnit> new_element = Create<IeBeaconTimingUnit> (); | 158 Ptr<IeBeaconTimingUnit> new_element = Create<IeBeaconTimingUnit> (); |
159 new_element->SetAid (i.ReadU8 ()); | 159 new_element->SetAid (i.ReadU8 ()); |
160 new_element->SetLastBeacon (i.ReadLsbtohU16 ()); | 160 new_element->SetLastBeacon (i.ReadLsbtohU16 ()); |
161 new_element->SetBeaconInterval (i.ReadLsbtohU16 ()); | 161 new_element->SetBeaconInterval (i.ReadLsbtohU16 ()); |
162 m_neighbours.push_back (new_element); | 162 m_neighbours.push_back (new_element); |
163 } | 163 } |
164 return i.GetDistanceFrom (start); | 164 return static_cast<uint8_t> (i.GetDistanceFrom (start)); |
165 } | 165 } |
166 ; | 166 ; |
167 uint16_t | 167 uint16_t |
168 IeBeaconTiming::TimestampToU16 (Time t) | 168 IeBeaconTiming::TimestampToU16 (Time t) |
169 { | 169 { |
170 return ((uint16_t)((t.GetMicroSeconds () >> 8) & 0xffff)); | 170 return ((uint16_t)((t.GetMicroSeconds () >> 8) & 0xffff)); |
171 } | 171 } |
172 ; | 172 ; |
173 | 173 |
174 uint16_t | 174 uint16_t |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 213 } |
214 std::ostream & | 214 std::ostream & |
215 operator << (std::ostream &os, const IeBeaconTiming &a) | 215 operator << (std::ostream &os, const IeBeaconTiming &a) |
216 { | 216 { |
217 a.Print (os); | 217 a.Print (os); |
218 return os; | 218 return os; |
219 } | 219 } |
220 } // namespace dot11s | 220 } // namespace dot11s |
221 } // namespace ns3 | 221 } // namespace ns3 |
222 | 222 |
OLD | NEW |