author | Kirill Andreev <andreev@iitp.ru> |
Sun, 29 Mar 2009 13:56:30 +0400 | |
changeset 4896 | e579c19f0dee |
parent 4877 | f08902c42733 |
child 4904 | 4e2ac4a8b5c6 |
permissions | -rw-r--r-- |
4793 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2008,2009 IITP RAS |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
4793 | 7 |
* published by the Free Software Foundation; |
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
4811
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
18 |
* Author: Kirill Andreev <andreev@iitp.ru> |
4793 | 19 |
*/ |
20 |
||
21 |
||
4877
f08902c42733
Added a method to find peer link, code cleanup
Kirill Andreev <andreev@iitp.ru>
parents:
4876
diff
changeset
|
22 |
#include "ie-dot11s-preq.h" |
4793 | 23 |
#include "ns3/address-utils.h" |
4841 | 24 |
#include "ns3/node.h" |
4793 | 25 |
#include "ns3/assert.h" |
4813
e4e2c44d27cd
All mesh related filed moved to devices/mesh. Let the refactoring begins!
Pavel Boyko <boyko@iitp.ru>
parents:
4812
diff
changeset
|
26 |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
27 |
namespace ns3 { |
4872 | 28 |
namespace dot11s { |
4793 | 29 |
/************************* |
30 |
* DestinationAddressUnit |
|
31 |
************************/ |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
32 |
DestinationAddressUnit::DestinationAddressUnit () |
4793 | 33 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
34 |
m_do = false; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
35 |
m_rf = false; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
36 |
m_destSeqNumber = 0; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
37 |
uint8_t mac_buffer[6]; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
38 |
for (int j = 0; j < 6; j++) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
39 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
40 |
mac_buffer[j] = 0; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
41 |
} |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
42 |
m_destinationAddress.CopyFrom (mac_buffer); |
4793 | 43 |
} |
44 |
void |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
45 |
DestinationAddressUnit::SetFlags (bool doFlag, bool rfFlag) |
4793 | 46 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
47 |
m_do = doFlag; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
48 |
m_rf = rfFlag; |
4793 | 49 |
} |
50 |
||
51 |
void |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
52 |
DestinationAddressUnit::SetDestSeqNumber (uint32_t dest_seq_number) |
4793 | 53 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
54 |
m_destSeqNumber = dest_seq_number; |
4793 | 55 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
56 |
void |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
57 |
DestinationAddressUnit::SetDestinationAddress (Mac48Address dest_address) |
4793 | 58 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
59 |
m_destinationAddress = dest_address; |
4793 | 60 |
} |
61 |
bool |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
62 |
DestinationAddressUnit::IsDo () |
4793 | 63 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
64 |
return m_do; |
4793 | 65 |
} |
66 |
||
67 |
bool |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
68 |
DestinationAddressUnit::IsRf () |
4793 | 69 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
70 |
return m_rf; |
4793 | 71 |
} |
72 |
||
73 |
uint32_t |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
74 |
DestinationAddressUnit::GetDestSeqNumber () const |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
75 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
76 |
return m_destSeqNumber; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
77 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
78 |
Mac48Address |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
79 |
DestinationAddressUnit::GetDestinationAddress () const |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
80 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
81 |
return m_destinationAddress; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
82 |
} |
4793 | 83 |
/******************************** |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
84 |
* IePreq |
4793 | 85 |
*******************************/ |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
86 |
IePreq::~IePreq () |
4793 | 87 |
{ |
88 |
} |
|
89 |
||
90 |
TypeId |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
91 |
IePreq::GetTypeId () |
4793 | 92 |
{ |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
93 |
static TypeId tid = TypeId ("ns3::IePreq") |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
94 |
.SetParent<Object> (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
95 |
return tid; |
4793 | 96 |
} |
97 |
TypeId |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
98 |
IePreq::GetInstanceTypeId () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
99 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
100 |
return GetTypeId (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
101 |
} |
4793 | 102 |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
103 |
IePreq::IePreq (): |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
104 |
m_maxSize (32), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
105 |
m_flags (0), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
106 |
m_hopCount (0), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
107 |
m_ttl (0), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
108 |
m_preqId (0), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
109 |
m_originatorAddress (Mac48Address::GetBroadcast()), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
110 |
m_originatorSeqNumber (0), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
111 |
m_lifetime (0), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
112 |
m_metric (0), |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
113 |
m_destCount (0) |
4793 | 114 |
{ |
115 |
} |
|
116 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
117 |
IePreq::SetUnicastPreq () |
4793 | 118 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
119 |
m_flags |= 1<<1; |
4793 | 120 |
} |
121 |
||
122 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
123 |
IePreq::SetNeedNotPrep () |
4793 | 124 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
125 |
m_flags |= 1<<2; |
4793 | 126 |
} |
127 |
//void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
128 |
//IePreq::SetFlags (uint8_t flags) |
4793 | 129 |
//{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
130 |
// m_flags = flags; |
4793 | 131 |
//} |
132 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
133 |
IePreq::SetHopcount (uint8_t hopcount) |
4793 | 134 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
135 |
m_hopCount = hopcount; |
4793 | 136 |
} |
137 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
138 |
IePreq::SetTTL (uint8_t ttl) |
4793 | 139 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
140 |
m_ttl = ttl; |
4793 | 141 |
} |
142 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
143 |
IePreq::SetPreqID (uint32_t preq_id) |
4793 | 144 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
145 |
m_preqId = preq_id; |
4793 | 146 |
} |
147 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
148 |
IePreq::SetMetric (uint32_t metric) |
4793 | 149 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
150 |
m_metric = metric; |
4793 | 151 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
152 |
void |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
153 |
IePreq::SetOriginatorAddress (Mac48Address originator_address) |
4793 | 154 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
155 |
m_originatorAddress = originator_address; |
4793 | 156 |
} |
157 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
158 |
IePreq::SetOriginatorSeqNumber (uint32_t originator_seq_number) |
4793 | 159 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
160 |
m_originatorSeqNumber = originator_seq_number; |
4793 | 161 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
162 |
void |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
163 |
IePreq::SetLifetime (uint32_t lifetime) |
4793 | 164 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
165 |
m_lifetime = lifetime; |
4793 | 166 |
} |
167 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
168 |
IePreq::SetDestCount (uint8_t dest_count) |
4793 | 169 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
170 |
m_destCount = dest_count; |
4793 | 171 |
} |
172 |
||
173 |
//uint8_t |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
174 |
//IePreq::GetFlags () const |
4793 | 175 |
//{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
176 |
// return m_flags; |
4793 | 177 |
//} |
178 |
bool |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
179 |
IePreq::IsUnicastPreq () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
180 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
181 |
return (m_flags & (1<<1)); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
182 |
} |
4793 | 183 |
|
184 |
bool |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
185 |
IePreq::IsNeedNotPrep () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
186 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
187 |
return (m_flags & (1<<2)); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
188 |
} |
4793 | 189 |
|
190 |
uint8_t |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
191 |
IePreq::GetHopCount () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
192 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
193 |
return m_hopCount; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
194 |
} |
4793 | 195 |
uint8_t |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
196 |
IePreq::GetTtl () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
197 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
198 |
return m_ttl; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
199 |
} |
4793 | 200 |
uint32_t |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
201 |
IePreq::GetPreqID () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
202 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
203 |
return m_preqId; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
204 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
205 |
uint32_t |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
206 |
IePreq::GetMetric () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
207 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
208 |
return m_metric; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
209 |
} |
4793 | 210 |
Mac48Address |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
211 |
IePreq::GetOriginatorAddress () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
212 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
213 |
return m_originatorAddress; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
214 |
} |
4793 | 215 |
uint32_t |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
216 |
IePreq::GetOriginatorSeqNumber () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
217 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
218 |
return m_originatorSeqNumber; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
219 |
} |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
220 |
uint32_t |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
221 |
IePreq::GetLifetime () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
222 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
223 |
return m_lifetime; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
224 |
} |
4793 | 225 |
|
226 |
uint8_t |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
227 |
IePreq::GetDestCount () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
228 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
229 |
return m_destCount; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
230 |
} |
4793 | 231 |
|
232 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
233 |
IePreq::DecrementTtl () |
4793 | 234 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
235 |
m_ttl --; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
236 |
m_hopCount ++; |
4793 | 237 |
} |
238 |
||
239 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
240 |
IePreq::IncrementMetric (uint32_t metric) |
4793 | 241 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
242 |
m_metric +=metric; |
4793 | 243 |
} |
244 |
||
245 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
246 |
IePreq::SerializeInformation (Buffer::Iterator i) const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
247 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
248 |
i.WriteU8 (m_flags); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
249 |
i.WriteU8 (m_hopCount); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
250 |
i.WriteU8 (m_ttl); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
251 |
i.WriteHtonU32 (m_preqId); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
252 |
WriteTo (i, m_originatorAddress); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
253 |
i.WriteHtonU32 (m_originatorSeqNumber); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
254 |
i.WriteHtonU32 (m_lifetime); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
255 |
i.WriteHtonU32 (m_metric); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
256 |
i.WriteU8 (m_destCount); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
257 |
int written = 0; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
258 |
for (std::vector<Ptr<DestinationAddressUnit> >::const_iterator j = m_destinations.begin (); j != m_destinations.end(); j++) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
259 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
260 |
uint8_t flags = 0; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
261 |
if ((*j)->IsDo ()) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
262 |
flags +=128; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
263 |
if ((*j)->IsRf ()) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
264 |
flags +=64; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
265 |
i.WriteU8 (flags); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
266 |
WriteTo (i, (*j)->GetDestinationAddress()); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
267 |
i.WriteHtonU32 ((*j)->GetDestSeqNumber ()); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
268 |
written++; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
269 |
if (written > m_maxSize) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
270 |
break; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
271 |
} |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
272 |
} |
4793 | 273 |
|
4838
ce31277d72ad
Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents:
4835
diff
changeset
|
274 |
uint8_t |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
275 |
IePreq::DeserializeInformation (Buffer::Iterator start, uint8_t length) |
4793 | 276 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
277 |
Buffer::Iterator i = start; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
278 |
m_flags = i.ReadU8 (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
279 |
m_hopCount = i.ReadU8 (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
280 |
m_ttl = i.ReadU8 (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
281 |
m_preqId = i.ReadNtohU32 (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
282 |
ReadFrom (i, m_originatorAddress); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
283 |
m_originatorSeqNumber = i.ReadNtohU32 (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
284 |
m_lifetime = i.ReadNtohU32 (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
285 |
m_metric = i.ReadNtohU32 (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
286 |
m_destCount = i.ReadU8 (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
287 |
for (int j = 0; j < m_destCount; j++ ) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
288 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
289 |
Ptr<DestinationAddressUnit> new_element = Create<DestinationAddressUnit> (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
290 |
bool doFlag = false; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
291 |
bool rfFlag = false; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
292 |
uint8_t flags = i.ReadU8 (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
293 |
if (flags >= 128) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
294 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
295 |
doFlag = true; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
296 |
flags -=128; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
297 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
298 |
if (flags >=64) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
299 |
rfFlag = true; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
300 |
new_element->SetFlags (doFlag, rfFlag); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
301 |
Mac48Address addr; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
302 |
ReadFrom (i,addr); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
303 |
new_element->SetDestinationAddress (addr); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
304 |
new_element->SetDestSeqNumber (i.ReadNtohU32()); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
305 |
m_destinations.push_back (new_element); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
306 |
NS_ASSERT (28+j*11 < length); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
307 |
} |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
308 |
return i.GetDistanceFrom (start); |
4793 | 309 |
} |
4838
ce31277d72ad
Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents:
4835
diff
changeset
|
310 |
uint8_t |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
311 |
IePreq::GetInformationSize () const |
4829
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
312 |
{ |
4838
ce31277d72ad
Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents:
4835
diff
changeset
|
313 |
uint8_t retval = |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
314 |
1 //Flags |
4829
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
315 |
+1 //Hopcount |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
316 |
+1 //TTL |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
317 |
+4 //PREQ ID |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
318 |
+6 //Source address (originator) |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
319 |
+4 //Originator seqno |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
320 |
+4 //Lifetime |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
321 |
+4 //metric |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
322 |
+1; //destination count |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
323 |
if (m_destCount > m_maxSize) |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
324 |
retval += (m_maxSize*11); |
4829
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
325 |
else |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
326 |
retval += (m_destCount*11); |
4829
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
327 |
return retval; |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
328 |
} |
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
329 |
void |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
330 |
IePreq::PrintInformation (std::ostream &os) const |
4829
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
331 |
{ |
4896
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
332 |
os << "Originator address =" << m_originatorAddress; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
333 |
os << " TTL=" << (uint16_t)m_ttl; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
334 |
os << " Hopcount=" << (uint16_t)m_hopCount; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
335 |
os << " metric=" << m_metric; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
336 |
os << " Seqno=" << m_originatorSeqNumber; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
337 |
os << " Lifetime=" << m_lifetime; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
338 |
os << "\nDestinations are:\n"; |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
339 |
for (int j = 0; j < m_destCount; j++ ) |
e579c19f0dee
Preq propagation ported:)
Kirill Andreev <andreev@iitp.ru>
parents:
4877
diff
changeset
|
340 |
os << m_destinations[j]->GetDestinationAddress () << "\n"; |
4829
51b7bcb3fab3
Restructured PREQ and PREP
Kirill Andreev <andreev@iitp.ru>
parents:
4824
diff
changeset
|
341 |
} |
4793 | 342 |
std::vector<Ptr<DestinationAddressUnit> > |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
343 |
IePreq::GetDestinationList () |
4793 | 344 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
345 |
return m_destinations; |
4793 | 346 |
} |
347 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
348 |
IePreq::AddDestinationAddressElement ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
349 |
bool doFlag, bool rfFlag, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
350 |
Mac48Address dest_address, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
351 |
uint32_t dest_seq_number |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
352 |
) |
4793 | 353 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
354 |
for (std::vector<Ptr<DestinationAddressUnit> >::iterator i = m_destinations.begin (); i != m_destinations.end(); i++ ) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
355 |
if ((*i)->GetDestinationAddress () == dest_address) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
356 |
return; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
357 |
Ptr<DestinationAddressUnit>new_element = Create<DestinationAddressUnit> (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
358 |
new_element->SetFlags (doFlag, rfFlag); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
359 |
new_element->SetDestinationAddress (dest_address); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
360 |
new_element->SetDestSeqNumber (dest_seq_number); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
361 |
m_destinations.push_back (new_element); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
362 |
m_destCount++; |
4793 | 363 |
} |
364 |
||
365 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
366 |
IePreq::DelDestinationAddressElement (Mac48Address dest_address) |
4793 | 367 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
368 |
for (std::vector<Ptr<DestinationAddressUnit> >::iterator i = m_destinations.begin (); i != m_destinations.end(); i++) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
369 |
if ((*i)->GetDestinationAddress () == dest_address) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
370 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
371 |
m_destinations.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
372 |
m_destCount--; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
373 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
374 |
} |
4793 | 375 |
} |
376 |
||
377 |
void |
|
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
378 |
IePreq::ClearDestinationAddressElement () |
4793 | 379 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
380 |
int i; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
381 |
for (std::vector<Ptr<DestinationAddressUnit> >::iterator j = m_destinations.begin (); j != m_destinations.end(); j++) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
382 |
(*j) = 0; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
383 |
for (i = 0; i < m_destCount; i ++) |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
384 |
m_destinations.pop_back (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
385 |
m_destinations.clear (); |
4793 | 386 |
}; |
4872 | 387 |
|
388 |
} // namespace dot11s |
|
389 |
} //namespace ns3 |
|
4793 | 390 |