]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c
[Change summary]:
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Input.c
index 0f4948d46ada867b5acb74d80fbd23c4bd2294f4..725735330129ae820cea598dc5077dde3f07f4da 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   IP4 input process.\r
   \r
-Copyright (c) 2005 - 2007, Intel Corporation.<BR>\r
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -228,7 +228,7 @@ Ip4Reassemble (
   NET_BUF                   *NewPacket;\r
   INTN                      Index;\r
 \r
-  IpHead  = Packet->Ip;\r
+  IpHead  = Packet->Ip.Ip4;\r
   This    = IP4_GET_CLIP_INFO (Packet);\r
 \r
   ASSERT (IpHead != NULL);\r
@@ -265,6 +265,10 @@ Ip4Reassemble (
 \r
     InsertHeadList (&Table->Bucket[Index], &Assemble->Link);\r
   }\r
+  //\r
+  // Assemble shouldn't be NULL here\r
+  //\r
+  ASSERT (Assemble != NULL);\r
 \r
   //\r
   // Find the point to insert the packet: before the first\r
@@ -413,7 +417,7 @@ Ip4Reassemble (
       return NULL;\r
     }\r
 \r
-    NewPacket->Ip = Assemble->Head;\r
+    NewPacket->Ip.Ip4 = Assemble->Head;\r
     CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (*IP4_GET_CLIP_INFO (NewPacket)));\r
     return NewPacket;\r
   }\r
@@ -497,7 +501,7 @@ Ip4AccpetFrame (
   //\r
   // Convert the IP header to host byte order, then get the per packet info.\r
   //\r
-  Packet->Ip      = Ip4NtohHead (Head);\r
+  Packet->Ip.Ip4  = Ip4NtohHead (Head);\r
 \r
   Info            = IP4_GET_CLIP_INFO (Packet);\r
   Info->LinkFlag  = Flag;\r
@@ -566,11 +570,11 @@ Ip4AccpetFrame (
   // info must be reloaded bofore use. The ownership of the packet\r
   // is transfered to the packet process logic.\r
   //\r
-  Head  = Packet->Ip;\r
+  Head  = Packet->Ip.Ip4;\r
   IP4_GET_CLIP_INFO (Packet)->Status = EFI_SUCCESS;\r
 \r
   switch (Head->Protocol) {\r
-  case IP4_PROTO_ICMP:\r
+  case EFI_IP_PROTO_ICMP:\r
     Ip4IcmpHandle (IpSb, Head, Packet);\r
     break;\r
 \r
@@ -588,7 +592,7 @@ Ip4AccpetFrame (
   // Dispatch the DPCs queued by the NotifyFunction of the rx token's events\r
   // which are signaled with received data.\r
   //\r
-  NetLibDispatchDpc ();\r
+  DispatchDpc ();\r
 \r
 RESTART:\r
   Ip4ReceiveFrame (IpSb->DefaultInterface, NULL, Ip4AccpetFrame, IpSb);\r
@@ -651,7 +655,7 @@ Ip4InstanceFrameAcceptable (
   //\r
   Proto = Head->Protocol;\r
 \r
-  if (Proto == IP4_PROTO_ICMP) {\r
+  if (Proto == EFI_IP_PROTO_ICMP) {\r
     NetbufCopy (Packet, 0, sizeof (Icmp.Head), (UINT8 *) &Icmp.Head);\r
 \r
     if (mIcmpClass[Icmp.Head.Type].IcmpClass == ICMP_ERROR_MESSAGE) {\r
@@ -846,13 +850,13 @@ Ip4WrapRxData (
     return NULL;\r
   }\r
 \r
-  ASSERT (Packet->Ip != NULL);\r
+  ASSERT (Packet->Ip.Ip4 != NULL);\r
 \r
   //\r
   // The application expects a network byte order header.\r
   //\r
-  RxData->HeaderLength  = (Packet->Ip->HeadLen << 2);\r
-  RxData->Header        = (EFI_IP4_HEADER *) Ip4NtohHead (Packet->Ip);\r
+  RxData->HeaderLength  = (Packet->Ip.Ip4->HeadLen << 2);\r
+  RxData->Header        = (EFI_IP4_HEADER *) Ip4NtohHead (Packet->Ip.Ip4);\r
 \r
   RxData->OptionsLength = RxData->HeaderLength - IP4_MIN_HEADLEN;\r
   RxData->Options       = NULL;\r
@@ -934,9 +938,9 @@ Ip4InstanceDeliverPacket (
       // may be not continuous before the data.\r
       //\r
       Head    = NetbufAllocSpace (Dup, IP4_MAX_HEADLEN, NET_BUF_HEAD);\r
-      Dup->Ip = (IP4_HEAD *) Head;\r
+      Dup->Ip.Ip4 = (IP4_HEAD *) Head;\r
 \r
-      CopyMem (Head, Packet->Ip, Packet->Ip->HeadLen << 2);\r
+      CopyMem (Head, Packet->Ip.Ip4, Packet->Ip.Ip4->HeadLen << 2);\r
       NetbufTrim (Dup, IP4_MAX_HEADLEN, TRUE);\r
 \r
       Wrap = Ip4WrapRxData (IpInstance, Dup);\r