NetworkDefines.dsc.inc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ## @file
  2. # Network DSC include file for [Defines] section of all Architectures.
  3. #
  4. # This file can be included to the [Defines] section of a platform DSC file by
  5. # using "!include NetworkPkg/NetworkDefines.dsc.inc" to set default value of
  6. # flags if they are not defined somewhere else, and also check the value to see
  7. # if there is any conflict.
  8. #
  9. # These flags can be defined before the !include line, or changed on the command
  10. # line to enable or disable related feature support.
  11. # -D FLAG=VALUE
  12. # The default value of these flags are:
  13. # DEFINE NETWORK_ENABLE = TRUE
  14. # DEFINE NETWORK_SNP_ENABLE = TRUE
  15. # DEFINE NETWORK_IP4_ENABLE = TRUE
  16. # DEFINE NETWORK_IP6_ENABLE = TRUE
  17. # DEFINE NETWORK_TLS_ENABLE = TRUE
  18. # DEFINE NETWORK_HTTP_ENABLE = FALSE
  19. # DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE
  20. # DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  21. # DEFINE NETWORK_ISCSI_ENABLE = FALSE
  22. # DEFINE NETWORK_ISCSI_MD5_ENABLE = TRUE
  23. # DEFINE NETWORK_VLAN_ENABLE = TRUE
  24. #
  25. # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  26. # (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
  27. #
  28. # SPDX-License-Identifier: BSD-2-Clause-Patent
  29. #
  30. ##
  31. !ifndef NETWORK_ENABLE
  32. #
  33. # This flag is to enable or disable the whole network stack.
  34. #
  35. DEFINE NETWORK_ENABLE = TRUE
  36. !endif
  37. !ifndef NETWORK_SNP_ENABLE
  38. #
  39. # This flag is to include the common SNP driver or not.
  40. #
  41. DEFINE NETWORK_SNP_ENABLE = TRUE
  42. !endif
  43. !ifndef NETWORK_VLAN_ENABLE
  44. #
  45. # This flag is to enable or disable VLAN feature.
  46. #
  47. DEFINE NETWORK_VLAN_ENABLE = TRUE
  48. !endif
  49. !ifndef NETWORK_IP4_ENABLE
  50. #
  51. # This flag is to enable or disable IPv4 network stack.
  52. #
  53. DEFINE NETWORK_IP4_ENABLE = TRUE
  54. !endif
  55. !ifndef NETWORK_IP6_ENABLE
  56. #
  57. # This flag is to enable or disable IPv6 network stack.
  58. #
  59. DEFINE NETWORK_IP6_ENABLE = TRUE
  60. !endif
  61. !ifndef NETWORK_TLS_ENABLE
  62. #
  63. # This flag is to enable or disable TLS feature.
  64. #
  65. # Note: This feature depends on the OpenSSL building. To enable this feature, please
  66. # follow the instructions found in the file "OpenSSL-HOWTO.txt" located in
  67. # CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.
  68. # The OpensslLib.inf library instance should be used since libssl is required.
  69. #
  70. DEFINE NETWORK_TLS_ENABLE = TRUE
  71. !endif
  72. !ifndef NETWORK_HTTP_ENABLE
  73. #
  74. # This flag is to enable or disable HTTP(S) feature.
  75. # The default is set to FALSE to not affecting the existing
  76. # platforms.
  77. # NETWORK_HTTP_ENABLE set to FALSE is not affecting NETWORK_HTTP_BOOT_ENABLE
  78. # when NETWORK_HTTP_BOOT_ENABLE is TRUE.
  79. DEFINE NETWORK_HTTP_ENABLE = FALSE
  80. !endif
  81. !ifndef NETWORK_HTTP_BOOT_ENABLE
  82. #
  83. # This flag is to enable or disable HTTP(S) boot feature.
  84. #
  85. #
  86. DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE
  87. !endif
  88. !ifndef NETWORK_ALLOW_HTTP_CONNECTIONS
  89. #
  90. # Indicates whether HTTP connections (i.e., unsecured) are permitted or not.
  91. #
  92. # Note: If NETWORK_ALLOW_HTTP_CONNECTIONS is TRUE, HTTP connections are allowed.
  93. # Both the "https://" and "http://" URI schemes are permitted. Otherwise, HTTP
  94. # connections are denied. Only the "https://" URI scheme is permitted.
  95. #
  96. DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  97. !endif
  98. !ifndef NETWORK_ISCSI_ENABLE
  99. #
  100. # This flag is to enable or disable iSCSI feature.
  101. #
  102. # Note: This feature depends on the OpenSSL building. To enable this feature, please
  103. # follow the instructions found in the file "OpenSSL-HOWTO.txt" located in
  104. # CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.
  105. # Both OpensslLib.inf and OpensslLibCrypto.inf library instance can be used
  106. # since libssl is not required for iSCSI.
  107. #
  108. DEFINE NETWORK_ISCSI_ENABLE = FALSE
  109. !endif
  110. !ifndef NETWORK_ISCSI_MD5_ENABLE
  111. #
  112. # This flag enables the deprecated MD5 hash algorithm in iSCSI CHAP
  113. # authentication.
  114. #
  115. # Note: The NETWORK_ISCSI_MD5_ENABLE flag only makes a difference if
  116. # NETWORK_ISCSI_ENABLE is TRUE; otherwise, NETWORK_ISCSI_MD5_ENABLE is
  117. # ignored.
  118. #
  119. # With NETWORK_ISCSI_MD5_ENABLE set to TRUE, MD5 is enabled as the
  120. # least preferred CHAP hash algorithm. With NETWORK_ISCSI_MD5_ENABLE
  121. # set to FALSE, MD5 is disabled statically, at build time.
  122. #
  123. # The default value is TRUE, because RFC 7143 mandates MD5, and because
  124. # several vendors' iSCSI targets only support MD5, for CHAP.
  125. #
  126. DEFINE NETWORK_ISCSI_MD5_ENABLE = TRUE
  127. !endif
  128. !if $(NETWORK_ENABLE) == TRUE
  129. #
  130. # Check the flags to see if there is any conflict.
  131. #
  132. !if ($(NETWORK_IP4_ENABLE) == FALSE) AND ($(NETWORK_IP6_ENABLE) == FALSE)
  133. !error "Must enable at least IP4 or IP6 stack if NETWORK_ENABLE is set to TRUE!"
  134. !endif
  135. !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) OR ($(NETWORK_HTTP_ENABLE) == TRUE)
  136. !if ($(NETWORK_TLS_ENABLE) == FALSE) AND ($(NETWORK_ALLOW_HTTP_CONNECTIONS) == FALSE)
  137. !error "Must enable TLS to support HTTPS, or allow unsecured HTTP connection, if NETWORK_HTTP_BOOT_ENABLE or NETWORK_HTTP_ENABLE is set to TRUE!"
  138. !endif
  139. !endif
  140. !endif