alg.idl 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /**
  2. * This file is part of the mingw-w64 runtime package.
  3. * No warranty is given; refer to the file DISCLAIMER within this package.
  4. */
  5. import "oaidl.idl";
  6. import "ocidl.idl";
  7. cpp_quote("#include <winapifamily.h>")
  8. cpp_quote("")
  9. cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
  10. typedef enum _ALG_ADAPTER_TYPE {
  11. eALG_PRIVATE = 0x1,
  12. eALG_BOUNDARY = 0x2,
  13. eALG_FIREWALLED = 0x4
  14. } ALG_ADAPTER_TYPE;
  15. typedef enum _ALG_CAPTURE {
  16. eALG_SOURCE_CAPTURE = 0x1,
  17. eALG_DESTINATION_CAPTURE = 0x2
  18. } ALG_CAPTURE;
  19. typedef enum _ALG_DIRECTION {
  20. eALG_INBOUND = 0x1,
  21. eALG_OUTBOUND = 0x2,
  22. eALG_BOTH = 0x3
  23. } ALG_DIRECTION;
  24. typedef enum _ALG_NOTIFICATION {
  25. eALG_NONE = 0x0,
  26. eALG_SESSION_CREATION = 0x1,
  27. eALG_SESSION_DELETION = 0x2,
  28. eALG_SESSION_BOTH = 0x3
  29. } ALG_NOTIFICATION;
  30. typedef enum _ALG_PROTOCOL {
  31. eALG_TCP = 0x1,
  32. eALG_UDP = 0x2
  33. } ALG_PROTOCOL;
  34. typedef struct _ALG_PRIMARY_CHANNEL_PROPERTIES {
  35. ALG_PROTOCOL eProtocol;
  36. USHORT usCapturePort;
  37. ALG_CAPTURE eCaptureType;
  38. BOOL fCaptureInbound;
  39. ULONG ulListeningAddress;
  40. USHORT usListeningPort;
  41. ULONG ulAdapterIndex;
  42. } ALG_PRIMARY_CHANNEL_PROPERTIES;
  43. typedef struct _ALG_SECONDARY_CHANNEL_PROPERTIES {
  44. ALG_PROTOCOL eProtocol;
  45. ULONG ulPrivateAddress;
  46. USHORT usPrivatePort;
  47. ULONG ulPublicAddress;
  48. USHORT usPublicPort;
  49. ULONG ulRemoteAddress;
  50. USHORT usRemotePort;
  51. ULONG ulListenAddress;
  52. USHORT usListenPort;
  53. ALG_DIRECTION eDirection;
  54. BOOL fPersistent;
  55. } ALG_SECONDARY_CHANNEL_PROPERTIES;
  56. typedef struct _ALG_DATA_CHANNEL_PROPERTIES {
  57. ALG_PROTOCOL eProtocol;
  58. ULONG ulPrivateAddress;
  59. USHORT usPrivatePort;
  60. ULONG ulPublicAddress;
  61. USHORT usPublicPort;
  62. ULONG ulRemoteAddress;
  63. USHORT usRemotePort;
  64. ALG_DIRECTION eDirection;
  65. ALG_NOTIFICATION eDesiredNotification;
  66. } ALG_DATA_CHANNEL_PROPERTIES;
  67. typedef struct _ALG_PERSISTENT_DATA_CHANNEL_PROPERTIES {
  68. ALG_PROTOCOL eProtocol;
  69. ULONG ulPrivateAddress;
  70. USHORT usPrivatePort;
  71. ULONG ulPublicAddress;
  72. USHORT usPublicPort;
  73. ULONG ulRemoteAddress;
  74. USHORT usRemotePort;
  75. ALG_DIRECTION eDirection;
  76. } ALG_PERSISTENT_DATA_CHANNEL_PROPERTIES;
  77. const int ALG_MAXIMUM_PORT_RANGE_SIZE = 10;
  78. [object, uuid (480bf94a-09fd-4f8a-a3e0-b0700282d84d), pointer_default (unique)]
  79. interface IAdapterInfo : IUnknown {
  80. HRESULT GetAdapterIndex ([out] ULONG *pulIndex);
  81. HRESULT GetAdapterType ([out] ALG_ADAPTER_TYPE *pAdapterType);
  82. HRESULT GetAdapterAddresses ([out] ULONG *pulAddressCount,[out, size_is (,*pulAddressCount)] ULONG **prgAddresses);
  83. };
  84. [object, uuid (B68E5043-3e3d-4cc2-b9c1-5f8f88fee81c), pointer_default (unique)]
  85. interface IPendingProxyConnection : IUnknown {
  86. HRESULT Cancel ();
  87. };
  88. [object, local, uuid (ad42d12a-4ad0-4856-919e-e854c91d1856), pointer_default (unique)]
  89. interface IDataChannel : IUnknown {
  90. HRESULT Cancel ();
  91. HRESULT GetChannelProperties ([out] ALG_DATA_CHANNEL_PROPERTIES **ppProperties);
  92. HRESULT GetSessionCreationEventHandle ([out] HANDLE *pHandle);
  93. HRESULT GetSessionDeletionEventHandle ([out] HANDLE *pHandle);
  94. };
  95. [object, uuid (a180e934-d92a-415d-9144-759f8054e8f6), pointer_default (unique)]
  96. interface IPersistentDataChannel : IUnknown {
  97. HRESULT Cancel ();
  98. HRESULT GetChannelProperties ([out] ALG_PERSISTENT_DATA_CHANNEL_PROPERTIES **ppProperties);
  99. };
  100. [object, uuid (1a2e8b62-9012-4be6-84ae-32bd66ba657a), pointer_default (unique)]
  101. interface IPrimaryControlChannel : IUnknown {
  102. HRESULT Cancel ();
  103. HRESULT GetChannelProperties ([out] ALG_PRIMARY_CHANNEL_PROPERTIES **ppProperties);
  104. HRESULT GetOriginalDestinationInformation ([in] ULONG ulSourceAddress,[in] USHORT usSourcePort,[out] ULONG *pulOriginalDestinationAddress,[out] USHORT *pusOriginalDestinationPort,[out] ULONG *pulRemapDestinationAddress,[out] USHORT *pulRemapDestinationPort,[out] IAdapterInfo **ppReceiveAdapter);
  105. };
  106. [object, uuid (a23f9d10-714c-41fe-8471-ffb19bc28454), pointer_default (unique)]
  107. interface ISecondaryControlChannel : IUnknown {
  108. HRESULT Cancel ();
  109. HRESULT GetChannelProperties ([out] ALG_SECONDARY_CHANNEL_PROPERTIES **ppProperties);
  110. HRESULT GetOriginalDestinationInformation ([in] ULONG ulSourceAddress,[in] USHORT usSourcePort,[out] ULONG *pulOriginalDestinationAddress,[out] USHORT *pusOriginalDestinationPort,[out] IAdapterInfo **ppReceiveAdapter);
  111. };
  112. [object, uuid (a23f9d11-714c-41fe-8471-ffb19bc28454), pointer_default (unique)]
  113. interface IEnumAdapterInfo : IUnknown {
  114. HRESULT Next ([in] ULONG celt,[out, size_is (celt), length_is (*pCeltFetched)] IAdapterInfo **rgAI,[out] ULONG *pCeltFetched);
  115. HRESULT Skip ([in] ULONG celt);
  116. HRESULT Reset ();
  117. HRESULT Clone ([out] IEnumAdapterInfo **ppEnum);
  118. }
  119. [object, uuid (44ab2dc3-23b2-47de-8228-2e1cceeb9911), pointer_default (unique)]
  120. interface IAdapterNotificationSink : IUnknown {
  121. HRESULT AdapterAdded (IAdapterInfo *pAdapter);
  122. HRESULT AdapterRemoved (IAdapterInfo *pAdapter);
  123. HRESULT AdapterModified (IAdapterInfo *pAdapter);
  124. HRESULT AdapterUpdatePortMapping (IAdapterInfo *pAdapter);
  125. };
  126. [object, uuid (5134842a-fdce-485d-93cd-de1640643bbe), pointer_default (unique)]
  127. interface IApplicationGatewayServices : IUnknown {
  128. HRESULT CreatePrimaryControlChannel ([in] ULONG uAdapterIndex,[in] ALG_PROTOCOL eProtocol,[in] USHORT usPortToCapture,[in] ALG_CAPTURE eCaptureType,[in] BOOL fCaptureInbound,[in] ULONG ulListenAddress,[in] USHORT usListenPort,[out] IPrimaryControlChannel **ppIControlChannel);
  129. HRESULT CreateSecondaryControlChannel ([in] ALG_PROTOCOL eProtocol,[in] ULONG ulPrivateAddress,[in] USHORT usPrivatePort,[in] ULONG ulPublicAddress,[in] USHORT usPublicPort,[in] ULONG ulRemoteAddress,[in] USHORT usRemotePort,[in] ULONG ulListenAddress,[in] USHORT usListenPort,[in] ALG_DIRECTION eDirection,[in] BOOL fPersistent,[out] ISecondaryControlChannel **ppControlChannel);
  130. HRESULT GetBestSourceAddressForDestinationAddress ([in] ULONG ulDstAddress,[in] BOOL fDemandDial,[out] ULONG *pulBestSrcAddress);
  131. HRESULT PrepareProxyConnection ([in] ALG_PROTOCOL eProtocol,[in] ULONG ulSrcAddress,[in] USHORT usSrcPort,[in] ULONG ulDstAddress,[in] USHORT usDstPort,[in] BOOL fNoTimeout,[out] IPendingProxyConnection **ppPendingConnection);
  132. HRESULT PrepareSourceModifiedProxyConnection ([in] ALG_PROTOCOL eProtocol,[in] ULONG ulSrcAddress,[in] USHORT usSrcPort,[in] ULONG ulDstAddress,[in] USHORT usDstPort,[in] ULONG ulNewSrcAddress,[in] USHORT usNewSourcePort,[out] IPendingProxyConnection **ppPendingConnection);
  133. HRESULT CreateDataChannel ([in] ALG_PROTOCOL eProtocol,[in] ULONG ulPrivateAddress,[in] USHORT usPrivatePort,[in] ULONG ulPublicAddress,[in] USHORT usPublicPort,[in] ULONG ulRemoteAddress,[in] USHORT usRemotePort,[in] ALG_DIRECTION eDirection,[in] ALG_NOTIFICATION eDesiredNotification,[in] BOOL fNoTimeout,[out] IDataChannel **ppDataChannel);
  134. HRESULT CreatePersistentDataChannel ([in] ALG_PROTOCOL eProtocol,[in] ULONG ulPrivateAddress,[in] USHORT usPrivatePort,[in] ULONG ulPublicAddress,[in] USHORT usPublicPort,[in] ULONG ulRemoteAddress,[in] USHORT usRemotePort,[in] ALG_DIRECTION eDirection,[out] IPersistentDataChannel **ppIPersistentDataChannel);
  135. HRESULT ReservePort ([in] USHORT usPortCount,[out] USHORT *pusReservedPort);
  136. HRESULT ReleaseReservedPort ([in] USHORT usReservedPortBase,[in] USHORT usPortCount);
  137. HRESULT EnumerateAdapters ([out] IEnumAdapterInfo **ppIEnumAdapterInfo);
  138. HRESULT StartAdapterNotifications ([in] IAdapterNotificationSink *pSink,[in] DWORD *pdwCookie);
  139. HRESULT StopAdapterNotifications ([in] DWORD dwCookieOfSink);
  140. HRESULT LookupAdapterPortMapping ([in] ULONG ulAdapterIndex,[in] UCHAR Protocol,[in] ULONG ulDestinationAddress,[in] USHORT usDestinationPort,[out] ULONG *pulRemapAddress,[out] USHORT *pusRemapPort);
  141. };
  142. [object, uuid (5134842b-fdce-485d-93cd-de1640643bbe), pointer_default (unique)]
  143. interface IApplicationGateway : IUnknown {
  144. HRESULT Initialize ([in] IApplicationGatewayServices *pAlgServices);
  145. HRESULT Stop (void);
  146. };
  147. [uuid (b6d1d098-e235-4b99-ba98-7c624fd875db), version (1.0)]
  148. library ALGLib {
  149. importlib ("stdole32.tlb");
  150. importlib ("stdole2.tlb");
  151. [uuid (f8ade1d3-49df-4b75-9005-ef9508e6a337)]
  152. coclass ApplicationGatewayServices {
  153. [default] interface IApplicationGatewayServices;
  154. };
  155. [uuid (3ceb5509-C1CD-432f-9d8f-65d1e286aa80)]
  156. coclass PrimaryControlChannel {
  157. [default] interface IPrimaryControlChannel;
  158. };
  159. [uuid (7b3181a0-c92F-4567-b0fa-cd9a10ecd7d1)]
  160. coclass SecondaryControlChannel {
  161. [default] interface ISecondaryControlChannel;
  162. };
  163. [uuid (6f9942c9-c1b1-4ab5-93da-6058991dc8f3)]
  164. coclass AdapterInfo {
  165. [default] interface IAdapterInfo;
  166. };
  167. [uuid (6f9942ca-c1b1-4ab5-93da-6058991dc8f3)]
  168. coclass EnumAdapterInfo {
  169. [default] interface IEnumAdapterInfo;
  170. };
  171. [uuid (d8a68e5e-2b37-426c-a329-c117c14c429e)]
  172. coclass PendingProxyConnection {
  173. [default] interface IPendingProxyConnection;
  174. };
  175. [uuid (bbb36f15-408d-4056-8c27-920843d40be5)]
  176. coclass DataChannel {
  177. [default] interface IDataChannel;
  178. };
  179. [uuid (bc9B54ab-7883-4c13-909f-033d03267990)]
  180. coclass PersistentDataChannel {
  181. [default] interface IPersistentDataChannel;
  182. };
  183. };
  184. cpp_quote("#endif")