]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Application/IpsecConfig/IpSecConfig.h
79a436a7b3b2a18e68a9cf717c9645db5a326af1
[mirror_edk2.git] / NetworkPkg / Application / IpsecConfig / IpSecConfig.h
1 /** @file
2 The internal structure and function declaration in IpSecConfig application.
3
4 Copyright (c) 2009 - 2016, 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 _IPSEC_CONFIG_H_
17 #define _IPSEC_CONFIG_H_
18
19 #include <Library/BaseMemoryLib.h>
20 #include <Library/UefiLib.h>
21 #include <Library/ShellLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/MemoryAllocationLib.h>
24 #include <Library/UefiBootServicesTableLib.h>
25 #include <Library/UefiHiiServicesLib.h>
26 #include <Library/NetLib.h>
27
28 #include <Protocol/IpSecConfig.h>
29
30 #ifndef ARRAY_SIZE
31 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
32 #endif
33
34 #define IPSECCONFIG_STATUS_NAME L"IpSecStatus"
35
36 #define BIT(x) (UINT32) (1 << (x))
37
38 #define IPSEC_STATUS_DISABLED 0x0
39 #define IPSEC_STATUS_ENABLED 0x1
40
41 #define EFI_IP4_PROTO_ICMP 0x1
42 #define EFI_IP4_PROTO_TCP 0x6
43 #define EFI_IP4_PROTO_UDP 0x11
44
45 #define EFI_IPSEC_ANY_PROTOCOL 0xFFFF
46 #define EFI_IPSEC_ANY_PORT 0
47
48 ///
49 /// IPsec Authentication Algorithm Definition
50 /// The number value definition is aligned to IANA assignment
51 ///
52 #define IPSEC_AALG_NONE 0x00
53 #define IPSEC_AALG_MD5HMAC 0x01
54 #define IPSEC_AALG_SHA1HMAC 0x02
55 #define IPSEC_AALG_SHA2_256HMAC 0x05
56 #define IPSEC_AALG_SHA2_384HMAC 0x06
57 #define IPSEC_AALG_SHA2_512HMAC 0x07
58 #define IPSEC_AALG_AES_XCBC_MAC 0x09
59 #define IPSEC_AALG_NULL 0xFB
60
61 ///
62 /// IPsec Encryption Algorithm Definition
63 /// The number value definition is aligned to IANA assignment
64 ///
65 #define IPSEC_EALG_NONE 0x00
66 #define IPSEC_EALG_DESCBC 0x02
67 #define IPSEC_EALG_3DESCBC 0x03
68 #define IPSEC_EALG_CASTCBC 0x06
69 #define IPSEC_EALG_BLOWFISHCBC 0x07
70 #define IPSEC_EALG_NULL 0x0B
71 #define IPSEC_EALG_AESCBC 0x0C
72 #define IPSEC_EALG_AESCTR 0x0D
73 #define IPSEC_EALG_AES_CCM_ICV8 0x0E
74 #define IPSEC_EALG_AES_CCM_ICV12 0x0F
75 #define IPSEC_EALG_AES_CCM_ICV16 0x10
76 #define IPSEC_EALG_AES_GCM_ICV8 0x12
77 #define IPSEC_EALG_AES_GCM_ICV12 0x13
78 #define IPSEC_EALG_AES_GCM_ICV16 0x14
79
80 typedef struct {
81 CHAR16 *VarName;
82 UINT32 Attribute1;
83 UINT32 Attribute2;
84 UINT32 Attribute3;
85 UINT32 Attribute4;
86 } VAR_CHECK_ITEM;
87
88 typedef struct {
89 LIST_ENTRY Link;
90 CHAR16 *Name;
91 SHELL_PARAM_TYPE Type;
92 CHAR16 *Value;
93 UINTN OriginalPosition;
94 } SHELL_PARAM_PACKAGE;
95
96 typedef struct {
97 CHAR16 *String;
98 UINT32 Integer;
99 } STR2INT;
100
101 extern EFI_IPSEC_CONFIG_PROTOCOL *mIpSecConfig;
102 extern EFI_HII_HANDLE mHiiHandle;
103 extern CHAR16 mAppName[];
104
105 //
106 // -P
107 //
108 extern STR2INT mMapPolicy[];
109
110 //
111 // --proto
112 //
113 extern STR2INT mMapIpProtocol[];
114
115 //
116 // --action
117 //
118 extern STR2INT mMapIpSecAction[];
119
120 //
121 // --mode
122 //
123 extern STR2INT mMapIpSecMode[];
124
125 //
126 // --dont-fragment
127 //
128 extern STR2INT mMapDfOption[];
129
130 //
131 // --ipsec-proto
132 //
133 extern STR2INT mMapIpSecProtocol[];
134 //
135 // --auth-algo
136 //
137 extern STR2INT mMapAuthAlgo[];
138
139 //
140 // --encrypt-algo
141 //
142 extern STR2INT mMapEncAlgo[];
143 //
144 // --auth-proto
145 //
146 extern STR2INT mMapAuthProto[];
147
148 //
149 // --auth-method
150 //
151 extern STR2INT mMapAuthMethod[];
152
153 #endif