Apply Patch to address bug 294 -- due to vincent
authorCraig Dowell <craigdo@ee.washington.edu>
Wed, 05 Nov 2008 14:33:20 -0800
changeset 3841 1e7abf5fca79
parent 3840 e48410cf76e4
child 3842 545ddf9398ed
Apply Patch to address bug 294 -- due to vincent
src/devices/bridge/bridge-net-device.cc
src/devices/bridge/bridge-net-device.h
src/devices/csma/csma-net-device.cc
src/devices/csma/csma-net-device.h
src/devices/point-to-point/point-to-point-net-device.cc
src/devices/point-to-point/point-to-point-net-device.h
src/devices/wifi/wifi-net-device.cc
src/devices/wifi/wifi-net-device.h
src/internet-stack/arp-ipv4-interface.cc
src/node/net-device.h
src/node/simple-net-device.cc
src/node/simple-net-device.h
--- 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);
--- 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> packet, const Address& dest, uint16_t protocolNumber);
   virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
--- 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);
 
--- 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?
--- 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");
 }
--- 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;
 
--- 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);
 }
--- 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> packet, const Address& dest, uint16_t protocolNumber);
   virtual Ptr<Node> GetNode (void) const;
--- 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
--- 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
--- 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);
 }
--- 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> packet, const Address& dest, uint16_t protocolNumber);
   virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);