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.

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