NetworkPackets.EthernetPacket.GetMulticastEthernetAddress C# (CSharp) Method

GetMulticastEthernetAddress() public static method

Generates a multicast mac address based upon the multicast IP address.
public static GetMulticastEthernetAddress ( MemBlock mcast_ip ) : MemBlock
mcast_ip MemBlock The multicast ip address
return MemBlock
    public static MemBlock GetMulticastEthernetAddress(MemBlock mcast_ip) {
      // set multicast bit and create address
      byte[] mcast_addr = new byte[6];
      mcast_addr[0] = 0x01;
      mcast_addr[1] = 0x00;
      mcast_addr[2] = 0x5E;
      mcast_addr[3] = (byte)(mcast_ip[1] & 0x7F);
      mcast_addr[4] = mcast_ip[2];
      mcast_addr[5] = mcast_ip[3];
      return MemBlock.Reference(mcast_addr);
    }
  }