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.

281 lines
8.4 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. #include <dhcp.h>
  7. typedef struct _M_SERVER {
  8. DWORD Address;
  9. DWORD State;
  10. DWORD Policy;
  11. ARRAY Subnets;
  12. ARRAY MScopes;
  13. ARRAY_LOCATION Loc; // if RoundRobin on, then we need this to keep track
  14. ARRAY SuperScopes;
  15. M_OPTCLASS Options;
  16. M_OPTCLASSDEFLIST OptDefs;
  17. M_CLASSDEFLIST ClassDefs;
  18. LPWSTR Name;
  19. LPWSTR Comment;
  20. } M_SERVER, *PM_SERVER, *LPM_SERVER;
  21. DWORD
  22. MemServerInit(
  23. OUT PM_SERVER *Server,
  24. IN DWORD Address,
  25. IN DWORD State,
  26. IN DWORD Policy,
  27. IN LPWSTR Name,
  28. IN LPWSTR Comment
  29. ) ;
  30. DWORD
  31. MemServerCleanup(
  32. IN OUT PM_SERVER Server
  33. ) ;
  34. DWORD
  35. MemServerGetUAddressInfo(
  36. IN PM_SERVER Server,
  37. IN DWORD Address,
  38. OUT PM_SUBNET *Subnet, // OPTIONAL
  39. OUT PM_RANGE *Range, // OPTIONAL
  40. OUT PM_EXCL *Excl, // OPTIONAL
  41. OUT PM_RESERVATION *Reservation // OPTIONAL
  42. ) ;
  43. DWORD
  44. MemServerGetMAddressInfo(
  45. IN PM_SERVER Server,
  46. IN DWORD Address,
  47. OUT PM_SUBNET *Subnet, // OPTIONAL
  48. OUT PM_RANGE *Range, // OPTIONAL
  49. OUT PM_EXCL *Excl, // OPTIONAL
  50. OUT PM_RESERVATION *Reservation // OPTIONAL
  51. ) ;
  52. DWORD _inline
  53. MemServerGetAddressInfo(
  54. IN PM_SERVER Server,
  55. IN DWORD Address,
  56. OUT PM_SUBNET *Subnet, // OPTIONAL
  57. OUT PM_RANGE *Range, // OPTIONAL
  58. OUT PM_EXCL *Excl, // OPTIONAL
  59. OUT PM_RESERVATION *Reservation // OPTIONAL
  60. ) {
  61. if (CLASSD_HOST_ADDR( Address )) {
  62. return MemServerGetMAddressInfo(
  63. Server,
  64. Address,
  65. Subnet,
  66. Range,
  67. Excl,
  68. Reservation
  69. );
  70. } else {
  71. return MemServerGetUAddressInfo(
  72. Server,
  73. Address,
  74. Subnet,
  75. Range,
  76. Excl,
  77. Reservation
  78. );
  79. }
  80. }
  81. DWORD
  82. MemServerAddSubnet(
  83. IN OUT PM_SERVER Server,
  84. IN PM_SUBNET Subnet // completely created subnet, must not be in Server's list tho'
  85. ) ;
  86. DWORD
  87. MemServerDelSubnet(
  88. IN OUT PM_SERVER Server,
  89. IN DWORD SubnetAddress,
  90. OUT PM_SUBNET *Subnet
  91. ) ;
  92. DWORD
  93. MemServerFindSubnetByName(
  94. IN PM_SERVER Server,
  95. IN LPWSTR Name,
  96. OUT PM_SUBNET *Subnet
  97. ) ;
  98. #define INVALID_SSCOPE_ID 0xFFFFFFFF
  99. #define INVALID_SSCOPE_NAME NULL
  100. DWORD
  101. MemServerFindSScope( // find matching with EITHER scopeid ir sscopename
  102. IN OUT PM_SERVER Server,
  103. IN DWORD SScopeId, // 0xFFFFFFFF == invalid scope id, dont use for search
  104. IN LPWSTR SScopeName, // NULL == invalid scope name
  105. OUT PM_SSCOPE *SScope
  106. ) ;
  107. DWORD
  108. MemServerAddSScope(
  109. IN OUT PM_SERVER Server,
  110. IN PM_SSCOPE SScope
  111. ) ;
  112. DWORD
  113. MemServerDelSScope(
  114. IN OUT PM_SERVER Server,
  115. IN DWORD SScopeId,
  116. OUT PM_SSCOPE *SScope
  117. ) ;
  118. #define INVALID_MSCOPE_ID 0x0
  119. #define INVALID_MSCOPE_NAME NULL
  120. DWORD
  121. MemServerFindMScope( // search either based on ScopeId or ScopeName
  122. IN PM_SERVER Server,
  123. IN DWORD MScopeId, // Multicast scope id, or 0 if this is not the key to search on
  124. IN LPWSTR Name, // Multicast scope name or NULL if this is not the key to search on
  125. OUT PM_MSCOPE *MScope
  126. ) ;
  127. DWORD
  128. MemServerAddMScope(
  129. IN OUT PM_SERVER Server,
  130. IN OUT PM_MSCOPE MScope
  131. ) ;
  132. DWORD
  133. MemServerDelMScope(
  134. IN OUT PM_SERVER Server,
  135. IN DWORD MScopeId,
  136. IN LPWSTR MScopeName,
  137. OUT PM_MSCOPE *MScope
  138. ) ;
  139. DWORD _inline
  140. MemServerGetClassDef( // look up a class id def on Key=ClassId or Key=ClassIdBytes
  141. IN PM_SERVER Server,
  142. IN DWORD ClassId, // OPTIONAL, 0 if not used
  143. IN LPWSTR Name, // OPTIONAL, NULL if not used
  144. IN DWORD nClassIdBytes, // OPTIONAL, 0 if not used
  145. IN LPBYTE ClassIdBytes, // OPTIONAL, NULL if not used
  146. OUT PM_CLASSDEF *ClassDef
  147. ) {
  148. AssertRet(Server && ClassDef && (0 != ClassId || 0 != nClassIdBytes || Name ), ERROR_INVALID_PARAMETER);
  149. AssertRet( 0 == nClassIdBytes || NULL != ClassIdBytes, ERROR_INVALID_PARAMETER);
  150. AssertRet( 0 != nClassIdBytes || NULL == ClassIdBytes, ERROR_INVALID_PARAMETER);
  151. return MemClassDefListFindOptDef(
  152. &Server->ClassDefs,
  153. ClassId,
  154. Name,
  155. ClassIdBytes,
  156. nClassIdBytes,
  157. ClassDef
  158. );
  159. }
  160. DWORD _inline
  161. MemServerAddClassDef(
  162. IN OUT PM_SERVER Server,
  163. IN DWORD ClassId,
  164. IN BOOL IsVendor,
  165. IN LPWSTR Name,
  166. IN LPWSTR Comment,
  167. IN DWORD nClassIdBytes,
  168. IN LPBYTE ClassIdBytes
  169. ) {
  170. AssertRet(Server, ERROR_INVALID_PARAMETER);
  171. return MemClassDefListAddClassDef(
  172. &Server->ClassDefs,
  173. ClassId,
  174. IsVendor,
  175. 0,
  176. Name,
  177. Comment,
  178. ClassIdBytes,
  179. nClassIdBytes
  180. );
  181. }
  182. DWORD _inline
  183. MemServerDelClassDef(
  184. IN OUT PM_SERVER Server,
  185. IN DWORD ClassId,
  186. IN LPWSTR Name,
  187. IN DWORD nClassIdBytes,
  188. IN LPBYTE ClassIdBytes
  189. ) {
  190. AssertRet(Server, ERROR_INVALID_PARAMETER);
  191. return MemClassDefListDelClassDef(
  192. &Server->ClassDefs,
  193. ClassId,
  194. Name,
  195. ClassIdBytes,
  196. nClassIdBytes
  197. );
  198. }
  199. DWORD
  200. MemServerGetOptDef(
  201. IN OUT PM_SERVER Server,
  202. IN DWORD ClassId, // required, strict search, no defaulting class to zero
  203. IN DWORD VendorId, // required, strict search, no defaulting vendor to zero
  204. IN DWORD OptId, // OPTIONAL - search by this or following param
  205. IN LPWSTR OptName, // OPTIONAL - search by name or above param
  206. OUT PM_OPTDEF *OptDef // if found return the opt def here
  207. ) ;
  208. DWORD
  209. MemServerAddOptDef(
  210. IN OUT PM_SERVER Server,
  211. IN DWORD ClassId,
  212. IN DWORD VendorId,
  213. IN DWORD OptId,
  214. IN LPWSTR OptName,
  215. IN LPWSTR OptComment,
  216. IN DWORD Type,
  217. IN LPBYTE OptVal,
  218. IN DWORD OptValLen
  219. ) ;
  220. DWORD
  221. MemServerDelOptDef(
  222. IN OUT PM_SERVER Server,
  223. IN DWORD ClassId,
  224. IN DWORD VendorId,
  225. IN DWORD OptId
  226. ) ;
  227. //========================================================================
  228. // end of file
  229. //========================================================================