author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Fri, 26 Sep 2014 15:51:00 -0700 | |
changeset 10968 | 2d29fee2b7b8 |
parent 10652 | dc18deba4502 |
child 11259 | ea2f6a3ed14e |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7176
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
242 | 2 |
/* |
3 |
* Copyright (c) 2005 INRIA |
|
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
19 |
*/ |
|
20 |
||
286
57e6a2006962
convert use of <cassert> to "ns3/assert.h"
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
258
diff
changeset
|
21 |
#include "ns3/assert.h" |
976
e82bac1816ce
ethernet Header and Trailer classes
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents:
902
diff
changeset
|
22 |
#include "ns3/address-utils.h" |
242 | 23 |
#include "arp-header.h" |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
24 |
#include "ns3/log.h" |
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
25 |
|
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
|
26 |
namespace ns3 { |
242 | 27 |
|
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
|
28 |
NS_LOG_COMPONENT_DEFINE ("ArpHeader"); |
1152
1d06449f0a98
macros to ensure proper initialization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1151
diff
changeset
|
29 |
|
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10410
diff
changeset
|
30 |
NS_OBJECT_ENSURE_REGISTERED (ArpHeader); |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1236
diff
changeset
|
31 |
|
242 | 32 |
void |
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
902
diff
changeset
|
33 |
ArpHeader::SetRequest (Address sourceHardwareAddress, |
242 | 34 |
Ipv4Address sourceProtocolAddress, |
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
902
diff
changeset
|
35 |
Address destinationHardwareAddress, |
242 | 36 |
Ipv4Address destinationProtocolAddress) |
37 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
38 |
NS_LOG_FUNCTION (this << sourceHardwareAddress << sourceProtocolAddress << destinationHardwareAddress << destinationProtocolAddress); |
242 | 39 |
m_type = ARP_TYPE_REQUEST; |
40 |
m_macSource = sourceHardwareAddress; |
|
41 |
m_macDest = destinationHardwareAddress; |
|
42 |
m_ipv4Source = sourceProtocolAddress; |
|
43 |
m_ipv4Dest = destinationProtocolAddress; |
|
44 |
} |
|
45 |
void |
|
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
902
diff
changeset
|
46 |
ArpHeader::SetReply (Address sourceHardwareAddress, |
242 | 47 |
Ipv4Address sourceProtocolAddress, |
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
902
diff
changeset
|
48 |
Address destinationHardwareAddress, |
242 | 49 |
Ipv4Address destinationProtocolAddress) |
50 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
51 |
NS_LOG_FUNCTION (this << sourceHardwareAddress << sourceProtocolAddress << destinationHardwareAddress << destinationProtocolAddress); |
242 | 52 |
m_type = ARP_TYPE_REPLY; |
53 |
m_macSource = sourceHardwareAddress; |
|
54 |
m_macDest = destinationHardwareAddress; |
|
55 |
m_ipv4Source = sourceProtocolAddress; |
|
56 |
m_ipv4Dest = destinationProtocolAddress; |
|
57 |
} |
|
58 |
bool |
|
59 |
ArpHeader::IsRequest (void) const |
|
60 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
61 |
NS_LOG_FUNCTION (this); |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
62 |
return (m_type == ARP_TYPE_REQUEST) ? true : false; |
242 | 63 |
} |
64 |
bool |
|
65 |
ArpHeader::IsReply (void) const |
|
66 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
67 |
NS_LOG_FUNCTION (this); |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
68 |
return (m_type == ARP_TYPE_REPLY) ? true : false; |
242 | 69 |
} |
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
902
diff
changeset
|
70 |
Address |
242 | 71 |
ArpHeader::GetSourceHardwareAddress (void) |
72 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
73 |
NS_LOG_FUNCTION (this); |
242 | 74 |
return m_macSource; |
75 |
} |
|
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
902
diff
changeset
|
76 |
Address |
242 | 77 |
ArpHeader::GetDestinationHardwareAddress (void) |
78 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
79 |
NS_LOG_FUNCTION (this); |
242 | 80 |
return m_macDest; |
81 |
} |
|
82 |
Ipv4Address |
|
83 |
ArpHeader::GetSourceIpv4Address (void) |
|
84 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
85 |
NS_LOG_FUNCTION (this); |
242 | 86 |
return m_ipv4Source; |
87 |
} |
|
88 |
Ipv4Address |
|
89 |
ArpHeader::GetDestinationIpv4Address (void) |
|
90 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
91 |
NS_LOG_FUNCTION (this); |
242 | 92 |
return m_ipv4Dest; |
93 |
} |
|
94 |
||
2646
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
95 |
|
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
96 |
TypeId |
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
97 |
ArpHeader::GetTypeId (void) |
795
cd108c9817d0
add Chunk::GetName and implement it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
524
diff
changeset
|
98 |
{ |
2646
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
99 |
static TypeId tid = TypeId ("ns3::ArpHeader") |
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
100 |
.SetParent<Header> () |
2650
3de4cacb8981
make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2646
diff
changeset
|
101 |
.AddConstructor<ArpHeader> () |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
102 |
; |
2646
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
103 |
return tid; |
795
cd108c9817d0
add Chunk::GetName and implement it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
524
diff
changeset
|
104 |
} |
2646
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
105 |
TypeId |
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
106 |
ArpHeader::GetInstanceTypeId (void) const |
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
107 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
108 |
NS_LOG_FUNCTION (this); |
2646
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
109 |
return GetTypeId (); |
c1fef7686472
remove dead code.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2643
diff
changeset
|
110 |
} |
242 | 111 |
void |
1232
2e8c3f8bb77f
remove Chunk base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1198
diff
changeset
|
112 |
ArpHeader::Print (std::ostream &os) const |
242 | 113 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
114 |
NS_LOG_FUNCTION (this << &os); |
242 | 115 |
if (IsRequest ()) |
116 |
{ |
|
2653
b8eff7186c5c
improve pretty-printing output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2650
diff
changeset
|
117 |
os << "request " |
902
b85919168708
change arp pretty printing to new format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
795
diff
changeset
|
118 |
<< "source mac: " << m_macSource << " " |
b85919168708
change arp pretty printing to new format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
795
diff
changeset
|
119 |
<< "source ipv4: " << m_ipv4Source << " " |
b85919168708
change arp pretty printing to new format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
795
diff
changeset
|
120 |
<< "dest ipv4: " << m_ipv4Dest |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
121 |
; |
242 | 122 |
} |
123 |
else |
|
124 |
{ |
|
286
57e6a2006962
convert use of <cassert> to "ns3/assert.h"
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
258
diff
changeset
|
125 |
NS_ASSERT (IsReply ()); |
2653
b8eff7186c5c
improve pretty-printing output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2650
diff
changeset
|
126 |
os << "reply " |
902
b85919168708
change arp pretty printing to new format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
795
diff
changeset
|
127 |
<< "source mac: " << m_macSource << " " |
b85919168708
change arp pretty printing to new format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
795
diff
changeset
|
128 |
<< "source ipv4: " << m_ipv4Source << " " |
b85919168708
change arp pretty printing to new format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
795
diff
changeset
|
129 |
<< "dest mac: " << m_macDest << " " |
b85919168708
change arp pretty printing to new format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
795
diff
changeset
|
130 |
<< "dest ipv4: " <<m_ipv4Dest |
7176
9f2663992e99
internet coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6834
diff
changeset
|
131 |
; |
242 | 132 |
} |
133 |
} |
|
134 |
uint32_t |
|
135 |
ArpHeader::GetSerializedSize (void) const |
|
136 |
{ |
|
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
137 |
NS_LOG_FUNCTION (this); |
8808
156662c93da6
bug 1396: ARP with hardware addresses longer than 6 bytes
Mike Moreton <mjvm_ns@hotmail.com>
parents:
7386
diff
changeset
|
138 |
NS_ASSERT((m_macSource.GetLength () == 6) || (m_macSource.GetLength () == 8)); |
156662c93da6
bug 1396: ARP with hardware addresses longer than 6 bytes
Mike Moreton <mjvm_ns@hotmail.com>
parents:
7386
diff
changeset
|
139 |
NS_ASSERT (m_macSource.GetLength () == m_macDest.GetLength ()); |
156662c93da6
bug 1396: ARP with hardware addresses longer than 6 bytes
Mike Moreton <mjvm_ns@hotmail.com>
parents:
7386
diff
changeset
|
140 |
|
156662c93da6
bug 1396: ARP with hardware addresses longer than 6 bytes
Mike Moreton <mjvm_ns@hotmail.com>
parents:
7386
diff
changeset
|
141 |
uint32_t length = 16; // Length minus two hardware addresses |
156662c93da6
bug 1396: ARP with hardware addresses longer than 6 bytes
Mike Moreton <mjvm_ns@hotmail.com>
parents:
7386
diff
changeset
|
142 |
length += m_macSource.GetLength () * 2; |
156662c93da6
bug 1396: ARP with hardware addresses longer than 6 bytes
Mike Moreton <mjvm_ns@hotmail.com>
parents:
7386
diff
changeset
|
143 |
|
156662c93da6
bug 1396: ARP with hardware addresses longer than 6 bytes
Mike Moreton <mjvm_ns@hotmail.com>
parents:
7386
diff
changeset
|
144 |
return length; |
242 | 145 |
} |
146 |
||
463
c2082308e01a
merge Packet API changes needed for Packet pretty printing.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
286
diff
changeset
|
147 |
void |
1232
2e8c3f8bb77f
remove Chunk base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1198
diff
changeset
|
148 |
ArpHeader::Serialize (Buffer::Iterator start) const |
242 | 149 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
150 |
NS_LOG_FUNCTION (this << &start); |
242 | 151 |
Buffer::Iterator i = start; |
286
57e6a2006962
convert use of <cassert> to "ns3/assert.h"
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
258
diff
changeset
|
152 |
NS_ASSERT (m_macSource.GetLength () == m_macDest.GetLength ()); |
242 | 153 |
|
154 |
/* ethernet */ |
|
155 |
i.WriteHtonU16 (0x0001); |
|
156 |
/* ipv4 */ |
|
157 |
i.WriteHtonU16 (0x0800); |
|
258
df3bca25ae37
make sure that mac addr len is correctly written
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
242
diff
changeset
|
158 |
i.WriteU8 (m_macSource.GetLength ()); |
242 | 159 |
i.WriteU8 (4); |
160 |
i.WriteHtonU16 (m_type); |
|
161 |
WriteTo (i, m_macSource); |
|
162 |
WriteTo (i, m_ipv4Source); |
|
163 |
WriteTo (i, m_macDest); |
|
164 |
WriteTo (i, m_ipv4Dest); |
|
165 |
} |
|
4170
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
166 |
|
463
c2082308e01a
merge Packet API changes needed for Packet pretty printing.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
286
diff
changeset
|
167 |
uint32_t |
1232
2e8c3f8bb77f
remove Chunk base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1198
diff
changeset
|
168 |
ArpHeader::Deserialize (Buffer::Iterator start) |
242 | 169 |
{ |
9704
1db7690f8e8f
Partially clean up function logging of internet module.
Kristijan Lenković <k.lenkovic@me.com>
parents:
8808
diff
changeset
|
170 |
NS_LOG_FUNCTION (this << &start); |
242 | 171 |
Buffer::Iterator i = start; |
4184
e7a525be7dc2
remove misguided __attribute__ ((unused))s
Craig Dowell <craigdo@ee.washington.edu>
parents:
4183
diff
changeset
|
172 |
i.Next (2); // Skip HRD |
4170
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
173 |
uint32_t protocolType = i.ReadNtohU16 (); // Read PRO |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
174 |
uint32_t hardwareAddressLen = i.ReadU8 (); // Read HLN |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
175 |
uint32_t protocolAddressLen = i.ReadU8 (); // Read PLN |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
176 |
|
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
177 |
// |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
178 |
// It is implicit here that we have a protocol type of 0x800 (IP). |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
179 |
// It is also implicit here that we are using Ipv4 (PLN == 4). |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
180 |
// If this isn't the case, we need to return an error since we don't want to |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
181 |
// be too fragile if we get connected to real networks. |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
182 |
// |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
183 |
if (protocolType != 0x800 || protocolAddressLen != 4) |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
184 |
{ |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
185 |
return 0; |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
186 |
} |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
187 |
|
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
188 |
m_type = i.ReadNtohU16 (); // Read OP |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
189 |
ReadFrom (i, m_macSource, hardwareAddressLen); // Read SHA (size HLN) |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
190 |
ReadFrom (i, m_ipv4Source); // Read SPA (size PLN == 4) |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
191 |
ReadFrom (i, m_macDest, hardwareAddressLen); // Read THA (size HLN) |
8e5bdeb6a71b
turn on checksums in example csma-tap-bridge and tweaks to make ping demo work
Craig Dowell <craigdo@ee.washington.edu>
parents:
3260
diff
changeset
|
192 |
ReadFrom (i, m_ipv4Dest); // Read TPA (size PLN == 4) |
463
c2082308e01a
merge Packet API changes needed for Packet pretty printing.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
286
diff
changeset
|
193 |
return GetSerializedSize (); |
242 | 194 |
} |
195 |
||
7386
2310ed220a61
standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents:
7385
diff
changeset
|
196 |
} // namespace ns3 |