};\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
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
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