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.

115 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. dhcprog.h
  5. Abstract:
  6. This file contain function prototypes for the DHCP server rogue detection
  7. routines.
  8. Author:
  9. Ramesh Vyaghrapuri (rameshv) 17-Aug-1998
  10. Environment:
  11. User Mode - Win32 - MIDL
  12. Revision History:
  13. --*/
  14. #ifndef ROGUE_H_INCLUDED
  15. #define ROGUE_H_INCLUDED
  16. //
  17. // Structure that holds the state information for Rogue detection
  18. //
  19. #define MAX_DNS_NAME_LEN 260
  20. typedef enum {
  21. ROLE_DOMAIN = 0,
  22. ROLE_NT4_DOMAIN,
  23. ROLE_WORKGROUP,
  24. ROLE_SBS,
  25. ROLE_INVALID
  26. } ROLE_TYPE;
  27. typedef struct {
  28. SOCKET socket;
  29. DHCP_IP_ADDRESS IpAddr;
  30. DHCP_IP_ADDRESS SubnetAddr;
  31. } ROGUE_ENDPOINT, *PROGUE_ENDPOINT;
  32. typedef struct {
  33. BOOL fInitialized;
  34. HANDLE TerminateEvent;
  35. HANDLE WaitHandle;
  36. ROLE_TYPE eRole;
  37. BOOL fDhcp;
  38. DWORD fLogEvents; // this is tri-state
  39. ULONG NoNetTriesCount;
  40. ULONG GetDsDcNameRetries;
  41. BOOL fJustUpgraded;
  42. BOOL fAuthorized;
  43. ULONG CachedAuthStatus;
  44. ULONG RogueState;
  45. ULONG InformsSentCount;
  46. DWORD TransactionID;
  47. ULONG SleepTime;
  48. ULONG ReceiveTimeLimit;
  49. ULONG ProcessAckRetries;
  50. ULONG WaitForAckRetries;
  51. ULONG nResponses;
  52. ULONG StartTime;
  53. ULONG LastUnauthLogTime;
  54. WCHAR DomainDnsName[MAX_DNS_NAME_LEN];
  55. WCHAR DnsForestName[MAX_DNS_NAME_LEN];
  56. DWORD nBoundEndpoints;
  57. PROGUE_ENDPOINT pBoundEP;
  58. SOCKET RecvSocket;
  59. BOOL fFormattedMessage;
  60. BYTE SendMessage[DHCP_MESSAGE_SIZE];
  61. UUID FakeHardwareAddress;
  62. ULONG SendMessageSize;
  63. BYTE RecvMessage[DHCP_MESSAGE_SIZE];
  64. ULONG LastSeenIpAddress;
  65. WCHAR LastSeenDomain[MAX_DNS_NAME_LEN];
  66. } DHCP_ROGUE_STATE_INFO, *PDHCP_ROGUE_STATE_INFO;
  67. //
  68. // Rogue.C
  69. //
  70. DWORD
  71. APIENTRY
  72. DhcpRogueInit(
  73. IN OUT PDHCP_ROGUE_STATE_INFO Info OPTIONAL,
  74. IN HANDLE WaitEvent,
  75. IN HANDLE TerminateEvent
  76. );
  77. VOID
  78. APIENTRY
  79. DhcpRogueCleanup(
  80. IN OUT PDHCP_ROGUE_STATE_INFO Info OPTIONAL
  81. );
  82. ULONG
  83. APIENTRY
  84. RogueDetectStateMachine(
  85. IN OUT PDHCP_ROGUE_STATE_INFO Info OPTIONAL
  86. );
  87. #endif