author | Pavel Boyko <boyko@iitp.ru> |
Mon, 04 May 2009 18:08:49 +0400 | |
changeset 5004 | 29928e8d1a1c |
parent 4951 | acaf07eb8542 |
child 5018 | aecd3eedd65f |
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-perr.h" |
4793 | 23 |
#include "ns3/address-utils.h" |
4841 | 24 |
#include "ns3/node.h" |
4951
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
25 |
#include "ns3/packet.h" |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
26 |
#include "ns3/test.h" |
4793 | 27 |
namespace ns3 { |
4872 | 28 |
namespace dot11s { |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
29 |
IePerr::~IePerr () |
4793 | 30 |
{ |
31 |
} |
|
32 |
||
33 |
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
|
34 |
IePerr::GetTypeId () |
4793 | 35 |
{ |
4920
fbd04c749aaa
HwmpRtable unit test + cleanup
Pavel Boyko <boyko@iitp.ru>
parents:
4877
diff
changeset
|
36 |
static TypeId tid = TypeId ("ns3::dot11s::IePerr") |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
37 |
.SetParent<Object> (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
38 |
return tid; |
4793 | 39 |
} |
40 |
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
|
41 |
IePerr::PrintInformation (std::ostream &os) const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
42 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
43 |
// FILL |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
44 |
} |
4793 | 45 |
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
|
46 |
IePerr::GetInstanceTypeId () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
47 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
48 |
return GetTypeId (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
49 |
} |
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
50 |
IePerr::IePerr (): |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
51 |
m_numOfDest (0) |
4793 | 52 |
{ |
53 |
} |
|
54 |
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
|
55 |
IePerr::GetNumOfDest () |
4793 | 56 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
57 |
return m_numOfDest; |
4793 | 58 |
} |
59 |
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
|
60 |
IePerr::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
|
61 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
62 |
i.WriteU8 (0); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
63 |
i.WriteU8 (m_numOfDest); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
64 |
NS_ASSERT (m_numOfDest == m_addressUnits.size ()); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
65 |
for (unsigned int j = 0; j < m_numOfDest; j++) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
66 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
67 |
WriteTo (i, m_addressUnits[j].destination); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
68 |
i.WriteHtonU32 (m_addressUnits[j].seqnum); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
69 |
} |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
70 |
} |
4838
ce31277d72ad
Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents:
4835
diff
changeset
|
71 |
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
|
72 |
IePerr::DeserializeInformation (Buffer::Iterator start, uint8_t length) |
4793 | 73 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
74 |
Buffer::Iterator i = start; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
75 |
i.Next (1); //Mode flags is not used now |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
76 |
m_numOfDest = i.ReadU8 (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
77 |
NS_ASSERT ((2+10*m_numOfDest) == length); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
78 |
length = 0; //to avoid compiler warning in optimized builds |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
79 |
for (unsigned int j = 0; j < m_numOfDest; j++) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
80 |
{ |
4872 | 81 |
FailedDestination unit; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
82 |
ReadFrom (i,unit.destination); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
83 |
unit.seqnum = i.ReadNtohU32 (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
84 |
m_addressUnits.push_back (unit); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
85 |
} |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
86 |
return i.GetDistanceFrom (start); |
4793 | 87 |
} |
88 |
||
4838
ce31277d72ad
Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents:
4835
diff
changeset
|
89 |
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
|
90 |
IePerr::GetInformationSize () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
91 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
92 |
uint8_t retval = |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
93 |
1 //ModeFlags |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
94 |
+1 //NumOfDests |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
95 |
+6*m_numOfDest |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
96 |
+4*m_numOfDest; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
97 |
return retval; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
98 |
} |
4832
780477df53b8
Returned size in bytes back
Kirill Andreev <andreev@iitp.ru>
parents:
4830
diff
changeset
|
99 |
|
4793 | 100 |
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
|
101 |
IePerr::AddAddressUnit (FailedDestination unit) |
4793 | 102 |
{ |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
103 |
for (unsigned int i = 0; i < m_addressUnits.size (); i ++) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
104 |
if (m_addressUnits[i].destination == unit.destination) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
105 |
return; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
106 |
m_addressUnits.push_back (unit); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
107 |
m_numOfDest++; |
4793 | 108 |
} |
109 |
||
4876
d78f1b978dac
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents:
4872
diff
changeset
|
110 |
std::vector<IePerr::FailedDestination> |
4923 | 111 |
IePerr::GetAddressUnitVector () const |
4793 | 112 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
113 |
return m_addressUnits; |
4793 | 114 |
} |
115 |
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
|
116 |
IePerr::DeleteAddressUnit (Mac48Address address) |
4793 | 117 |
{ |
4872 | 118 |
for (std::vector<FailedDestination>::iterator i = m_addressUnits.begin (); i != m_addressUnits.end(); i ++) |
4923 | 119 |
if (i->destination == address) |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
120 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
121 |
m_numOfDest --; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
122 |
m_addressUnits.erase (i); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
123 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
124 |
} |
4793 | 125 |
} |
4923 | 126 |
void |
127 |
IePerr::Merge(const IePerr perr) |
|
128 |
{ |
|
129 |
std::vector<FailedDestination> to_merge = perr.GetAddressUnitVector (); |
|
130 |
for (std::vector<FailedDestination>::iterator i = to_merge.begin (); i != to_merge.end(); i ++) |
|
131 |
{ |
|
132 |
bool should_add = true; |
|
133 |
for (std::vector<FailedDestination>::iterator j = m_addressUnits.begin (); j != m_addressUnits.end(); j ++) |
|
134 |
if ((i->destination == j->destination) && (i->seqnum <= j->seqnum)) |
|
135 |
should_add = false; |
|
136 |
if(should_add) |
|
137 |
AddAddressUnit (*i); |
|
138 |
} |
|
139 |
} |
|
4793 | 140 |
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
|
141 |
IePerr::ResetPerr () |
4793 | 142 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
143 |
m_numOfDest = 0; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4841
diff
changeset
|
144 |
m_addressUnits.clear (); |
4793 | 145 |
} |
4951
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
146 |
bool operator== (const IePerr & a, const IePerr & b) |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
147 |
{ |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
148 |
if(a.m_numOfDest != b.m_numOfDest) |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
149 |
return false; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
150 |
for(unsigned int i = 0; i < a.m_addressUnits.size(); i ++) |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
151 |
{ |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
152 |
if(a.m_addressUnits[i].destination != b.m_addressUnits[i].destination) |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
153 |
return false; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
154 |
if(a.m_addressUnits[i].seqnum != b.m_addressUnits[i].seqnum) |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
155 |
return false; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
156 |
} |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
157 |
return true; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
158 |
} |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
159 |
#ifdef RUN_SELF_TESTS |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
160 |
|
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
161 |
/// Built-in self test for IePreq |
5004 | 162 |
struct IePerrBist : public IeTest |
4951
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
163 |
{ |
5004 | 164 |
IePerrBist () : IeTest ("Mesh/802.11s/IE/PERR") {} |
4951
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
165 |
virtual bool RunTests(); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
166 |
}; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
167 |
|
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
168 |
/// Test instance |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
169 |
static IePerrBist g_IePerrBist; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
170 |
|
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
171 |
bool IePerrBist::RunTests () |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
172 |
{ |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
173 |
bool result(true); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
174 |
// create test information element |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
175 |
IePerr a; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
176 |
IePerr::FailedDestination dest; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
177 |
dest.destination = Mac48Address("11:22:33:44:55:66"); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
178 |
dest.seqnum = 1; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
179 |
a.AddAddressUnit(dest); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
180 |
dest.destination = Mac48Address("10:20:30:40:50:60"); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
181 |
dest.seqnum = 2; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
182 |
a.AddAddressUnit(dest); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
183 |
dest.destination = Mac48Address("01:02:03:04:05:06"); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
184 |
dest.seqnum = 3; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
185 |
a.AddAddressUnit(dest); |
5004 | 186 |
|
187 |
IePerr b = a; |
|
4951
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
188 |
b.Merge(a); |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
189 |
NS_TEST_ASSERT_EQUAL (a, b); |
5004 | 190 |
|
191 |
result = result && TestRoundtripSerialization (a); |
|
4951
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
192 |
return result; |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
193 |
} |
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
194 |
|
acaf07eb8542
Unit testing for dot11s-IE
Kirill Andreev <andreev@iitp.ru>
parents:
4924
diff
changeset
|
195 |
#endif // RUN_SELF_TESTS |
4793 | 196 |
|
4872 | 197 |
} // namespace dot11s |
198 |
} //namespace ns3 |
|
199 |
||
200 |