import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
return false;
}
+ /**
+ * Returns true if the MAC address is a unicast MAC address and false
+ * otherwise.
+ *
+ * @param MACAddress
+ * @return
+ */
+ public static boolean isUnicastMACAddr(byte[] MACAddress) {
+ if (MACAddress.length == MACAddrLengthInBytes) {
+ return (MACAddress[0] & 1) == 0;
+ }
+ return false;
+ }
/**
* Returns true if the MAC address is a multicast MAC address and false
return null;
}
}
+
+ /**
+ * Returns Broadcast MAC Address
+ *
+ * @return the byte array containing broadcaset mac address
+ */
+ public static byte[] getBroadcastMACAddr() {
+ return Arrays.copyOf(BroadcastMACAddr, BroadcastMACAddr.length);
+ }
+
}