merge with ns-3-dev

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2009-09-08 13:57:17 +01:00
commit be1e0dea3f
88 files changed
+1844 -1070

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ ArpL3Protocol::CreateCache (Ptr<NetDevice> device, Ptr<Ipv4Interface> interface)
Ptr<ArpCache> cache = CreateObject<ArpCache> ();
cache->SetDevice (device, interface);
NS_ASSERT (device->IsBroadcast ());
device->SetLinkChangeCallback (MakeCallback (&ArpCache::Flush, cache));
device->AddLinkChangeCallback (MakeCallback (&ArpCache::Flush, cache));
cache->SetArpRequestCallback (MakeCallback (&ArpL3Protocol::SendArpRequest, this));
m_cacheList.push_back (cache);
return cache;
+15 -5
View File
@@ -1076,16 +1076,26 @@ Ptr<NdiscCache> Icmpv6L4Protocol::CreateCache (Ptr<NetDevice> device, Ptr<Ipv6In
{
Ptr<Ipv6L3Protocol> ipv6 = m_node->GetObject<Ipv6L3Protocol> ();
Ptr<NdiscCache> cache = CreateObject<NdiscCache> ();
cache->SetDevice (device, interface);
/* XXX : make a list of callback in net-device.cc
* else we override IPv4 flushing ARP table...
*/
/* device->SetLinkChangeCallback (MakeCallback (&NdiscCache::Flush, cache)); */
device->AddLinkChangeCallback (MakeCallback (&NdiscCache::Flush, cache));
m_cacheList.push_back (cache);
return cache;
}
bool Icmpv6L4Protocol::Lookup (Ipv6Address dst, Ptr<NetDevice> device, Ptr<NdiscCache> cache, Address* hardwareDestination)
{
NS_LOG_FUNCTION (this << dst << device << hardwareDestination);
if (!cache)
{
/* try to find the cache */
cache = FindCache (device);
}
return cache->Lookup (dst);
}
bool Icmpv6L4Protocol::Lookup (Ptr<Packet> p, Ipv6Address dst, Ptr<NetDevice> device, Ptr<NdiscCache> cache, Address* hardwareDestination)
{
NS_LOG_FUNCTION (this << p << dst << device << hardwareDestination);
+12 -1
View File
@@ -226,7 +226,6 @@ class Icmpv6L4Protocol : public Ipv6L4Protocol
* \param id id of the packet
* \param seq sequence number
* \param data auxiliary data
* \todo Change data to be a char[], change it too in icmpv6-header.
*/
void SendEchoReply (Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr<Packet> data);
@@ -349,8 +348,20 @@ class Icmpv6L4Protocol : public Ipv6L4Protocol
*/
static void FunctionDadTimeout (Ptr<Icmpv6L4Protocol> icmpv6, Ipv6Interface* interface, Ipv6Address addr);
/**
* \brief Lookup in the ND cache for the IPv6 address
* \param dst destination address
* \param device device
* \param cache the neighbor cache
* \param hardwareDestination hardware address
* \note Unlike other Lookup method, it does not send NS request!
*/
bool Lookup (Ipv6Address dst, Ptr<NetDevice> device, Ptr<NdiscCache> cache, Address* hardwareDestination);
/**
* \brief Lookup in the ND cache for the IPv6 address (similar as ARP protocol).
*
* It also send NS request to target and store the waiting packet.
* \param p the packet
* \param dst destination address
* \param device device
+4 -13
View File
@@ -269,12 +269,6 @@ void Ipv6L3Protocol::AddAutoconfiguredAddress (uint32_t interface, Ipv6Address n
(*it)->StopPreferredTimer ();
(*it)->StopValidTimer ();
(*it)->StartPreferredTimer ();
/* Suppose a link with two prefixes advertised,
* when first prefix (which is the default route) expires,
* the second ones router has to be default router
*/
GetRoutingProtocol ()->NotifyAddRoute (Ipv6Address::GetAny (), Ipv6Prefix ((uint8_t)0), defaultRouter, interface, network);
return;
}
}
@@ -284,10 +278,7 @@ void Ipv6L3Protocol::AddAutoconfiguredAddress (uint32_t interface, Ipv6Address n
AddAddress (interface, address);
/* add default router
* check to know if default route already exists is done
* in Ipv6StaticRouting class
*
* If default route is already set, this function does nothing.
* if a previous default route exists, the new ones is simply added
*/
GetRoutingProtocol ()->NotifyAddRoute (Ipv6Address::GetAny (), Ipv6Prefix ((uint8_t)0), defaultRouter, interface, network);
@@ -327,7 +318,7 @@ void Ipv6L3Protocol::RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Addres
}
}
GetRoutingProtocol ()->NotifyRemoveRoute (Ipv6Address::GetAny (), Ipv6Prefix ((uint8_t)0), defaultRouter, interface);
GetRoutingProtocol ()->NotifyRemoveRoute (Ipv6Address::GetAny (), Ipv6Prefix ((uint8_t)0), defaultRouter, interface, network);
}
bool Ipv6L3Protocol::AddAddress (uint32_t i, Ipv6InterfaceAddress address)
@@ -811,7 +802,7 @@ void Ipv6L3Protocol::IpForward (Ptr<Ipv6Route> rtentry, Ptr<const Packet> p, con
copy->AddHeader (header);
if (icmpv6->Lookup (copy, target, rtentry->GetOutputDevice (), 0, &hardwareTarget))
if (icmpv6->Lookup (target, rtentry->GetOutputDevice (), 0, &hardwareTarget))
{
icmpv6->SendRedirection (copy, src, target, dst, hardwareTarget);
}
@@ -820,7 +811,7 @@ void Ipv6L3Protocol::IpForward (Ptr<Ipv6Route> rtentry, Ptr<const Packet> p, con
icmpv6->SendRedirection (copy, src, target, dst, Address ());
}
}
SendRealOut (rtentry, packet, ipHeader);
}
+1 -1
View File
@@ -125,7 +125,7 @@ LoopbackNetDevice::IsLinkUp (void) const
}
void
LoopbackNetDevice::SetLinkChangeCallback (Callback<void> callback)
LoopbackNetDevice::AddLinkChangeCallback (Callback<void> callback)
{}
bool
+1 -1
View File
@@ -50,7 +50,7 @@ public:
virtual bool SetMtu (const uint16_t mtu);
virtual uint16_t GetMtu (void) const;
virtual bool IsLinkUp (void) const;
virtual void SetLinkChangeCallback (Callback<void> callback);
virtual void AddLinkChangeCallback (Callback<void> callback);
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;