NetworkPkg: Fix IpsecConfig GCC build failure issue
[mirror_edk2.git] / NetworkPkg / Application / IpsecConfig / IpSecConfig.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 The internal structure and function declaration in IpSecConfig application.\r
3\r
96c1d788 4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
a3bcde70
HT
5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _IPSEC_CONFIG_H_\r
17#define _IPSEC_CONFIG_H_\r
18\r
19#include <Library/BaseMemoryLib.h>\r
20#include <Library/UefiLib.h>\r
21#include <Library/ShellLib.h>\r
22#include <Library/DebugLib.h>\r
23#include <Library/MemoryAllocationLib.h>\r
24#include <Library/UefiBootServicesTableLib.h>\r
be6cd654 25#include <Library/UefiHiiServicesLib.h>\r
a3bcde70
HT
26#include <Library/NetLib.h>\r
27\r
28#include <Protocol/IpSecConfig.h>\r
29\r
a3bcde70
HT
30#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))\r
31\r
32#define IPSECCONFIG_STATUS_NAME L"IpSecStatus"\r
33\r
34#define BIT(x) (UINT32) (1 << (x))\r
35\r
36#define IPSEC_STATUS_DISABLED 0x0\r
37#define IPSEC_STATUS_ENABLED 0x1\r
38\r
39#define EFI_IP4_PROTO_ICMP 0x1\r
40#define EFI_IP4_PROTO_TCP 0x6\r
41#define EFI_IP4_PROTO_UDP 0x11\r
42\r
43#define EFI_IPSEC_ANY_PROTOCOL 0xFFFF\r
44#define EFI_IPSEC_ANY_PORT 0\r
45\r
780847d1 46///\r
47/// IPsec Authentication Algorithm Definition\r
48/// The number value definition is aligned to IANA assignment\r
49///\r
50#define IPSEC_AALG_NONE 0x00\r
51#define IPSEC_AALG_MD5HMAC 0x01\r
52#define IPSEC_AALG_SHA1HMAC 0x02\r
53#define IPSEC_AALG_SHA2_256HMAC 0x05\r
54#define IPSEC_AALG_SHA2_384HMAC 0x06\r
55#define IPSEC_AALG_SHA2_512HMAC 0x07\r
56#define IPSEC_AALG_AES_XCBC_MAC 0x09\r
57#define IPSEC_AALG_NULL 0xFB\r
58\r
59///\r
60/// IPsec Encryption Algorithm Definition\r
61/// The number value definition is aligned to IANA assignment\r
62///\r
63#define IPSEC_EALG_NONE 0x00\r
64#define IPSEC_EALG_DESCBC 0x02\r
65#define IPSEC_EALG_3DESCBC 0x03\r
66#define IPSEC_EALG_CASTCBC 0x06\r
67#define IPSEC_EALG_BLOWFISHCBC 0x07\r
68#define IPSEC_EALG_NULL 0x0B\r
69#define IPSEC_EALG_AESCBC 0x0C\r
70#define IPSEC_EALG_AESCTR 0x0D\r
71#define IPSEC_EALG_AES_CCM_ICV8 0x0E\r
72#define IPSEC_EALG_AES_CCM_ICV12 0x0F\r
73#define IPSEC_EALG_AES_CCM_ICV16 0x10\r
74#define IPSEC_EALG_AES_GCM_ICV8 0x12\r
75#define IPSEC_EALG_AES_GCM_ICV12 0x13\r
76#define IPSEC_EALG_AES_GCM_ICV16 0x14\r
77\r
78typedef struct {\r
a3bcde70
HT
79 CHAR16 *VarName;\r
80 UINT32 Attribute1;\r
81 UINT32 Attribute2;\r
82 UINT32 Attribute3;\r
83 UINT32 Attribute4;\r
84} VAR_CHECK_ITEM;\r
85\r
780847d1 86typedef struct {\r
87 LIST_ENTRY Link;\r
88 CHAR16 *Name;\r
89 SHELL_PARAM_TYPE Type;\r
90 CHAR16 *Value;\r
91 UINTN OriginalPosition;\r
a3bcde70
HT
92} SHELL_PARAM_PACKAGE;\r
93\r
780847d1 94typedef struct {\r
a3bcde70
HT
95 CHAR16 *String;\r
96 UINT32 Integer;\r
97} STR2INT;\r
98\r
99extern EFI_IPSEC_CONFIG_PROTOCOL *mIpSecConfig;\r
100extern EFI_HII_HANDLE mHiiHandle;\r
101extern CHAR16 mAppName[];\r
102\r
103//\r
104// -P\r
105//\r
106extern STR2INT mMapPolicy[];\r
107\r
108//\r
109// --proto\r
110//\r
111extern STR2INT mMapIpProtocol[];\r
112\r
113//\r
114// --action\r
115//\r
116extern STR2INT mMapIpSecAction[];\r
117\r
118//\r
119// --mode\r
120//\r
121extern STR2INT mMapIpSecMode[];\r
122\r
123//\r
124// --dont-fragment\r
125//\r
126extern STR2INT mMapDfOption[];\r
127\r
128//\r
129// --ipsec-proto\r
130//\r
131extern STR2INT mMapIpSecProtocol[];\r
132//\r
133// --auth-algo\r
134//\r
135extern STR2INT mMapAuthAlgo[];\r
136\r
137//\r
138// --encrypt-algo\r
139//\r
140extern STR2INT mMapEncAlgo[];\r
141//\r
142// --auth-proto\r
143//\r
144extern STR2INT mMapAuthProto[];\r
145\r
146//\r
147// --auth-method\r
148//\r
149extern STR2INT mMapAuthMethod[];\r
150\r
151#endif\r