author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Fri, 26 Sep 2014 15:51:00 -0700 | |
changeset 10968 | 2d29fee2b7b8 |
parent 10652 | dc18deba4502 |
child 11264 | 8eeabddc6c40 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
6801
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6349 | 2 |
/* |
3 |
* Copyright (c) 2009 CTTC |
|
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 |
* Author: Nicola Baldo <nbaldo@cttc.es> |
|
19 |
*/ |
|
20 |
||
21 |
#include <ns3/log.h> |
|
22 |
#include "aloha-noack-mac-header.h" |
|
23 |
||
24 |
||
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
25 |
namespace ns3 { |
6349 | 26 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
27 |
NS_LOG_COMPONENT_DEFINE ("AlohaNoackMacHeader"); |
6349 | 28 |
|
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10410
diff
changeset
|
29 |
NS_OBJECT_ENSURE_REGISTERED (AlohaNoackMacHeader); |
6393
f7e1f9dfa08d
ensure objects are regsitered
Josh Pelkey <jpelkey@gatech.edu>
parents:
6349
diff
changeset
|
30 |
|
6349 | 31 |
TypeId |
32 |
AlohaNoackMacHeader::GetTypeId (void) |
|
33 |
{ |
|
6445 | 34 |
static TypeId tid = TypeId ("ns3::AlohaNoackMacHeader") |
6349 | 35 |
.SetParent<Header> () |
36 |
.AddConstructor<AlohaNoackMacHeader> () |
|
37 |
; |
|
38 |
return tid; |
|
39 |
} |
|
40 |
||
41 |
TypeId |
|
42 |
AlohaNoackMacHeader::GetInstanceTypeId (void) const |
|
43 |
{ |
|
44 |
return GetTypeId (); |
|
45 |
} |
|
46 |
||
47 |
||
48 |
||
49 |
uint32_t |
|
50 |
AlohaNoackMacHeader::GetSerializedSize (void) const |
|
51 |
{ |
|
52 |
return 12; |
|
53 |
} |
|
54 |
||
55 |
||
56 |
||
57 |
void |
|
58 |
AlohaNoackMacHeader::Serialize (Buffer::Iterator start) const |
|
59 |
{ |
|
60 |
WriteTo (start, m_destination); |
|
61 |
WriteTo (start, m_source); |
|
62 |
} |
|
63 |
||
64 |
uint32_t |
|
65 |
AlohaNoackMacHeader::Deserialize (Buffer::Iterator start) |
|
66 |
{ |
|
67 |
ReadFrom (start, m_destination); |
|
68 |
ReadFrom (start, m_source); |
|
69 |
return GetSerializedSize (); |
|
70 |
} |
|
71 |
||
72 |
||
73 |
void |
|
74 |
AlohaNoackMacHeader::Print (std::ostream &os) const |
|
75 |
{ |
|
76 |
os << "src=" << m_source |
|
77 |
<< "dst=" << m_destination; |
|
78 |
} |
|
79 |
||
80 |
||
81 |
void |
|
82 |
AlohaNoackMacHeader::SetSource (Mac48Address source) |
|
83 |
{ |
|
84 |
m_source = source; |
|
85 |
} |
|
86 |
||
87 |
Mac48Address |
|
88 |
AlohaNoackMacHeader::GetSource () const |
|
89 |
{ |
|
90 |
return m_source; |
|
91 |
} |
|
92 |
||
93 |
void |
|
94 |
AlohaNoackMacHeader::SetDestination (Mac48Address dst) |
|
95 |
{ |
|
96 |
m_destination = dst; |
|
97 |
} |
|
98 |
||
99 |
Mac48Address |
|
100 |
AlohaNoackMacHeader::GetDestination () const |
|
101 |
{ |
|
102 |
return m_destination; |
|
103 |
} |
|
104 |
||
105 |
||
106 |
||
107 |
||
108 |
} // namespace ns3 |
|
109 |
||
110 |