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.

669 lines
20 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. dhcpdef.h
  5. Abstract:
  6. This module contains data type definitions for the DHCP client.
  7. Author:
  8. Madan Appiah (madana) 31-Oct-1993
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. //
  14. // init.c will #include this file with GLOBAL_DATA_ALLOCATE defined.
  15. // That will cause each of these variables to be allocated.
  16. //
  17. #ifndef _DHCPDEF_
  18. #define _DHCPDEF_
  19. #ifdef GLOBAL_DATA_ALLOCATE
  20. #define EXTERN
  21. #else
  22. #define EXTERN extern
  23. #endif
  24. //
  25. // the registry key is of different type between NT and Memphis.
  26. //
  27. #ifdef VXD
  28. typedef VMMHKEY DHCPKEY;
  29. #else // NT
  30. typedef HKEY DHCPKEY;
  31. #endif
  32. #ifndef VXD
  33. #define RUNNING_IN_RAS_CONTEXT() (!DhcpGlobalIsService)
  34. #else
  35. #define RUNNING_IN_RAS_CONTEXT() FALSE
  36. #endif
  37. //
  38. // The amount of time to wait for a retry if we have no IP address
  39. //
  40. #define ADDRESS_ALLOCATION_RETRY 300 // 5 minutes
  41. #define EASYNET_ALLOCATION_RETRY 300 // 5 minutes
  42. //
  43. // The amount of time to wait for a retry if we have an IP address,
  44. // but the renewal on startup failed.
  45. //
  46. #if !DBG
  47. #define RENEWAL_RETRY 600 // 10 minutes
  48. #else
  49. #define RENEWAL_RETRY 60 // 1 minute
  50. #endif
  51. //
  52. // The number of times to send a request before giving up waiting
  53. // for a response.
  54. //
  55. #define DHCP_MAX_RETRIES 4
  56. #define DHCP_ACCEPT_RETRIES 2
  57. #define DHCP_MAX_RENEW_RETRIES 2
  58. //
  59. // amount of time required between consequtive send_informs..
  60. //
  61. #define DHCP_DEFAULT_INFORM_SEPARATION_INTERVAL 60 // one minute
  62. //
  63. // amount of time to wait after an address conflict is detected
  64. //
  65. #define ADDRESS_CONFLICT_RETRY 10 // 10 seconds
  66. //
  67. //
  68. // Expoenential backoff delay.
  69. //
  70. #define DHCP_EXPO_DELAY 4
  71. //
  72. // The maximum total amount of time to spend trying to obtain an
  73. // initial address.
  74. //
  75. // This delay is computed as below:
  76. //
  77. // DHCP_MAX_RETRIES - n
  78. // DHCP_EXPO_DELAY - m
  79. // WAIT_FOR_RESPONSE_TIME - w
  80. // MAX_STARTUP_DELAY - t
  81. //
  82. // Binary Exponential backup Algorithm.
  83. //
  84. // t > m * (n*(n+1)/2) + n + w*n
  85. // ------------------- ---
  86. // random wait + response wait
  87. //
  88. #define MAX_STARTUP_DELAY \
  89. DHCP_EXPO_DELAY * \
  90. (( DHCP_MAX_RETRIES * (DHCP_MAX_RETRIES + 1)) / 2) + \
  91. DHCP_MAX_RETRIES + DHCP_MAX_RETRIES * WAIT_FOR_RESPONSE_TIME
  92. #define MAX_RENEW_DELAY \
  93. DHCP_EXPO_DELAY * \
  94. (( DHCP_MAX_RENEW_RETRIES * (DHCP_MAX_RENEW_RETRIES + 1)) / 2) + \
  95. DHCP_MAX_RENEW_RETRIES + DHCP_MAX_RENEW_RETRIES * \
  96. WAIT_FOR_RESPONSE_TIME
  97. //
  98. // The maximum amount of time to wait between renewal retries, if the
  99. // lease period is between T1 and T2.
  100. //
  101. #define MAX_RETRY_TIME 3600 // 1 hour
  102. //
  103. // Minimum time to sleep between retries.
  104. //
  105. #if DBG
  106. #define MIN_SLEEP_TIME 1 * 60 // 1 min.
  107. #else
  108. #define MIN_SLEEP_TIME 5 * 60 // 5 min.
  109. #endif
  110. //
  111. // Minimum lease time.
  112. //
  113. #define DHCP_MINIMUM_LEASE 60*60 // 24 hours.
  114. #ifdef __DHCP_DYNDNS_ENABLED__
  115. #define DHCP_DNS_TTL 0 // let the DNS api decide..
  116. #endif
  117. //
  118. // IP Autoconfiguration defaults
  119. //
  120. #define DHCP_IPAUTOCONFIGURATION_DEFAULT_SUBNET "169.254.0.0"
  121. #define DHCP_IPAUTOCONFIGURATION_DEFAULT_MASK "255.255.0.0"
  122. // define the reserved range of autonet addresses..
  123. #define DHCP_RESERVED_AUTOCFG_SUBNET "169.254.255.0"
  124. #define DHCP_RESERVED_AUTOCFG_MASK "255.255.255.0"
  125. // will dhcp pick any reserved autonet addr? NO!
  126. #define DHCP_RESERVED_AUTOCFG_FLAG (1)
  127. // self default route (0,0,<self>) will have a metric of (3)
  128. #define DHCP_SELF_DEFAULT_METRIC (3)
  129. //
  130. // General purpose macros
  131. //
  132. #define MIN(a,b) ((a) < (b) ? (a) : (b))
  133. #define MAX(a,b) ((a) > (b) ? (a) : (b))
  134. #if DBG
  135. #define STATIC
  136. #else
  137. #define STATIC static
  138. #endif
  139. /*#define LOCK_RENEW_LIST() EnterCriticalSection(&DhcpGlobalRenewListCritSect)
  140. #define UNLOCK_RENEW_LIST() LeaveCriticalSection(&DhcpGlobalRenewListCritSect)
  141. #define LOCK_INTERFACE() EnterCriticalSection(&DhcpGlobalSetInterfaceCritSect)
  142. #define UNLOCK_INTERFACE() LeaveCriticalSection(&DhcpGlobalSetInterfaceCritSect)
  143. #define LOCK_OPTIONS_LIST() EnterCriticalSection(&DhcpGlobalOptionsListCritSect)
  144. #define UNLOCK_OPTIONS_LIST() LeaveCriticalSection(&DhcpGlobalOptionsListCritSect)
  145. */
  146. #define LOCK_RENEW_LIST()
  147. #define UNLOCK_RENEW_LIST()
  148. #define LOCK_INTERFACE()
  149. #define UNLOCK_INTERFACE()
  150. #define LOCK_OPTIONS_LIST()
  151. #define UNLOCK_OPTIONS_LIST()
  152. #define ZERO_TIME 0x0 // in secs.
  153. //
  154. // length of the time string returned by ctime.
  155. // actually it is 26.
  156. //
  157. #define TIME_STRING_LEN 32
  158. //
  159. // String size when a long converted to printable string.
  160. // 2^32 = 4294967295 (10 digits) + termination char.
  161. //
  162. #define LONG_STRING_SIZE 12
  163. //
  164. // A renewal function.
  165. //
  166. typedef
  167. DWORD
  168. (*PRENEWAL_FUNCTION) (
  169. IN PVOID Context,
  170. LPDWORD Sleep
  171. );
  172. //
  173. // DHCP Client-Identifier (option 61)
  174. //
  175. typedef struct _DHCP_CLIENT_IDENTIFIER
  176. {
  177. BYTE *pbID;
  178. DWORD cbID;
  179. BYTE bType;
  180. BOOL fSpecified;
  181. } DHCP_CLIENT_IDENTIFIER;
  182. //
  183. // state information for IP autoconfiguration
  184. //
  185. typedef struct _DHCP_IPAUTOCONFIGURATION_CONTEXT
  186. {
  187. DHCP_IP_ADDRESS Address;
  188. DHCP_IP_ADDRESS Subnet;
  189. DHCP_IP_ADDRESS Mask;
  190. DWORD Seed;
  191. } DHCP_IPAUTOCONFIGURATION_CONTEXT;
  192. //
  193. // A DHCP context block. One block is maintained per NIC (network
  194. // interface Card).
  195. //
  196. typedef struct _DHCP_CONTEXT {
  197. // list of adapters.
  198. //LIST_ENTRY NicListEntry;
  199. // hardware type.
  200. BYTE HardwareAddressType;
  201. // HW address, just follows this context structure.
  202. LPBYTE HardwareAddress;
  203. // Length of HW address.
  204. DWORD HardwareAddressLength;
  205. // Selected IpAddress, NetworkOrder.
  206. DHCP_IP_ADDRESS IpAddress;
  207. // Selected subnet mask. NetworkOrder.
  208. //DHCP_IP_ADDRESS SubnetMask;
  209. // Selected DHCP server address. Network Order.
  210. DHCP_IP_ADDRESS DhcpServerAddress;
  211. // Desired IpAddress the client request in next discover.
  212. //DHCP_IP_ADDRESS DesiredIpAddress;
  213. // The ip address that was used just before losing this..
  214. //DHCP_IP_ADDRESS LastKnownGoodAddress; // ONLY DNS uses this..
  215. // the domain name that was used with last registration..
  216. //WCHAR LastUsedDomainName[257]; // dns domain name is atmost 255 bytes.
  217. // current domain name for this adapter.
  218. //BYTE DomainName[257];
  219. // IP Autoconfiguration state
  220. //DHCP_IPAUTOCONFIGURATION_CONTEXT IPAutoconfigurationContext;
  221. DHCP_CLIENT_IDENTIFIER ClientIdentifier;
  222. // Lease time in seconds.
  223. //DWORD Lease;
  224. // Time the lease was obtained.
  225. //time_t LeaseObtained;
  226. // Time the client should start renew its address.
  227. //time_t T1Time;
  228. // Time the client should start broadcast to renew address.
  229. time_t T2Time;
  230. // Time the lease expires. The clinet should stop using the
  231. // IpAddress.
  232. // LeaseObtained < T1Time < T2Time < LeaseExpires
  233. //time_t LeaseExpires;
  234. // when was the last time an inform was sent?
  235. time_t LastInformSent;
  236. // how many seconds between consecutive informs?
  237. //DWORD InformSeparationInterval;
  238. // # of gateways and the currently plumbed gateways are stored here
  239. //DWORD nGateways;
  240. //DHCP_IP_ADDRESS *GatewayAddresses;
  241. // # of static routes and the actual static routes are stored here
  242. //DWORD nStaticRoutes;
  243. //DHCP_IP_ADDRESS *StaticRouteAddresses;
  244. // to place in renewal list.
  245. //LIST_ENTRY RenewalListEntry;
  246. // Time for next renewal state.
  247. //time_t RunTime;
  248. // seconds passed since boot.
  249. DWORD SecondsSinceBoot;
  250. // should we ping the g/w or always assume g/w is NOT present?
  251. //BOOL DontPingGatewayFlag;
  252. // can we use DHCP_INFORM packets or should we use DHCP_REQUEST instead?
  253. //BOOL UseInformFlag;
  254. //WORD ClientPort;
  255. // what to function at next renewal state.
  256. //PRENEWAL_FUNCTION RenewalFunction;
  257. // A semaphore for synchronization to this structure
  258. //HANDLE RenewHandle;
  259. // the list of options to send and the list of options received
  260. LIST_ENTRY SendOptionsList;
  261. LIST_ENTRY RecdOptionsList;
  262. // the opened key to the adapter info storage location
  263. //DHCPKEY AdapterInfoKey;
  264. // the class this adapter belongs to
  265. LPBYTE ClassId;
  266. DWORD ClassIdLength;
  267. // Message buffer to send and receive DHCP message.
  268. PDHCP_MESSAGE MessageBuffer;
  269. // state information for this interface. see below for manifests
  270. struct /* anonymous */ {
  271. unsigned Plumbed : 1 ; // is this interface plumbed
  272. unsigned ServerReached : 1 ; // Did we reach the server ever
  273. unsigned AutonetEnabled: 1 ; // Autonet enabled?
  274. unsigned HasBeenLooked : 1 ; // Has this context been looked at?
  275. unsigned DhcpEnabled : 1 ; // Is this context dhcp enabled?
  276. unsigned AutoMode : 1 ; // Currently in autonet mode?
  277. unsigned MediaState : 2 ; // One of connected, disconnected, reconnected
  278. unsigned MDhcp : 1 ; // Is this context created for Mdhcp?
  279. unsigned PowerResumed : 1 ; // Was power just resumed on this interface?
  280. unsigned Broadcast : 1 ;
  281. } State;
  282. // machine specific information
  283. //PVOID LocalInformation;
  284. // DWORD IpInterfaceInstance; // needed for BringUpInterface
  285. LPTSTR AdapterName;
  286. // LPWSTR DeviceName;
  287. // LPWSTR NetBTDeviceName;
  288. // LPWSTR RegistryKey;
  289. SOCKET Socket;
  290. DWORD IpInterfaceContext;
  291. // BOOL DefaultGatewaysSet;
  292. CHAR szMessageBuffer[DHCP_MESSAGE_SIZE];
  293. } DHCP_CONTEXT, *PDHCP_CONTEXT;
  294. #define ADDRESS_PLUMBED(Ctxt) ((Ctxt)->State.Plumbed = 1)
  295. #define ADDRESS_UNPLUMBED(Ctxt) ((Ctxt)->State.Plumbed = 0)
  296. #define IS_ADDRESS_PLUMBED(Ctxt) ((Ctxt)->State.Plumbed)
  297. #define IS_ADDRESS_UNPLUMBED(Ctxt) (!(Ctxt)->State.Plumbed)
  298. #define CONNECTION_BROADCAST(Ctxt) ((Ctxt)->State.Broadcast = 1)
  299. #define CONNECTION_NO_BROADCAST(Ctxt) ((Ctxt)->State.Broadcast = 0)
  300. #define IS_CONNECTION_BROADCAST(Ctxt) ((Ctxt)->State.Broadcast)
  301. #define IS_CONNECTION_NOBROADCAST(Ctxt) (!(Ctxt)->State.Broadcast)
  302. #define SERVER_REACHED(Ctxt) ((Ctxt)->State.ServerReached = 1)
  303. #define SERVER_UNREACHED(Ctxt) ((Ctxt)->State.ServerReached = 0)
  304. #define IS_SERVER_REACHABLE(Ctxt) ((Ctxt)->State.ServerReached)
  305. #define IS_SERVER_UNREACHABLE(Ctxt) (!(Ctxt)->State.ServerReached)
  306. #define AUTONET_ENABLED(Ctxt) ((Ctxt)->State.AutonetEnabled = 1)
  307. #define AUTONET_DISABLED(Ctxt) ((Ctxt)->State.AutonetEnabled = 0)
  308. #define IS_AUTONET_ENABLED(Ctxt) ((Ctxt)->State.AutonetEnabled)
  309. #define IS_AUTONET_DISABLED(Ctxt) (!(Ctxt)->State.AutonetEnabled)
  310. #define CTXT_WAS_LOOKED(Ctxt) ((Ctxt)->State.HasBeenLooked = 1)
  311. #define CTXT_WAS_NOT_LOOKED(Ctxt) ((Ctxt)->State.HasBeenLooked = 0)
  312. #define WAS_CTXT_LOOKED(Ctxt) ((Ctxt)->State.HasBeenLooked)
  313. #define WAS_CTXT_NOT_LOOKED(Ctxt) (!(Ctxt)->State.HasBeenLooked)
  314. #define DHCP_ENABLED(Ctxt) ((Ctxt)->State.DhcpEnabled = 1)
  315. #define DHCP_DISABLED(Ctxt) ((Ctxt)->State.DhcpEnabled = 0)
  316. #define IS_DHCP_ENABLED(Ctxt) ((Ctxt)->State.DhcpEnabled )
  317. #define IS_DHCP_DISABLED(Ctxt) (!(Ctxt)->State.DhcpEnabled )
  318. #define ADDRESS_TYPE_AUTO 1
  319. #define ADDRESS_TYPE_DHCP 0
  320. #define ACQUIRED_DHCP_ADDRESS(Ctxt) ((Ctxt)->State.AutoMode = 0 )
  321. #define ACQUIRED_AUTO_ADDRESS(Ctxt) ((Ctxt)->State.AutoMode = 1 )
  322. #define IS_ADDRESS_DHCP(Ctxt) (!(Ctxt)->State.AutoMode)
  323. #define IS_ADDRESS_AUTO(Ctxt) ((Ctxt)->State.AutoMode)
  324. #define MEDIA_CONNECTED(Ctxt) ((Ctxt)->State.MediaState = 0)
  325. #define MEDIA_RECONNECTED(Ctxt) ((Ctxt)->State.MediaState = 1)
  326. #define MEDIA_DISCONNECTED(Ctxt) ((Ctxt)->State.MediaState = 2)
  327. #define IS_MEDIA_CONNECTED(Ctxt) ((Ctxt)->State.MediaState == 0)
  328. #define IS_MEDIA_RECONNECTED(Ctxt) ((Ctxt)->State.MediaState == 1)
  329. #define IS_MEDIA_DISCONNECTED(Ctxt) ((Ctxt)->State.MediaState == 2)
  330. #define _INIT_STATE1(Ctxt) do{(Ctxt)->State.Plumbed = 0; (Ctxt)->State.AutonetEnabled=0;}while(0)
  331. #define _INIT_STATE2(Ctxt) do{(Ctxt)->State.HasBeenLooked = 0; (Ctxt)->State.DhcpEnabled=1;}while(0)
  332. #define _INIT_STATE3(Ctxt) do{(Ctxt)->State.AutoMode = 0; (Ctxt)->State.MediaState = 0;}while(0)
  333. #define INIT_STATE(Ctxt) do{_INIT_STATE1(Ctxt);_INIT_STATE2(Ctxt);_INIT_STATE3(Ctxt);}while(0)
  334. #define MDHCP_CTX(Ctxt) ((Ctxt)->State.MDhcp = 1)
  335. #define NONMDHCP_CTX(Ctxt) ((Ctxt)->State.MDhcp = 0)
  336. #define IS_MDHCP_CTX(Ctxt) ((Ctxt)->State.MDhcp )
  337. #define SET_MDHCP_STATE( Ctxt ) { \
  338. ADDRESS_PLUMBED( Ctxt ), MDHCP_CTX( Ctxt ); \
  339. }
  340. #define POWER_RESUMED(Ctxt) ((Ctxt)->State.PowerResumed = 1)
  341. #define POWER_NOT_RESUMED(Ctxt) ((Ctxt)->State.PowerResumed = 0)
  342. #define IS_POWER_RESUMED(Ctxt) ((Ctxt)->State.PowerResumed )
  343. /*LPSTR _inline // the string'ed version of state (same as Buffer)
  344. ConvertStateToString( // convert from bits to string
  345. IN PDHCP_CONTEXT Ctxt, // The context to print state for
  346. IN LPBYTE Buffer // The input buffer to write state into
  347. ) {
  348. strcpy(Buffer, IS_DHCP_ENABLED(Ctxt)?"DhcpEnabled ":"DhcpDisabled ");
  349. strcat(Buffer, IS_AUTONET_ENABLED(Ctxt)?"AutonetEnabled ":"AutonetDisabled ");
  350. strcat(Buffer, IS_ADDRESS_DHCP(Ctxt)?"DhcpMode ":"AutoMode ");
  351. strcat(Buffer, IS_ADDRESS_PLUMBED(Ctxt)?"Plumbed ":"UnPlumbed ");
  352. strcat(Buffer, IS_SERVER_REACHABLE(Ctxt)?"(server-present) ":"(server-absent) ");
  353. strcat(Buffer, WAS_CTXT_LOOKED(Ctxt)? "(seen) ":"(not-seen) ");
  354. if(IS_MEDIA_CONNECTED(Ctxt) ) strcat(Buffer, "MediaConnected\n");
  355. else if(IS_MEDIA_RECONNECTED(Ctxt)) strcat(Buffer, "MediaReConnected\n");
  356. else if(IS_MEDIA_DISCONNECTED(Ctxt)) strcat(Buffer, "MediaDisConnected\n");
  357. else strcat(Buffer, "MediaUnknownState\n");
  358. strcat(Buffer, IS_MDHCP_CTX(Ctxt)? "(MDhcp) ":"");
  359. strcat(Buffer, IS_POWER_RESUMED(Ctxt)? "Pwr Resumed ":"");
  360. return Buffer;
  361. }
  362. */
  363. //
  364. // The types of machines.. laptop would have aggressive EASYNET behaviour.
  365. //
  366. #define MACHINE_NONE 0
  367. #define MACHINE_LAPTOP 1
  368. //
  369. // Here is the set of expected options by the client -- If they are absent, not much can be done
  370. //
  371. typedef struct _DHCP_EXPECTED_OPTIONS {
  372. BYTE UNALIGNED* MessageType;
  373. DHCP_IP_ADDRESS UNALIGNED* SubnetMask;
  374. DHCP_IP_ADDRESS UNALIGNED* LeaseTime;
  375. DHCP_IP_ADDRESS UNALIGNED* ServerIdentifier;
  376. BYTE UNALIGNED* DomainName;
  377. DWORD DomainNameSize;
  378. // Wpad Auto-Proxy Url
  379. BYTE UNALIGNED* WpadUrl;
  380. DWORD WpadUrlSize;
  381. } DHCP_EXPECTED_OPTIONS, *PDHCP_EXPECTED_OPTIONS, *LPDHCP_EXPECTED_OPTIONS;
  382. //
  383. // Here is the set of options understood by the client
  384. //
  385. typedef struct _DHCP_FULL_OPTIONS {
  386. BYTE UNALIGNED* MessageType; // What kind of message is this?
  387. // Basic IP Parameters
  388. DHCP_IP_ADDRESS UNALIGNED* SubnetMask;
  389. DHCP_IP_ADDRESS UNALIGNED* LeaseTime;
  390. DHCP_IP_ADDRESS UNALIGNED* T1Time;
  391. DHCP_IP_ADDRESS UNALIGNED* T2Time;
  392. DHCP_IP_ADDRESS UNALIGNED* GatewayAddresses;
  393. DWORD nGateways;
  394. DHCP_IP_ADDRESS UNALIGNED* StaticRouteAddresses;
  395. DWORD nStaticRoutes;
  396. DHCP_IP_ADDRESS UNALIGNED* ServerIdentifier;
  397. // DNS parameters
  398. BYTE UNALIGNED* DnsFlags;
  399. BYTE UNALIGNED* DnsRcode1;
  400. BYTE UNALIGNED* DnsRcode2;
  401. BYTE UNALIGNED* DomainName;
  402. DWORD DomainNameSize;
  403. DHCP_IP_ADDRESS UNALIGNED* DnsServerList;
  404. DWORD nDnsServers;
  405. // Multicast options.
  406. DWORD UNALIGNED* MCastLeaseStartTime;
  407. BYTE UNALIGNED *MCastTTL;
  408. // Server message is something that the server may inform us of
  409. BYTE UNALIGNED* ServerMessage;
  410. DWORD ServerMessageLength;
  411. // Wpad Auto-Proxy Url
  412. BYTE UNALIGNED* WpadUrl;
  413. DWORD WpadUrlSize;
  414. } DHCP_FULL_OPTIONS, *PDHCP_FULL_OPTIONS, *LPDHCP_FULL_OPTIONS;
  415. typedef DHCP_FULL_OPTIONS DHCP_OPTIONS, *PDHCP_OPTIONS;
  416. //
  417. // structure for a list of messages
  418. //
  419. typedef struct _MSG_LIST {
  420. LIST_ENTRY MessageListEntry;
  421. DWORD ServerIdentifier;
  422. DWORD MessageSize;
  423. DWORD LeaseExpirationTime;
  424. DHCP_MESSAGE Message;
  425. } MSGLIST, *PMSGLIST, *LPMSGLIST;
  426. //
  427. // DHCP Global data.
  428. //
  429. extern BOOL DhcpGlobalServiceRunning; // initialized global.
  430. EXTERN LPSTR DhcpGlobalHostName;
  431. EXTERN LPWSTR DhcpGlobalHostNameW;
  432. EXTERN LPSTR DhcpGlobalHostComment;
  433. //
  434. // NIC List.
  435. //
  436. EXTERN LIST_ENTRY DhcpGlobalNICList;
  437. EXTERN LIST_ENTRY DhcpGlobalRenewList;
  438. //
  439. // Synchronization variables.
  440. //
  441. EXTERN CRITICAL_SECTION DhcpGlobalRenewListCritSect;
  442. EXTERN CRITICAL_SECTION DhcpGlobalSetInterfaceCritSect;
  443. EXTERN CRITICAL_SECTION DhcpGlobalOptionsListCritSect;
  444. EXTERN HANDLE DhcpGlobalRecomputeTimerEvent;
  445. EXTERN HANDLE DhcpGlobalResumePowerEvent;
  446. // waitable timer
  447. EXTERN HANDLE DhcpGlobalWaitableTimerHandle;
  448. //
  449. // to display success message.
  450. //
  451. EXTERN BOOL DhcpGlobalProtocolFailed;
  452. //
  453. // This varible tells if we are going to provide the DynDns api support to external clients
  454. // and if we are going to use the corresponding DnsApi. The define below gives the default
  455. // value.
  456. //
  457. EXTERN DWORD UseMHAsyncDns;
  458. #define DEFAULT_USEMHASYNCDNS 1
  459. //
  460. // This flag tells if we need to use inform or request packets
  461. //
  462. EXTERN DWORD DhcpGlobalUseInformFlag;
  463. //
  464. // This flag tells if pinging the g/w is disabled. (in this case the g/w is always NOT present)
  465. //
  466. EXTERN DWORD DhcpGlobalDontPingGatewayFlag;
  467. //
  468. // The # of seconds before retrying according to AUTONET... default is EASYNET_ALLOCATION_RETRY
  469. //
  470. EXTERN DWORD AutonetRetriesSeconds;
  471. //
  472. // Not used on NT. Just here for memphis.
  473. //
  474. EXTERN DWORD DhcpGlobalMachineType;
  475. //
  476. // Do we need to do a global refresh?
  477. //
  478. EXTERN ULONG DhcpGlobalDoRefresh;
  479. //
  480. // options related lists
  481. //
  482. EXTERN LIST_ENTRY DhcpGlobalClassesList;
  483. EXTERN LIST_ENTRY DhcpGlobalOptionDefList;
  484. //
  485. // dhcpmsg.c.. list for doing parallel recv on..
  486. //
  487. EXTERN LIST_ENTRY DhcpGlobalRecvFromList;
  488. EXTERN CRITICAL_SECTION DhcpGlobalRecvFromCritSect;
  489. //
  490. // the client vendor name ( "MSFT 5.0" or something like that )
  491. //
  492. EXTERN LPSTR DhcpGlobalClientClassInfo;
  493. //
  494. // The following global keys are used to avoid re-opening each time
  495. //
  496. EXTERN DHCPKEY DhcpGlobalParametersKey;
  497. EXTERN DHCPKEY DhcpGlobalTcpipParametersKey;
  498. EXTERN DHCPKEY DhcpGlobalClientOptionKey;
  499. EXTERN DHCPKEY DhcpGlobalServicesKey;
  500. //
  501. // debug variables.
  502. //
  503. #if DBG
  504. EXTERN DWORD DhcpGlobalDebugFlag;
  505. #endif
  506. #endif // _DHCPDEF_