d1a7681012fe5b87802b8f8603fc2cbeaed65a22
[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 - 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 _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/NetLib.h>
26
27 #include <Protocol/IpSecConfig.h>
28
29 #define EFI_IPSEC_CONFIG_GUID \
30 { \
31 0x9db0c3ac, 0xd9d2, 0x4f96, {0x9e, 0xd7, 0x6d, 0xa6, 0x12, 0xa4, 0xf3, 0x27} \
32 }
33
34 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
35
36 #define IPSECCONFIG_STATUS_NAME L"IpSecStatus"
37
38 #define BIT(x) (UINT32) (1 << (x))
39
40 #define IPSEC_STATUS_DISABLED 0x0
41 #define IPSEC_STATUS_ENABLED 0x1
42
43 #define EFI_IP4_PROTO_ICMP 0x1
44 #define EFI_IP4_PROTO_TCP 0x6
45 #define EFI_IP4_PROTO_UDP 0x11
46
47 #define EFI_IPSEC_ANY_PROTOCOL 0xFFFF
48 #define EFI_IPSEC_ANY_PORT 0
49
50 typedef struct _VAR_CHECK_ITEM {
51 CHAR16 *VarName;
52 UINT32 Attribute1;
53 UINT32 Attribute2;
54 UINT32 Attribute3;
55 UINT32 Attribute4;
56 } VAR_CHECK_ITEM;
57
58 typedef struct _SHELL_PARAM_PACKAGE{
59 LIST_ENTRY Link;
60 CHAR16 *Name;
61 ParamType Type;
62 CHAR16 *Value;
63 UINTN OriginalPosition;
64 } SHELL_PARAM_PACKAGE;
65
66 typedef struct _STR2INT {
67 CHAR16 *String;
68 UINT32 Integer;
69 } STR2INT;
70
71 extern EFI_IPSEC_CONFIG_PROTOCOL *mIpSecConfig;
72 extern EFI_HII_HANDLE mHiiHandle;
73 extern CHAR16 mAppName[];
74
75 //
76 // -P
77 //
78 extern STR2INT mMapPolicy[];
79
80 //
81 // --proto
82 //
83 extern STR2INT mMapIpProtocol[];
84
85 //
86 // --action
87 //
88 extern STR2INT mMapIpSecAction[];
89
90 //
91 // --mode
92 //
93 extern STR2INT mMapIpSecMode[];
94
95 //
96 // --dont-fragment
97 //
98 extern STR2INT mMapDfOption[];
99
100 //
101 // --ipsec-proto
102 //
103 extern STR2INT mMapIpSecProtocol[];
104 //
105 // --auth-algo
106 //
107 extern STR2INT mMapAuthAlgo[];
108
109 //
110 // --encrypt-algo
111 //
112 extern STR2INT mMapEncAlgo[];
113 //
114 // --auth-proto
115 //
116 extern STR2INT mMapAuthProto[];
117
118 //
119 // --auth-method
120 //
121 extern STR2INT mMapAuthMethod[];
122
123 #endif