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.

168 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. mdhcp.h
  5. Abstract:
  6. This file contains the header for data blocks of
  7. client side APIs for the MCAST.
  8. Author:
  9. Munil Shah (munils) 02-Sept-97
  10. Environment:
  11. User Mode - Win32
  12. Revision History:
  13. --*/
  14. #ifndef _MDHCPCLI_H_
  15. #define _MDHCPCLI_H_
  16. #include <madcapcl.h>
  17. /***********************************************************************
  18. * Structure Definitions
  19. ***********************************************************************/
  20. // Mdhcp scopelist
  21. typedef struct _MCAST_SCOPE_LIST {
  22. DWORD ScopeLen;
  23. DWORD ScopeCount;
  24. MCAST_SCOPE_ENTRY pScopeBuf[1];
  25. } MCAST_SCOPE_LIST, *PMCAST_SCOPE_LIST;
  26. typedef struct _MCAST_SCOPE_LIST_OPT_V4 {
  27. DWORD ScopeId;
  28. DWORD LastAddr;
  29. BYTE TTL;
  30. BYTE NameCount;
  31. } MCAST_SCOPE_LIST_OPT_V4, *PMCAST_SCOPE_LIST_OPT_V4;
  32. typedef struct _MCAST_SCOPE_LIST_OPT_V6 {
  33. BYTE ScopeId[16];
  34. BYTE LastAddr[16];
  35. BYTE TTL;
  36. BYTE NameCount;
  37. } MCAST_SCOPE_LIST_OPT_V6, *PMCAST_SCOPE_LIST_OPT_V6;
  38. typedef struct _MCAST_SCOPE_LIST_OPT_LANG {
  39. BYTE Flags;
  40. BYTE Len;
  41. BYTE Tag[1];
  42. } MCAST_SCOPE_LIST_OPT_LANG, *PMCAST_SCOPE_LIST_OPT_LANG;
  43. /***********************************************************************
  44. * Macro Definitions
  45. ***********************************************************************/
  46. // Locking of scope list.
  47. #define LOCK_MSCOPE_LIST() EnterCriticalSection(&MadcapGlobalScopeListCritSect)
  48. #define UNLOCK_MSCOPE_LIST() LeaveCriticalSection(&MadcapGlobalScopeListCritSect)
  49. /***********************************************************************
  50. * Global Data
  51. ***********************************************************************/
  52. #ifdef MADCAP_DATA_ALLOCATE
  53. #define MADCAP_EXTERN
  54. #else
  55. #define MADCAP_EXTERN extern
  56. #endif
  57. #define MADCAP_QUERY_SCOPE_LIST_RETRIES 2
  58. #define MADCAP_MAX_RETRIES 4
  59. #define MADCAP_QUERY_SCOPE_LIST_TIME 1
  60. MADCAP_EXTERN CRITICAL_SECTION MadcapGlobalScopeListCritSect; // protects scopelist.
  61. MADCAP_EXTERN PMCAST_SCOPE_LIST gMadcapScopeList;
  62. MADCAP_EXTERN BOOL gMScopeQueryInProgress;
  63. MADCAP_EXTERN HANDLE gMScopeQueryEvent;
  64. MADCAP_EXTERN DWORD gMadcapClientApplVersion;
  65. /***********************************************************************
  66. * Function Protos.
  67. ***********************************************************************/
  68. DWORD
  69. CopyMScopeList(
  70. IN OUT PMCAST_SCOPE_ENTRY pScopeList,
  71. IN OUT PDWORD pScopeLen,
  72. OUT PDWORD pScopeCount
  73. );
  74. BOOL
  75. ShouldRequeryMScopeList();
  76. DWORD
  77. CreateMadcapContext(
  78. IN OUT PDHCP_CONTEXT *ppContext,
  79. IN LPMCAST_CLIENT_UID pRequestID,
  80. IN DHCP_IP_ADDRESS IpAddress
  81. );
  82. DWORD
  83. MadcapDoInform(
  84. IN PDHCP_CONTEXT pContext
  85. );
  86. DWORD
  87. StoreMScopeList(
  88. IN PDHCP_CONTEXT pContext,
  89. IN BOOL NewList
  90. );
  91. DWORD
  92. ObtainMScopeList(
  93. );
  94. DWORD
  95. GenMadcapClientUID(
  96. OUT PBYTE pRequestID,
  97. IN PDWORD pRequestIDLen
  98. );
  99. DWORD
  100. ObtainMadcapAddress(
  101. IN PDHCP_CONTEXT DhcpContext,
  102. IN PIPNG_ADDRESS pScopeID,
  103. IN PMCAST_LEASE_REQUEST pRenewRequest,
  104. IN OUT PMCAST_LEASE_RESPONSE pAddrResponse
  105. );
  106. DWORD
  107. RenewMadcapAddress(
  108. IN PDHCP_CONTEXT DhcpContext,
  109. IN PIPNG_ADDRESS pScopeID,
  110. IN PMCAST_LEASE_REQUEST pRenewRequest,
  111. IN OUT PMCAST_LEASE_RESPONSE pAddrResponse,
  112. IN DHCP_IP_ADDRESS SelectedServer
  113. );
  114. DWORD
  115. ReleaseMadcapAddress(
  116. PDHCP_CONTEXT DhcpContext
  117. );
  118. DWORD
  119. MadcapInitGlobalData(VOID);
  120. #endif _MDHCPCLI_H_
  121.