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.

289 lines
10 KiB

  1. //========================================================================
  2. // Copyright (C) 1997 Microsoft Corporation
  3. // Author: RameshV
  4. // Description: This file has been generated. Pl look at the .c file
  5. //========================================================================
  6. #ifndef _MM_SUBNET_H_
  7. #define _MM_SUBNET_H_
  8. typedef struct _M_SUBNET {
  9. LPVOID ServerPtr; // Ptr to Server object
  10. union {
  11. struct { // for normal subnet.
  12. DWORD Address;
  13. DWORD Mask;
  14. DWORD SuperScopeId; // unused for MCAST scopes
  15. };
  16. struct { // for multicast scope
  17. DWORD MScopeId;
  18. LPWSTR LangTag; // the language tag for multicast scope
  19. BYTE TTL;
  20. };
  21. };
  22. DWORD fSubnet; // TRUE => Subnet, FALSE => MSCOPE
  23. DWORD State;
  24. DWORD Policy;
  25. DATE_TIME ExpiryTime; // Scope Lifetime. Currently used for MCast only.
  26. M_OPTCLASS Options;
  27. ARRAY Ranges;
  28. ARRAY Exclusions;
  29. M_RESERVATIONS Reservations;
  30. ARRAY Servers; // future use, Server-Server protocol
  31. LPWSTR Name;
  32. LPWSTR Description;
  33. ULONG UniqId;
  34. } M_SUBNET, *PM_SUBNET, *LPM_SUBNET;
  35. enum /* Anonymous */ {
  36. AddressPolicyNone = 0,
  37. AddressPolicySequential,
  38. AddressPolicyRoundRobin
  39. };
  40. DWORD
  41. MemSubnetInit(
  42. OUT PM_SUBNET *pSubnet,
  43. IN DWORD Address,
  44. IN DWORD Mask,
  45. IN DWORD State,
  46. IN DWORD SuperScopeId,
  47. IN LPWSTR Name,
  48. IN LPWSTR Description
  49. ) ;
  50. DWORD
  51. MemMScopeInit(
  52. OUT PM_SUBNET *pMScope,
  53. IN DWORD MScopeId,
  54. IN DWORD State,
  55. IN DWORD AddressPolicy,
  56. IN BYTE TTL,
  57. IN LPWSTR Name,
  58. IN LPWSTR Description,
  59. IN LPWSTR LangTag,
  60. IN DATE_TIME ExpiryTime
  61. ) ;
  62. DWORD _inline
  63. MemSubnetCleanup(
  64. IN OUT PM_SUBNET Subnet
  65. )
  66. {
  67. DWORD Error;
  68. AssertRet(Subnet, ERROR_INVALID_PARAMETER);
  69. Require(Subnet->Address&Subnet->Mask);
  70. Error = MemOptClassCleanup(&Subnet->Options);
  71. if( ERROR_SUCCESS != Error ) return Error;
  72. Error = MemArrayCleanup(&Subnet->Ranges);
  73. if( ERROR_SUCCESS != Error ) return Error;
  74. Error = MemArrayCleanup(&Subnet->Exclusions);
  75. if( ERROR_SUCCESS != Error ) return Error;
  76. Error = MemArrayCleanup(&Subnet->Servers);
  77. if( ERROR_SUCCESS != Error ) return Error;
  78. Error = MemReserveCleanup(&Subnet->Reservations);
  79. if( ERROR_SUCCESS != Error ) return Error;
  80. MemFree(Subnet);
  81. return ERROR_SUCCESS;
  82. }
  83. DWORD // SUCCESS if either of Excl or Range get filled, else FILE_NOT_FOUND
  84. MemSubnetGetAddressInfo(
  85. IN PM_SUBNET Subnet,
  86. IN DWORD Address,
  87. OUT PM_RANGE *Range, // OPTIONAL -- filled if a range could be found -- even if excluded
  88. OUT PM_EXCL *Excl, // OPTIONAL -- filled if an exclusion could be found
  89. OUT PM_RESERVATION *Reservation // OPTIONAL -- filled with a matching reservation, if found
  90. ) ;
  91. DWORD // ERROR_SUCCESS on finding a collition, else ERROR_FILE_NOT_FOUND
  92. MemSubnetFindCollision(
  93. IN OUT PM_SUBNET Subnet,
  94. IN DWORD Start,
  95. IN DWORD End,
  96. OUT PM_RANGE *Range, // OPTIONAL
  97. OUT PM_EXCL *Excl // OPTIONAL
  98. ) ;
  99. DWORD // ERROR_OBJECT_ALREADY_EXISTS on collision
  100. MemSubnetAddRange( // check if the range is valid, and only then add it
  101. IN OUT PM_SUBNET Subnet,
  102. IN DWORD Start,
  103. IN DWORD End,
  104. IN DWORD State,
  105. IN ULONG BootpAllocated,
  106. IN ULONG MaxBootpAllowed,
  107. OUT PM_RANGE *OverlappingRange,
  108. IN ULONG UniqId
  109. ) ;
  110. DWORD
  111. MemSubnetAddRangeExpandOrContract(
  112. IN PM_SUBNET Subnet,
  113. IN DWORD StartAddress,
  114. IN DWORD EndAddress,
  115. OUT DWORD *OldStartAddress,
  116. OUT DWORD *OldEndAddress
  117. ) ;
  118. DWORD
  119. MemSubnetAddExcl(
  120. IN OUT PM_SUBNET Subnet,
  121. IN DWORD Start,
  122. IN DWORD End,
  123. OUT PM_EXCL *OverlappingExcl,
  124. IN ULONG UniqId
  125. ) ;
  126. DWORD
  127. MemSubnetDelRange(
  128. IN OUT PM_SUBNET Subnet,
  129. IN DWORD Start
  130. ) ;
  131. DWORD
  132. MemSubnetDelExcl(
  133. IN OUT PM_SUBNET Subnet,
  134. IN DWORD Start
  135. ) ;
  136. DWORD
  137. MemSubnetExtendOrContractRange(
  138. IN OUT PM_SUBNET Subnet,
  139. IN OUT PM_RANGE Range,
  140. IN DWORD nAddresses, // how many addresses to extend by
  141. IN BOOL fExtend, // is this an EXTEND? or a CONTRACT?
  142. IN BOOL fEnd // is this operation to be done to END of range or START?
  143. ) ;
  144. DWORD
  145. MemSubnetExtendOrContractExcl(
  146. IN OUT PM_SUBNET Subnet,
  147. IN OUT PM_EXCL Excl,
  148. IN DWORD nAddresses, // how many addresses to extend by
  149. IN BOOL fExtend, // is this an EXTEND? or a CONTRACT?
  150. IN BOOL fEnd // is this operation to be done to END of range or START?
  151. ) ;
  152. typedef M_SUBNET M_MSCOPE; // same structure for Multicast Scopes and Subnets
  153. typedef PM_SUBNET PM_MSCOPE; // still, use the correct functions for MScope
  154. typedef LPM_SUBNET LPM_MSCOPE;
  155. DWORD _inline
  156. MemMScopeCleanup(
  157. IN PM_MSCOPE MScope
  158. ) {
  159. return MemSubnetCleanup(MScope);
  160. }
  161. #define MemMScopeGetAddressInfo MemSubnetGetAddressInfo
  162. #define MemMScopeFindCollision MemSubnetFindCollision
  163. #define MemMScopeAddExcl MemSubnetAddExcl
  164. #define MemMScopeDelRange MemSubnetDelRange
  165. #define MemMScopeDelExcl MemSubnetDelExcl
  166. #define MemMScopeExtendOrContractRange MemSubnetExtendOrContractRange
  167. #define MemMScopeExtendOrContractExcl MemSubnetExtendOrContractExcl
  168. DWORD
  169. MemMScopeGetAddressInfo(
  170. IN PM_MSCOPE MScope,
  171. IN DWORD MCastAddress,
  172. OUT PM_RANGE *Range, // OPTIONAL -- filled if a range could be found -- even if excluded
  173. OUT PM_EXCL *Excl, // OPTIONAL -- filled if an exclusion could be found
  174. OUT PM_RESERVATION *Reservation // OPTIONAL -- filled with a matching reservation, if found
  175. );
  176. DWORD // ERROR_SUCCESS on finding a collition, else ERROR_FILE_NOT_FOUND
  177. MemMScopeFindCollision(
  178. IN OUT PM_MSCOPE Subnet,
  179. IN DWORD MCastStart,
  180. IN DWORD MCastEnd,
  181. OUT PM_RANGE *Range, // OPTIONAL
  182. OUT PM_EXCL *Excl // OPTIONAL
  183. );
  184. DWORD _inline // ERROR_OBJECT_ALREADY_EXISTS on collision
  185. MemMScopeAddRange( // check if the range is valid, and only then add it
  186. IN OUT PM_MSCOPE Subnet,
  187. IN DWORD MCastStart,
  188. IN DWORD MCastEnd,
  189. IN DWORD State,
  190. OUT PM_RANGE *OverlappingRange,
  191. IN ULONG UniqId
  192. )
  193. {
  194. return MemSubnetAddRange( Subnet,MCastStart, MCastEnd,
  195. State, 0, 0, OverlappingRange, UniqId );
  196. }
  197. DWORD
  198. MemMScopeAddExcl(
  199. IN OUT PM_MSCOPE Subnet,
  200. IN DWORD MCastStart,
  201. IN DWORD MCastEnd,
  202. OUT PM_EXCL *OverlappingExcl,
  203. IN ULONG UniqId
  204. );
  205. DWORD
  206. MemMScopeDelRange(
  207. IN OUT PM_MSCOPE Subnet,
  208. IN DWORD MCastStart
  209. );
  210. DWORD
  211. MemMScopeDelExcl(
  212. IN OUT PM_MSCOPE Subnet,
  213. IN DWORD MCastStart
  214. );
  215. DWORD
  216. MemMScopeExtendOrContractRange(
  217. IN OUT PM_MSCOPE Subnet,
  218. IN OUT PM_RANGE Range,
  219. IN DWORD nAddresses, // how many addresses to extend by
  220. IN BOOL fExtend, // is this an EXTEND? or a CONTRACT?
  221. IN BOOL fEnd // is this operation to be done to END of range or START?
  222. );
  223. DWORD
  224. MemMScopeExtendOrContractExcl(
  225. IN OUT PM_MSCOPE Subnet,
  226. IN OUT PM_EXCL Excl,
  227. IN DWORD nAddresses, // how many addresses to extend by
  228. IN BOOL fExtend, // is this an EXTEND? or a CONTRACT?
  229. IN BOOL fEnd // is this operation to be done to END of range or START?
  230. );
  231. #endif _MM_SUBNET_H_
  232. //========================================================================
  233. // end of file
  234. //========================================================================