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.

233 lines
14 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. #define DDS_RESERVED_DWORD 0
  7. #define DDS_RESERVED_PTR ((LPVOID)0)
  8. //DOC The following constants are Flag values that maybe passed to different
  9. //DOC functions.
  10. #define DDS_FLAGS_CREATE 0x01
  11. //DOC Some standard names and locations in the DS
  12. #define DHCP_ROOT_OBJECT_LOC L"CN=DhcpRoot, CN=NetServices, CN=Services"
  13. #define DHCP_ROOT_OBJECT_PARENT_LOC L"CN=NetServices, CN=Services"
  14. #define DHCP_ROOT_OBJECT_CN_NAME L"CN=DhcpRoot"
  15. #define DHCP_ROOT_OBJECT_NAME L"DhcpRoot"
  16. #define DHCP_ATTRIB_WHEN_CHANGED L"whenChanged"
  17. //DOC The attributes that are defined for the dhcp class follows.
  18. #define DHCP_ATTRIB_UNIQUE_KEY L"dhcpUniqueKey" // reqd,single,integer8
  19. #define DHCP_ATTRIB_IDENTIFICATION L"dhcpIdentification" // reqd,single,directorystring
  20. #define DHCP_ATTRIB_TYPE L"dhcpType" // reqd,single,integer
  21. #define DHCP_ATTRIB_FLAGS L"dhcpFlags" // reqd,single,integer8
  22. #define DHCP_ATTRIB_DESCRIPTION L"description" // -,mv,directorystring
  23. #define DHCP_ATTRIB_CLASSES L"dhcpClasses" // -,mv,octetstring
  24. #define DHCP_ATTRIB_MASK L"dhcpMask" // -,mv,printablestring
  25. #define DHCP_ATTRIB_OBJ_DESCRIPTION L"dhcpObjDescription" // -,single,directorystring
  26. #define DHCP_ATTRIB_OBJ_NAME L"dhcpObjName" // -,single,direcotrystring
  27. #define DHCP_ATTRIB_OPTIONS L"dhcpOptions" // -,single,octetstring
  28. #define DHCP_ATTRIB_RANGES L"dhcpRanges" // -,mv,printablestring
  29. #define DHCP_ATTRIB_RESERVATIONS L"dhcpReservations" // -,mv,printablestring
  30. #define DHCP_ATTRIB_SERVERS L"dhcpServers" // -,mv,printablestring
  31. #define DHCP_ATTRIB_STATE L"dhcpState" // -,mv,printablestring
  32. #define DHCP_ATTRIB_SUBNETS L"dhcpSubnets" // -,mv,printablestring
  33. #define DHCP_ATTRIB_LOCATION_DN L"locationDN" // -,single,dn
  34. #define DHCP_ATTRIB_MSCOPEID L"mscopeid" // -,single,printablestring
  35. #define DHCP_ATTRIB_ADDRESS L"networkAddress" // -,mv,CaseIgnoreString
  36. #define DHCP_ATTRIB_OPTIONS_LOC L"optionsLocation" // -,mv,printablestring
  37. #define DHCP_ATTRIB_OPTION_DESCRIPTION L"optionDescription" // -,mv,directorystring
  38. #define DHCP_ATTRIB_SUPERSCOPES L"superScopes" // -,mv,printablestring
  39. //DOC The following are the various types of objects recognized by the dhcp server
  40. #define DHCP_OBJ_TYPE_ROOT 0 // dhcp root object
  41. #define DHCP_OBJ_TYPE_SERVER 1 // dhcp server object
  42. #define DHCP_OBJ_TYPE_SUBNET 2 // subnet object
  43. #define DHCP_OBJ_TYPE_RANGE 3 // range object
  44. #define DHCP_OBJ_TYPE_RESERVATION 4 // reservation object
  45. #define DHCP_OBJ_TYPE_OPTION 5 // options object
  46. #define DHCP_OBJ_TYPE_CLASS 6 // class object
  47. #define DHCP_OBJ_TYPE_ROOT_DESC L"DHCP Root object"
  48. #define DHCP_OBJ_TYPE_SERVER_DESC L"DHCP Server object"
  49. #define DHCP_OBJ_TYPE_SUBNET_DESC L"Dhcp Subnet object"
  50. #define DHCP_OBJ_TYPE_RANGE_DESC L"Dhcp Range object"
  51. #define DHCP_OBJ_TYPE_RESERVATION_DESC L"Dhcp Reservation object"
  52. #define DHCP_OBJ_TYPE_OPTION_DESC L"Dhcp Option object"
  53. #define DHCP_OBJ_TYPE_CLASS_DESC L"Dhcp Class object"
  54. //DOC The following defines are bitmasks and bits in various flags..
  55. //DOC The flag2 portion of Ranges key is used for differntiating between exclusions and ranges
  56. #define RANGE_TYPE_RANGE 0
  57. #define RANGE_TYPE_EXCL 1
  58. #define RANGE_TYPE_MASK (0x1)
  59. //DOC DhcpDsGetDhcpC gets the dhcp container in the DS.. This is usually the
  60. //DOC container CN=Netservices,CN=Services,CN=Configuration etc..
  61. //DOC This is used in many functions, so it is useful to have a central function..
  62. //DOC
  63. DWORD
  64. DhcpDsGetDhcpC( // get dhcp container
  65. IN DWORD Reserved, // future use
  66. IN OUT LPSTORE_HANDLE hStoreCC, // config container handle
  67. OUT LPSTORE_HANDLE hDhcpC // output dhcp container handle
  68. ) ;
  69. //DOC DhcpDsGetRoot gets the dhcp root object given to the configuration container
  70. //DOC This is usually CN=DhcpRoot,CN=NetServices,CN=Services,CN=Configuration...
  71. //DOC If Flags has the DDS_FLAGS_CREATE bit set, then the root object is created.
  72. //DOC Return Values:
  73. //DOC Store any returns returned by the Store module
  74. //DOC ERROR_DDS_NO_DHCP_ROOT no DhcpRoot object found
  75. //DOC ERROR_DDS_UNEXPECTED_ERROR the DhcpRoot's parent container not found..
  76. DWORD
  77. DhcpDsGetRoot(
  78. IN DWORD Flags, // 0 or DDS_FLAGS_CREATE
  79. IN OUT LPSTORE_HANDLE hStoreCC, // configuration container handle
  80. OUT LPSTORE_HANDLE hStoreDhcpRoot // dhcp root object handle
  81. ) ;
  82. //DOC DhcpDsGetLists function retrives a list of attributes and adds it the given array
  83. //DOC allocating each element separateley, and traversing any pointers indicated by
  84. //DOC the value of the attribute.
  85. //DOC Note that even in case of error, the array may still contain some elements.
  86. //DOC This is a best effort even in case of failure.
  87. //DOC Each element of the array must be freed via MemFree, and the array itself
  88. //DOC must be cleaned up via MemArrayCleanup.
  89. //DOC Note that any of the PARRAY type parameters may be NULL, as they are optional.
  90. //DOC but reading these separately is highly inefficient...
  91. //DOC Return Values:
  92. //DOC ERROR_DDS_UNEXPECTED_ERROR some entirely unexpected error
  93. //DOC ERROR_DDS_TOO_MANY_ERRORS multiple errors occured, and was caught
  94. //DOC Store any errors returned by the store apis
  95. DWORD
  96. DhcpDsGetLists( // get list of different objects
  97. IN DWORD Reserved, // must be zero -- for future use
  98. IN OUT LPSTORE_HANDLE hStore, // the object to get the lists for
  99. IN DWORD RecursionDepth,// how much nesting allowed? 0 ==> one level only
  100. IN OUT PARRAY Servers, // <Name,Description,IpAddress,State,Location>
  101. IN OUT PARRAY Subnets, // <Name,Description,IpAddress,Mask,State,Location>
  102. IN OUT PARRAY IpAddress, // <Name,Description,IpAddress,State,Location>
  103. IN OUT PARRAY Mask, // <Name,Description,IpAddress,State,Location>
  104. IN OUT PARRAY Ranges, // <Name,Description,IpAddress1,IpAddress2,State,Location>
  105. IN OUT PARRAY Sites, // dont know what this looks like now
  106. IN OUT PARRAY Reservations, // <Name,Description,IpAddress,State,Location>
  107. IN OUT PARRAY SuperScopes, // <Name,Description,State,DWORD, Location>
  108. //IN PARRAY SuperScopesDescription, // UNUSED
  109. IN OUT PARRAY OptionDescription, // <options definition>
  110. IN OUT PARRAY OptionsLocation, // <Location>
  111. IN OUT PARRAY Options, // xxx <Name, Description, String1=HexStream>
  112. IN OUT PARRAY Classes // xxx <Name, Description, String1=HexStream>
  113. ) ;
  114. //DOC DhcpDsGetAttribs retreives all the miscellaneous attributes (whichever is requested) and
  115. //DOC returns it as XXX_TYPE parameter. These parameters are allocated within this function
  116. //DOC using MemAlloc and must be freed via MemFree. Any of the parameters maybe NULL indicating
  117. //DOC lack of interest in that attribute. (Note that the following parameters are NOT allocated:
  118. //DOC they are just filled in: UniqueKey, Type, Flags, MScopeId, FoundParams)
  119. //DOC Note that some of the parameters may not be found, but this can be checked against the
  120. //DOC value returned in FoundParams (which is a REQUIRED parameter) using the FOUND_ARG(FoundParams,Arg#)
  121. //DOC where the Args are numbered from 0 starting at UniqueKey..
  122. //DOC Return Values:
  123. //DOC ERROR_DDS_UNEXPECTED_ERROR some entirely unexpected error
  124. //DOC ERROR_DDS_TOO_MANY_ERRORS multiple errors occured, and was caught
  125. //DOC Store any errors returned by the store apis
  126. DWORD
  127. DhcpDsGetAttribs( // get list of attributes
  128. IN DWORD Reserved, // must be zero -- for future use
  129. IN OUT LPSTORE_HANDLE hStore,
  130. IN OUT DWORD *FoundParams, // which of the following params was found?
  131. IN OUT LARGE_INTEGER *UniqueKey, // fill in an unique key
  132. IN OUT DWORD *Type, // object type
  133. IN OUT LARGE_INTEGER *Flags, // additional info about the object
  134. IN OUT LPWSTR *Name, // Allocated, name of object
  135. IN OUT LPWSTR *Description, // Allocated, something that describes this object
  136. IN OUT LPWSTR *Location, // the reference location from which to do other stuff
  137. IN OUT DWORD *MScopeId // what is the scope id used?
  138. ) ;
  139. //DOC DhcpCheckParams checks to see if the argument numbered (ArgNo) was found
  140. //DOC as marked in the bitmap FoundParams. Essentially used by the DhcpDsGetAttribs function only.
  141. //DOC Return Values:
  142. BOOL _inline
  143. DhcpCheckParams( // check to see if requested param was returned
  144. IN DWORD FoundParams,
  145. IN DWORD ArgNo
  146. )
  147. {
  148. if( ArgNo > sizeof(FoundParams)*8 ) return FALSE;
  149. return ((FoundParams) & (1 << ArgNo) )?TRUE:FALSE;
  150. }
  151. //DOC DhcpDsSetLists function sets the various list of attributes to the values given.
  152. //DOC it walks the arrays and encapsulates the arrays.
  153. //DOC Note that in case of error, this function returns immediately.
  154. //DOC In case of error, pl check the SetParams parameter with the CheckParams function
  155. //DOC to determine which parameters were set... (no order guarantee is made for setting
  156. //DOC the parameters).
  157. //DOC Any PARRAY parameter may be omitted if it is not required to be modified.
  158. //DOC SetParams is REQUIRED to be present. See the discussion in DhcpDsGetAttribs for
  159. //DOC the meaning of this parameter.
  160. //DOC Return Values:
  161. //DOC ERROR_DDS_UNEXPECTED_ERROR something bad happened
  162. //DOC ERROR_DDS_TOO_MANY_ERRORS too many simple errors
  163. //DOC Store any errors returned by the store module
  164. DWORD
  165. DhcpDsSetLists( // set the list of attributes after encapsulating them
  166. IN DWORD Reserved, // must be zero -- for future use
  167. IN OUT LPSTORE_HANDLE hStore, // the object to get the lists for
  168. IN OUT LPDWORD SetParams, // which of the following params got modified really?
  169. IN PARRAY Servers, // <Name,Description,IpAddress,State,Location>
  170. IN PARRAY Subnets, // <Name,Description,IpAddress,Mask,State,Location>
  171. IN PARRAY IpAddress, // <Name,Description,IpAddress,State,Location>
  172. IN PARRAY Mask, // <Name,Description,IpAddress,State,Location>
  173. IN PARRAY Ranges, // <Name,Description,IpAddress1,IpAddress2,State,Location>
  174. IN PARRAY Sites, // dont know what this looks like now
  175. IN PARRAY Reservations, // <Name,Description,IpAddress,State,Location>
  176. IN PARRAY SuperScopes, // <Name,Description,State,DWORD, Location>
  177. //IN PARRAY SuperScopesDescription, // UNUSED
  178. IN PARRAY OptionDescription, // option definitions..
  179. IN PARRAY OptionsLocation, // <Location>
  180. IN PARRAY Options, // xxx <Name, Description, String1=HexStream>
  181. IN PARRAY ClassDescription, // <Name, Description, String, Location>
  182. IN PARRAY Classes // xxx <Name, Description, String1=HexStream>
  183. ) ;
  184. //DOC DhcpDsSetAttribs sets the miscellaneous single-valued attributes. Any of the attributes
  185. //DOC may be omitted if not required to be set. (In this case they must be set to NULL).
  186. //DOC SetParams contains the information on which parameters were actually modified.
  187. //DOC See DhcpDsGetAttribs on using this parameter.
  188. //DOC Return Values:
  189. //DOC ERROR_DDS_UNEXPECTED_ERROR something unexpected
  190. //DOC Store any errors returned by the Store APIs
  191. DWORD
  192. DhcpDsSetAttribs( // set these attributes
  193. IN DWORD Reserved, // must be zero -- for future use
  194. IN OUT LPSTORE_HANDLE hStore, // the object to set the attributes
  195. IN OUT DWORD *SetParams, // which of the following params were actually modified?
  196. IN OUT LARGE_INTEGER *UniqueKey, // fill in an unique key
  197. IN OUT DWORD *Type, // object type
  198. IN OUT LPWSTR *Name, // Allocated, name of object
  199. IN OUT LPWSTR *Description, // Allocated, something that describes this object
  200. IN OUT LPWSTR *Location, // the reference location from which to do other stuff
  201. IN OUT DWORD *MScopeId // what is the scope id used?
  202. ) ;
  203. //========================================================================
  204. // end of file
  205. //========================================================================