]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
MdeModulePkg: Fix issue about current Ip4Dxe implementation for DHCP DORA process
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Impl.h
index 0bd90bc1dfab2846a601ef5a14309c185e6e7ba0..84dfa80f1cf34f4670c613ed01471d68638f0e02 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Ip4 internal functions and type defintions.\r
   \r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>                                                         \r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
+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
 http://opensource.org/licenses/bsd-license.php\r
@@ -19,9 +19,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Protocol/IpSec.h>\r
 #include <Protocol/Ip4.h>\r
-#include <Protocol/Ip4Config.h>\r
+#include <Protocol/Ip4Config2.h>\r
 #include <Protocol/Arp.h>\r
 #include <Protocol/ManagedNetwork.h>\r
+#include <Protocol/Dhcp4.h>\r
+#include <Protocol/HiiConfigRouting.h>\r
+#include <Protocol/HiiConfigAccess.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
@@ -33,6 +36,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/DpcLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/HiiLib.h>\r
+#include <Library/UefiHiiServicesLib.h>\r
 \r
 #include "Ip4Common.h"\r
 #include "Ip4Driver.h"\r
@@ -43,6 +50,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Ip4Route.h"\r
 #include "Ip4Input.h"\r
 #include "Ip4Output.h"\r
+#include "Ip4Config2Impl.h"\r
+#include "Ip4Config2Nv.h"\r
+#include "Ip4NvData.h"\r
 \r
 #define IP4_PROTOCOL_SIGNATURE  SIGNATURE_32 ('I', 'P', '4', 'P')\r
 #define IP4_SERVICE_SIGNATURE   SIGNATURE_32 ('I', 'P', '4', 'S')\r
@@ -50,23 +60,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // The state of IP4 protocol. It starts from UNCONFIGED. if it is\r
 // successfully configured, it goes to CONFIGED. if configure NULL\r
-// is called, it becomes UNCONFIGED again. If (partly) destoried, it\r
-// becomes DESTORY.\r
+// is called, it becomes UNCONFIGED again. If (partly) destroyed, it\r
+// becomes DESTROY.\r
 //\r
 #define IP4_STATE_UNCONFIGED    0\r
 #define IP4_STATE_CONFIGED      1\r
-#define IP4_STATE_DESTORY       2\r
+#define IP4_STATE_DESTROY       2\r
 \r
 //\r
 // The state of IP4 service. It starts from UNSTARTED. It transits\r
 // to STARTED if autoconfigure is started. If default address is\r
-// configured, it becomes CONFIGED. and if partly destoried, it goes\r
-// to DESTORY.\r
+// configured, it becomes CONFIGED. and if partly destroyed, it goes\r
+// to DESTROY.\r
 //\r
 #define IP4_SERVICE_UNSTARTED   0\r
 #define IP4_SERVICE_STARTED     1\r
 #define IP4_SERVICE_CONFIGED    2\r
-#define IP4_SERVICE_DESTORY     3\r
+#define IP4_SERVICE_DESTROY     3\r
 \r
 \r
 ///\r
@@ -160,7 +170,6 @@ struct _IP4_SERVICE {
   UINT32                          Signature;\r
   EFI_SERVICE_BINDING_PROTOCOL    ServiceBinding;\r
   INTN                            State;\r
-  BOOLEAN                         InDestory;\r
 \r
   //\r
   // List of all the IP instances and interfaces, and default\r
@@ -195,18 +204,12 @@ struct _IP4_SERVICE {
   EFI_EVENT                       Timer;\r
 \r
   //\r
-  // Auto configure staff\r
+  // IPv4 Configuration II Protocol instance\r
   //\r
-  EFI_IP4_CONFIG_PROTOCOL         *Ip4Config;\r
-  EFI_EVENT                       DoneEvent;\r
-  EFI_EVENT                       ReconfigEvent;\r
-  EFI_EVENT                       ActiveEvent;\r
+  IP4_CONFIG2_INSTANCE            Ip4Config2Instance;\r
 \r
-  //\r
-  // The string representation of the current mac address of the\r
-  // NIC this IP4_SERVICE works on.\r
-  //\r
   CHAR16                          *MacString;\r
+\r
   UINT32                          MaxPacketSize;\r
   UINT32                          OldMaxPacketSize; ///< The MTU before IPsec enable.\r
 };\r
@@ -217,6 +220,10 @@ struct _IP4_SERVICE {
 #define IP4_SERVICE_FROM_PROTOCOL(Sb)   \\r
           CR ((Sb), IP4_SERVICE, ServiceBinding, IP4_SERVICE_SIGNATURE)\r
 \r
+#define IP4_SERVICE_FROM_CONFIG2_INSTANCE(This) \\r
+  CR (This, IP4_SERVICE, Ip4Config2Instance, IP4_SERVICE_SIGNATURE)\r
+\r
+\r
 #define IP4_NO_MAPPING(IpInstance) (!(IpInstance)->Interface->Configured)\r
 \r
 extern EFI_IP4_PROTOCOL mEfiIp4ProtocolTemplete;\r
@@ -263,8 +270,8 @@ Ip4InitProtocol (
 \r
   @param[in]  IpInstance         The IP4 child to clean up.\r
 \r
-  @retval EFI_SUCCESS            The IP4 child is cleaned up\r
-  @retval EFI_DEVICE_ERROR       Some resources failed to be released\r
+  @retval EFI_SUCCESS            The IP4 child is cleaned up.\r
+  @retval EFI_DEVICE_ERROR       Some resources failed to be released.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -275,13 +282,13 @@ Ip4CleanProtocol (
 /**\r
   Cancel the user's receive/transmit request.\r
 \r
-  @param[in]  IpInstance         The IP4 child\r
+  @param[in]  IpInstance         The IP4 child.\r
   @param[in]  Token              The token to cancel. If NULL, all token will be\r
                                  cancelled.\r
 \r
-  @retval EFI_SUCCESS            The token is cancelled\r
+  @retval EFI_SUCCESS            The token is cancelled.\r
   @retval EFI_NOT_FOUND          The token isn't found on either the\r
-                                 transmit/receive queue\r
+                                 transmit/receive queue.\r
   @retval EFI_DEVICE_ERROR       Not all token is cancelled when Token is NULL.\r
 \r
 **/\r
@@ -338,10 +345,10 @@ Ip4TimerTicking (
   packets.\r
 \r
   @param[in]  Map                    The IP4 child's transmit map.\r
-  @param[in]  Item                   Current transmitted packet\r
+  @param[in]  Item                   Current transmitted packet.\r
   @param[in]  Context                Not used.\r
 \r
-  @retval EFI_SUCCESS            Always returns EFI_SUCCESS\r
+  @retval EFI_SUCCESS            Always returns EFI_SUCCESS.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -370,7 +377,7 @@ Ip4SentPacketTicking (
   are bound together. Check the comments in Ip4Output for information\r
   about IP fragmentation.\r
 \r
-  @param[in]  Context                The token's wrap\r
+  @param[in]  Context                The token's wrap.\r
 \r
 **/\r
 VOID\r
@@ -379,6 +386,6 @@ Ip4FreeTxToken (
   IN VOID                   *Context\r
   );\r
 \r
-extern EFI_IPSEC_PROTOCOL   *mIpSec;\r
+extern EFI_IPSEC2_PROTOCOL   *mIpSec;\r
 \r
 #endif\r