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.

239 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. intfc.h
  5. Abstract:
  6. Declarations of data types and constants used to provide
  7. multiple-interface support in H.323/LDAP proxy.
  8. Revision History:
  9. 03/01/2000 File creation. Ilya Kleyman (IlyaK)
  10. --*/
  11. #ifndef __nath323_intfc_h
  12. #define __nath323_intfc_h
  13. class PROXY_INTERFACE {
  14. friend class PROXY_INTERFACE_ARRAY;
  15. private:
  16. H323_INTERFACE_TYPE InterfaceType; // public or private
  17. ULONG Index;
  18. DWORD Address; // host order
  19. DWORD Mask; // host order
  20. ULONG AdapterIndex;
  21. HANDLE Q931RedirectHandle;
  22. HANDLE LdapRedirectHandle1;
  23. HANDLE LdapRedirectHandle2;
  24. HANDLE Q931LocalRedirectHandle;
  25. HANDLE LdapLocalRedirectHandle1;
  26. HANDLE LdapLocalRedirectHandle2;
  27. IP_NAT_PORT_MAPPING Q931PortMapping;
  28. IP_NAT_PORT_MAPPING LdapPortMapping;
  29. IP_NAT_PORT_MAPPING LdapAltPortMapping;
  30. private:
  31. ULONG
  32. StartNatRedirects (
  33. void
  34. );
  35. void
  36. StopNatRedirects (
  37. void
  38. );
  39. ULONG
  40. StartQ931ReceiveRedirect (
  41. void
  42. );
  43. void
  44. StopQ931ReceiveRedirect (
  45. void
  46. );
  47. public:
  48. PROXY_INTERFACE (
  49. IN ULONG ArgIndex,
  50. IN H323_INTERFACE_TYPE ArgInterfaceType,
  51. IN PIP_ADAPTER_BINDING_INFO BindingInfo
  52. );
  53. ~PROXY_INTERFACE (
  54. void
  55. );
  56. DWORD
  57. GetIndex (
  58. void
  59. ) const
  60. {
  61. return Index;
  62. }
  63. ULONG
  64. Start (
  65. void
  66. );
  67. void
  68. Stop (
  69. void
  70. );
  71. BOOL
  72. IsFirewalled (
  73. void
  74. );
  75. BOOL
  76. IsPrivate (
  77. void
  78. );
  79. BOOL
  80. IsPublic (
  81. void
  82. );
  83. BOOL
  84. HasQ931PortMapping (
  85. void
  86. );
  87. BOOL
  88. HasLdapPortMapping (
  89. void
  90. );
  91. BOOL
  92. HasLdapAltPortMapping (
  93. void
  94. );
  95. ULONG
  96. GetQ931PortMappingDestination (
  97. void
  98. );
  99. ULONG
  100. GetLdapPortMappingDestination (
  101. void
  102. );
  103. ULONG
  104. GetLdapAltPortMappingDestination (
  105. void
  106. );
  107. };
  108. class PROXY_INTERFACE_ARRAY :
  109. public SIMPLE_CRITICAL_SECTION_BASE {
  110. private:
  111. DYNAMIC_ARRAY <PROXY_INTERFACE *> Array;
  112. LONG Q931ReceiveRedirectStartCount;
  113. private:
  114. HRESULT
  115. Add (
  116. IN PROXY_INTERFACE * Interface
  117. );
  118. PROXY_INTERFACE *
  119. RemoveByIndex (
  120. IN DWORD Index
  121. );
  122. PROXY_INTERFACE **
  123. FindByIndex (
  124. IN DWORD InterfaceIndex
  125. );
  126. public:
  127. PROXY_INTERFACE_ARRAY ()
  128. {
  129. Q931ReceiveRedirectStartCount = 0;
  130. }
  131. // only called during service shutdown to assert that all
  132. // interfaces have been previously deactivated
  133. void
  134. AssertShutdownReady (
  135. void
  136. )
  137. {
  138. assert (Array.GetLength() == 0);
  139. }
  140. HRESULT
  141. IsPrivateAddress (
  142. IN DWORD Address, // host order
  143. OUT BOOL * IsPrivate
  144. );
  145. HRESULT
  146. IsPublicAddress (
  147. IN DWORD Address, // host order
  148. OUT BOOL * IsPublic
  149. );
  150. ULONG
  151. AddStartInterface (
  152. IN ULONG Index,
  153. IN H323_INTERFACE_TYPE InterfaceType,
  154. IN PIP_ADAPTER_BINDING_INFO BindingInfo
  155. );
  156. void
  157. RemoveStopInterface (
  158. IN DWORD Index
  159. );
  160. void
  161. Stop (
  162. void
  163. );
  164. void
  165. StartQ931ReceiveRedirects (
  166. void
  167. );
  168. void
  169. StopQ931ReceiveRedirects (
  170. void
  171. );
  172. };
  173. extern PROXY_INTERFACE_ARRAY InterfaceArray;
  174. HRESULT
  175. IsPrivateAddress (
  176. IN DWORD Address,
  177. OUT BOOL * IsPrivate
  178. );
  179. HRESULT
  180. IsPublicAddress (
  181. IN DWORD Address,
  182. OUT BOOL * IsPublic
  183. );
  184. #endif // __nath323_intfc_h