/* Find an interface that Ip is on that connected network. */
IP4_INTERFACE* Ip4FindNet(IN IP4_SERVICE *IpSb, IN IP4_ADDR Ip)
/* Find an interface that Ip is on that connected network. */
IP4_INTERFACE* Ip4FindNet(IN IP4_SERVICE *IpSb, IN IP4_ADDR Ip)
{
  LIST_ENTRY     *Entry;
  IP4_INTERFACE  *IpIf;
  NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
    IpIf = NET_LIST_USER_STRUCT (Entry, IP4_INTERFACE, Link);
    if (IpIf->Configured && IP4_NET_EQUAL (Ip, IpIf->Ip, IpIf->SubnetMask)) {
      return IpIf;
    }
  }
  return NULL;
}