2 The implementation to go through each entry in IpSecConfig application.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "IpSecConfig.h"
15 Enumerate all entries in the database to execute specified operations according to datatype.
17 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
18 @param[in] Routine The pointer to the function of a specified operation.
19 @param[in] Context The pointer to the context of a function.
21 @retval EFI_SUCCESS Execute specified operation successfully.
25 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
26 IN VISIT_POLICY_ENTRY Routine
,
30 EFI_STATUS GetNextStatus
;
31 EFI_STATUS GetDataStatus
;
32 EFI_IPSEC_CONFIG_SELECTOR
*Selector
;
39 SelectorSize
= sizeof (EFI_IPSEC_CONFIG_SELECTOR
);
40 Selector
= AllocateZeroPool (SelectorSize
);
46 GetNextStatus
= mIpSecConfig
->GetNextSelector (
52 if (GetNextStatus
== EFI_BUFFER_TOO_SMALL
) {
53 gBS
->FreePool (Selector
);
54 Selector
= FirstGetNext
? AllocateZeroPool (SelectorSize
) : AllocatePool (SelectorSize
);
56 GetNextStatus
= mIpSecConfig
->GetNextSelector (
64 if (EFI_ERROR (GetNextStatus
)) {
70 GetDataStatus
= mIpSecConfig
->GetData (
77 if (GetDataStatus
== EFI_BUFFER_TOO_SMALL
) {
82 Data
= AllocateZeroPool (DataSize
);
83 GetDataStatus
= mIpSecConfig
->GetData (
92 ASSERT_EFI_ERROR (GetDataStatus
);
94 if (EFI_ERROR (Routine (Selector
, Data
, Context
))) {
100 gBS
->FreePool (Data
);
103 if (Selector
!= NULL
) {
104 gBS
->FreePool (Selector
);