Apply Patch to address bug 294 -- due to vincent

This commit is contained in:
Craig Dowell
2008-11-05 14:33:20 -08:00
parent ee5df1fda8
commit 3aa50e6af9
12 changed files with 13 additions and 80 deletions

View File

@@ -290,16 +290,8 @@ BridgeNetDevice::IsMulticast (void) const
return true;
}
Address
BridgeNetDevice::GetMulticast (void) const
{
return Mac48Address ("01:00:5e:00:00:00");
}
Address
BridgeNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
BridgeNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
NS_LOG_FUNCTION (this << multicastGroup);
Mac48Address multicast = Mac48Address::GetMulticast (multicastGroup);

View File

@@ -96,8 +96,7 @@ public:
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
virtual Address GetMulticast (void) const;
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
virtual Address GetMulticast (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;
virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);

View File

@@ -796,14 +796,7 @@ CsmaNetDevice::IsMulticast (void) const
}
Address
CsmaNetDevice::GetMulticast (void) const
{
NS_LOG_FUNCTION_NOARGS ();
return Mac48Address::GetMulticastPrefix ();
}
Address
CsmaNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
CsmaNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
NS_LOG_FUNCTION (multicastGroup);

View File

@@ -319,7 +319,6 @@ public:
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
virtual Address GetMulticast (void) const;
/**
* \brief Make and return a MAC multicast address using the provided
@@ -343,7 +342,7 @@ public:
* \see Mac48Address
* \see Address
*/
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
virtual Address GetMulticast (Ipv4Address multicastGroup) const;
/**
* Is this a point to point link?

View File

@@ -372,20 +372,8 @@ PointToPointNetDevice::IsMulticast (void) const
return false;
}
//
// Since we return false in the IsMulticast call, calls to other multicast
// related methods returns are undefined according to the base class. So we
// can freely make something up, which is the base of the MAC multicast
// address space.
//
Address
PointToPointNetDevice::GetMulticast (void) const
{
return Mac48Address ("01:00:5e:00:00:00");
}
Address
PointToPointNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
PointToPointNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
return Mac48Address ("01:00:5e:00:00:00");
}

View File

@@ -249,8 +249,7 @@ public:
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
virtual Address GetMulticast (void) const;
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
virtual Address GetMulticast (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;

View File

@@ -253,12 +253,7 @@ WifiNetDevice::IsMulticast (void) const
return false;
}
Address
WifiNetDevice::GetMulticast (void) const
{
return Mac48Address::GetMulticastPrefix ();
}
Address
WifiNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
WifiNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
return Mac48Address::GetMulticast (multicastGroup);
}

View File

@@ -92,8 +92,7 @@ public:
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
virtual Address GetMulticast (void) const;
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
virtual Address GetMulticast (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;
virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
virtual Ptr<Node> GetNode (void) const;

View File

@@ -139,7 +139,7 @@ ArpIpv4Interface::SendTo (Ptr<Packet> p, Ipv4Address dest)
"ArpIpv4Interface::SendTo (): Sending multicast packet over "
"non-multicast device");
hardwareDestination = GetDevice ()->MakeMulticastAddress(dest);
hardwareDestination = GetDevice ()->GetMulticast(dest);
found = true;
}
else

View File

@@ -141,31 +141,6 @@ public:
*/
virtual bool IsMulticast (void) const = 0;
/**
* \brief Return the MAC multicast base address used when mapping multicast
* groups to MAC multicast addresses.
*
* Typically when one constructs a multicast MAC addresses, some bits from
* the IP multicast group are copied into a corresponding MAC multicast
* group. In EUI-48, for example, the low order 23 bits of the multicast
* group are copied to the MAC multicast group base address.
*
* This method allows access to the underlying MAC multicast group base
* address. It is expected that in most cases, a net device client will
* allow the net device to perform the actual construction of the multicast
* address. Use of this method is discouraged unless you have a good reason
* to perform a custom mapping. You should prefer
* NetDevice::MakeMulticastAddress which will do the RFC-specified mapping
* for the net device in question.
*
* \return The multicast address supported by this net device.
*
* \warning Calling this method is invalid if IsMulticast returns not true.
* The method NS_ASSERTs if the device is not a multicast device.
* \see NetDevice::MakeMulticastAddress
*/
virtual Address GetMulticast (void) const = 0;
/**
* \brief Make and return a MAC multicast address using the provided
* multicast group
@@ -179,7 +154,7 @@ public:
* encapsulated in an abstract Address to avoid dependencies on the exact
* MAC address format.
*
* A default imlementation of MakeMulticastAddress is provided, but this
* A default imlementation of GetMulticast is provided, but this
* method simply NS_ASSERTS. In the case of net devices that do not support
* multicast, clients are expected to test NetDevice::IsMulticast and avoid
* attempting to map multicast packets. Subclasses of NetDevice that do
@@ -196,7 +171,7 @@ public:
* \see Address
* \see NetDevice::IsMulticast
*/
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const = 0;
virtual Address GetMulticast (Ipv4Address multicastGroup) const = 0;
/**
* \return value of m_isPointToPoint flag

View File

@@ -148,12 +148,7 @@ SimpleNetDevice::IsMulticast (void) const
return false;
}
Address
SimpleNetDevice::GetMulticast (void) const
{
return Mac48Address::GetMulticastPrefix ();
}
Address
SimpleNetDevice::MakeMulticastAddress (Ipv4Address multicastGroup) const
SimpleNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
return Mac48Address::GetMulticast (multicastGroup);
}

View File

@@ -59,8 +59,7 @@ public:
virtual bool IsBroadcast (void) const;
virtual Address GetBroadcast (void) const;
virtual bool IsMulticast (void) const;
virtual Address GetMulticast (void) const;
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const;
virtual Address GetMulticast (Ipv4Address multicastGroup) const;
virtual bool IsPointToPoint (void) const;
virtual bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);