/* Remove a route entry and all the route caches spawn from it. */
EFI_STATUS Ip4DelRoute(IN OUT IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Netmask, IN IP4_ADDR Gateway)
/* Remove a route entry and all the route caches spawn from it. */
EFI_STATUS Ip4DelRoute(IN OUT IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Netmask, IN IP4_ADDR Gateway)
{
  LIST_ENTRY       *Head;
  LIST_ENTRY       *Entry;
  LIST_ENTRY       *Next;
  IP4_ROUTE_ENTRY  *RtEntry;
  Head = &(RtTable->RouteArea[NetGetMaskLength (Netmask)]);
  NET_LIST_FOR_EACH_SAFE (Entry, Next, Head) {
    RtEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_ENTRY, Link);
    if (IP4_NET_EQUAL (RtEntry->Dest, Dest, Netmask) && (RtEntry->NextHop == Gateway)) {
      Ip4PurgeRouteCache (&RtTable->Cache, (UINTN)RtEntry);
      RemoveEntryList (Entry);
      Ip4FreeRouteEntry (RtEntry);
      RtTable->TotalNum--;
      return EFI_SUCCESS;
    }
  }
  return EFI_NOT_FOUND;
}