author | Craig Dowell <craigdo@ee.washington.edu> |
Wed, 05 Nov 2008 14:33:20 -0800 | |
changeset 3841 | 1e7abf5fca79 |
parent 3820 | c04ecfdce1ef |
child 4375 | db81fdcb06e7 |
permissions | -rw-r--r-- |
242 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2007 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 |
* Authors: |
|
19 |
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr>, |
|
20 |
*/ |
|
21 |
||
22 |
#include "ns3/packet.h" |
|
1505 | 23 |
#include "ns3/log.h" |
729
b5e744285e92
rename i-node to node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
728
diff
changeset
|
24 |
#include "ns3/node.h" |
524
082ffdd8fbd7
move code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
521
diff
changeset
|
25 |
#include "ns3/net-device.h" |
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
745
diff
changeset
|
26 |
#include "ns3/address.h" |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
27 |
#include "ns3/pointer.h" |
242 | 28 |
|
29 |
#include "arp-ipv4-interface.h" |
|
733
fb1882e7d785
rename ipv4.h to ipv4-l3-protocol.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
729
diff
changeset
|
30 |
#include "ipv4-l3-protocol.h" |
1177
c7bf3cf186ac
remove now-unused ArpPrivate class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1167
diff
changeset
|
31 |
#include "arp-l3-protocol.h" |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
32 |
#include "arp-cache.h" |
242 | 33 |
|
1505 | 34 |
NS_LOG_COMPONENT_DEFINE ("ArpIpv4Interface"); |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
35 |
|
242 | 36 |
namespace ns3 { |
37 |
||
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
38 |
TypeId |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
39 |
ArpIpv4Interface::GetTypeId (void) |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
40 |
{ |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
41 |
static TypeId tid = TypeId ("ns3::ArpIpv4Interface") |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
42 |
.SetParent<Ipv4Interface> () |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
43 |
.AddAttribute ("ArpCache", |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
44 |
"The arp cache for this ipv4 interface", |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
45 |
PointerValue (0), |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
46 |
MakePointerAccessor (&ArpIpv4Interface::m_cache), |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
47 |
MakePointerChecker<ArpIpv4Interface> ()) |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
48 |
; |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
49 |
return tid; |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
50 |
} |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
51 |
|
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
52 |
ArpIpv4Interface::ArpIpv4Interface () |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
53 |
: m_node (0), |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
54 |
m_device (0) |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
55 |
{ |
3149
5974bac1688f
more logging. Make sure we invoke parent's Dispose method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3147
diff
changeset
|
56 |
NS_LOG_FUNCTION (this); |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
57 |
} |
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
58 |
|
242 | 59 |
ArpIpv4Interface::~ArpIpv4Interface () |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
60 |
{ |
3149
5974bac1688f
more logging. Make sure we invoke parent's Dispose method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3147
diff
changeset
|
61 |
NS_LOG_FUNCTION (this); |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
62 |
} |
242 | 63 |
|
64 |
void |
|
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
65 |
ArpIpv4Interface::DoDispose (void) |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
66 |
{ |
3149
5974bac1688f
more logging. Make sure we invoke parent's Dispose method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3147
diff
changeset
|
67 |
NS_LOG_FUNCTION (this); |
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
68 |
m_device = 0; |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
69 |
m_cache = 0; |
3149
5974bac1688f
more logging. Make sure we invoke parent's Dispose method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3147
diff
changeset
|
70 |
Ipv4Interface::DoDispose (); |
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
71 |
} |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
72 |
|
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
73 |
void |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
74 |
ArpIpv4Interface::SetNode (Ptr<Node> node) |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
75 |
{ |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
76 |
m_node = node; |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
77 |
DoSetup (); |
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
78 |
} |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
79 |
void |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
80 |
ArpIpv4Interface::SetDevice (Ptr<NetDevice> device) |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
81 |
{ |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
82 |
m_device = device; |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
83 |
DoSetup (); |
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
84 |
} |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
85 |
|
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
86 |
Ptr<NetDevice> |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
87 |
ArpIpv4Interface::GetDevice (void) const |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
88 |
{ |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
89 |
return m_device; |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
90 |
} |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
91 |
|
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
92 |
void |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
93 |
ArpIpv4Interface::DoSetup (void) |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
94 |
{ |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
95 |
if (m_node == 0 || m_device == 0) |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
96 |
{ |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
97 |
return; |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
98 |
} |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
99 |
Ptr<ArpL3Protocol> arp = m_node->GetObject<ArpL3Protocol> (); |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
100 |
m_cache = arp->CreateCache (m_device, this); |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
101 |
} |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
102 |
|
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2538
diff
changeset
|
103 |
void |
1866
e7dbcc4df546
do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1505
diff
changeset
|
104 |
ArpIpv4Interface::SendTo (Ptr<Packet> p, Ipv4Address dest) |
242 | 105 |
{ |
2983
e3a416fe9dd5
NS_LOG_FUNCTION -> NS_LOG_FUNCTION_NOARGS and NS_LOG_PARAMS -> NS_LOG_FUNCTION
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
106 |
NS_LOG_FUNCTION (this << p << dest); |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
107 |
|
568
e1660959ecbb
use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
553
diff
changeset
|
108 |
NS_ASSERT (GetDevice () != 0); |
3820 | 109 |
if (dest == GetAddress ()) |
110 |
{ |
|
111 |
Ptr<Ipv4L3Protocol> ipv4 = m_node->GetObject<Ipv4L3Protocol> (); |
|
112 |
||
113 |
ipv4->Receive (0, p, Ipv4L3Protocol::PROT_NUMBER, |
|
114 |
GetDevice ()->GetBroadcast (), |
|
115 |
GetDevice ()->GetBroadcast (), |
|
116 |
NetDevice::PACKET_HOST // note: linux uses PACKET_LOOPBACK here |
|
117 |
); |
|
118 |
return; |
|
119 |
} |
|
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
120 |
if (m_device->NeedsArp ()) |
242 | 121 |
{ |
1505 | 122 |
NS_LOG_LOGIC ("Needs ARP"); |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
123 |
Ptr<ArpL3Protocol> arp = |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2231
diff
changeset
|
124 |
m_node->GetObject<ArpL3Protocol> (); |
1161
bb72baff8b26
replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
745
diff
changeset
|
125 |
Address hardwareDestination; |
933
df68dad55087
WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
745
diff
changeset
|
126 |
bool found; |
1318
89b78e2d521e
Fix for bug69: set local address correctly upon UDP connect; apply correct UDP connect() semantics (that sendto cannot override addresses on a connected socket); if destination is IPv4 limited broadcast address, convert to subnet-directed broadcast and send out on each interface; provide example csma-broadcast.cc script
Tom Henderson <tomh@tomh.org>
parents:
1229
diff
changeset
|
127 |
|
89b78e2d521e
Fix for bug69: set local address correctly upon UDP connect; apply correct UDP connect() semantics (that sendto cannot override addresses on a connected socket); if destination is IPv4 limited broadcast address, convert to subnet-directed broadcast and send out on each interface; provide example csma-broadcast.cc script
Tom Henderson <tomh@tomh.org>
parents:
1229
diff
changeset
|
128 |
if (dest.IsBroadcast () || |
89b78e2d521e
Fix for bug69: set local address correctly upon UDP connect; apply correct UDP connect() semantics (that sendto cannot override addresses on a connected socket); if destination is IPv4 limited broadcast address, convert to subnet-directed broadcast and send out on each interface; provide example csma-broadcast.cc script
Tom Henderson <tomh@tomh.org>
parents:
1229
diff
changeset
|
129 |
dest.IsSubnetDirectedBroadcast (GetNetworkMask ()) ) |
933
df68dad55087
WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
745
diff
changeset
|
130 |
{ |
1505 | 131 |
NS_LOG_LOGIC ("IsBroadcast"); |
1177
c7bf3cf186ac
remove now-unused ArpPrivate class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1167
diff
changeset
|
132 |
hardwareDestination = GetDevice ()->GetBroadcast (); |
c7bf3cf186ac
remove now-unused ArpPrivate class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1167
diff
changeset
|
133 |
found = true; |
933
df68dad55087
WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
745
diff
changeset
|
134 |
} |
1432
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1430
diff
changeset
|
135 |
else if (dest.IsMulticast ()) |
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1430
diff
changeset
|
136 |
{ |
1505 | 137 |
NS_LOG_LOGIC ("IsMulticast"); |
1441
d6f8a7546e7f
semi-real multicast hardware addresses
Craig Dowell <craigdo@ee.washington.edu>
parents:
1432
diff
changeset
|
138 |
NS_ASSERT_MSG(GetDevice ()->IsMulticast (), |
d6f8a7546e7f
semi-real multicast hardware addresses
Craig Dowell <craigdo@ee.washington.edu>
parents:
1432
diff
changeset
|
139 |
"ArpIpv4Interface::SendTo (): Sending multicast packet over " |
d6f8a7546e7f
semi-real multicast hardware addresses
Craig Dowell <craigdo@ee.washington.edu>
parents:
1432
diff
changeset
|
140 |
"non-multicast device"); |
1442
bb5cf98c0c64
real multicast enet addr, more source routes, default multicast route
Craig Dowell <craigdo@ee.washington.edu>
parents:
1441
diff
changeset
|
141 |
|
3841
1e7abf5fca79
Apply Patch to address bug 294 -- due to vincent
Craig Dowell <craigdo@ee.washington.edu>
parents:
3820
diff
changeset
|
142 |
hardwareDestination = GetDevice ()->GetMulticast(dest); |
1432
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1430
diff
changeset
|
143 |
found = true; |
3aef7d7a71c2
more multicast plumbing
Craig Dowell <craigdo@ee.washington.edu>
parents:
1430
diff
changeset
|
144 |
} |
933
df68dad55087
WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
745
diff
changeset
|
145 |
else |
df68dad55087
WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
745
diff
changeset
|
146 |
{ |
1505 | 147 |
NS_LOG_LOGIC ("ARP Lookup"); |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2983
diff
changeset
|
148 |
found = arp->Lookup (p, dest, GetDevice (), m_cache, &hardwareDestination); |
933
df68dad55087
WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
745
diff
changeset
|
149 |
} |
df68dad55087
WAF: add a --command-template option to e.g. allow running programs with valgrind, gdb, etc.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
745
diff
changeset
|
150 |
|
446
ceecc7397053
use NetDevice::NeedsArp where needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
151 |
if (found) |
ceecc7397053
use NetDevice::NeedsArp where needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
152 |
{ |
1505 | 153 |
NS_LOG_LOGIC ("Address Resolved. Send."); |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
154 |
GetDevice ()->Send (p, hardwareDestination, |
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
155 |
Ipv4L3Protocol::PROT_NUMBER); |
446
ceecc7397053
use NetDevice::NeedsArp where needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
156 |
} |
ceecc7397053
use NetDevice::NeedsArp where needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
157 |
} |
ceecc7397053
use NetDevice::NeedsArp where needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
158 |
else |
ceecc7397053
use NetDevice::NeedsArp where needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
345
diff
changeset
|
159 |
{ |
1505 | 160 |
NS_LOG_LOGIC ("Doesn't need ARP"); |
1430
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
161 |
GetDevice ()->Send (p, GetDevice ()->GetBroadcast (), |
25fa26a6533e
many debug prints
Craig Dowell <craigdo@ee.washington.edu>
parents:
1229
diff
changeset
|
162 |
Ipv4L3Protocol::PROT_NUMBER); |
242 | 163 |
} |
164 |
} |
|
165 |
||
166 |
}//namespace ns3 |