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.

236 lines
8.5 KiB

  1. //================================================================================
  2. // Copyright (C) 1997-1999 Microsoft Corporation
  3. // Description: these are the exported dhcp client api function definitions
  4. //================================================================================
  5. #ifndef _DHCPCSDK_
  6. #define _DHCPCSDK_
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #ifndef DHCP_OPTIONS_DEFINED
  11. #define DHCP_OPTIONS_DEFINED
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. //
  16. // DHCP Standard Options.
  17. //
  18. #define OPTION_PAD 0
  19. #define OPTION_SUBNET_MASK 1
  20. #define OPTION_TIME_OFFSET 2
  21. #define OPTION_ROUTER_ADDRESS 3
  22. #define OPTION_TIME_SERVERS 4
  23. #define OPTION_IEN116_NAME_SERVERS 5
  24. #define OPTION_DOMAIN_NAME_SERVERS 6
  25. #define OPTION_LOG_SERVERS 7
  26. #define OPTION_COOKIE_SERVERS 8
  27. #define OPTION_LPR_SERVERS 9
  28. #define OPTION_IMPRESS_SERVERS 10
  29. #define OPTION_RLP_SERVERS 11
  30. #define OPTION_HOST_NAME 12
  31. #define OPTION_BOOT_FILE_SIZE 13
  32. #define OPTION_MERIT_DUMP_FILE 14
  33. #define OPTION_DOMAIN_NAME 15
  34. #define OPTION_SWAP_SERVER 16
  35. #define OPTION_ROOT_DISK 17
  36. #define OPTION_EXTENSIONS_PATH 18
  37. //
  38. // IP layer parameters - per host
  39. //
  40. #define OPTION_BE_A_ROUTER 19
  41. #define OPTION_NON_LOCAL_SOURCE_ROUTING 20
  42. #define OPTION_POLICY_FILTER_FOR_NLSR 21
  43. #define OPTION_MAX_REASSEMBLY_SIZE 22
  44. #define OPTION_DEFAULT_TTL 23
  45. #define OPTION_PMTU_AGING_TIMEOUT 24
  46. #define OPTION_PMTU_PLATEAU_TABLE 25
  47. //
  48. // Link layer parameters - per interface.
  49. //
  50. #define OPTION_MTU 26
  51. #define OPTION_ALL_SUBNETS_MTU 27
  52. #define OPTION_BROADCAST_ADDRESS 28
  53. #define OPTION_PERFORM_MASK_DISCOVERY 29
  54. #define OPTION_BE_A_MASK_SUPPLIER 30
  55. #define OPTION_PERFORM_ROUTER_DISCOVERY 31
  56. #define OPTION_ROUTER_SOLICITATION_ADDR 32
  57. #define OPTION_STATIC_ROUTES 33
  58. #define OPTION_TRAILERS 34
  59. #define OPTION_ARP_CACHE_TIMEOUT 35
  60. #define OPTION_ETHERNET_ENCAPSULATION 36
  61. //
  62. // TCP Paramters - per host
  63. //
  64. #define OPTION_TTL 37
  65. #define OPTION_KEEP_ALIVE_INTERVAL 38
  66. #define OPTION_KEEP_ALIVE_DATA_SIZE 39
  67. //
  68. // Application Layer Parameters
  69. //
  70. #define OPTION_NETWORK_INFO_SERVICE_DOM 40
  71. #define OPTION_NETWORK_INFO_SERVERS 41
  72. #define OPTION_NETWORK_TIME_SERVERS 42
  73. //
  74. // Vender specific information option
  75. //
  76. #define OPTION_VENDOR_SPEC_INFO 43
  77. //
  78. // NetBIOS over TCP/IP Name server option
  79. //
  80. #define OPTION_NETBIOS_NAME_SERVER 44
  81. #define OPTION_NETBIOS_DATAGRAM_SERVER 45
  82. #define OPTION_NETBIOS_NODE_TYPE 46
  83. #define OPTION_NETBIOS_SCOPE_OPTION 47
  84. //
  85. // X Window System Options.
  86. //
  87. #define OPTION_XWINDOW_FONT_SERVER 48
  88. #define OPTION_XWINDOW_DISPLAY_MANAGER 49
  89. //
  90. // Other extensions
  91. //
  92. #define OPTION_REQUESTED_ADDRESS 50
  93. #define OPTION_LEASE_TIME 51
  94. #define OPTION_OK_TO_OVERLAY 52
  95. #define OPTION_MESSAGE_TYPE 53
  96. #define OPTION_SERVER_IDENTIFIER 54
  97. #define OPTION_PARAMETER_REQUEST_LIST 55
  98. #define OPTION_MESSAGE 56
  99. #define OPTION_MESSAGE_LENGTH 57
  100. #define OPTION_RENEWAL_TIME 58 // T1
  101. #define OPTION_REBIND_TIME 59 // T2
  102. #define OPTION_CLIENT_CLASS_INFO 60
  103. #define OPTION_CLIENT_ID 61
  104. #define OPTION_TFTP_SERVER_NAME 66
  105. #define OPTION_BOOTFILE_NAME 67
  106. #define OPTION_END 255
  107. #endif DHCP_OPTIONS_DEFINED
  108. #ifndef DHCPAPI_PARAMS_DEFINED
  109. #define DHCPAPI_PARAMS_DEFINED
  110. typedef struct _DHCPAPI_PARAMS { // use this structure to request params
  111. ULONG Flags; // for future use
  112. ULONG OptionId; // what option is this?
  113. BOOL IsVendor; // is this vendor specific?
  114. LPBYTE Data; // the actual data
  115. DWORD nBytesData; // how many bytes of data are there in Data?
  116. } DHCPAPI_PARAMS, *PDHCPAPI_PARAMS, *LPDHCPAPI_PARAMS;
  117. #endif DHCPAPI_PARAMS_DEFINED
  118. typedef struct _DHCPAPI_PARAMS
  119. DHCPCAPI_PARAMS, *PDHCPCAPI_PARAMS, *LPDHCPCAPI_PARAMS;
  120. typedef struct _DHCPCAPI_PARAMS_ARARAY { // array of params..
  121. ULONG nParams; // size of array
  122. LPDHCPCAPI_PARAMS Params; // actual array
  123. } DHCPCAPI_PARAMS_ARRAY, *PDHCPCAPI_PARAMS_ARRAY, *LPDHCPCAPI_PARAMS_ARRAY;
  124. typedef struct _DHCPCAPI_CLASSID { // defines a client class id.
  125. ULONG Flags; // must be zero currently.
  126. LPBYTE Data; // classid binary data.
  127. ULONG nBytesData; // how many bytes of data are there?
  128. } DHCPCAPI_CLASSID, *PDHCPCAPI_CLASSID, *LPDHCPCAPI_CLASSID;
  129. #define DHCPCAPI_REQUEST_PERSISTENT 0x01 // request this options "permanently"
  130. #define DHCPCAPI_REQUEST_SYNCHRONOUS 0x02 // request and block on it
  131. #define DHCPCAPI_REQUEST_ASYNCHRONOUS 0x04 // request and return, set event on completion
  132. #define DHCPCAPI_REQUEST_CANCEL 0x08 // cancel request
  133. #define DHCPCAPI_REQUEST_MASK 0x0F // allowed flags..
  134. DWORD
  135. APIENTRY
  136. DhcpCApiInitialize(
  137. OUT LPDWORD Version
  138. );
  139. VOID
  140. APIENTRY
  141. DhcpCApiCleanup(
  142. VOID
  143. );
  144. DWORD // win32 status
  145. APIENTRY
  146. DhcpRequestParams( // request parameters of client
  147. IN DWORD Flags, // must be DHCPCAPI_REQUEST_SYNCHRONOUS
  148. IN LPVOID Reserved, // this parameter is reserved
  149. IN LPWSTR AdapterName, // adapter name to request for
  150. IN LPDHCPCAPI_CLASSID ClassId, // reserved must be NULL
  151. IN DHCPCAPI_PARAMS_ARRAY SendParams, // parameters to send.
  152. IN OUT DHCPCAPI_PARAMS_ARRAY RecdParams, // parameters that are to be requested..
  153. IN LPBYTE Buffer, // a buffer to hold data for RecdParams
  154. IN OUT LPDWORD pSize, // i/p: size of above in BYTES, o/p required bytes..
  155. IN LPWSTR RequestIdStr // needed for persistent requests
  156. ); // returns ERROR_MORE_DATA if o/p buffer is of insufficient size, and fills in reqd size in # of bytes
  157. DWORD // win32 status
  158. APIENTRY
  159. DhcpUndoRequestParams( // undo the effect of a persistent request -- currently undo from registry
  160. IN DWORD Flags, // must be zero, reserved
  161. IN LPVOID Reserved, // this parameter is reserved
  162. IN LPWSTR AdapterName, // the name of the adpater to delete for
  163. IN LPWSTR RequestIdStr // needed for persistent requests..
  164. );
  165. #define DHCPCAPI_REGISTER_HANDLE_EVENT 0x01 // handle returned is to an event
  166. DWORD // win32 status
  167. APIENTRY
  168. DhcpRegisterParamChange( // notify if a parameter has changed
  169. IN DWORD Flags, // must be zero, reserved
  170. IN LPVOID Reserved, // this parameter is reserved
  171. IN LPWSTR AdapterName, // adapter of interest
  172. IN LPDHCPCAPI_CLASSID ClassId, // reserved must be NULL
  173. IN DHCPCAPI_PARAMS_ARRAY Params, // parameters of interest
  174. IN OUT LPVOID Handle // handle to event that will be SetEvent'ed in case of param change
  175. );
  176. #define DHCPCAPI_DEREGISTER_HANDLE_EVENT 0x01 // de-register handle that is an event
  177. DWORD
  178. APIENTRY
  179. DhcpDeRegisterParamChange( // undo the registration
  180. IN DWORD Flags, // MUST BE ZERO --> No flags yet.
  181. IN LPVOID Reserved, // MUST BE NULL --> Reserved
  182. IN LPVOID Event // handle to event returned by DhcpRegisterParamChange.
  183. );
  184. DWORD
  185. APIENTRY
  186. DhcpRemoveDNSRegistrations(
  187. VOID
  188. );
  189. #ifdef __cplusplus
  190. }
  191. #endif
  192. //================================================================================
  193. // end of file
  194. //================================================================================
  195. #endif _DHCPCSDK_