/* If all bits of the host address of IP are 0 or 1, IP is also not a valid unicast address, except when the originator is one of the endpoints of a point-to-point link with a 31-bit mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network environment (e.g. PPP link). */
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
/* If all bits of the host address of IP are 0 or 1, IP is also not a valid unicast address, except when the originator is one of the endpoints of a point-to-point link with a 31-bit mask (RFC3021), or a 32bit NetMask (all 0xFF) is used for special network environment (e.g. PPP link). */
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
{
  INTN  MaskLength;
  ASSERT (NetMask != 0);
  if ((Ip == 0) || IP4_IS_LOCAL_BROADCAST (Ip)) {
    return FALSE;
  }
  MaskLength = NetGetMaskLength (NetMask);
  ASSERT ((MaskLength >= 0) && (MaskLength <= IP4_MASK_NUM));
  if (MaskLength < 31) {
    if (((Ip &~NetMask) == ~NetMask) || ((Ip &~NetMask) == 0)) {
      return FALSE;
    }
  }
  return TRUE;
}