Source code of Windows XP (NT5)
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.

179 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1997, Microsoft Corporation.
  4. //
  5. // File: ipsup.h
  6. //
  7. // Contents: Declarations for DFS_IP_INFO entries
  8. //
  9. // History: 15 Dec 1997 Jharper Created
  10. //
  11. //--------------------------------------------------------------------------
  12. #ifndef __IPSUP_H_
  13. #define __IPSUP_H_
  14. //
  15. // For machine names we associate a list of sites
  16. //
  17. typedef struct _DFS_IP_INFO {
  18. //
  19. // Type and size of this record (must be DFS_NTC_IP_INFO)
  20. //
  21. NODE_TYPE_CODE NodeTypeCode;
  22. NODE_BYTE_SIZE NodeByteSize;
  23. //
  24. // A list entry for the hash table chain.
  25. //
  26. LIST_ENTRY HashChain;
  27. //
  28. // A list entry for the LRU chain
  29. //
  30. LIST_ENTRY LRUChain;
  31. //
  32. // Count (for multi-threading)
  33. // Uses InterlockedIncrement()/InterlockedDecrement
  34. //
  35. ULONG UseCount;
  36. //
  37. // Flags
  38. //
  39. ULONG Flags;
  40. //
  41. // The time this entry becomes invalid
  42. //
  43. LARGE_INTEGER Timeout;
  44. //
  45. // Ip address
  46. //
  47. DFS_IPADDRESS IpAddress;
  48. //
  49. // The site associated with this IP address
  50. //
  51. UNICODE_STRING SiteName;
  52. } DFS_IP_INFO, *PDFS_IP_INFO;
  53. #define IP_INFO_DELETE_PENDING 0x00000001 // DFS_IP_INFO should be freed
  54. //
  55. //
  56. // Declaration of the hash table. The hash table can be variably
  57. // sized, with the hash table size being a parameter of the hash
  58. // function.
  59. //
  60. typedef struct _IP_HASH_TABLE {
  61. //
  62. // The type and size of this record (must be DFS_NTC_IP_HASH)
  63. //
  64. NODE_TYPE_CODE NodeTypeCode;
  65. NODE_BYTE_SIZE NodeByteSize;
  66. //
  67. // Mask value for the hash function. The hash table size is
  68. // assumed to be a power of two; the mask is the size - 1.
  69. //
  70. ULONG HashMask;
  71. //
  72. // A mutex to protect access to the hash bucket lists and LRU list
  73. //
  74. FAST_MUTEX HashListMutex;
  75. //
  76. // The LRU list
  77. //
  78. LIST_ENTRY LRUChain;
  79. //
  80. // Max number of DFS_IP_INFO entries allowed
  81. //
  82. ULONG MaxEntries;
  83. //
  84. // Number of DFS_IP_INFO entries
  85. //
  86. ULONG EntryCount;
  87. //
  88. // Timeout
  89. //
  90. LARGE_INTEGER Timeout;
  91. //
  92. // An array of list heads for the hash table chains. There
  93. // are actually N of these where N is the hash table size.
  94. //
  95. LIST_ENTRY HashBuckets[1];
  96. } IP_HASH_TABLE, *PIP_HASH_TABLE;
  97. NTSTATUS
  98. DfsInitIp(
  99. ULONG cHash,
  100. ULONG cEntries
  101. );
  102. VOID
  103. DfsUninitIp(
  104. VOID
  105. );
  106. VOID
  107. DfsReleaseIpInfo(
  108. PDFS_IP_INFO pIpInfo
  109. );
  110. NTSTATUS
  111. DfsFsctrlCreateIpInfo(
  112. PIRP Irp,
  113. PVOID InputBuffer,
  114. ULONG InputBufferLength
  115. );
  116. NTSTATUS
  117. DfsFsctrlDeleteIpInfo(
  118. PIRP Irp,
  119. PVOID InputBuffer,
  120. ULONG InputBufferLength
  121. );
  122. PDFS_IP_INFO
  123. DfsLookupSiteByIpaddress(
  124. IN PDFS_IPADDRESS pDfsIpAddress,
  125. IN BOOLEAN UseForce
  126. );
  127. VOID
  128. DfsReleaseIpInfo(
  129. IN PDFS_IP_INFO pIpInfo
  130. );
  131. #endif // __IPSUP_H_