--- a/src/devices/csma-cd/csma-cd-net-device.cc Wed Aug 01 19:09:11 2007 +0200
+++ b/src/devices/csma-cd/csma-cd-net-device.cc Wed Aug 01 19:19:28 2007 +0200
@@ -250,8 +250,9 @@
}
bool
-CsmaCdNetDevice::SendTo (Packet& p, const Address& dest, uint16_t protocolNumber)
+CsmaCdNetDevice::SendTo (const Packet& packet, const Address& dest, uint16_t protocolNumber)
{
+ Packet p = packet;
NS_DEBUG ("CsmaCdNetDevice::SendTo (" << &p << ")");
NS_DEBUG ("CsmaCdNetDevice::SendTo (): UID is " << p.GetUid () << ")");
--- a/src/devices/csma-cd/csma-cd-net-device.h Wed Aug 01 19:09:11 2007 +0200
+++ b/src/devices/csma-cd/csma-cd-net-device.h Wed Aug 01 19:19:28 2007 +0200
@@ -249,7 +249,7 @@
* \param protocolNumber -- this parameter is not used here
* \return true if success, false on failure
*/
- virtual bool SendTo (Packet& p, const Address& dest, uint16_t protocolNumber);
+ virtual bool SendTo (const Packet& p, const Address& dest, uint16_t protocolNumber);
/**
* Start Sending a Packet Down the Wire.
--- a/src/devices/point-to-point/point-to-point-net-device.cc Wed Aug 01 19:09:11 2007 +0200
+++ b/src/devices/point-to-point/point-to-point-net-device.cc Wed Aug 01 19:19:28 2007 +0200
@@ -102,9 +102,10 @@
m_tInterframeGap = t;
}
-bool PointToPointNetDevice::SendTo (Packet& p, const Address& dest,
+bool PointToPointNetDevice::SendTo (const Packet& packet, const Address& dest,
uint16_t protocolNumber)
{
+ Packet p = packet;
NS_DEBUG ("PointToPointNetDevice::SendTo (" << &p << ", " << &dest << ")");
NS_DEBUG ("PointToPointNetDevice::SendTo (): UID is " << p.GetUid () << ")");
--- a/src/devices/point-to-point/point-to-point-net-device.h Wed Aug 01 19:09:11 2007 +0200
+++ b/src/devices/point-to-point/point-to-point-net-device.h Wed Aug 01 19:19:28 2007 +0200
@@ -212,7 +212,7 @@
* @param protocolNumber Protocol Number used to find protocol touse
* @returns true if success, false on failure
*/
- virtual bool SendTo (Packet& p, const Address& dest,
+ virtual bool SendTo (const Packet& p, const Address& dest,
uint16_t protocolNumber);
/**
* Start Sending a Packet Down the Wire.
--- a/src/node/net-device.cc Wed Aug 01 19:09:11 2007 +0200
+++ b/src/node/net-device.cc Wed Aug 01 19:19:28 2007 +0200
@@ -171,7 +171,7 @@
// Receive packet from above
bool
-NetDevice::Send(Packet& p, const Address& dest, uint16_t protocolNumber)
+NetDevice::Send(const Packet& p, const Address& dest, uint16_t protocolNumber)
{
if (m_isUp)
{
--- a/src/node/net-device.h Wed Aug 01 19:09:11 2007 +0200
+++ b/src/node/net-device.h Wed Aug 01 19:19:28 2007 +0200
@@ -158,7 +158,7 @@
*
* \return whether the Send operation succeeded
*/
- bool Send(Packet& p, const Address& dest, uint16_t protocolNumber);
+ bool Send(const Packet& p, const Address& dest, uint16_t protocolNumber);
/**
* \returns the node base class which contains this network
* interface.
@@ -274,7 +274,7 @@
* method. When the link is Up, this method is invoked to ask
* subclasses to forward packets. Subclasses MUST override this method.
*/
- virtual bool SendTo (Packet& p, const Address &dest, uint16_t protocolNumber) = 0;
+ virtual bool SendTo (const Packet& p, const Address &dest, uint16_t protocolNumber) = 0;
/**
* \returns true if this NetDevice needs the higher-layers
* to perform ARP over it, false otherwise.