summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-01 08:17:43 +0000
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-01 08:17:43 +0000
commit780847d1287b1d70555570a4cdbcfa5da65d53b1 (patch)
tree7b4e50f2678d44248dc753d51c20d34f8f68b5ce /NetworkPkg
parent97f98500c1d40eba76210961e90ea5d354bcbc18 (diff)
downloadedk2-platforms-780847d1287b1d70555570a4cdbcfa5da65d53b1.tar.xz
Update ipsecconfig and ping6 due to ShellLib update.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10990 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/Application/IpsecConfig/IpSecConfig.c49
-rw-r--r--NetworkPkg/Application/IpsecConfig/IpSecConfig.h48
-rw-r--r--NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c8
-rw-r--r--NetworkPkg/Application/Ping6/Ping6.c2
4 files changed, 69 insertions, 38 deletions
diff --git a/NetworkPkg/Application/IpsecConfig/IpSecConfig.c b/NetworkPkg/Application/IpsecConfig/IpSecConfig.c
index 8006d84860..3554355bd7 100644
--- a/NetworkPkg/Application/IpsecConfig/IpSecConfig.c
+++ b/NetworkPkg/Application/IpsecConfig/IpSecConfig.c
@@ -178,14 +178,14 @@ STR2INT mMapIpSecProtocol[] = {
// --auth-algo
//
STR2INT mMapAuthAlgo[] = {
- { L"NONE", EFI_IPSEC_AALG_NONE },
- { L"MD5HMAC", EFI_IPSEC_AALG_MD5HMAC },
- { L"SHA1HMAC", EFI_IPSEC_AALG_SHA1HMAC },
- { L"SHA2-256HMAC", EFI_IPSEC_AALG_SHA2_256HMAC },
- { L"SHA2-384HMAC", EFI_IPSEC_AALG_SHA2_384HMAC },
- { L"SHA2-512HMAC", EFI_IPSEC_AALG_SHA2_512HMAC },
- { L"AES-XCBC-MAC", EFI_IPSEC_AALG_AES_XCBC_MAC },
- { L"NULL", EFI_IPSEC_AALG_NULL },
+ { L"NONE", IPSEC_AALG_NONE },
+ { L"MD5HMAC", IPSEC_AALG_MD5HMAC },
+ { L"SHA1HMAC", IPSEC_AALG_SHA1HMAC },
+ { L"SHA2-256HMAC", IPSEC_AALG_SHA2_256HMAC },
+ { L"SHA2-384HMAC", IPSEC_AALG_SHA2_384HMAC },
+ { L"SHA2-512HMAC", IPSEC_AALG_SHA2_512HMAC },
+ { L"AES-XCBC-MAC", IPSEC_AALG_AES_XCBC_MAC },
+ { L"NULL", IPSEC_AALG_NULL },
{ NULL, 0 },
};
@@ -193,20 +193,20 @@ STR2INT mMapAuthAlgo[] = {
// --encrypt-algo
//
STR2INT mMapEncAlgo[] = {
- { L"NONE", EFI_IPSEC_EALG_NONE },
- { L"DESCBC", EFI_IPSEC_EALG_DESCBC },
- { L"3DESCBC", EFI_IPSEC_EALG_3DESCBC },
- { L"CASTCBC", EFI_IPSEC_EALG_CASTCBC },
- { L"BLOWFISHCBC", EFI_IPSEC_EALG_BLOWFISHCBC },
- { L"NULL", EFI_IPSEC_EALG_NULL },
- { L"AESCBC", EFI_IPSEC_EALG_AESCBC },
- { L"AESCTR", EFI_IPSEC_EALG_AESCTR },
- { L"AES-CCM-ICV8", EFI_IPSEC_EALG_AES_CCM_ICV8 },
- { L"AES-CCM-ICV12",EFI_IPSEC_EALG_AES_CCM_ICV12 },
- { L"AES-CCM-ICV16",EFI_IPSEC_EALG_AES_CCM_ICV16 },
- { L"AES-GCM-ICV8", EFI_IPSEC_EALG_AES_GCM_ICV8 },
- { L"AES-GCM-ICV12",EFI_IPSEC_EALG_AES_GCM_ICV12 },
- { L"AES-GCM-ICV16",EFI_IPSEC_EALG_AES_GCM_ICV16 },
+ { L"NONE", IPSEC_EALG_NONE },
+ { L"DESCBC", IPSEC_EALG_DESCBC },
+ { L"3DESCBC", IPSEC_EALG_3DESCBC },
+ { L"CASTCBC", IPSEC_EALG_CASTCBC },
+ { L"BLOWFISHCBC", IPSEC_EALG_BLOWFISHCBC },
+ { L"NULL", IPSEC_EALG_NULL },
+ { L"AESCBC", IPSEC_EALG_AESCBC },
+ { L"AESCTR", IPSEC_EALG_AESCTR },
+ { L"AES-CCM-ICV8", IPSEC_EALG_AES_CCM_ICV8 },
+ { L"AES-CCM-ICV12",IPSEC_EALG_AES_CCM_ICV12 },
+ { L"AES-CCM-ICV16",IPSEC_EALG_AES_CCM_ICV16 },
+ { L"AES-GCM-ICV8", IPSEC_EALG_AES_GCM_ICV8 },
+ { L"AES-GCM-ICV12",IPSEC_EALG_AES_GCM_ICV12 },
+ { L"AES-GCM-ICV16",IPSEC_EALG_AES_GCM_ICV16 },
{ NULL, 0 },
};
@@ -228,7 +228,7 @@ STR2INT mMapAuthMethod[] = {
{ NULL, 0 },
};
-EFI_IPSEC_PROTOCOL *mIpSec;
+EFI_IPSEC2_PROTOCOL *mIpSec;
EFI_IPSEC_CONFIG_PROTOCOL *mIpSecConfig;
EFI_HII_HANDLE mHiiHandle;
EFI_GUID mEfiIpSecConfigGuid = EFI_IPSEC_CONFIG_GUID;
@@ -711,7 +711,6 @@ InitializeIpSecConfig (
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_CONFIG_STATUS_ENABLE), mHiiHandle, mAppName);
}
-
goto Done;
}
@@ -754,7 +753,7 @@ InitializeIpSecConfig (
goto Done;
}
- NonOptionCount = ShellCommandLineGetCount ();
+ NonOptionCount = ShellCommandLineGetCount (ParamPackage);
if ((NonOptionCount - 1) > 0) {
ValueStr = ShellCommandLineGetRawValue (ParamPackage, (UINT32) (NonOptionCount - 1));
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_REDUNDANCY_MANY), mHiiHandle, mAppName, ValueStr);
diff --git a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h
index d1a7681012..1ab57b56cc 100644
--- a/NetworkPkg/Application/IpsecConfig/IpSecConfig.h
+++ b/NetworkPkg/Application/IpsecConfig/IpSecConfig.h
@@ -47,7 +47,39 @@
#define EFI_IPSEC_ANY_PROTOCOL 0xFFFF
#define EFI_IPSEC_ANY_PORT 0
-typedef struct _VAR_CHECK_ITEM {
+///
+/// IPsec Authentication Algorithm Definition
+/// The number value definition is aligned to IANA assignment
+///
+#define IPSEC_AALG_NONE 0x00
+#define IPSEC_AALG_MD5HMAC 0x01
+#define IPSEC_AALG_SHA1HMAC 0x02
+#define IPSEC_AALG_SHA2_256HMAC 0x05
+#define IPSEC_AALG_SHA2_384HMAC 0x06
+#define IPSEC_AALG_SHA2_512HMAC 0x07
+#define IPSEC_AALG_AES_XCBC_MAC 0x09
+#define IPSEC_AALG_NULL 0xFB
+
+///
+/// IPsec Encryption Algorithm Definition
+/// The number value definition is aligned to IANA assignment
+///
+#define IPSEC_EALG_NONE 0x00
+#define IPSEC_EALG_DESCBC 0x02
+#define IPSEC_EALG_3DESCBC 0x03
+#define IPSEC_EALG_CASTCBC 0x06
+#define IPSEC_EALG_BLOWFISHCBC 0x07
+#define IPSEC_EALG_NULL 0x0B
+#define IPSEC_EALG_AESCBC 0x0C
+#define IPSEC_EALG_AESCTR 0x0D
+#define IPSEC_EALG_AES_CCM_ICV8 0x0E
+#define IPSEC_EALG_AES_CCM_ICV12 0x0F
+#define IPSEC_EALG_AES_CCM_ICV16 0x10
+#define IPSEC_EALG_AES_GCM_ICV8 0x12
+#define IPSEC_EALG_AES_GCM_ICV12 0x13
+#define IPSEC_EALG_AES_GCM_ICV16 0x14
+
+typedef struct {
CHAR16 *VarName;
UINT32 Attribute1;
UINT32 Attribute2;
@@ -55,15 +87,15 @@ typedef struct _VAR_CHECK_ITEM {
UINT32 Attribute4;
} VAR_CHECK_ITEM;
-typedef struct _SHELL_PARAM_PACKAGE{
- LIST_ENTRY Link;
- CHAR16 *Name;
- ParamType Type;
- CHAR16 *Value;
- UINTN OriginalPosition;
+typedef struct {
+ LIST_ENTRY Link;
+ CHAR16 *Name;
+ SHELL_PARAM_TYPE Type;
+ CHAR16 *Value;
+ UINTN OriginalPosition;
} SHELL_PARAM_PACKAGE;
-typedef struct _STR2INT {
+typedef struct {
CHAR16 *String;
UINT32 Integer;
} STR2INT;
diff --git a/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c b/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c
index ddfbb4c504..f128bee1ec 100644
--- a/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c
+++ b/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c
@@ -932,7 +932,7 @@ CreateSadEntry (
L"--auth-algo"
);
ReturnStatus = EFI_INVALID_PARAMETER;
- } else if ((*Data)->AlgoInfo.EspAlgoInfo.AuthAlgoId != EFI_IPSEC_AALG_NONE && (*Mask & AUTH_KEY) == 0) {
+ } else if ((*Data)->AlgoInfo.EspAlgoInfo.AuthAlgoId != IPSEC_AALG_NONE && (*Mask & AUTH_KEY) == 0) {
ShellPrintHiiEx (
-1,
-1,
@@ -956,7 +956,7 @@ CreateSadEntry (
L"--encrypt-algo"
);
ReturnStatus = EFI_INVALID_PARAMETER;
- } else if ((*Data)->AlgoInfo.EspAlgoInfo.EncAlgoId != EFI_IPSEC_EALG_NONE && (*Mask & ENCRYPT_KEY) == 0) {
+ } else if ((*Data)->AlgoInfo.EspAlgoInfo.EncAlgoId != IPSEC_EALG_NONE && (*Mask & ENCRYPT_KEY) == 0) {
ShellPrintHiiEx (
-1,
-1,
@@ -999,7 +999,7 @@ CreatePadEntry (
{
EFI_STATUS Status;
EFI_STATUS ReturnStatus;
- EFI_FILE_HANDLE FileHandle;
+ SHELL_FILE_HANDLE FileHandle;
UINT64 FileSize;
UINTN AuthDataLength;
UINTN RevocationDataLength;
@@ -1588,7 +1588,7 @@ CombineSadEntry (
//
// Encrypt_key should be provided if algorithm is not NONE.
//
- if (NewData->AlgoInfo.EspAlgoInfo.EncAlgoId != EFI_IPSEC_EALG_NONE && (Mask & ENCRYPT_KEY) == 0) {
+ if (NewData->AlgoInfo.EspAlgoInfo.EncAlgoId != IPSEC_EALG_NONE && (Mask & ENCRYPT_KEY) == 0) {
ShellPrintHiiEx (
-1,
-1,
diff --git a/NetworkPkg/Application/Ping6/Ping6.c b/NetworkPkg/Application/Ping6/Ping6.c
index b783c5a027..b86ee18ae5 100644
--- a/NetworkPkg/Application/Ping6/Ping6.c
+++ b/NetworkPkg/Application/Ping6/Ping6.c
@@ -1136,7 +1136,7 @@ InitializePing6 (
//
// Parse the paramter of destination ip address.
//
- NonOptionCount = ShellCommandLineGetCount();
+ NonOptionCount = ShellCommandLineGetCount(ParamPackage);
ValueStr = ShellCommandLineGetRawValue (ParamPackage, (UINT32)(NonOptionCount-1));
if (NonOptionCount != 2) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_INPUT), mHiiHandle);