remove Mac48Address::IsMulticast
authorFabian Mauchle <f1mauchl@hsr.ch>
Tue, 28 Apr 2009 09:25:33 +0200
changeset 4424 af26433b13bc
parent 4422 f5ef533e56e4
child 4425 be14bd6680f4
remove Mac48Address::IsMulticast
src/devices/csma/csma-net-device.cc
src/devices/emu/emu-net-device.cc
src/devices/wifi/qap-wifi-mac.cc
src/node/mac48-address.cc
src/node/mac48-address.h
src/node/simple-net-device.cc
--- a/src/devices/csma/csma-net-device.cc	Mon Apr 27 16:50:16 2009 +0200
+++ b/src/devices/csma/csma-net-device.cc	Tue Apr 28 09:25:33 2009 +0200
@@ -722,20 +722,6 @@
   NS_LOG_FUNCTION (packet << senderDevice);
   NS_LOG_LOGIC ("UID is " << packet->GetUid ());
 
-  /* IPv6 support*/
-  uint8_t mac[6];
-  Mac48Address multicast6AllNodes("33:33:00:00:00:01");
-  Mac48Address multicast6AllRouters("33:33:00:00:00:02");
-  Mac48Address multicast6AllHosts("33:33:00:00:00:03");
-  Mac48Address multicast6Node; /* multicast address addressed to our MAC address */
-
-  /* generate IPv6 multicast ethernet destination that nodes will accept */
-  GetAddress().CopyTo(mac);
-  mac[0]=0x33;
-  mac[1]=0x33;
-  /* mac[2]=0xff; */
-  multicast6Node.CopyFrom(mac);
-
   //
   // We never forward up packets that we sent.  Real devices don't do this since
   // their receivers are disabled during send, so we don't.
@@ -805,16 +791,12 @@
       // Classify the packet based on its destination.
       //
       PacketType packetType;
-      
+
       if (header.GetDestination ().IsBroadcast ())
         {
           packetType = PACKET_BROADCAST;
         }
-      else if (header.GetDestination ().IsMulticast () ||
-          header.GetDestination() == multicast6Node ||
-          header.GetDestination() == multicast6AllNodes ||
-          header.GetDestination() == multicast6AllRouters ||
-          header.GetDestination() == multicast6AllHosts)
+      else if (header.GetDestination ().IsGroup ())
         {
           packetType = PACKET_MULTICAST;          
         }
--- a/src/devices/emu/emu-net-device.cc	Mon Apr 27 16:50:16 2009 +0200
+++ b/src/devices/emu/emu-net-device.cc	Tue Apr 28 09:25:33 2009 +0200
@@ -584,19 +584,6 @@
 {
   NS_LOG_FUNCTION (buf << len);
 
-  /* IPv6 support*/
-  uint8_t mac[6];
-  Mac48Address multicast6AllNodes("33:33:00:00:00:01");
-  Mac48Address multicast6AllRouters("33:33:00:00:00:02");
-  Mac48Address multicast6AllHosts("33:33:00:00:00:03");
-  Mac48Address multicast6Node; /* multicast address addressed to our MAC address */
-
-  /* generate IPv6 multicast ethernet destination that nodes will accept */
-  GetAddress().CopyTo(mac);
-  mac[0]=0x33;
-  mac[1]=0x33;
-  multicast6Node.CopyFrom(mac);
-
   //
   // Create a packet out of the buffer we received and free that buffer.
   //
@@ -636,16 +623,12 @@
     }
 
   PacketType packetType;
-      
+
   if (header.GetDestination ().IsBroadcast ())
     {
       packetType = NS3_PACKET_BROADCAST;
     }
-  else if (header.GetDestination ().IsMulticast () ||
-           header.GetDestination() == multicast6Node ||
-           header.GetDestination() == multicast6AllNodes ||
-           header.GetDestination() == multicast6AllRouters ||
-           header.GetDestination() == multicast6AllHosts)
+  else if (header.GetDestination ().IsGroup ())
     {
       packetType = NS3_PACKET_MULTICAST;          
     }
--- a/src/devices/wifi/qap-wifi-mac.cc	Mon Apr 27 16:50:16 2009 +0200
+++ b/src/devices/wifi/qap-wifi-mac.cc	Tue Apr 28 09:25:33 2009 +0200
@@ -591,8 +591,7 @@
                   ForwardUp (packet, from, bssid);
                 }
             }
-          else if (to.IsBroadcast () ||
-                   to.IsMulticast () ||
+          else if (to.IsGroup () ||
                    toStation->IsAssociated ())
             {
               NS_LOG_DEBUG ("forwarding frame from="<<from<<", to="<<to);
--- a/src/node/mac48-address.cc	Mon Apr 27 16:50:16 2009 +0200
+++ b/src/node/mac48-address.cc	Tue Apr 28 09:25:33 2009 +0200
@@ -142,18 +142,6 @@
   return *this == GetBroadcast ();
 }
 bool 
-Mac48Address::IsMulticast (void) const
-{
-  uint8_t mcBuf[6];
-  CopyTo (mcBuf);
-  mcBuf[3] &= 0x80;
-  mcBuf[4] = 0;
-  mcBuf[5] = 0;
-  Mac48Address prefix;
-  prefix.CopyFrom (mcBuf);
-  return prefix == Mac48Address::GetMulticastPrefix ();
-}
-bool 
 Mac48Address::IsGroup (void) const
 {
   return (m_address[0] & 0x01) == 0x01;
--- a/src/node/mac48-address.h	Mon Apr 27 16:50:16 2009 +0200
+++ b/src/node/mac48-address.h	Tue Apr 28 09:25:33 2009 +0200
@@ -90,10 +90,7 @@
    * \returns true if this is a broadcast address, false otherwise.
    */
   bool IsBroadcast (void) const;
-  /**
-   * \returns true if this is a multicast address, false otherwise.
-   */
-  bool IsMulticast (void) const;
+  
   /**
    * \returns true if the group bit is set, false otherwise.
    */
--- a/src/node/simple-net-device.cc	Mon Apr 27 16:50:16 2009 +0200
+++ b/src/node/simple-net-device.cc	Tue Apr 28 09:25:33 2009 +0200
@@ -54,7 +54,7 @@
     {
       packetType = NetDevice::PACKET_HOST;
     }
-  else if (to.IsMulticast ())
+  else if (to.IsGroup ())
     {
       packetType = NetDevice::PACKET_MULTICAST;
     }