IpSecConfig.h 3.3 KB

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