/* Validate that Ip/Netmask pair is OK to be used as station address. Only continuous netmasks are supported. and check that StationAddress is a unicast address on the network. */
BOOLEAN Ip4StationAddressValid(IN IP4_ADDR Ip, IN IP4_ADDR Netmask)
/* Validate that Ip/Netmask pair is OK to be used as station address. Only continuous netmasks are supported. and check that StationAddress is a unicast address on the network. */
BOOLEAN Ip4StationAddressValid(IN IP4_ADDR Ip, IN IP4_ADDR Netmask)
{
  if (Netmask == IP4_ALLZERO_ADDRESS) {
    return (BOOLEAN)(Ip == IP4_ALLZERO_ADDRESS);
  }
  if (NetGetMaskLength (Netmask) == (IP4_MASK_MAX + 1)) {
    return FALSE;
  }
  if (NetGetIpClass (Ip) > IP4_ADDR_CLASSC) {
    return FALSE;
  }
  return NetIp4IsUnicast (Ip, Netmask);
}