2 The implementation to go through each entry in IpSecConfig application.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "IpSecConfig.h"
21 Enumerate all entries in the database to execute specified operations according to datatype.
23 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
24 @param[in] Routine The pointer to the function of a specified operation.
25 @param[in] Context The pointer to the context of a function.
27 @retval EFI_SUCCESS Execute specified operation successfully.
31 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
32 IN VISIT_POLICY_ENTRY Routine
,
36 EFI_STATUS GetNextStatus
;
37 EFI_STATUS GetDataStatus
;
38 EFI_IPSEC_CONFIG_SELECTOR
*Selector
;
45 SelectorSize
= sizeof (EFI_IPSEC_CONFIG_SELECTOR
);
46 Selector
= AllocateZeroPool (SelectorSize
);
52 GetNextStatus
= mIpSecConfig
->GetNextSelector (
58 if (GetNextStatus
== EFI_BUFFER_TOO_SMALL
) {
59 gBS
->FreePool (Selector
);
60 Selector
= FirstGetNext
? AllocateZeroPool (SelectorSize
) : AllocatePool (SelectorSize
);
62 GetNextStatus
= mIpSecConfig
->GetNextSelector (
70 if (EFI_ERROR (GetNextStatus
)) {
76 GetDataStatus
= mIpSecConfig
->GetData (
83 if (GetDataStatus
== EFI_BUFFER_TOO_SMALL
) {
88 Data
= AllocateZeroPool (DataSize
);
89 GetDataStatus
= mIpSecConfig
->GetData (
98 ASSERT_EFI_ERROR (GetDataStatus
);
100 if (EFI_ERROR (Routine (Selector
, Data
, Context
))) {
106 gBS
->FreePool (Data
);
109 if (Selector
!= NULL
) {
110 gBS
->FreePool (Selector
);