author | Kirill Andreev <andreev@iitp.ru> |
Wed, 25 Mar 2009 12:23:12 +0300 | |
changeset 4876 | d78f1b978dac |
parent 4852 | 123dc54d734e |
permissions | -rw-r--r-- |
4811
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
2 |
/* |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
3 |
* Copyright (c) 2009 IITP RAS |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
4 |
* |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
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 |
4811
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
7 |
* published by the Free Software Foundation; |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
8 |
* |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
12 |
* GNU General Public License for more details. |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
13 |
* |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
17 |
* |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
18 |
* Author: Kirill Andreev <andreev@iitp.ru> |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
19 |
*/ |
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
20 |
|
080b8f23fa4a
Added license information to some files.
Andrey Mazo <mazo@iitp.ru>
parents:
4809
diff
changeset
|
21 |
|
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
22 |
#include "ns3/assert.h" |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
23 |
#include "ns3/address-utils.h" |
4813
e4e2c44d27cd
All mesh related filed moved to devices/mesh. Let the refactoring begins!
Pavel Boyko <boyko@iitp.ru>
parents:
4812
diff
changeset
|
24 |
#include "ns3/mesh-wifi-mac-header.h" |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
25 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
26 |
namespace ns3 { |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
27 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
28 |
/*********************************************************** |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
29 |
* Here Mesh Mac Header functionality is defined. |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
30 |
***********************************************************/ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
31 |
TypeId |
4809
c7c4e4f260a9
Removed unneeded (void) (closed ticket #22), renamed enums
Kirill Andreev <andreev@iitp.ru>
parents:
4802
diff
changeset
|
32 |
WifiMeshHeader::GetTypeId () |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
33 |
{ |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
34 |
static TypeId tid = TypeId ("ns3::WifiMeshHeader") |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
35 |
.SetParent<Header> () |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
36 |
.AddConstructor<WifiMeshHeader> () |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
37 |
; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
38 |
return tid; |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
39 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
40 |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
41 |
WifiMeshHeader::WifiMeshHeader () |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
42 |
:m_meshFlags (0) |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
43 |
{ |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
44 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
45 |
|
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
46 |
WifiMeshHeader::~WifiMeshHeader () |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
47 |
{ |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
48 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
49 |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
50 |
TypeId |
4809
c7c4e4f260a9
Removed unneeded (void) (closed ticket #22), renamed enums
Kirill Andreev <andreev@iitp.ru>
parents:
4802
diff
changeset
|
51 |
WifiMeshHeader::GetInstanceTypeId () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
52 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
53 |
return GetTypeId (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
54 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
55 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
56 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
57 |
WifiMeshHeader::SetAddr5 (Mac48Address address) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
58 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
59 |
m_addr5 = address; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
60 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
61 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
62 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
63 |
WifiMeshHeader::SetAddr6 (Mac48Address address) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
64 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
65 |
m_addr6 = address; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
66 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
67 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
68 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
69 |
WifiMeshHeader::SetAddr7 (Mac48Address address) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
70 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
71 |
m_addr7 = address; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
72 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
73 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
74 |
Mac48Address |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
75 |
WifiMeshHeader::GetAddr5 () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
76 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
77 |
return m_addr5; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
78 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
79 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
80 |
Mac48Address |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
81 |
WifiMeshHeader::GetAddr6 () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
82 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
83 |
return m_addr6; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
84 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
85 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
86 |
Mac48Address |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
87 |
WifiMeshHeader::GetAddr7 () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
88 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
89 |
return m_addr7; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
90 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
91 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
92 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
93 |
WifiMeshHeader::SetMeshSeqno (uint32_t seqno) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
94 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
95 |
m_meshSeqno = seqno; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
96 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
97 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
98 |
uint32_t |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
99 |
WifiMeshHeader::GetMeshSeqno () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
100 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
101 |
return m_meshSeqno; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
102 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
103 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
104 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
105 |
WifiMeshHeader::SetMeshTtl (uint8_t TTL) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
106 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
107 |
m_meshTtl = TTL; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
108 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
109 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
110 |
uint8_t |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
111 |
WifiMeshHeader::GetMeshTtl () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
112 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
113 |
return m_meshTtl; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
114 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
115 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
116 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
117 |
WifiMeshHeader::SetAddressExt (uint8_t num_of_addresses) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
118 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
119 |
if (num_of_addresses > 3) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
120 |
return; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
121 |
m_meshFlags = 0xc0 | (num_of_addresses << 6); |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
122 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
123 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
124 |
uint8_t |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
125 |
WifiMeshHeader::GetAddressExt () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
126 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
127 |
return ((0xc0 & m_meshFlags) >> 6); |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
128 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
129 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
130 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
131 |
uint32_t |
4809
c7c4e4f260a9
Removed unneeded (void) (closed ticket #22), renamed enums
Kirill Andreev <andreev@iitp.ru>
parents:
4802
diff
changeset
|
132 |
WifiMeshHeader::GetSerializedSize () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
133 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
134 |
return 6 + ((0xc0 & m_meshFlags) >> 6)*6; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
135 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
136 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
137 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
138 |
WifiMeshHeader::Serialize (Buffer::Iterator start) const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
139 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
140 |
Buffer::Iterator i = start; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
141 |
i.WriteU8 (m_meshFlags); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
142 |
i.WriteU8 (m_meshTtl); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
143 |
i.WriteU32 (m_meshSeqno); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
144 |
uint8_t addresses_to_add = (m_meshFlags & 0xc0) >> 6; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
145 |
//Writing Address extensions: |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
146 |
if (addresses_to_add > 0) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
147 |
WriteTo (i, m_addr5); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
148 |
if (addresses_to_add > 1) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
149 |
WriteTo (i, m_addr6); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
150 |
if (addresses_to_add > 2) |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
151 |
WriteTo (i, m_addr7); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
152 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
153 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
154 |
uint32_t |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
155 |
WifiMeshHeader::Deserialize (Buffer::Iterator start) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
156 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
157 |
Buffer::Iterator i = start; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
158 |
uint8_t addresses_to_read = 0; |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
159 |
m_meshFlags = i.ReadU8 (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
160 |
m_meshTtl = i.ReadU8 (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
161 |
m_meshSeqno = i.ReadU32 (); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
162 |
addresses_to_read = (m_meshFlags & 0xc0) >> 6; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
163 |
if (addresses_to_read > 0) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
164 |
ReadFrom (i, m_addr5); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
165 |
if (addresses_to_read > 1) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
166 |
ReadFrom (i, m_addr6); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
167 |
if (addresses_to_read > 2) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
168 |
ReadFrom (i, m_addr7); |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
169 |
return i.GetDistanceFrom (start); |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
170 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
171 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
172 |
WifiMeshHeader::Print (std::ostream &os) const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
173 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
174 |
os << "flags" << m_meshFlags |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
175 |
<< "ttl" << m_meshTtl |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
176 |
<< "seqno" << m_meshSeqno; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
177 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
178 |
/********************************************************** |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
179 |
* MultihopActionFrame |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
180 |
**********************************************************/ |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
181 |
WifiMeshMultihopActionHeader::WifiMeshMultihopActionHeader () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
182 |
{ |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
183 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
184 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
185 |
WifiMeshMultihopActionHeader::~WifiMeshMultihopActionHeader () |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
186 |
{ |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
187 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
188 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
189 |
void |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
190 |
WifiMeshMultihopActionHeader::SetAction ( |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
191 |
enum WifiMeshMultihopActionHeader::CategoryValue type, |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
192 |
WifiMeshMultihopActionHeader::ACTION_VALUE action) |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
193 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
194 |
switch (type) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
195 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
196 |
case MESH_PEER_LINK_MGT: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
197 |
m_category = 4; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
198 |
switch (action.peerLink) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
199 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
200 |
case PEER_LINK_OPEN: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
201 |
m_actionValue = 0; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
202 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
203 |
case PEER_LINK_CONFIRM: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
204 |
m_actionValue = 1; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
205 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
206 |
case PEER_LINK_CLOSE: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
207 |
m_actionValue = 2; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
208 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
209 |
}; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
210 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
211 |
case MESH_LINK_METRIC: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
212 |
m_category = 5; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
213 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
214 |
case MESH_PATH_SELECTION: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
215 |
m_category = 6; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
216 |
switch (action.pathSelection) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
217 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
218 |
case PATH_REQUEST: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
219 |
m_actionValue = 0; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
220 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
221 |
case PATH_REPLY: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
222 |
m_actionValue = 1; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
223 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
224 |
case PATH_ERROR: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
225 |
m_actionValue = 2; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
226 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
227 |
case ROOT_ANNOUNCEMENT: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
228 |
m_actionValue = 3; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
229 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
230 |
}; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
231 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
232 |
case MESH_INTERWORK_ACTION: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
233 |
m_category = 7; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
234 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
235 |
case MESH_RESOURCE_COORDINATION: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
236 |
m_category = 8; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
237 |
break; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
238 |
}; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
239 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
240 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
241 |
enum WifiMeshMultihopActionHeader::CategoryValue |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
242 |
WifiMeshMultihopActionHeader::GetCategory () |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
243 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
244 |
switch (m_category) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
245 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
246 |
case 4: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
247 |
return MESH_PEER_LINK_MGT; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
248 |
case 5: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
249 |
return MESH_LINK_METRIC; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
250 |
case 6: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
251 |
return MESH_PATH_SELECTION; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
252 |
case 7: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
253 |
return MESH_INTERWORK_ACTION; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
254 |
case 8: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
255 |
return MESH_RESOURCE_COORDINATION; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
256 |
default: |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
257 |
NS_ASSERT (false); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
258 |
return MESH_PEER_LINK_MGT; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
259 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
260 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
261 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
262 |
WifiMeshMultihopActionHeader::ACTION_VALUE |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
263 |
WifiMeshMultihopActionHeader::GetAction () |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
264 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
265 |
ACTION_VALUE retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
266 |
switch (m_category) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
267 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
268 |
case 4: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
269 |
//MESH_PEER_LINK_MGT; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
270 |
switch (m_actionValue) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
271 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
272 |
case 0: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
273 |
retval.peerLink = PEER_LINK_OPEN; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
274 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
275 |
case 1: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
276 |
retval.peerLink = PEER_LINK_CONFIRM; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
277 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
278 |
case 2: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
279 |
retval.peerLink = PEER_LINK_CLOSE; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
280 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
281 |
default: |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
282 |
NS_ASSERT (false); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
283 |
return retval; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
284 |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
285 |
} |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
286 |
case 5: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
287 |
//MESH_LINK_METRIC; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
288 |
case 6: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
289 |
//MESH_PATH_SELECTION; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
290 |
switch (m_actionValue) |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
291 |
{ |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
292 |
case 0: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
293 |
retval.pathSelection = PATH_REQUEST; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
294 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
295 |
case 1: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
296 |
retval.pathSelection = PATH_REPLY; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
297 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
298 |
case 2: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
299 |
retval.pathSelection = PATH_ERROR; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
300 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
301 |
case 3: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
302 |
retval.pathSelection = ROOT_ANNOUNCEMENT; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
303 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
304 |
default: |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
305 |
NS_ASSERT (false); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
306 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
307 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
308 |
|
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
309 |
case 7: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
310 |
//MESH_INTERWORK_ACTION; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
311 |
case 8: |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
312 |
//MESH_RESOURCE_COORDINATION; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
313 |
default: |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
314 |
NS_ASSERT (false); |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
315 |
return retval; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
316 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
317 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
318 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
319 |
TypeId |
4809
c7c4e4f260a9
Removed unneeded (void) (closed ticket #22), renamed enums
Kirill Andreev <andreev@iitp.ru>
parents:
4802
diff
changeset
|
320 |
WifiMeshMultihopActionHeader::GetTypeId () |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
321 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
322 |
static TypeId tid = TypeId ("ns3::WifiMeshMultihopActionHeader") |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
323 |
.SetParent<Header> () |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
324 |
.AddConstructor<WifiMeshMultihopActionHeader> () |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
325 |
; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
326 |
return tid; |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
327 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
328 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
329 |
TypeId |
4809
c7c4e4f260a9
Removed unneeded (void) (closed ticket #22), renamed enums
Kirill Andreev <andreev@iitp.ru>
parents:
4802
diff
changeset
|
330 |
WifiMeshMultihopActionHeader::GetInstanceTypeId () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
331 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
332 |
return GetTypeId (); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
333 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
334 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
335 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
336 |
WifiMeshMultihopActionHeader::Print (std::ostream &os) const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
337 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
338 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
339 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
340 |
uint32_t |
4809
c7c4e4f260a9
Removed unneeded (void) (closed ticket #22), renamed enums
Kirill Andreev <andreev@iitp.ru>
parents:
4802
diff
changeset
|
341 |
WifiMeshMultihopActionHeader::GetSerializedSize () const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
342 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
343 |
return 2; |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
344 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
345 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
346 |
void |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
347 |
WifiMeshMultihopActionHeader::Serialize (Buffer::Iterator start) const |
4852
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
348 |
{ |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
349 |
start.WriteU8 (m_category); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
350 |
start.WriteU8 (m_actionValue); |
123dc54d734e
Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents:
4813
diff
changeset
|
351 |
} |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
352 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
353 |
uint32_t |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
354 |
WifiMeshMultihopActionHeader::Deserialize (Buffer::Iterator start) |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
355 |
{ |
4812
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
356 |
Buffer::Iterator i = start; |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
357 |
m_category = i.ReadU8 (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
358 |
m_actionValue = i.ReadU8 (); |
adcb26652e1d
Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents:
4811
diff
changeset
|
359 |
return i.GetDistanceFrom (start); |
4798
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
360 |
} |
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
361 |
|
f5f30f79d845
Restructured files - unfinished
Kirill Andreev <andreev@iitp.ru>
parents:
diff
changeset
|
362 |
} // namespace ns3 |