2 The function declaration of policy entry operation 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 #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)
50 #define PEER_ID BIT(0)
51 #define PEER_ADDRESS BIT(1)
52 #define AUTH_PROTO BIT(2)
53 #define AUTH_METHOD BIT(3)
55 #define AUTH_DATA BIT(5)
56 #define REVOCATION_DATA BIT(6)
59 EFI_IPSEC_CONFIG_DATA_TYPE DataType
;
60 EFI_IPSEC_CONFIG_SELECTOR
*Selector
; // Data to be inserted.
63 POLICY_ENTRY_INDEXER Indexer
;
64 EFI_STATUS Status
; // Indicate whether insertion succeeds.
65 } EDIT_POLICY_ENTRY_CONTEXT
;
68 EFI_IPSEC_CONFIG_DATA_TYPE DataType
;
69 EFI_IPSEC_CONFIG_SELECTOR
*Selector
; // Data to be inserted.
71 POLICY_ENTRY_INDEXER Indexer
;
72 EFI_STATUS Status
; // Indicate whether insertion succeeds.
73 } INSERT_POLICY_ENTRY_CONTEXT
;
76 The prototype for the CreateSpdEntry()/CreateSadEntry()/CreatePadEntry().
77 Fill in EFI_IPSEC_CONFIG_SELECTOR and corresponding data thru ParamPackage list.
79 @param[out] Selector The pointer to the EFI_IPSEC_CONFIG_SELECTOR union.
80 @param[out] Data The pointer to corresponding data.
81 @param[in] ParamPackage The pointer to the ParamPackage list.
82 @param[out] Mask The pointer to the Mask.
83 @param[in] CreateNew The switch to create new.
85 @retval EFI_SUCCESS Filled in EFI_IPSEC_CONFIG_SELECTOR and corresponding data successfully.
86 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
91 (*CREATE_POLICY_ENTRY
) (
92 OUT EFI_IPSEC_CONFIG_SELECTOR
**Selector
,
94 IN LIST_ENTRY
*ParamPackage
,
100 The prototype for the CombineSpdEntry()/CombineSadEntry()/CombinePadEntry().
101 Combine old SPD/SAD/PAD entry with new SPD/SAD/PAD entry.
103 @param[in, out] OldSelector The pointer to the old EFI_IPSEC_CONFIG_SELECTOR union.
104 @param[in, out] OldData The pointer to the corresponding old data.
105 @param[in] NewSelector The pointer to the new EFI_IPSEC_CONFIG_SELECTOR union.
106 @param[in] NewData The pointer to the corresponding new data.
107 @param[in] Mask The pointer to the Mask.
108 @param[out] CreateNew The switch to create new.
110 @retval EFI_SUCCESS Combined successfully.
111 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
116 (* COMBINE_POLICY_ENTRY
) (
117 EFI_IPSEC_CONFIG_SELECTOR
*OldSelector
,
119 EFI_IPSEC_CONFIG_SELECTOR
*NewSelector
,
126 Insert or add entry information in database according to datatype.
128 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
129 @param[in] ParamPackage The pointer to the ParamPackage list.
131 @retval EFI_SUCCESS Insert or add entry information successfully.
132 @retval EFI_NOT_FOUND Can't find the specified entry.
133 @retval EFI_BUFFER_TOO_SMALL The entry already existed.
134 @retval EFI_UNSUPPORTED The operation is not supported./
135 @retval Others Some mistaken case.
138 AddOrInsertPolicyEntry (
139 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
140 IN LIST_ENTRY
*ParamPackage
144 Edit entry information in the database according to datatype.
146 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
147 @param[in] ParamPackage The pointer to the ParamPackage list.
149 @retval EFI_SUCCESS Edit entry information successfully.
150 @retval EFI_NOT_FOUND Can't find the specified entry.
151 @retval Others Some mistaken case.
155 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType
,
156 IN LIST_ENTRY
*ParamPackage