public static boolean isUnicastMac(final String macAddr) { String std = standardizeMacAddress(macAddr); if(std == null) { return false; } long stdl = mac2Long(std); // libvirt refuses to attach a mac address that is multicast, as defined // by the least significant bit of the first octet of the mac. long mask = 0x1l << 40l; return ((stdl & mask) == mask) ? false : true; }
public String getMacAddress() { if (macaddr == null) { return null; } if(!NetUtils.isValidMac(macaddr)) { throw new InvalidParameterValueException("Mac address is not valid: " + macaddr); } else if(!NetUtils.isUnicastMac(macaddr)) { throw new InvalidParameterValueException("Mac address is not unicast: " + macaddr); } return NetUtils.standardizeMacAddress(macaddr); }
public String getMacAddress() { if (macAddress == null) { return null; } if(!NetUtils.isValidMac(macAddress)) { throw new InvalidParameterValueException("Mac address is not valid: " + macAddress); } else if(!NetUtils.isUnicastMac(macAddress)) { throw new InvalidParameterValueException("Mac address is not unicast: " + macAddress); } return NetUtils.standardizeMacAddress(macAddress); }
throw new InvalidParameterValueException("Mac address is not unicast: " + requestedMac); requestedMac = NetUtils.standardizeMacAddress(requestedMac);
public static boolean isUnicastMac(final String macAddr) { final String std = standardizeMacAddress(macAddr); if (std == null) { return false; } final long stdl = mac2Long(std); // libvirt refuses to attach a mac address that is multicast, as defined // by the least significant bit of the first octet of the mac. final long mask = 0x1l << 40l; return (stdl & mask) != mask; }
public String getMacAddress() { if (macAddress == null) { return null; } if (!NetUtils.isValidMac(macAddress)) { throw new InvalidParameterValueException("MAC-Address is not valid: " + macAddress); } else if (!NetUtils.isUnicastMac(macAddress)) { throw new InvalidParameterValueException("MAC-Address is not unicast: " + macAddress); } return NetUtils.standardizeMacAddress(macAddress); }
public String getMacAddress() { if (macaddr == null) { return null; } if (!NetUtils.isValidMac(macaddr)) { throw new InvalidParameterValueException("MAC-Address is not valid: " + macaddr); } else if (!NetUtils.isUnicastMac(macaddr)) { throw new InvalidParameterValueException("MAC-Address is not unicast: " + macaddr); } return NetUtils.standardizeMacAddress(macaddr); }
throw new InvalidParameterValueException("MAC-Address is not unicast: " + requestedMac); requestedMac = NetUtils.standardizeMacAddress(requestedMac);