# HG changeset patch # User Craig Dowell # Date 1225924400 28800 # Node ID 1e7abf5fca79781eb918cf5f711b30b01303252d # Parent e48410cf76e4f249e80aec7a1248aabac4e882f1 Apply Patch to address bug 294 -- due to vincent diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/bridge/bridge-net-device.cc --- a/src/devices/bridge/bridge-net-device.cc Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/bridge/bridge-net-device.cc Wed Nov 05 14:33:20 2008 -0800 @@ -290,16 +290,8 @@ 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); diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/bridge/bridge-net-device.h --- a/src/devices/bridge/bridge-net-device.h Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/bridge/bridge-net-device.h Wed Nov 05 14:33:20 2008 -0800 @@ -96,8 +96,7 @@ 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, const Address& dest, uint16_t protocolNumber); virtual bool SendFrom (Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber); diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/csma/csma-net-device.cc --- a/src/devices/csma/csma-net-device.cc Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/csma/csma-net-device.cc Wed Nov 05 14:33:20 2008 -0800 @@ -796,14 +796,7 @@ } 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); diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/csma/csma-net-device.h --- a/src/devices/csma/csma-net-device.h Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/csma/csma-net-device.h Wed Nov 05 14:33:20 2008 -0800 @@ -319,7 +319,6 @@ 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 @@ * \see Mac48Address * \see Address */ - virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const; + virtual Address GetMulticast (Ipv4Address multicastGroup) const; /** * Is this a point to point link? diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/point-to-point/point-to-point-net-device.cc --- a/src/devices/point-to-point/point-to-point-net-device.cc Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/point-to-point/point-to-point-net-device.cc Wed Nov 05 14:33:20 2008 -0800 @@ -372,20 +372,8 @@ 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"); } diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/point-to-point/point-to-point-net-device.h --- a/src/devices/point-to-point/point-to-point-net-device.h Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/point-to-point/point-to-point-net-device.h Wed Nov 05 14:33:20 2008 -0800 @@ -249,8 +249,7 @@ 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; diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/wifi/wifi-net-device.cc --- a/src/devices/wifi/wifi-net-device.cc Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/wifi/wifi-net-device.cc Wed Nov 05 14:33:20 2008 -0800 @@ -253,12 +253,7 @@ 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); } diff -r e48410cf76e4 -r 1e7abf5fca79 src/devices/wifi/wifi-net-device.h --- a/src/devices/wifi/wifi-net-device.h Wed Nov 05 14:09:43 2008 -0800 +++ b/src/devices/wifi/wifi-net-device.h Wed Nov 05 14:33:20 2008 -0800 @@ -92,8 +92,7 @@ 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, const Address& dest, uint16_t protocolNumber); virtual Ptr GetNode (void) const; diff -r e48410cf76e4 -r 1e7abf5fca79 src/internet-stack/arp-ipv4-interface.cc --- a/src/internet-stack/arp-ipv4-interface.cc Wed Nov 05 14:09:43 2008 -0800 +++ b/src/internet-stack/arp-ipv4-interface.cc Wed Nov 05 14:33:20 2008 -0800 @@ -139,7 +139,7 @@ "ArpIpv4Interface::SendTo (): Sending multicast packet over " "non-multicast device"); - hardwareDestination = GetDevice ()->MakeMulticastAddress(dest); + hardwareDestination = GetDevice ()->GetMulticast(dest); found = true; } else diff -r e48410cf76e4 -r 1e7abf5fca79 src/node/net-device.h --- a/src/node/net-device.h Wed Nov 05 14:09:43 2008 -0800 +++ b/src/node/net-device.h Wed Nov 05 14:33:20 2008 -0800 @@ -142,31 +142,6 @@ 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 @@ * 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 @@ * \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 diff -r e48410cf76e4 -r 1e7abf5fca79 src/node/simple-net-device.cc --- a/src/node/simple-net-device.cc Wed Nov 05 14:09:43 2008 -0800 +++ b/src/node/simple-net-device.cc Wed Nov 05 14:33:20 2008 -0800 @@ -148,12 +148,7 @@ 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); } diff -r e48410cf76e4 -r 1e7abf5fca79 src/node/simple-net-device.h --- a/src/node/simple-net-device.h Wed Nov 05 14:09:43 2008 -0800 +++ b/src/node/simple-net-device.h Wed Nov 05 14:33:20 2008 -0800 @@ -59,8 +59,7 @@ 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, const Address& dest, uint16_t protocolNumber); virtual bool SendFrom(Ptr packet, const Address& source, const Address& dest, uint16_t protocolNumber);