author | Kirill Andreev <andreev@iitp.ru> |
Wed, 22 Jul 2009 14:52:42 +0400 | |
changeset 5129 | 5688b8da4526 |
parent 5124 | e206046b2e44 |
child 5132 | aee541a30256 |
permissions | -rw-r--r-- |
4974 | 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 |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
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 |
* |
|
18 |
* Authors: Kirill Andreev <andreev@iitp.ru> |
|
19 |
*/ |
|
20 |
||
21 |
#include "ie-dot11s-peering-protocol.h" |
|
5129 | 22 |
namespace ns3 |
23 |
{ |
|
24 |
namespace dot11s |
|
25 |
{ |
|
4974 | 26 |
uint8_t |
27 |
IePeeringProtocol::GetInformationSize () const |
|
28 |
{ |
|
29 |
return 1; |
|
30 |
} |
|
5129 | 31 |
IePeeringProtocol::IePeeringProtocol () : |
32 |
m_protocol (0) |
|
4974 | 33 |
{ |
34 |
} |
|
5124
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
35 |
WifiElementId |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
36 |
IePeeringProtocol::ElementId () const |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
37 |
{ |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
38 |
return IE11S_MESH_PEERING_PROTOCOL_VERSION; |
e206046b2e44
removed GetElementId from *.h files. Fixed spaces before '(' and added {} when needed.
Kirill Andreev <andreev@iitp.ru>
parents:
5063
diff
changeset
|
39 |
} |
4974 | 40 |
void |
41 |
IePeeringProtocol::SerializeInformation (Buffer::Iterator i) const |
|
42 |
{ |
|
43 |
i.WriteU8 (m_protocol); |
|
44 |
} |
|
45 |
uint8_t |
|
46 |
IePeeringProtocol::DeserializeInformation (Buffer::Iterator i, uint8_t length) |
|
47 |
{ |
|
48 |
Buffer::Iterator start = i; |
|
5129 | 49 |
m_protocol = i.ReadU8 (); |
4974 | 50 |
return i.GetDistanceFrom (start); |
51 |
} |
|
52 |
void |
|
53 |
IePeeringProtocol::PrintInformation (std::ostream& os) const |
|
54 |
{ |
|
5063 | 55 |
os << "peering protocol = " << m_protocol; |
4974 | 56 |
} |
57 |
} // namespace dot11s |
|
58 |
} //namespace ns3 |
|
59 |