2 The function declaration of policy entry operation in IpSecConfig application.
4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef _POLICY_ENTRY_OPERATION_H_
11 #define _POLICY_ENTRY_OPERATION_H_
16 #define LOCAL_PORT BIT(3)
17 #define REMOTE_PORT BIT(4)
18 #define ICMP_TYPE BIT(5)
19 #define ICMP_CODE BIT(6)
21 #define PACKET_FLAG BIT(8)
23 #define EXT_SEQUENCE BIT(10)
24 #define SEQUENCE_OVERFLOW BIT(11)
25 #define FRAGMENT_CHECK BIT(12)
26 #define LIFEBYTE BIT(13)
27 #define LIFETIME_SOFT BIT(14)
28 #define LIFETIME BIT(15)
30 #define TUNNEL_LOCAL BIT(17)
31 #define TUNNEL_REMOTE BIT(18)
32 #define DONT_FRAGMENT BIT(19)
33 #define IPSEC_PROTO BIT(20)
34 #define AUTH_ALGO BIT(21)
35 #define ENCRYPT_ALGO BIT(22)
38 #define SEQUENCE_NUMBER BIT(25)
39 #define ANTIREPLAY_WINDOW BIT(26)
40 #define AUTH_KEY BIT(27)
41 #define ENCRYPT_KEY BIT(28)
42 #define PATH_MTU BIT(29)
43 #define SOURCE BIT(30)
45 #define PEER_ID BIT(0)
46 #define PEER_ADDRESS BIT(1)
47 #define AUTH_PROTO BIT(2)
48 #define AUTH_METHOD BIT(3)
50 #define AUTH_DATA BIT(5)
51 #define REVOCATION_DATA BIT(6)
54 EFI_IPSEC_CONFIG_DATA_TYPE DataType
;
55 EFI_IPSEC_CONFIG_SELECTOR
*Selector
; // Data to be inserted.
58 POLICY_ENTRY_INDEXER Indexer
;
59 EFI_STATUS Status
; // Indicate whether insertion succeeds.
60 } EDIT_POLICY_ENTRY_CONTEXT
;
63 EFI_IPSEC_CONFIG_DATA_TYPE DataType
;
64 EFI_IPSEC_CONFIG_SELECTOR
*Selector
; // Data to be inserted.
66 POLICY_ENTRY_INDEXER Indexer
;
67 EFI_STATUS Status
; // Indicate whether insertion succeeds.
68 } INSERT_POLICY_ENTRY_CONTEXT
;
71 The prototype for the CreateSpdEntry()/CreateSadEntry()/CreatePadEntry().
72 Fill in EFI_IPSEC_CONFIG_SELECTOR and corresponding data thru ParamPackage list.
74 @param[out] Selector The pointer to the EFI_IPSEC_CONFIG_SELECTOR union.
75 @param[out] Data The pointer to corresponding data.
76 @param[in] ParamPackage The pointer to the ParamPackage list.
77 @param[out] Mask The pointer to the Mask.
78 @param[in] CreateNew The switch to create new.
80 @retval EFI_SUCCESS Filled in EFI_IPSEC_CONFIG_SELECTOR and corresponding data successfully.
81 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
86 (*CREATE_POLICY_ENTRY
) (
87 OUT EFI_IPSEC_CONFIG_SELECTOR
**Selector
,
89 IN LIST_ENTRY
*ParamPackage
,
95 The prototype for the CombineSpdEntry()/CombineSadEntry()/CombinePadEntry().
96 Combine old SPD/SAD/PAD entry with new SPD/SAD/PAD entry.
98 @param[in, out] OldSelector The pointer to the old EFI_IPSEC_CONFIG_SELECTOR union.
99 @param[in, out] OldData The pointer to the corresponding old data.
100 @param[in] NewSelector The pointer to the new EFI_IPSEC_CONFIG_SELECTOR union.
101 @param[in] NewData The pointer to the corresponding new data.
102 @param[in] Mask The pointer to the Mask.
103 @param[out] CreateNew The switch to create new.
105 @retval EFI_SUCCESS Combined successfully.
106 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
111 (* COMBINE_POLICY_ENTRY
) (
112 IN OUT EFI_IPSEC_CONFIG_SELECTOR
*OldSelector
,
113 IN OUT VOID
*OldData
,
114 IN EFI_IPSEC_CONFIG_SELECTOR
*NewSelector
,
117 OUT BOOLEAN
*CreateNew
121 Insert or add entry information in database according to datatype.
123 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
124 @param[in] ParamPackage The pointer to the ParamPackage list.
126 @retval EFI_SUCCESS Insert or add entry information successfully.
127 @retval EFI_NOT_FOUND Can't find the specified entry.
128 @retval EFI_BUFFER_TOO_SMALL The entry already existed.
129 @retval EFI_UNSUPPORTED The operation is not supported./
130 @retval Others Some mistaken case.
133 AddOrInsertPolicyEntry (
134 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
135 IN LIST_ENTRY
*ParamPackage
139 Edit entry information in the database according to datatype.
141 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
142 @param[in] ParamPackage The pointer to the ParamPackage list.
144 @retval EFI_SUCCESS Edit entry information successfully.
145 @retval EFI_NOT_FOUND Can't find the specified entry.
146 @retval Others Some mistaken case.
150 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
151 IN LIST_ENTRY
*ParamPackage