/* Trim the packet to fit in [Start, End), and update the per packet information. */
VOID Ip4TrimPacket(IN OUT NET_BUF *Packet, IN INTN Start, IN INTN End)
/* Trim the packet to fit in [Start, End), and update the per packet information. */
VOID Ip4TrimPacket(IN OUT NET_BUF *Packet, IN INTN Start, IN INTN End)
{
  IP4_CLIP_INFO  *Info;
  INTN           Len;
  Info = IP4_GET_CLIP_INFO (Packet);
  ASSERT (Info->Start + Info->Length == Info->End);
  ASSERT ((Info->Start < End) && (Start < Info->End));
  if (Info->Start < Start) {
    Len = Start - Info->Start;
    NetbufTrim (Packet, (UINT32)Len, NET_BUF_HEAD);
    Info->Start   = Start;
    Info->Length -= Len;
  }
  if (End < Info->End) {
    Len = End - Info->End;
    NetbufTrim (Packet, (UINT32)Len, NET_BUF_TAIL);
    Info->End     = End;
    Info->Length -= Len;
  }
}