Fix the EBC build problem in DxeIpIoLib of r9374.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9375 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
tye 2009-10-27 02:45:43 +00:00
parent fb115c6150
commit 3cf888f5f9
2 changed files with 80 additions and 31 deletions

View File

@ -121,7 +121,6 @@ typedef enum {
/// The helper struct for IpIoGetIcmpErrStatus(). It is for internal use only. /// The helper struct for IpIoGetIcmpErrStatus(). It is for internal use only.
/// ///
typedef struct { typedef struct {
EFI_STATUS Error;
BOOLEAN IsHard; BOOLEAN IsHard;
BOOLEAN Notify; BOOLEAN Notify;
} ICMP_ERROR_INFO; } ICMP_ERROR_INFO;

View File

@ -61,29 +61,29 @@ EFI_IP6_CONFIG_DATA mIp6IoDefaultIpConfigData = {
}; };
ICMP_ERROR_INFO mIcmpErrMap[10] = { ICMP_ERROR_INFO mIcmpErrMap[10] = {
{ EFI_NETWORK_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_UNREACH_NET {FALSE, TRUE }, // ICMP_ERR_UNREACH_NET
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_UNREACH_HOST {FALSE, TRUE }, // ICMP_ERR_UNREACH_HOST
{ EFI_PROTOCOL_UNREACHABLE, TRUE, TRUE }, // ICMP_ERR_UNREACH_PROTOCOL {TRUE, TRUE }, // ICMP_ERR_UNREACH_PROTOCOL
{ EFI_PORT_UNREACHABLE, TRUE, TRUE }, // ICMP_ERR_UNREACH_PORT {TRUE, TRUE }, // ICMP_ERR_UNREACH_PORT
{ EFI_ICMP_ERROR, TRUE, TRUE }, // ICMP_ERR_MSGSIZE {TRUE, TRUE }, // ICMP_ERR_MSGSIZE
{ EFI_ICMP_ERROR, FALSE, TRUE }, // ICMP_ERR_UNREACH_SRCFAIL {FALSE, TRUE }, // ICMP_ERR_UNREACH_SRCFAIL
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_TIMXCEED_INTRANS {FALSE, TRUE }, // ICMP_ERR_TIMXCEED_INTRANS
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_TIMEXCEED_REASS {FALSE, TRUE }, // ICMP_ERR_TIMEXCEED_REASS
{ EFI_ICMP_ERROR, FALSE, FALSE }, // ICMP_ERR_QUENCH {FALSE, FALSE}, // ICMP_ERR_QUENCH
{ EFI_ICMP_ERROR, FALSE, TRUE } // ICMP_ERR_PARAMPROB {FALSE, TRUE } // ICMP_ERR_PARAMPROB
}; };
ICMP_ERROR_INFO mIcmp6ErrMap[10] = { ICMP_ERROR_INFO mIcmp6ErrMap[10] = {
{ EFI_NETWORK_UNREACHABLE, FALSE, TRUE }, // ICMP6_ERR_UNREACH_NET {FALSE, TRUE}, // ICMP6_ERR_UNREACH_NET
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP6_ERR_UNREACH_HOST {FALSE, TRUE}, // ICMP6_ERR_UNREACH_HOST
{ EFI_PROTOCOL_UNREACHABLE, TRUE, TRUE }, // ICMP6_ERR_UNREACH_PROTOCOL {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PROTOCOL
{ EFI_PORT_UNREACHABLE, TRUE, TRUE }, // ICMP6_ERR_UNREACH_PORT {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PORT
{ EFI_ICMP_ERROR, TRUE, TRUE }, // ICMP6_ERR_PACKAGE_TOOBIG {TRUE, TRUE}, // ICMP6_ERR_PACKAGE_TOOBIG
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP6_ERR_TIMXCEED_HOPLIMIT {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_HOPLIMIT
{ EFI_HOST_UNREACHABLE, FALSE, TRUE }, // ICMP_ERR_TIMEXCEED_REASS {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_REASS
{ EFI_ICMP_ERROR, FALSE, TRUE }, // ICMP_ERR_PARAMPROB_HEADER {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER
{ EFI_ICMP_ERROR, FALSE, TRUE }, // ICMP_ERR_PARAMPROB_NEXHEADER {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_NEXHEADER
{ EFI_ICMP_ERROR, FALSE, TRUE } // ICMP_ERR_PARAMPROB_IPV6OPTION {FALSE, TRUE} // ICMP6_ERR_PARAMPROB_IPV6OPTION
}; };
@ -2027,18 +2027,43 @@ IpIoGetIcmpErrStatus (
OUT BOOLEAN *Notify OPTIONAL OUT BOOLEAN *Notify OPTIONAL
) )
{ {
if (IpVersion == IP_VERSION_4 ){ if (IpVersion == IP_VERSION_4 ) {
ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB)); ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));
if (IsHard != NULL) { if (IsHard != NULL) {
*IsHard = mIcmpErrMap[IcmpError].IsHard; *IsHard = mIcmpErrMap[IcmpError].IsHard;
} }
if (Notify != NULL) { if (Notify != NULL) {
*Notify = mIcmpErrMap[IcmpError].Notify; *Notify = mIcmpErrMap[IcmpError].Notify;
} }
switch (IcmpError) {
case ICMP_ERR_UNREACH_NET:
return EFI_NETWORK_UNREACHABLE;
case ICMP_ERR_TIMXCEED_INTRANS:
case ICMP_ERR_TIMXCEED_REASS:
case ICMP_ERR_UNREACH_HOST:
return EFI_HOST_UNREACHABLE;
case ICMP_ERR_UNREACH_PROTOCOL:
return EFI_PROTOCOL_UNREACHABLE;
case ICMP_ERR_UNREACH_PORT:
return EFI_PORT_UNREACHABLE;
case ICMP_ERR_MSGSIZE:
case ICMP_ERR_UNREACH_SRCFAIL:
case ICMP_ERR_QUENCH:
case ICMP_ERR_PARAMPROB:
return EFI_ICMP_ERROR;
default:
ASSERT (FALSE);
return EFI_UNSUPPORTED;
}
return mIcmpErrMap[IcmpError].Error;
} else if (IpVersion == IP_VERSION_6) { } else if (IpVersion == IP_VERSION_6) {
ASSERT ((IcmpError >= ICMP6_ERR_UNREACH_NET) && (IcmpError <= ICMP6_ERR_PARAMPROB_IPV6OPTION)); ASSERT ((IcmpError >= ICMP6_ERR_UNREACH_NET) && (IcmpError <= ICMP6_ERR_PARAMPROB_IPV6OPTION));
@ -2050,7 +2075,32 @@ IpIoGetIcmpErrStatus (
if (Notify != NULL) { if (Notify != NULL) {
*Notify = mIcmp6ErrMap[IcmpError].Notify; *Notify = mIcmp6ErrMap[IcmpError].Notify;
} }
return mIcmp6ErrMap[IcmpError].Error;
switch (IcmpError) {
case ICMP6_ERR_UNREACH_NET:
return EFI_NETWORK_UNREACHABLE;
case ICMP6_ERR_UNREACH_HOST:
case ICMP6_ERR_TIMXCEED_HOPLIMIT:
case ICMP6_ERR_TIMXCEED_REASS:
return EFI_HOST_UNREACHABLE;
case ICMP6_ERR_UNREACH_PROTOCOL:
return EFI_PROTOCOL_UNREACHABLE;
case ICMP6_ERR_UNREACH_PORT:
return EFI_PORT_UNREACHABLE;
case ICMP6_ERR_PACKAGE_TOOBIG:
case ICMP6_ERR_PARAMPROB_HEADER:
case ICMP6_ERR_PARAMPROB_NEXHEADER:
case ICMP6_ERR_PARAMPROB_IPV6OPTION:
return EFI_ICMP_ERROR;
default:
ASSERT (FALSE);
return EFI_UNSUPPORTED;
}
} else { } else {
// //