]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.h
Update ipsecconfig and ping6 due to ShellLib update.
[mirror_edk2.git] / NetworkPkg / Application / IpsecConfig / PolicyEntryOperation.h
1 /** @file
2 The function declaration of policy entry operation in IpSecConfig application.
3
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5
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.
10
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.
13
14 **/
15
16 #ifndef _POLICY_ENTRY_OPERATION_H_
17 #define _POLICY_ENTRY_OPERATION_H_
18
19 #define LOCAL BIT(0)
20 #define REMOTE BIT(1)
21 #define PROTO BIT(2)
22 #define LOCAL_PORT BIT(3)
23 #define REMOTE_PORT BIT(4)
24 #define ICMP_TYPE BIT(5)
25 #define ICMP_CODE BIT(6)
26 #define NAME BIT(7)
27 #define PACKET_FLAG BIT(8)
28 #define ACTION BIT(9)
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)
35 #define MODE BIT(16)
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)
42 #define SPI BIT(23)
43 #define DEST BIT(24)
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
50 #define PEER_ID BIT(0)
51 #define PEER_ADDRESS BIT(1)
52 #define AUTH_PROTO BIT(2)
53 #define AUTH_METHOD BIT(3)
54 #define IKE_ID BIT(4)
55 #define AUTH_DATA BIT(5)
56 #define REVOCATION_DATA BIT(6)
57
58 typedef struct {
59 EFI_IPSEC_CONFIG_DATA_TYPE DataType;
60 EFI_IPSEC_CONFIG_SELECTOR *Selector; // Data to be inserted.
61 VOID *Data;
62 UINT32 Mask;
63 POLICY_ENTRY_INDEXER Indexer;
64 EFI_STATUS Status; // Indicate whether insertion succeeds.
65 } EDIT_POLICY_ENTRY_CONTEXT;
66
67 typedef struct {
68 EFI_IPSEC_CONFIG_DATA_TYPE DataType;
69 EFI_IPSEC_CONFIG_SELECTOR *Selector; // Data to be inserted.
70 VOID *Data;
71 POLICY_ENTRY_INDEXER Indexer;
72 EFI_STATUS Status; // Indicate whether insertion succeeds.
73 } INSERT_POLICY_ENTRY_CONTEXT;
74
75 /**
76 The prototype for the CreateSpdEntry()/CreateSadEntry()/CreatePadEntry().
77 Fill in EFI_IPSEC_CONFIG_SELECTOR and corresponding data thru ParamPackage list.
78
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.
84
85 @retval EFI_SUCCESS Filled in EFI_IPSEC_CONFIG_SELECTOR and corresponding data successfully.
86 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
87
88 **/
89 typedef
90 EFI_STATUS
91 (*CREATE_POLICY_ENTRY) (
92 OUT EFI_IPSEC_CONFIG_SELECTOR **Selector,
93 OUT VOID **Data,
94 IN LIST_ENTRY *ParamPackage,
95 OUT UINT32 *Mask,
96 IN BOOLEAN CreateNew
97 );
98
99 /**
100 The prototype for the CombineSpdEntry()/CombineSadEntry()/CombinePadEntry().
101 Combine old SPD/SAD/PAD entry with new SPD/SAD/PAD entry.
102
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.
109
110 @retval EFI_SUCCESS Combined successfully.
111 @retval EFI_INVALID_PARAMETER Invalid user input parameter.
112
113 **/
114 typedef
115 EFI_STATUS
116 (* COMBINE_POLICY_ENTRY) (
117 EFI_IPSEC_CONFIG_SELECTOR *OldSelector,
118 VOID *OldData,
119 EFI_IPSEC_CONFIG_SELECTOR *NewSelector,
120 VOID *NewData,
121 UINT32 Mask,
122 BOOLEAN *CreateNew
123 );
124
125 /**
126 Insert or add entry information in database according to datatype.
127
128 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
129 @param[in] ParamPackage The pointer to the ParamPackage list.
130
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.
136 **/
137 EFI_STATUS
138 AddOrInsertPolicyEntry (
139 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
140 IN LIST_ENTRY *ParamPackage
141 );
142
143 /**
144 Edit entry information in the database according to datatype.
145
146 @param[in] DataType The value of EFI_IPSEC_CONFIG_DATA_TYPE.
147 @param[in] ParamPackage The pointer to the ParamPackage list.
148
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.
152 **/
153 EFI_STATUS
154 EditPolicyEntry (
155 IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
156 IN LIST_ENTRY *ParamPackage
157 );
158 #endif