consitify the API a bit

This commit is contained in:
Mathieu Lacage
2007-08-01 19:19:28 +02:00
parent 48d1219f5c
commit 1b62aa5a79
6 changed files with 9 additions and 7 deletions

View File

@@ -250,8 +250,9 @@ CsmaCdNetDevice::DoNeedsArp (void) const
}
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 () << ")");

View File

@@ -249,7 +249,7 @@ private:
* \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.

View File

@@ -102,9 +102,10 @@ void PointToPointNetDevice::SetInterframeGap(const Time& t)
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 () << ")");

View File

@@ -212,7 +212,7 @@ private:
* @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.

View File

@@ -171,7 +171,7 @@ NetDevice::DisablePointToPoint (void)
// 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)
{

View File

@@ -158,7 +158,7 @@ public:
*
* \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 @@ public:
* 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.