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