Update ipsecconfig and ping6 due to ShellLib update.
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Nov 2010 08:17:43 +0000 (08:17 +0000)
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Nov 2010 08:17:43 +0000 (08:17 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10990 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/Application/IpsecConfig/IpSecConfig.c
NetworkPkg/Application/IpsecConfig/IpSecConfig.h
NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c
NetworkPkg/Application/Ping6/Ping6.c

index 8006d84..3554355 100644 (file)
@@ -178,14 +178,14 @@ STR2INT mMapIpSecProtocol[] = {
 // --auth-algo\r
 //\r
 STR2INT mMapAuthAlgo[] = {\r
-  { L"NONE",         EFI_IPSEC_AALG_NONE },\r
-  { L"MD5HMAC",      EFI_IPSEC_AALG_MD5HMAC },\r
-  { L"SHA1HMAC",     EFI_IPSEC_AALG_SHA1HMAC },\r
-  { L"SHA2-256HMAC", EFI_IPSEC_AALG_SHA2_256HMAC },\r
-  { L"SHA2-384HMAC", EFI_IPSEC_AALG_SHA2_384HMAC },\r
-  { L"SHA2-512HMAC", EFI_IPSEC_AALG_SHA2_512HMAC },\r
-  { L"AES-XCBC-MAC", EFI_IPSEC_AALG_AES_XCBC_MAC },\r
-  { L"NULL",         EFI_IPSEC_AALG_NULL },\r
+  { L"NONE",         IPSEC_AALG_NONE },\r
+  { L"MD5HMAC",      IPSEC_AALG_MD5HMAC },\r
+  { L"SHA1HMAC",     IPSEC_AALG_SHA1HMAC },\r
+  { L"SHA2-256HMAC", IPSEC_AALG_SHA2_256HMAC },\r
+  { L"SHA2-384HMAC", IPSEC_AALG_SHA2_384HMAC },\r
+  { L"SHA2-512HMAC", IPSEC_AALG_SHA2_512HMAC },\r
+  { L"AES-XCBC-MAC", IPSEC_AALG_AES_XCBC_MAC },\r
+  { L"NULL",         IPSEC_AALG_NULL },\r
   { NULL,            0 },\r
 };\r
 \r
@@ -193,20 +193,20 @@ STR2INT mMapAuthAlgo[] = {
 // --encrypt-algo\r
 //\r
 STR2INT mMapEncAlgo[] = {\r
-  { L"NONE",         EFI_IPSEC_EALG_NONE },\r
-  { L"DESCBC",       EFI_IPSEC_EALG_DESCBC },\r
-  { L"3DESCBC",      EFI_IPSEC_EALG_3DESCBC },\r
-  { L"CASTCBC",      EFI_IPSEC_EALG_CASTCBC },\r
-  { L"BLOWFISHCBC",  EFI_IPSEC_EALG_BLOWFISHCBC },\r
-  { L"NULL",         EFI_IPSEC_EALG_NULL },\r
-  { L"AESCBC",       EFI_IPSEC_EALG_AESCBC },\r
-  { L"AESCTR",       EFI_IPSEC_EALG_AESCTR },\r
-  { L"AES-CCM-ICV8", EFI_IPSEC_EALG_AES_CCM_ICV8 },\r
-  { L"AES-CCM-ICV12",EFI_IPSEC_EALG_AES_CCM_ICV12 },\r
-  { L"AES-CCM-ICV16",EFI_IPSEC_EALG_AES_CCM_ICV16 },\r
-  { L"AES-GCM-ICV8", EFI_IPSEC_EALG_AES_GCM_ICV8 },\r
-  { L"AES-GCM-ICV12",EFI_IPSEC_EALG_AES_GCM_ICV12 },\r
-  { L"AES-GCM-ICV16",EFI_IPSEC_EALG_AES_GCM_ICV16 },\r
+  { L"NONE",         IPSEC_EALG_NONE },\r
+  { L"DESCBC",       IPSEC_EALG_DESCBC },\r
+  { L"3DESCBC",      IPSEC_EALG_3DESCBC },\r
+  { L"CASTCBC",      IPSEC_EALG_CASTCBC },\r
+  { L"BLOWFISHCBC",  IPSEC_EALG_BLOWFISHCBC },\r
+  { L"NULL",         IPSEC_EALG_NULL },\r
+  { L"AESCBC",       IPSEC_EALG_AESCBC },\r
+  { L"AESCTR",       IPSEC_EALG_AESCTR },\r
+  { L"AES-CCM-ICV8", IPSEC_EALG_AES_CCM_ICV8 },\r
+  { L"AES-CCM-ICV12",IPSEC_EALG_AES_CCM_ICV12 },\r
+  { L"AES-CCM-ICV16",IPSEC_EALG_AES_CCM_ICV16 },\r
+  { L"AES-GCM-ICV8", IPSEC_EALG_AES_GCM_ICV8 },\r
+  { L"AES-GCM-ICV12",IPSEC_EALG_AES_GCM_ICV12 },\r
+  { L"AES-GCM-ICV16",IPSEC_EALG_AES_GCM_ICV16 },\r
   { NULL,            0 },\r
 };\r
 \r
@@ -228,7 +228,7 @@ STR2INT mMapAuthMethod[] = {
   { NULL,               0 },\r
 };\r
 \r
-EFI_IPSEC_PROTOCOL           *mIpSec;\r
+EFI_IPSEC2_PROTOCOL          *mIpSec;\r
 EFI_IPSEC_CONFIG_PROTOCOL    *mIpSecConfig;\r
 EFI_HII_HANDLE               mHiiHandle;\r
 EFI_GUID                     mEfiIpSecConfigGuid = EFI_IPSEC_CONFIG_GUID;\r
@@ -711,7 +711,6 @@ InitializeIpSecConfig (
     } else {\r
       ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_CONFIG_STATUS_ENABLE), mHiiHandle, mAppName);\r
     }\r
-\r
     goto Done;\r
   }\r
 \r
@@ -754,7 +753,7 @@ InitializeIpSecConfig (
     goto Done;\r
   }\r
 \r
-  NonOptionCount = ShellCommandLineGetCount ();\r
+  NonOptionCount = ShellCommandLineGetCount (ParamPackage);\r
   if ((NonOptionCount - 1) > 0) {\r
     ValueStr = ShellCommandLineGetRawValue (ParamPackage, (UINT32) (NonOptionCount - 1));\r
     ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_REDUNDANCY_MANY), mHiiHandle, mAppName, ValueStr);\r
index d1a7681..1ab57b5 100644 (file)
 #define EFI_IPSEC_ANY_PROTOCOL    0xFFFF\r
 #define EFI_IPSEC_ANY_PORT        0\r
 \r
-typedef struct _VAR_CHECK_ITEM {\r
+///\r
+/// IPsec Authentication Algorithm Definition\r
+///   The number value definition is aligned to IANA assignment\r
+///\r
+#define IPSEC_AALG_NONE                0x00\r
+#define IPSEC_AALG_MD5HMAC             0x01\r
+#define IPSEC_AALG_SHA1HMAC            0x02\r
+#define IPSEC_AALG_SHA2_256HMAC        0x05\r
+#define IPSEC_AALG_SHA2_384HMAC        0x06\r
+#define IPSEC_AALG_SHA2_512HMAC        0x07\r
+#define IPSEC_AALG_AES_XCBC_MAC        0x09\r
+#define IPSEC_AALG_NULL                0xFB\r
+\r
+///\r
+/// IPsec Encryption Algorithm Definition\r
+///   The number value definition is aligned to IANA assignment\r
+///\r
+#define IPSEC_EALG_NONE                0x00\r
+#define IPSEC_EALG_DESCBC              0x02\r
+#define IPSEC_EALG_3DESCBC             0x03\r
+#define IPSEC_EALG_CASTCBC             0x06\r
+#define IPSEC_EALG_BLOWFISHCBC         0x07\r
+#define IPSEC_EALG_NULL                0x0B\r
+#define IPSEC_EALG_AESCBC              0x0C\r
+#define IPSEC_EALG_AESCTR              0x0D\r
+#define IPSEC_EALG_AES_CCM_ICV8        0x0E\r
+#define IPSEC_EALG_AES_CCM_ICV12       0x0F\r
+#define IPSEC_EALG_AES_CCM_ICV16       0x10\r
+#define IPSEC_EALG_AES_GCM_ICV8        0x12\r
+#define IPSEC_EALG_AES_GCM_ICV12       0x13\r
+#define IPSEC_EALG_AES_GCM_ICV16       0x14\r
+\r
+typedef struct {\r
   CHAR16      *VarName;\r
   UINT32      Attribute1;\r
   UINT32      Attribute2;\r
@@ -55,15 +87,15 @@ typedef struct _VAR_CHECK_ITEM {
   UINT32      Attribute4;\r
 } VAR_CHECK_ITEM;\r
 \r
-typedef struct _SHELL_PARAM_PACKAGE{\r
-  LIST_ENTRY     Link;\r
-  CHAR16         *Name;\r
-  ParamType      Type;\r
-  CHAR16         *Value;\r
-  UINTN          OriginalPosition;\r
+typedef struct {\r
+  LIST_ENTRY        Link;\r
+  CHAR16            *Name;\r
+  SHELL_PARAM_TYPE  Type;\r
+  CHAR16            *Value;\r
+  UINTN             OriginalPosition;\r
 } SHELL_PARAM_PACKAGE;\r
 \r
-typedef struct _STR2INT {\r
+typedef struct {\r
   CHAR16        *String;\r
   UINT32        Integer;\r
 } STR2INT;\r
index ddfbb4c..f128bee 100644 (file)
@@ -932,7 +932,7 @@ CreateSadEntry (
             L"--auth-algo"\r
             );\r
           ReturnStatus = EFI_INVALID_PARAMETER;\r
-        } else if ((*Data)->AlgoInfo.EspAlgoInfo.AuthAlgoId != EFI_IPSEC_AALG_NONE && (*Mask & AUTH_KEY) == 0) {\r
+        } else if ((*Data)->AlgoInfo.EspAlgoInfo.AuthAlgoId != IPSEC_AALG_NONE && (*Mask & AUTH_KEY) == 0) {\r
           ShellPrintHiiEx (\r
             -1,\r
             -1,\r
@@ -956,7 +956,7 @@ CreateSadEntry (
             L"--encrypt-algo"\r
             );\r
           ReturnStatus = EFI_INVALID_PARAMETER;\r
-        } else if ((*Data)->AlgoInfo.EspAlgoInfo.EncAlgoId != EFI_IPSEC_EALG_NONE && (*Mask & ENCRYPT_KEY) == 0) {\r
+        } else if ((*Data)->AlgoInfo.EspAlgoInfo.EncAlgoId != IPSEC_EALG_NONE && (*Mask & ENCRYPT_KEY) == 0) {\r
           ShellPrintHiiEx (\r
             -1,\r
             -1,\r
@@ -999,7 +999,7 @@ CreatePadEntry (
 {\r
   EFI_STATUS         Status;\r
   EFI_STATUS         ReturnStatus;\r
-  EFI_FILE_HANDLE    FileHandle;\r
+  SHELL_FILE_HANDLE  FileHandle;\r
   UINT64             FileSize;\r
   UINTN              AuthDataLength;\r
   UINTN              RevocationDataLength;\r
@@ -1588,7 +1588,7 @@ CombineSadEntry (
     //\r
     // Encrypt_key should be provided if algorithm is not NONE.\r
     //\r
-    if (NewData->AlgoInfo.EspAlgoInfo.EncAlgoId != EFI_IPSEC_EALG_NONE && (Mask & ENCRYPT_KEY) == 0) {\r
+    if (NewData->AlgoInfo.EspAlgoInfo.EncAlgoId != IPSEC_EALG_NONE && (Mask & ENCRYPT_KEY) == 0) {\r
       ShellPrintHiiEx (\r
         -1,\r
         -1,\r
index b783c5a..b86ee18 100644 (file)
@@ -1136,7 +1136,7 @@ InitializePing6 (
   //\r
   // Parse the paramter of destination ip address.\r
   //\r
-  NonOptionCount = ShellCommandLineGetCount();\r
+  NonOptionCount = ShellCommandLineGetCount(ParamPackage);\r
   ValueStr = ShellCommandLineGetRawValue (ParamPackage, (UINT32)(NonOptionCount-1));\r
   if (NonOptionCount != 2) {\r
     ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_INPUT), mHiiHandle);\r