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.

262 lines
6.7 KiB

  1. // Copyright (c) 1990-1999 Microsoft Corporation
  2. #ifndef _MADCAPCL_H_
  3. #define _MADCAPCL_H_
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include <time.h>
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif
  11. #define MCAST_CLIENT_ID_LEN 17
  12. enum {
  13. MCAST_API_VERSION_0 = 0,
  14. MCAST_API_VERSION_1
  15. };
  16. #define MCAST_API_CURRENT_VERSION MCAST_API_VERSION_1
  17. typedef unsigned short IP_ADDR_FAMILY;
  18. typedef union _IPNG_ADDRESS {
  19. DWORD IpAddrV4;
  20. BYTE IpAddrV6[16];
  21. } IPNG_ADDRESS, *PIPNG_ADDRESS;
  22. /*++
  23. Description:
  24. This union is used to pass both IPv4 and IPv6 style address.
  25. Members:
  26. IpAddrV4 - IPv4 style address
  27. IpAddrV6 - IPv6 style address
  28. --*/
  29. typedef struct _MCAST_CLIENT_UID {
  30. LPBYTE ClientUID;
  31. DWORD ClientUIDLength;
  32. } MCAST_CLIENT_UID, *LPMCAST_CLIENT_UID;
  33. /*++
  34. Description:
  35. This describes the unique clientID for each request.
  36. Members:
  37. ClientUID - Buffer containing the clientID
  38. ClientUIDLength - The size of the above buffer in bytes.
  39. --*/
  40. typedef struct _MCAST_SCOPE_CTX {
  41. IPNG_ADDRESS ScopeID;
  42. IPNG_ADDRESS Interface;
  43. IPNG_ADDRESS ServerID;
  44. } MCAST_SCOPE_CTX, *PMCAST_SCOPE_CTX;
  45. /*++
  46. Description:
  47. This defines the handle of the scope from which the address
  48. is to be allocated/renewed/released.
  49. Members:
  50. ScopeID - Scope ID is essentially first ip of the scope
  51. Interface - Interface on which this scope was found
  52. ServerID - IPAddress of the MADCAP server
  53. --*/
  54. typedef struct _MCAST_SCOPE_ENTRY {
  55. MCAST_SCOPE_CTX ScopeCtx;
  56. IPNG_ADDRESS LastAddr;
  57. DWORD TTL;
  58. UNICODE_STRING ScopeDesc;
  59. } MCAST_SCOPE_ENTRY, *PMCAST_SCOPE_ENTRY;
  60. /*++
  61. Description:
  62. This structure contains all the info pertaining to a given multicast
  63. scope.
  64. Members:
  65. ScopeCtx - the handle for this scope
  66. LastAddr - last addr of the scope
  67. TTL - TTL value of this scope.
  68. ScopeDesc - user friendly description of scope
  69. --*/
  70. typedef struct _MCAST_LEASE_REQUEST {
  71. LONG LeaseStartTime;
  72. LONG MaxLeaseStartTime;
  73. DWORD LeaseDuration;
  74. DWORD MinLeaseDuration;
  75. IPNG_ADDRESS ServerAddress;
  76. WORD MinAddrCount;
  77. WORD AddrCount;
  78. PBYTE pAddrBuf;
  79. } MCAST_LEASE_REQUEST, *PMCAST_LEASE_REQUEST;
  80. /*++
  81. Description:
  82. This structure is used to describe the request parameters for
  83. requesting/renewing/releasing multicast addresses
  84. Members:
  85. LeaseStartTime - desired start time of the lease, pass 0 if desired start time
  86. is current time. The desired time is specified in the number of seconds elapsed
  87. since midnight (00:00:00), January 1, 1970, coordinated universal time.
  88. MaxLeaseStartTime - the maximum start time that the client is willing to accept.
  89. Where time is the number of seconds elapsed since midnight (00:00:00),
  90. January 1, 1970, coordinated universal time.
  91. LeaseDuration - desired lease time for the request, pass 0 if default
  92. lease time is requested.
  93. MinLeaseDuration - the minimum lease time that the client is willing
  94. to accept
  95. ServerAddress - server's ip address where this lease whas renewed/requested.
  96. pass 0 if unknown (e.g in McastRequestAddress)
  97. MinAddrCount - minimum number of addresses that the client is willing
  98. to accept
  99. AddrCount - the desired number of addresses requested/allocated/renewed.
  100. This also specifies the size of the array specified by Addr.
  101. pAddrBuf - buffer containing specific addresses being requested/renewed/released.
  102. For IPv4 it is a pointer to 4 byte addresses and for IPv6 it
  103. points to 16 byte chunks. Pass NULL if no specific addresses
  104. are requested.
  105. Remarks:
  106. In MCAST_API_VERSION_1 version, the MaxLeaseStartTime, MinLeaseDuration and
  107. MinAddrCount are ignored by the API implementation. However, the clients should
  108. set appropriate desired values for these members so as when the OS update brings
  109. new implementation of the APIs then the clients can take advantage of it.
  110. --*/
  111. typedef struct _MCAST_LEASE_RESPONSE {
  112. LONG LeaseStartTime;
  113. LONG LeaseEndTime;
  114. IPNG_ADDRESS ServerAddress;
  115. WORD AddrCount;
  116. PBYTE pAddrBuf;
  117. } MCAST_LEASE_RESPONSE, *PMCAST_LEASE_RESPONSE;
  118. /*++
  119. Description:
  120. This structure is used to pass the response of the operation of
  121. requesting/renewing/releasing multicast addresses.
  122. Members:
  123. LeaseStartTime - start time of the lease in number of seconds elapsed since
  124. midnight (00:00:00), January 1, 1970, coordinated universal time.
  125. LeaseEndTime - time when lease ends, where time is the number of seconds elapsed
  126. since midnight (00:00:00), January 1, 1970, coordinated universal time.
  127. ServerAddress - server's ip address where this lease is renewed/requested.
  128. AddrCount - number of addresses requested/allocated/renewed.
  129. This also specifies the size of the array specified by Addr.
  130. Addr - buffer containing addresses being requested/renewed/released. For IPv4
  131. it is a pointer to 4 byte addresses and for IPv6 it points to 16 byte chunks
  132. --*/
  133. DWORD
  134. APIENTRY
  135. McastApiStartup(
  136. IN OUT PDWORD Version
  137. );
  138. VOID
  139. APIENTRY
  140. McastApiCleanup(
  141. VOID
  142. );
  143. DWORD
  144. APIENTRY
  145. McastGenUID(
  146. IN OUT LPMCAST_CLIENT_UID pRequestID
  147. );
  148. DWORD
  149. APIENTRY
  150. McastEnumerateScopes(
  151. IN IP_ADDR_FAMILY AddrFamily,
  152. IN BOOL ReQuery,
  153. IN OUT PMCAST_SCOPE_ENTRY pScopeList,
  154. IN OUT PDWORD pScopeLen,
  155. OUT PDWORD pScopeCount
  156. );
  157. DWORD
  158. APIENTRY
  159. McastRequestAddress(
  160. IN IP_ADDR_FAMILY AddrFamily,
  161. IN LPMCAST_CLIENT_UID pRequestID,
  162. IN PMCAST_SCOPE_CTX pScopeCtx,
  163. IN PMCAST_LEASE_REQUEST pAddrRequest,
  164. IN OUT PMCAST_LEASE_RESPONSE pAddrResponse
  165. );
  166. DWORD
  167. APIENTRY
  168. McastRenewAddress(
  169. IN IP_ADDR_FAMILY AddrFamily,
  170. IN LPMCAST_CLIENT_UID pRequestID,
  171. IN PMCAST_LEASE_REQUEST pRenewRequest,
  172. IN OUT PMCAST_LEASE_RESPONSE pRenewResponse
  173. );
  174. DWORD
  175. APIENTRY
  176. McastReleaseAddress(
  177. IN IP_ADDR_FAMILY AddrFamily,
  178. IN LPMCAST_CLIENT_UID pRequestID,
  179. IN PMCAST_LEASE_REQUEST pReleaseRequest
  180. );
  181. #ifdef __cplusplus
  182. }
  183. #endif
  184. #endif _MADCAPCL_H_