]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Application/IpsecConfig/IpSecConfig.c
NetworkPkg: Convert non DOS format files to DOS format
[mirror_edk2.git] / NetworkPkg / Application / IpsecConfig / IpSecConfig.c
index 3554355bd7081f516d8fbfd11fbc12cce863d266..e4f6057f403b5ad0eb2a1253071cc7e7780aaaf3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The main process for IpSecConfig application.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -82,7 +82,8 @@ SHELL_PARAM_ITEM    mIpSecConfigParamList[] = {
   // --ipsec-proto\r
   //\r
   { L"--spi",                 TypeValue },\r
-  { L"--dest",                TypeValue },\r
+  { L"--tunnel-dest",         TypeValue },\r
+  { L"--tunnel-source",       TypeValue },\r
   { L"--lookup-spi",          TypeValue },\r
   { L"--lookup-ipsec-proto",  TypeValue },\r
   { L"--lookup-dest",         TypeValue },\r
@@ -231,7 +232,6 @@ STR2INT mMapAuthMethod[] = {
 EFI_IPSEC2_PROTOCOL          *mIpSec;\r
 EFI_IPSEC_CONFIG_PROTOCOL    *mIpSecConfig;\r
 EFI_HII_HANDLE               mHiiHandle;\r
-EFI_GUID                     mEfiIpSecConfigGuid = EFI_IPSEC_CONFIG_GUID;\r
 CHAR16                       mAppName[]          = L"IpSecConfig";\r
 \r
 //\r
@@ -292,7 +292,8 @@ VAR_CHECK_ITEM    mIpSecConfigVarCheckList[] = {
   // --ipsec-proto\r
   //\r
   { L"--spi",                0,              0,       BIT(1),               0 },\r
-  { L"--dest",               0,              0,       BIT(1),               0 },\r
+  { L"--tunnel-dest",        0,              0,       BIT(1),               0 },\r
+  { L"--tunnel-source",      0,              0,       BIT(1),               0 },\r
   { L"--lookup-spi",         0,              0,       BIT(1),               0 },\r
   { L"--lookup-ipsec-proto", 0,              0,       BIT(1),               0 },\r
   { L"--lookup-dest",        0,              0,       BIT(1),               0 },\r
@@ -548,7 +549,7 @@ IpSecConfigRetriveCheckListByName (
   for (Node = GetFirstNode (ParamPackage); !IsNull (ParamPackage, Node); Node = GetNextNode (ParamPackage, Node)) {\r
     if (((SHELL_PARAM_PACKAGE *) Node)->Name != NULL) {\r
       //\r
-         // Enumerate the check list that defines the conflicted attributes of each flag.\r
+      // Enumerate the check list that defines the conflicted attributes of each flag.\r
       //\r
       for (; Item->VarName != NULL; Item++) {\r
         if (StrCmp (((SHELL_PARAM_PACKAGE *) Node)->Name, Item->VarName) == 0) {\r
@@ -646,7 +647,7 @@ InitializeIpSecConfig (
     goto Done;\r
   }\r
 \r
-  Status = LocateProtocol (&gEfiIpSecProtocolGuid, (VOID **) &mIpSec);\r
+  Status = LocateProtocol (&gEfiIpSec2ProtocolGuid, (VOID **) &mIpSec);\r
   if (EFI_ERROR (Status) || mIpSec == NULL) {\r
     ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_CONFIG_PROTOCOL_INEXISTENT), mHiiHandle, mAppName);\r
     goto Done;\r
@@ -717,7 +718,7 @@ InitializeIpSecConfig (
   //\r
   // Try to get policy database type.\r
   //\r
-  DataType = (EFI_IPSEC_CONFIG_DATA_TYPE) -1;\r
+  DataType = (EFI_IPSEC_CONFIG_DATA_TYPE) - 1;\r
   ValueStr = ShellCommandLineGetValue (ParamPackage, L"-p");\r
   if (ValueStr != NULL) {\r
     DataType = (EFI_IPSEC_CONFIG_DATA_TYPE) MapStringToInteger (ValueStr, mMapPolicy);\r
@@ -728,11 +729,12 @@ InitializeIpSecConfig (
   }\r
 \r
   if (ShellCommandLineGetFlag (ParamPackage, L"-?")) {\r
-    switch (DataType) {\r
-      case (EFI_IPSEC_CONFIG_DATA_TYPE) -1:\r
-        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_CONFIG_HELP), mHiiHandle);\r
-        break;\r
+    if (DataType == -1) {\r
+      ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_CONFIG_HELP), mHiiHandle);\r
+      goto Done;\r
+    }\r
 \r
+    switch (DataType) {\r
       case IPsecConfigDataTypeSpd:\r
         ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IPSEC_CONFIG_SPD_HELP), mHiiHandle);\r
         break;\r