NetworkPkg/Application/IpsecConfig/IpSecConfig.c File Reference


Functions

BOOLEAN GrowBuffer (IN OUT EFI_STATUS *Status, IN OUT VOID **Buffer, IN UINTN BufferSize)
EFI_STATUS LocateHandle (IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol, IN VOID *SearchKey, IN OUT UINTN *NoHandles, OUT EFI_HANDLE **Buffer)
EFI_STATUS LocateProtocol (IN EFI_GUID *ProtocolGuid, OUT VOID **Interface)
EFI_STATUS IpSecConfigRetriveCheckListByName (IN VAR_CHECK_ITEM *CheckList, IN LIST_ENTRY *ParamPackage)
EFI_STATUS EFIAPI InitializeIpSecConfig (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)

Variables

SHELL_PARAM_ITEM mIpSecConfigParamList []
STR2INT mMapPolicy []
STR2INT mMapIpProtocol []
STR2INT mMapIpSecAction []
STR2INT mMapIpSecMode []
STR2INT mMapDfOption []
STR2INT mMapIpSecProtocol []
STR2INT mMapAuthAlgo []
STR2INT mMapEncAlgo []
STR2INT mMapAuthProto []
STR2INT mMapAuthMethod []
EFI_IPSEC2_PROTOCOL * mIpSec
EFI_IPSEC_CONFIG_PROTOCOL * mIpSecConfig
EFI_HII_HANDLE mHiiHandle
CHAR16 mAppName [] = L"IpSecConfig"
VAR_CHECK_ITEM mIpSecConfigVarCheckList []

Detailed Description

The main process for IpSecConfig application.

Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

BOOLEAN GrowBuffer ( IN OUT EFI_STATUS *  Status,
IN OUT VOID **  Buffer,
IN UINTN  BufferSize 
)

The function to allocate the proper sized buffer for various EFI interfaces.

Parameters:
[in,out] Status Current status.
[in,out] Buffer Current allocated buffer, or NULL.
[in] BufferSize Current buffer size needed
Return values:
TRUE If the buffer was reallocated and the caller should try the API again.
FALSE If the buffer was not reallocated successfully.

Referenced by LocateHandle().

EFI_STATUS EFIAPI InitializeIpSecConfig ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE *  SystemTable 
)

This is the declaration of an EFI image entry point. This entry point is the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers, including both device drivers and bus drivers.

The entry point for IpSecConfig application that parse the command line input and call an IpSecConfig process.

Parameters:
[in] ImageHandle The image handle of this application.
[in] SystemTable The pointer to the EFI System Table.
Return values:
EFI_SUCCESS The operation completed successfully.

References AddOrInsertPolicyEntry(), EditPolicyEntry(), FlushOrDeletePolicyEntry(), IPSEC_STATUS_ENABLED, IPSECCONFIG_STATUS_NAME, IpSecConfigRetriveCheckListByName(), ListPolicyEntry(), LocateProtocol(), mAppName, MapStringToInteger(), mHiiHandle, mIpSec, mIpSecConfig, and mIpSecConfigParamList.

EFI_STATUS IpSecConfigRetriveCheckListByName ( IN VAR_CHECK_ITEM CheckList,
IN LIST_ENTRY *  ParamPackage 
)

Helper function called to check the conflicted flags.

Parameters:
[in] CheckList The pointer to the VAR_CHECK_ITEM table.
[in] ParamPackage The pointer to the ParamPackage list.
Return values:
EFI_SUCCESS No conflicted flags.
EFI_INVALID_PARAMETER The input parameter is erroroneous or there are some conflicted flags.

References VAR_CHECK_ITEM::Attribute1, VAR_CHECK_ITEM::Attribute2, VAR_CHECK_ITEM::Attribute3, VAR_CHECK_ITEM::Attribute4, and VAR_CHECK_ITEM::VarName.

Referenced by InitializeIpSecConfig().

EFI_STATUS LocateHandle ( IN EFI_LOCATE_SEARCH_TYPE  SearchType,
IN EFI_GUID *  Protocol,
IN VOID *  SearchKey,
IN OUT UINTN *  NoHandles,
OUT EFI_HANDLE **  Buffer 
)

Function returns an array of handles that support the requested protocol in a buffer allocated from a pool.

Parameters:
[in] SearchType Specifies which handle(s) are to be returned.
[in] Protocol Provides the protocol to search by. This parameter is only valid for SearchType ByProtocol.
[in] SearchKey Supplies the search key depending on the SearchType.
[in,out] NoHandles The number of handles returned in Buffer.
[out] Buffer A pointer to the buffer to return the requested array of handles that support Protocol.
Return values:
EFI_SUCCESS The resulting array of handles was returned.
Others Other mistake case.

References GrowBuffer().

Referenced by LocateProtocol().

EFI_STATUS LocateProtocol ( IN EFI_GUID *  ProtocolGuid,
OUT VOID **  Interface 
)

Find the first instance of this protocol in the system and return its interface.

Parameters:
[in] ProtocolGuid The guid of the protocol.
[out] Interface The pointer to the first instance of the protocol.
Return values:
EFI_SUCCESS A protocol instance matching ProtocolGuid was found.
Others A protocol instance matching ProtocolGuid was not found.

References LocateHandle().

Referenced by InitializeIpSecConfig().


Variable Documentation

CHAR16 mAppName[] = L"IpSecConfig"

EFI_HII_HANDLE mHiiHandle

EFI_IPSEC2_PROTOCOL* mIpSec

EFI_IPSEC_CONFIG_PROTOCOL* mIpSecConfig

SHELL_PARAM_ITEM mIpSecConfigParamList[]

Referenced by InitializeIpSecConfig().

Initial value:

 {
  { 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 },
}

Referenced by CreateSadEntry(), CreateSpdEntry(), DumpSadEntry(), and DumpSpdEntry().

Initial value:

 {
  { L"PreSharedSecret", EfiIPsecAuthMethodPreSharedSecret },
  { L"Certificates",    EfiIPsecAuthMethodCertificates },
  { NULL,               0 },
}

Referenced by CreatePadEntry(), and DumpPadEntry().

Initial value:

 {
  { L"IKEv1",        EfiIPsecAuthProtocolIKEv1 },
  { L"IKEv2",        EfiIPsecAuthProtocolIKEv2 },
  { NULL,            0 },
}

Referenced by CreatePadEntry(), and DumpPadEntry().

Initial value:

 {
  { L"clear",     EfiIPsecTunnelClearDf },
  { L"set",       EfiIPsecTunnelSetDf },
  { L"copy",      EfiIPsecTunnelCopyDf },
  { NULL,         0 },
}

Referenced by CreateSpdEntry(), and DumpSpdEntry().

Initial value:

 {
  { 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 },
}

Referenced by CreateSadEntry(), CreateSpdEntry(), DumpSadEntry(), and DumpSpdEntry().

Initial value:

 {
  { L"TCP",       EFI_IP4_PROTO_TCP },
  { L"UDP",       EFI_IP4_PROTO_UDP },
  { L"ICMP",      EFI_IP4_PROTO_ICMP },
  { NULL,         0 },
}

Referenced by CreateSpdSelector(), and DumpSpdSelector().

Initial value:

 {
  { L"Bypass",    EfiIPsecActionBypass },
  { L"Discard",   EfiIPsecActionDiscard },
  { L"Protect",   EfiIPsecActionProtect },
  { NULL,         0 },
}

Referenced by CreateSpdEntry(), and DumpSpdEntry().

Initial value:

 {
  { L"Transport", EfiIPsecTransport },
  { L"Tunnel",    EfiIPsecTunnel },
  { NULL,         0 },
}

Referenced by CreateSadEntry(), CreateSpdEntry(), DumpSadEntry(), and DumpSpdEntry().

Initial value:

 {
  { L"AH",        EfiIPsecAH },
  { L"ESP",       EfiIPsecESP },
  { NULL,         0 },
}

Referenced by ConstructSadIndexer(), CreateSadEntry(), CreateSpdEntry(), DumpSadEntry(), and DumpSpdEntry().

Initial value:

 {
  { L"SPD",       IPsecConfigDataTypeSpd },
  { L"SAD",       IPsecConfigDataTypeSad },
  { L"PAD",       IPsecConfigDataTypePad },
  { NULL,         0 },
}


Generated on Mon Sep 28 08:49:05 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1