2 The function declaration of policy entry operation in IpSecConfig application.
4 Copyright (c) 2009 - 2011, 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 #ifndef _POLICY_ENTRY_OPERATION_H_
17 #define _POLICY_ENTRY_OPERATION_H_
22 #define LOCAL_PORT BIT(3)
23 #define REMOTE_PORT BIT(4)
24 #define ICMP_TYPE BIT(5)
25 #define ICMP_CODE BIT(6)
27 #define PACKET_FLAG BIT(8)
29 #define EXT_SEQUENCE BIT(10)
30 #define SEQUENCE_OVERFLOW BIT(11)
31 #define FRAGMENT_CHECK BIT(12)
32 #define LIFEBYTE BIT(13)
33 #define LIFETIME_SOFT BIT(14)
34 #define LIFETIME BIT(15)
36 #define TUNNEL_LOCAL BIT(17)
37 #define TUNNEL_REMOTE BIT(18)
38 #define DONT_FRAGMENT BIT(19)
39 #define IPSEC_PROTO BIT(20)
40 #define AUTH_ALGO BIT(21)
41 #define ENCRYPT_ALGO BIT(22)
44 #define SEQUENCE_NUMBER BIT(25)
45 #define ANTIREPLAY_WINDOW BIT(26)
46 #define AUTH_KEY BIT(27)
47 #define ENCRYPT_KEY BIT(28)
48 #define PATH_MTU BIT(29)
49 #define SOURCE BIT(30)
51 #define PEER_ID BIT(0)
52 #define PEER_ADDRESS BIT(1)
53 #define AUTH_PROTO BIT(2)
54 #define AUTH_METHOD BIT(3)
56 #define AUTH_DATA BIT(5)
57 #define REVOCATION_DATA BIT(6)
60 EFI_IPSEC_CONFIG_DATA_TYPE DataType
;
61 EFI_IPSEC_CONFIG_SELECTOR
*Selector
; // Data to be inserted.
64 POLICY_ENTRY_INDEXER Indexer
;
65 EFI_STATUS Status
; // Indicate whether insertion succeeds.
66 } EDIT_POLICY_ENTRY_CONTEXT
;
69 EFI_IPSEC_CONFIG_DATA_TYPE DataType
;
70 EFI_IPSEC_CONFIG_SELECTOR
*Selector
; // Data to be inserted.
72 POLICY_ENTRY_INDEXER Indexer
;
73 EFI_STATUS Status
; // Indicate whether insertion succeeds.
74 } INSERT_POLICY_ENTRY_CONTEXT
;
77 The prototype for the CreateSpdEntry()/CreateSadEntry()/CreatePadEntry().
78 Fill in EFI_IPSEC_CONFIG_SELECTOR and corresponding data thru ParamPackage list.
80 @param[out] Selector The pointer to the EFI_IPSEC_CONFIG_SELECTOR union.
81 @param[out] Data The pointer to corresponding data.
82 @param[in] ParamPackage The pointer to the ParamPackage list.
83 @param[out] Mask The pointer to the Mask.
84 @param[in] CreateNew The switch to create new.
86 @retval EFI_SUCCESS Filled in EFI_IPSEC_CONFIG_SELECTOR and corresponding data successfully.
87 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
92 (*CREATE_POLICY_ENTRY
) (
93 OUT EFI_IPSEC_CONFIG_SELECTOR
**Selector
,
95 IN LIST_ENTRY
*ParamPackage
,
101 The prototype for the CombineSpdEntry()/CombineSadEntry()/CombinePadEntry().
102 Combine old SPD/SAD/PAD entry with new SPD/SAD/PAD entry.
104 @param[in, out] OldSelector The pointer to the old EFI_IPSEC_CONFIG_SELECTOR union.
105 @param[in, out] OldData The pointer to the corresponding old data.
106 @param[in] NewSelector The pointer to the new EFI_IPSEC_CONFIG_SELECTOR union.
107 @param[in] NewData The pointer to the corresponding new data.
108 @param[in] Mask The pointer to the Mask.
109 @param[out] CreateNew The switch to create new.
111 @retval EFI_SUCCESS Combined successfully.
112 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
117 (* COMBINE_POLICY_ENTRY
) (
118 IN OUT EFI_IPSEC_CONFIG_SELECTOR
*OldSelector
,
119 IN OUT VOID
*OldData
,
120 IN EFI_IPSEC_CONFIG_SELECTOR
*NewSelector
,
123 OUT BOOLEAN
*CreateNew
127 Insert or add entry information in database according to datatype.
129 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
130 @param[in] ParamPackage The pointer to the ParamPackage list.
132 @retval EFI_SUCCESS Insert or add entry information successfully.
133 @retval EFI_NOT_FOUND Can't find the specified entry.
134 @retval EFI_BUFFER_TOO_SMALL The entry already existed.
135 @retval EFI_UNSUPPORTED The operation is not supported./
136 @retval Others Some mistaken case.
139 AddOrInsertPolicyEntry (
140 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
141 IN LIST_ENTRY
*ParamPackage
145 Edit entry information in the database according to datatype.
147 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
148 @param[in] ParamPackage The pointer to the ParamPackage list.
150 @retval EFI_SUCCESS Edit entry information successfully.
151 @retval EFI_NOT_FOUND Can't find the specified entry.
152 @retval Others Some mistaken case.
156 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
157 IN LIST_ENTRY
*ParamPackage