]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix the EBC build problem in DxeIpIoLib of r9374.
authortye <tye@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Oct 2009 02:45:43 +0000 (02:45 +0000)
committertye <tye@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Oct 2009 02:45:43 +0000 (02:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9375 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Library/IpIoLib.h
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c

index a27487f7e57afa8e09c38e8f4a84a8b608dceb19..2f6f1e8f53900679b596c629ab808d56ae0b22dd 100644 (file)
@@ -121,7 +121,6 @@ typedef enum {
 /// The helper struct for IpIoGetIcmpErrStatus(). It is for internal use only.\r
 ///\r
 typedef struct {\r
-  EFI_STATUS                Error;\r
   BOOLEAN                   IsHard;\r
   BOOLEAN                   Notify;\r
 } ICMP_ERROR_INFO;\r
index e18537fd5f0ad42f21b40e1223149c72071c90e2..5aaef6d743f55e1117587622f96187a008ce8f3d 100644 (file)
@@ -61,29 +61,29 @@ EFI_IP6_CONFIG_DATA  mIp6IoDefaultIpConfigData = {
 };\r
 \r
 ICMP_ERROR_INFO  mIcmpErrMap[10] = {\r
-  { EFI_NETWORK_UNREACHABLE,  FALSE, TRUE  }, // ICMP_ERR_UNREACH_NET\r
-  { EFI_HOST_UNREACHABLE,     FALSE, TRUE  }, // ICMP_ERR_UNREACH_HOST\r
-  { EFI_PROTOCOL_UNREACHABLE, TRUE,  TRUE  }, // ICMP_ERR_UNREACH_PROTOCOL\r
-  { EFI_PORT_UNREACHABLE,     TRUE,  TRUE  }, // ICMP_ERR_UNREACH_PORT\r
-  { EFI_ICMP_ERROR,           TRUE,  TRUE  }, // ICMP_ERR_MSGSIZE\r
-  { EFI_ICMP_ERROR,           FALSE, TRUE  }, // ICMP_ERR_UNREACH_SRCFAIL\r
-  { EFI_HOST_UNREACHABLE,     FALSE, TRUE  }, // ICMP_ERR_TIMXCEED_INTRANS\r
-  { EFI_HOST_UNREACHABLE,     FALSE, TRUE  }, // ICMP_ERR_TIMEXCEED_REASS\r
-  { EFI_ICMP_ERROR,           FALSE, FALSE }, // ICMP_ERR_QUENCH\r
-  { EFI_ICMP_ERROR,           FALSE, TRUE  }  // ICMP_ERR_PARAMPROB\r
+  {FALSE, TRUE }, // ICMP_ERR_UNREACH_NET\r
+  {FALSE, TRUE }, // ICMP_ERR_UNREACH_HOST\r
+  {TRUE,  TRUE }, // ICMP_ERR_UNREACH_PROTOCOL\r
+  {TRUE,  TRUE }, // ICMP_ERR_UNREACH_PORT\r
+  {TRUE,  TRUE }, // ICMP_ERR_MSGSIZE\r
+  {FALSE, TRUE }, // ICMP_ERR_UNREACH_SRCFAIL\r
+  {FALSE, TRUE }, // ICMP_ERR_TIMXCEED_INTRANS\r
+  {FALSE, TRUE }, // ICMP_ERR_TIMEXCEED_REASS\r
+  {FALSE, FALSE}, // ICMP_ERR_QUENCH\r
+  {FALSE, TRUE }  // ICMP_ERR_PARAMPROB\r
 };\r
 \r
 ICMP_ERROR_INFO  mIcmp6ErrMap[10] = {\r
-  { EFI_NETWORK_UNREACHABLE,  FALSE, TRUE  }, // ICMP6_ERR_UNREACH_NET\r
-  { EFI_HOST_UNREACHABLE,     FALSE, TRUE  }, // ICMP6_ERR_UNREACH_HOST\r
-  { EFI_PROTOCOL_UNREACHABLE, TRUE,  TRUE  }, // ICMP6_ERR_UNREACH_PROTOCOL\r
-  { EFI_PORT_UNREACHABLE,     TRUE,  TRUE  }, // ICMP6_ERR_UNREACH_PORT    \r
-  { EFI_ICMP_ERROR,           TRUE,  TRUE  }, // ICMP6_ERR_PACKAGE_TOOBIG\r
-  { EFI_HOST_UNREACHABLE,     FALSE, TRUE  }, // ICMP6_ERR_TIMXCEED_HOPLIMIT\r
-  { EFI_HOST_UNREACHABLE,     FALSE, TRUE  }, // ICMP_ERR_TIMEXCEED_REASS\r
-  { EFI_ICMP_ERROR,           FALSE, TRUE  }, // ICMP_ERR_PARAMPROB_HEADER    \r
-  { EFI_ICMP_ERROR,           FALSE, TRUE  }, // ICMP_ERR_PARAMPROB_NEXHEADER\r
-  { EFI_ICMP_ERROR,           FALSE, TRUE  }  // ICMP_ERR_PARAMPROB_IPV6OPTION\r
+  {FALSE, TRUE}, // ICMP6_ERR_UNREACH_NET\r
+  {FALSE, TRUE}, // ICMP6_ERR_UNREACH_HOST\r
+  {TRUE,  TRUE}, // ICMP6_ERR_UNREACH_PROTOCOL\r
+  {TRUE,  TRUE}, // ICMP6_ERR_UNREACH_PORT    \r
+  {TRUE,  TRUE}, // ICMP6_ERR_PACKAGE_TOOBIG\r
+  {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_HOPLIMIT\r
+  {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_REASS\r
+  {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER    \r
+  {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_NEXHEADER\r
+  {FALSE, TRUE}  // ICMP6_ERR_PARAMPROB_IPV6OPTION\r
 };\r
 \r
 \r
@@ -2027,18 +2027,43 @@ IpIoGetIcmpErrStatus (
   OUT BOOLEAN     *Notify  OPTIONAL\r
   )\r
 {\r
-  if (IpVersion == IP_VERSION_4 ){\r
-  ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));\r
+  if (IpVersion == IP_VERSION_4 ) {\r
+    ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));\r
 \r
-  if (IsHard != NULL) {\r
-    *IsHard = mIcmpErrMap[IcmpError].IsHard;\r
-  }\r
+    if (IsHard != NULL) {\r
+      *IsHard = mIcmpErrMap[IcmpError].IsHard;\r
+    }\r
 \r
-  if (Notify != NULL) {\r
-    *Notify = mIcmpErrMap[IcmpError].Notify;\r
-  }\r
+    if (Notify != NULL) {\r
+      *Notify = mIcmpErrMap[IcmpError].Notify;\r
+    }\r
+\r
+    switch (IcmpError) {\r
+    case ICMP_ERR_UNREACH_NET:\r
+      return  EFI_NETWORK_UNREACHABLE;\r
+\r
+    case ICMP_ERR_TIMXCEED_INTRANS:\r
+    case ICMP_ERR_TIMXCEED_REASS:\r
+    case ICMP_ERR_UNREACH_HOST:\r
+      return  EFI_HOST_UNREACHABLE;\r
+\r
+    case ICMP_ERR_UNREACH_PROTOCOL:\r
+      return  EFI_PROTOCOL_UNREACHABLE;\r
+\r
+    case ICMP_ERR_UNREACH_PORT:\r
+      return  EFI_PORT_UNREACHABLE;\r
+\r
+    case ICMP_ERR_MSGSIZE:\r
+    case ICMP_ERR_UNREACH_SRCFAIL:\r
+    case ICMP_ERR_QUENCH:\r
+    case ICMP_ERR_PARAMPROB:\r
+      return  EFI_ICMP_ERROR;\r
+\r
+    default:\r
+      ASSERT (FALSE);\r
+      return EFI_UNSUPPORTED;\r
+    }\r
 \r
-    return mIcmpErrMap[IcmpError].Error;\r
   } else if (IpVersion == IP_VERSION_6) {\r
 \r
     ASSERT ((IcmpError >= ICMP6_ERR_UNREACH_NET) && (IcmpError <= ICMP6_ERR_PARAMPROB_IPV6OPTION));\r
@@ -2050,7 +2075,32 @@ IpIoGetIcmpErrStatus (
     if (Notify != NULL) {\r
       *Notify = mIcmp6ErrMap[IcmpError].Notify;\r
     }\r
-    return mIcmp6ErrMap[IcmpError].Error;\r
+\r
+    switch (IcmpError) {\r
+    case ICMP6_ERR_UNREACH_NET:\r
+      return EFI_NETWORK_UNREACHABLE;\r
+\r
+    case ICMP6_ERR_UNREACH_HOST:\r
+    case ICMP6_ERR_TIMXCEED_HOPLIMIT:\r
+    case ICMP6_ERR_TIMXCEED_REASS:       \r
+      return EFI_HOST_UNREACHABLE;\r
+\r
+    case ICMP6_ERR_UNREACH_PROTOCOL:\r
+      return EFI_PROTOCOL_UNREACHABLE;\r
+      \r
+    case ICMP6_ERR_UNREACH_PORT:\r
+      return EFI_PORT_UNREACHABLE;\r
+\r
+    case ICMP6_ERR_PACKAGE_TOOBIG:\r
+    case ICMP6_ERR_PARAMPROB_HEADER:\r
+    case ICMP6_ERR_PARAMPROB_NEXHEADER:\r
+    case ICMP6_ERR_PARAMPROB_IPV6OPTION:\r
+      return EFI_ICMP_ERROR;\r
+\r
+    default:\r
+      ASSERT (FALSE);\r
+      return EFI_UNSUPPORTED;\r
+    }\r
 \r
   } else {\r
     //\r