Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
5.8 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991-1993 Microsoft Corporation
  3. Module Name:
  4. ntddtcp.h
  5. Abstract:
  6. This header file defines constants and types for accessing the NT
  7. TCP driver.
  8. Author:
  9. Mike Massa (mikemas) August 13, 1993
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDTCP_
  13. #define _NTDDTCP_
  14. //
  15. // Device Name - this string is the name of the device. It is the name
  16. // that should be passed to NtCreateFile when accessing the device.
  17. //
  18. #define DD_TCP_DEVICE_NAME L"\\Device\\Tcp"
  19. #define DD_UDP_DEVICE_NAME L"\\Device\\Udp"
  20. #define DD_RAW_IP_DEVICE_NAME L"\\Device\\RawIp"
  21. //
  22. // Security Filter Support
  23. //
  24. // Security filters provide a mechanism by which the transport protocol
  25. // traffic accepted on IP interfaces may be controlled. Security filtering
  26. // is globally enabled or disabled for all IP interfaces and transports.
  27. // If filtering is enabled, incoming traffic is filtered based on registered
  28. // {interface, protocol, transport value} tuples. The tuples specify
  29. // permissible traffic. All other values will be rejected. For UDP datagrams
  30. // and TCP connections, the transport value is the port number. For RawIP
  31. // datagrams, the transport value is the IP protocol number. An entry exists
  32. // in the filter database for all active interfaces and protocols in the
  33. // system.
  34. //
  35. // The following ioctls may be used to access the security filter
  36. // database. The ioctls may be issued on any TCP/IP device object. All of them
  37. // require Administrator privilege. These ioctls do not update the registry
  38. // parameters used to initialize security filtering when an interface is
  39. // installed.
  40. //
  41. // The TCP_QUERY_SECURITY_FILTER_STATUS ioctl returns the current status of
  42. // security filtering - enabled or disabled.
  43. //
  44. // The TCP_SET_SECURITY_FILTER_STATUS ioctl modifies the status of security
  45. // filtering. Changing the filtering status does not change the contents of
  46. // the filter database.
  47. //
  48. // The following ioctls manipulate the filter database. They operate the same
  49. // whether security filtering is enabled or disabled. If filtering is disabled,
  50. // any changes will take effect only when filtering is enabled.
  51. //
  52. // The TCP_ADD_SECURITY_FILTER ioctl registers an {Interface, Protocol, Value}
  53. // tuple. The TCP_DELETE_SECURITY_FILTER ioctl deregisters an
  54. // {Interface, Protocol, Value} tuple. The TCP_ENUMERATE_SECURITY_FILTER ioctl
  55. // returns the list of {Interface, Protocol, Value} filters currently
  56. // registered.
  57. //
  58. // Each of these ioctls takes an {Interface, Protocol, Value} tuple as an input
  59. // parameter. Zero is a wildcard value. If the Interface or Protocol elements
  60. // are zero, the operation applies to all interfaces or protocols, as
  61. // appropriate. The meaning of a zero Value element depends on the ioctl.
  62. // For an ADD, a zero Value causes all values to be permissible. For a DELETE,
  63. // a zero Value causes all all values to be rejected. In both cases, any
  64. // previously registered values are purged from the database. For an
  65. // ENUMERATE, a zero Value just causes all registered values to be enumerated,
  66. // as opposed to a specific value.
  67. //
  68. // For all ioctls, a return code of STATUS_INVALID_ADDRESS indicates that
  69. // the IP address submitted in the input buffer does not correspond to
  70. // an interface which exists in the system. A code of
  71. // STATUS_INVALID_PARAMETER possibly indicates that the Protocol number
  72. // submitted in the input buffer does not correspond to a transport protocol
  73. // available in the system.
  74. //
  75. //
  76. // Structures used in Security Filter IOCTLs.
  77. //
  78. //
  79. // Structure contained in the input buffer of
  80. // TCP_SET_SECURITY_FILTER_STATUS ioctls and the output buffer of
  81. // TCP_QUERY_SECURITY_FILTER_STATUS ioctls.
  82. //
  83. struct tcp_security_filter_status {
  84. ULONG FilteringEnabled; // FALSE if filtering is (to be) disabled.
  85. }; // Any other value indicates that filtering
  86. // is (to be) enabled.
  87. typedef struct tcp_security_filter_status
  88. TCP_SECURITY_FILTER_STATUS,
  89. *PTCP_SECURITY_FILTER_STATUS;
  90. //
  91. // The TCPSecurityFilterEntry structure, defined in tcpinfo.h, is contained in
  92. // the input buffer of TCP_[ADD|DELETE|ENUMERATE]_SECURITY_FILTER ioctls.
  93. //
  94. //
  95. // The TCPSecurityFilterEnum structure, defined in tcpinfo.h, is contained
  96. // in the output buffer of TCP_ENUMERATE_SECURITY_FILTER ioctls. The output
  97. // buffer passed in the ioctl must be large enough to contain at least this
  98. // structure or the call will fail. The structure is followed immediately in
  99. // the buffer by an array of zero or more TCPSecurityFilterEntry structures.
  100. // The number of TCPSecurityFilterEntry structures is specified by the
  101. // tfe_entries_returned field of the TCPSecurityFilterEnum.
  102. //
  103. //
  104. // TCP/UDP/RawIP IOCTL code definitions
  105. //
  106. #define FSCTL_TCP_BASE FILE_DEVICE_NETWORK
  107. #define _TCP_CTL_CODE(function, method, access) \
  108. CTL_CODE(FSCTL_TCP_BASE, function, method, access)
  109. #define IOCTL_TCP_QUERY_INFORMATION_EX \
  110. _TCP_CTL_CODE(0, METHOD_NEITHER, FILE_ANY_ACCESS)
  111. #define IOCTL_TCP_SET_INFORMATION_EX \
  112. _TCP_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  113. #define IOCTL_TCP_QUERY_SECURITY_FILTER_STATUS \
  114. _TCP_CTL_CODE(2, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  115. #define IOCTL_TCP_SET_SECURITY_FILTER_STATUS \
  116. _TCP_CTL_CODE(3, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  117. #define IOCTL_TCP_ADD_SECURITY_FILTER \
  118. _TCP_CTL_CODE(4, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  119. #define IOCTL_TCP_DELETE_SECURITY_FILTER \
  120. _TCP_CTL_CODE(5, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  121. #define IOCTL_TCP_ENUMERATE_SECURITY_FILTER \
  122. _TCP_CTL_CODE(6, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  123. #endif // ifndef _NTDDTCP_