0\r
};\r
\r
+STATIC ICMP_ERROR_INFO mIcmpErrMap[10] = {\r
+ {FALSE, TRUE},\r
+ {FALSE, TRUE},\r
+ {TRUE, TRUE},\r
+ {TRUE, TRUE},\r
+ {TRUE, TRUE},\r
+ {FALSE, TRUE},\r
+ {FALSE, TRUE},\r
+ {FALSE, TRUE},\r
+ {FALSE, FALSE},\r
+ {FALSE, TRUE}\r
+};\r
+\r
STATIC\r
VOID\r
EFIAPI\r
OUT BOOLEAN *Notify OPTIONAL\r
)\r
{\r
- ICMP_ERROR_INFO IcmpErrMap[10];\r
-\r
- IcmpErrMap[0].Error = EFI_NETWORK_UNREACHABLE;\r
- IcmpErrMap[0].IsHard = FALSE;\r
- IcmpErrMap[0].Notify = TRUE;\r
-\r
- IcmpErrMap[1].Error = EFI_HOST_UNREACHABLE;\r
- IcmpErrMap[1].IsHard = FALSE;\r
- IcmpErrMap[1].Notify = TRUE;\r
-\r
- IcmpErrMap[2].Error = EFI_PROTOCOL_UNREACHABLE;\r
- IcmpErrMap[2].IsHard = TRUE;\r
- IcmpErrMap[2].Notify = TRUE;\r
-\r
- IcmpErrMap[3].Error = EFI_PORT_UNREACHABLE;\r
- IcmpErrMap[3].IsHard = TRUE;\r
- IcmpErrMap[3].Notify = TRUE;\r
-\r
- IcmpErrMap[4].Error = EFI_ICMP_ERROR;\r
- IcmpErrMap[4].IsHard = TRUE;\r
- IcmpErrMap[4].Notify = TRUE;\r
-\r
- IcmpErrMap[5].Error = EFI_ICMP_ERROR;\r
- IcmpErrMap[5].IsHard = FALSE;\r
- IcmpErrMap[5].Notify = TRUE;\r
+ ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));\r
\r
- IcmpErrMap[6].Error = EFI_HOST_UNREACHABLE;\r
- IcmpErrMap[6].IsHard = FALSE;\r
- IcmpErrMap[6].Notify = TRUE;\r
+ if (IsHard != NULL) {\r
+ *IsHard = mIcmpErrMap[IcmpError].IsHard;\r
+ }\r
\r
- IcmpErrMap[7].Error = EFI_HOST_UNREACHABLE;\r
- IcmpErrMap[7].IsHard = FALSE;\r
- IcmpErrMap[7].Notify = TRUE;\r
+ if (Notify != NULL) {\r
+ *Notify = mIcmpErrMap[IcmpError].Notify;\r
+ }\r
\r
- IcmpErrMap[8].Error = EFI_ICMP_ERROR;\r
- IcmpErrMap[8].IsHard = FALSE;\r
- IcmpErrMap[8].Notify = FALSE;\r
+ switch (IcmpError) {\r
+ case ICMP_ERR_UNREACH_NET:\r
+ return EFI_NETWORK_UNREACHABLE;\r
\r
- IcmpErrMap[9].Error = EFI_ICMP_ERROR;\r
- IcmpErrMap[9].IsHard = FALSE;\r
- IcmpErrMap[9].Notify = TRUE;\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
- ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));\r
+ case ICMP_ERR_UNREACH_PROTOCOL:\r
+ return EFI_PROTOCOL_UNREACHABLE;\r
\r
- if (IsHard != NULL) {\r
- *IsHard = IcmpErrMap[IcmpError].IsHard;\r
- }\r
+ case ICMP_ERR_UNREACH_PORT:\r
+ return EFI_PORT_UNREACHABLE;\r
\r
- if (Notify != NULL) {\r
- *Notify = IcmpErrMap[IcmpError].Notify;\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
\r
- return IcmpErrMap[IcmpError].Error;\r
+ //\r
+ // will never run here!\r
+ //\r
+ ASSERT (FALSE);\r
+ return EFI_UNSUPPORTED;\r
}\r
\r