NetworkDefines.dsc.inc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_BOOT_ENABLE = TRUE
  19. # DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  20. # DEFINE NETWORK_ISCSI_ENABLE = TRUE
  21. # DEFINE NETWORK_VLAN_ENABLE = TRUE
  22. #
  23. # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  24. #
  25. # SPDX-License-Identifier: BSD-2-Clause-Patent
  26. #
  27. ##
  28. !ifndef NETWORK_ENABLE
  29. #
  30. # This flag is to enable or disable the whole network stack.
  31. #
  32. DEFINE NETWORK_ENABLE = TRUE
  33. !endif
  34. !ifndef NETWORK_SNP_ENABLE
  35. #
  36. # This flag is to include the common SNP driver or not.
  37. #
  38. DEFINE NETWORK_SNP_ENABLE = TRUE
  39. !endif
  40. !ifndef NETWORK_VLAN_ENABLE
  41. #
  42. # This flag is to enable or disable VLAN feature.
  43. #
  44. DEFINE NETWORK_VLAN_ENABLE = TRUE
  45. !endif
  46. !ifndef NETWORK_IP4_ENABLE
  47. #
  48. # This flag is to enable or disable IPv4 network stack.
  49. #
  50. DEFINE NETWORK_IP4_ENABLE = TRUE
  51. !endif
  52. !ifndef NETWORK_IP6_ENABLE
  53. #
  54. # This flag is to enable or disable IPv6 network stack.
  55. #
  56. DEFINE NETWORK_IP6_ENABLE = TRUE
  57. !endif
  58. !ifndef NETWORK_TLS_ENABLE
  59. #
  60. # This flag is to enable or disable TLS feature.
  61. #
  62. # Note: This feature depends on the OpenSSL building. To enable this feature, please
  63. # follow the instructions found in the file "OpenSSL-HOWTO.txt" located in
  64. # CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.
  65. # The OpensslLib.inf library instance should be used since libssl is required.
  66. #
  67. DEFINE NETWORK_TLS_ENABLE = TRUE
  68. !endif
  69. !ifndef NETWORK_HTTP_BOOT_ENABLE
  70. #
  71. # This flag is to enable or disable HTTP(S) boot feature.
  72. #
  73. DEFINE NETWORK_HTTP_BOOT_ENABLE = TRUE
  74. !endif
  75. !ifndef NETWORK_ALLOW_HTTP_CONNECTIONS
  76. #
  77. # Indicates whether HTTP connections (i.e., unsecured) are permitted or not.
  78. #
  79. # Note: If NETWORK_ALLOW_HTTP_CONNECTIONS is TRUE, HTTP connections are allowed.
  80. # Both the "https://" and "http://" URI schemes are permitted. Otherwise, HTTP
  81. # connections are denied. Only the "https://" URI scheme is permitted.
  82. #
  83. DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  84. !endif
  85. !ifndef NETWORK_ISCSI_ENABLE
  86. #
  87. # This flag is to enable or disable iSCSI feature.
  88. #
  89. # Note: This feature depends on the OpenSSL building. To enable this feature, please
  90. # follow the instructions found in the file "OpenSSL-HOWTO.txt" located in
  91. # CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.
  92. # Both OpensslLib.inf and OpensslLibCrypto.inf library instance can be used
  93. # since libssl is not required for iSCSI.
  94. #
  95. DEFINE NETWORK_ISCSI_ENABLE = TRUE
  96. !endif
  97. !if $(NETWORK_ENABLE) == TRUE
  98. #
  99. # Check the flags to see if there is any conflict.
  100. #
  101. !if ($(NETWORK_IP4_ENABLE) == FALSE) AND ($(NETWORK_IP6_ENABLE) == FALSE)
  102. !error "Must enable at least IP4 or IP6 stack if NETWORK_ENABLE is set to TRUE!"
  103. !endif
  104. !if ($(NETWORK_HTTP_BOOT_ENABLE) == TRUE) AND ($(NETWORK_TLS_ENABLE) == FALSE) AND ($(NETWORK_ALLOW_HTTP_CONNECTIONS) == FALSE)
  105. !error "Must enable TLS to support HTTPS, or allow unsecured HTTP connection, if NETWORK_HTTP_BOOT_ENABLE is set to TRUE!"
  106. !endif
  107. !endif