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.

582 lines
15 KiB

  1. // ALG.idl : IDL source for ALG.dll
  2. //
  3. // This file will be processed by the MIDL tool to
  4. // produce the type library (ALG.tlb) and marshalling code.
  5. cpp_quote("//+-------------------------------------------------------------------------")
  6. cpp_quote("//")
  7. cpp_quote("// Microsoft Windows")
  8. cpp_quote("// Copyright (C) Microsoft Corporation, 1992-2001.")
  9. cpp_quote("//")
  10. cpp_quote("//--------------------------------------------------------------------------")
  11. cpp_quote("// MODULE: alg.h")
  12. cpp_quote("//")
  13. import "oaidl.idl";
  14. import "ocidl.idl";
  15. const int ALG_MAXIMUM_PORT_RANGE_SIZE=10;
  16. typedef enum _ALG_PROTOCOL
  17. {
  18. eALG_TCP = 0x01,
  19. eALG_UDP = 0x02
  20. } ALG_PROTOCOL;
  21. typedef enum _ALG_CAPTURE
  22. {
  23. eALG_SOURCE_CAPTURE = 0x01,
  24. eALG_DESTINATION_CAPTURE = 0x02
  25. } ALG_CAPTURE;
  26. typedef enum _ALG_DIRECTION
  27. {
  28. eALG_INBOUND = 0x01,
  29. eALG_OUTBOUND = 0x02,
  30. eALG_BOTH = 0x03
  31. } ALG_DIRECTION;
  32. typedef enum _ALG_ADAPTER_TYPE
  33. {
  34. eALG_PRIVATE = 0x01,
  35. eALG_BOUNDARY = 0x02,
  36. eALG_FIREWALLED = 0x04
  37. } ALG_ADAPTER_TYPE;
  38. typedef enum _ALG_NOTIFICATION
  39. {
  40. eALG_NONE = 0x00,
  41. eALG_SESSION_CREATION = 0x01,
  42. eALG_SESSION_DELETION = 0x02,
  43. eALG_SESSION_BOTH = 0x03
  44. } ALG_NOTIFICATION;
  45. typedef struct _ALG_PRIMARY_CHANNEL_PROPERTIES
  46. {
  47. ALG_PROTOCOL eProtocol;
  48. USHORT usCapturePort;
  49. ALG_CAPTURE eCaptureType;
  50. BOOL fCaptureInbound;
  51. ULONG ulListeningAddress;
  52. USHORT usListeningPort;
  53. } ALG_PRIMARY_CHANNEL_PROPERTIES;
  54. typedef struct _ALG_SECONDARY_CHANNEL_PROPERTIES
  55. {
  56. ALG_PROTOCOL eProtocol;
  57. ULONG ulPrivateAddress;
  58. USHORT usPrivatePort;
  59. ULONG ulPublicAddress;
  60. USHORT usPublicPort;
  61. ULONG ulRemoteAddress;
  62. USHORT usRemotePort;
  63. ULONG ulListenAddress;
  64. USHORT usListenPort;
  65. ALG_DIRECTION eDirection;
  66. BOOL fPersistent;
  67. } ALG_SECONDARY_CHANNEL_PROPERTIES;
  68. typedef struct _ALG_DATA_CHANNEL_PROPERTIES
  69. {
  70. ALG_PROTOCOL eProtocol;
  71. ULONG ulPrivateAddress;
  72. USHORT usPrivatePort;
  73. ULONG ulPublicAddress;
  74. USHORT usPublicPort;
  75. ULONG ulRemoteAddress;
  76. USHORT usRemotePort;
  77. ALG_DIRECTION eDirection;
  78. ALG_NOTIFICATION eDesiredNotification;
  79. } ALG_DATA_CHANNEL_PROPERTIES;
  80. typedef struct _ALG_PERSISTENT_DATA_CHANNEL_PROPERTIES
  81. {
  82. ALG_PROTOCOL eProtocol;
  83. ULONG ulPrivateAddress;
  84. USHORT usPrivatePort;
  85. ULONG ulPublicAddress;
  86. USHORT usPublicPort;
  87. ULONG ulRemoteAddress;
  88. USHORT usRemotePort;
  89. ALG_DIRECTION eDirection;
  90. } ALG_PERSISTENT_DATA_CHANNEL_PROPERTIES;
  91. [
  92. object,
  93. uuid(480BF94A-09FD-4F8A-A3E0-B0700282D84D),
  94. pointer_default(unique)
  95. ]
  96. interface IAdapterInfo : IUnknown
  97. {
  98. HRESULT GetAdapterIndex(
  99. [out] ULONG* pulIndex);
  100. HRESULT GetAdapterType(
  101. [out] ALG_ADAPTER_TYPE* pAdapterType);
  102. HRESULT GetAdapterAddresses(
  103. [out] ULONG* pulAddressCount,
  104. [out] ULONG** prgAddresses
  105. );
  106. };
  107. [
  108. object,
  109. uuid(B68E5043-3E3D-4CC2-B9C1-5F8F88FEE81C),
  110. pointer_default(unique)
  111. ]
  112. interface IPendingProxyConnection : IUnknown
  113. {
  114. HRESULT Cancel();
  115. };
  116. [
  117. object,
  118. uuid(AD42D12A-4AD0-4856-919E-E854C91D1856),
  119. pointer_default(unique),
  120. local
  121. ]
  122. interface IDataChannel : IUnknown
  123. {
  124. HRESULT Cancel();
  125. HRESULT GetChannelProperties(
  126. [out] ALG_DATA_CHANNEL_PROPERTIES** ppProperties
  127. );
  128. HRESULT GetSessionCreationEventHandle(
  129. [out] HANDLE* pHandle
  130. );
  131. HRESULT GetSessionDeletionEventHandle(
  132. [out] HANDLE* pHandle
  133. );
  134. };
  135. [
  136. object,
  137. uuid(A180E934-D92A-415D-9144-759F8054E8F6),
  138. pointer_default(unique)
  139. ]
  140. interface IPersistentDataChannel : IUnknown
  141. {
  142. HRESULT Cancel();
  143. HRESULT GetChannelProperties(
  144. [out] ALG_PERSISTENT_DATA_CHANNEL_PROPERTIES** ppProperties
  145. );
  146. };
  147. [
  148. object,
  149. uuid(1A2E8B62-9012-4BE6-84AE-32BD66BA657A),
  150. pointer_default(unique)
  151. ]
  152. interface IPrimaryControlChannel : IUnknown
  153. {
  154. HRESULT Cancel();
  155. HRESULT GetChannelProperties(
  156. [out] ALG_PRIMARY_CHANNEL_PROPERTIES** ppProperties
  157. );
  158. HRESULT GetOriginalDestinationInformation(
  159. [in] ULONG ulSourceAddress,
  160. [in] USHORT usSourcePort,
  161. [out] ULONG* pulOriginalDestinationAddress,
  162. [out] USHORT* pusOriginalDestinationPort,
  163. [out] IAdapterInfo ** ppReceiveAdapter
  164. );
  165. };
  166. [
  167. object,
  168. uuid(A23F9D10-714C-41FE-8471-FFB19BC28454),
  169. pointer_default(unique)
  170. ]
  171. interface ISecondaryControlChannel : IUnknown
  172. {
  173. HRESULT Cancel();
  174. HRESULT GetChannelProperties(
  175. [out] ALG_SECONDARY_CHANNEL_PROPERTIES ** ppProperties
  176. );
  177. HRESULT GetOriginalDestinationInformation(
  178. [in] ULONG ulSourceAddress,
  179. [in] USHORT usSourcePort,
  180. [out] ULONG* pulOriginalDestinationAddress,
  181. [out] USHORT* pusOriginalDestinationPort,
  182. [out] IAdapterInfo** ppReceiveAdapter
  183. );
  184. };
  185. [
  186. object,
  187. uuid(A23F9D11-714C-41FE-8471-FFB19BC28454),
  188. pointer_default(unique)
  189. ]
  190. interface IEnumAdapterInfo : IUnknown
  191. {
  192. HRESULT Next(
  193. [in] ULONG celt,
  194. [out, size_is(celt), length_is(*pCeltFetched)] IAdapterInfo ** rgAI,
  195. [out] ULONG * pCeltFetched
  196. );
  197. HRESULT Skip(
  198. [in] ULONG celt
  199. );
  200. HRESULT Reset(
  201. );
  202. HRESULT Clone(
  203. [out] IEnumAdapterInfo ** ppEnum
  204. );
  205. }
  206. //
  207. // Implemented by ISV in there ALG proxy's
  208. //
  209. [
  210. object,
  211. uuid(44AB2DC3-23B2-47DE-8228-2E1CCEEB9911),
  212. helpstring("IAdapterNotificationSink Interface"),
  213. pointer_default(unique)
  214. ]
  215. interface IAdapterNotificationSink : IUnknown
  216. {
  217. HRESULT AdapterAdded(
  218. IAdapterInfo * pAdapter
  219. );
  220. HRESULT AdapterRemoved(
  221. IAdapterInfo* pAdapter
  222. );
  223. HRESULT AdapterModified(
  224. IAdapterInfo* pAdapter
  225. );
  226. };
  227. //
  228. // ALG main public interface
  229. //
  230. [
  231. object,
  232. uuid(5134842A-FDCE-485D-93CD-DE1640643BBE),
  233. pointer_default(unique)
  234. ]
  235. interface IApplicationGatewayServices : IUnknown
  236. {
  237. HRESULT CreatePrimaryControlChannel(
  238. [in] ALG_PROTOCOL eProtocol,
  239. [in] USHORT usPortToCapture,
  240. [in] ALG_CAPTURE eCaptureType,
  241. [in] BOOL fCaptureInbound,
  242. [in] ULONG ulListenAddress,
  243. [in] USHORT usListenPort,
  244. [out] IPrimaryControlChannel** ppIControlChannel
  245. );
  246. HRESULT CreateSecondaryControlChannel(
  247. [in] ALG_PROTOCOL eProtocol,
  248. [in] ULONG ulPrivateAddress,
  249. [in] USHORT usPrivatePort,
  250. [in] ULONG ulPublicAddress,
  251. [in] USHORT usPublicPort,
  252. [in] ULONG ulRemoteAddress,
  253. [in] USHORT usRemotePort,
  254. [in] ULONG ulListenAddress,
  255. [in] USHORT usListenPort,
  256. [in] ALG_DIRECTION eDirection,
  257. [in] BOOL fPersistent,
  258. [out] ISecondaryControlChannel** ppControlChannel
  259. );
  260. HRESULT GetBestSourceAddressForDestinationAddress(
  261. [in] ULONG ulDstAddress,
  262. [in] BOOL fDemandDial,
  263. [out] ULONG* pulBestSrcAddress
  264. );
  265. HRESULT PrepareProxyConnection(
  266. [in] ALG_PROTOCOL eProtocol,
  267. [in] ULONG ulSrcAddress,
  268. [in] USHORT usSrcPort,
  269. [in] ULONG ulDstAddress,
  270. [in] USHORT usDstPort,
  271. [in] BOOL fNoTimeout,
  272. [out] IPendingProxyConnection** ppPendingConnection
  273. );
  274. HRESULT PrepareSourceModifiedProxyConnection(
  275. [in] ALG_PROTOCOL eProtocol,
  276. [in] ULONG ulSrcAddress,
  277. [in] USHORT usSrcPort,
  278. [in] ULONG ulDstAddress,
  279. [in] USHORT usDstPort,
  280. [in] ULONG ulNewSrcAddress,
  281. [in] USHORT usNewSourcePort,
  282. [out] IPendingProxyConnection** ppPendingConnection
  283. );
  284. HRESULT CreateDataChannel(
  285. [in] ALG_PROTOCOL eProtocol,
  286. [in] ULONG ulPrivateAddress,
  287. [in] USHORT usPrivatePort,
  288. [in] ULONG ulPublicAddress,
  289. [in] USHORT usPublicPort,
  290. [in] ULONG ulRemoteAddress,
  291. [in] USHORT usRemotePort,
  292. [in] ALG_DIRECTION eDirection,
  293. [in] ALG_NOTIFICATION eDesiredNotification,
  294. [in] BOOL fNoTimeout,
  295. [out] IDataChannel** ppDataChannel
  296. );
  297. HRESULT CreatePersistentDataChannel(
  298. [in] ALG_PROTOCOL eProtocol,
  299. [in] ULONG ulPrivateAddress,
  300. [in] USHORT usPrivatePort,
  301. [in] ULONG ulPublicAddress,
  302. [in] USHORT usPublicPort,
  303. [in] ULONG ulRemoteAddress,
  304. [in] USHORT usRemotePort,
  305. [in] ALG_DIRECTION eDirection,
  306. [out] IPersistentDataChannel** ppIPersistentDataChannel
  307. );
  308. HRESULT ReservePort(
  309. [in] USHORT usPortCount,
  310. [out] USHORT* pusReservedPort
  311. );
  312. HRESULT ReleaseReservedPort(
  313. [in] USHORT usReservedPortBase,
  314. [in] USHORT usPortCount
  315. );
  316. HRESULT EnumerateAdapters(
  317. [out] IEnumAdapterInfo ** ppIEnumAdapterInfo
  318. );
  319. HRESULT StartAdapterNotifications(
  320. [in] IAdapterNotificationSink* pSink,
  321. [in] DWORD* pdwCookie
  322. );
  323. HRESULT StopAdapterNotifications(
  324. [in] DWORD dwCookieOfSink
  325. );
  326. };
  327. //
  328. // Implemented by the ISV ALG's
  329. //
  330. [
  331. object,
  332. uuid(5134842B-FDCE-485D-93CD-DE1640643BBE),
  333. pointer_default(unique)
  334. ]
  335. interface IApplicationGateway : IUnknown
  336. {
  337. HRESULT Initialize(
  338. [in] IApplicationGatewayServices* pAlgServices
  339. );
  340. HRESULT Stop(void);
  341. };
  342. //
  343. //
  344. // Must be implemented by the ALG Manager
  345. //
  346. [
  347. uuid(B6D1D098-E235-4B99-BA98-7C624FD875DB),
  348. version(1.0),
  349. helpstring("MyICS 1.0 Type Library")
  350. ]
  351. library ALGLib
  352. {
  353. importlib("stdole32.tlb");
  354. importlib("stdole2.tlb");
  355. [
  356. uuid(F8ADE1D3-49DF-4B75-9005-EF9508E6A337),
  357. helpstring("ApplicationGatewayServices Class")
  358. ]
  359. coclass ApplicationGatewayServices
  360. {
  361. [default] interface IApplicationGatewayServices;
  362. };
  363. [
  364. uuid(3CEB5509-C1CD-432F-9D8F-65D1E286AA80),
  365. helpstring("PrimaryControlChannel Class")
  366. ]
  367. coclass PrimaryControlChannel
  368. {
  369. [default] interface IPrimaryControlChannel;
  370. };
  371. [
  372. uuid(7B3181A0-C92F-4567-B0FA-CD9A10ECD7D1),
  373. helpstring("SecondaryControlChannel Class")
  374. ]
  375. coclass SecondaryControlChannel
  376. {
  377. [default] interface ISecondaryControlChannel;
  378. };
  379. [
  380. uuid(6F9942C9-C1B1-4AB5-93DA-6058991DC8F3),
  381. helpstring("AdapterInfo Class")
  382. ]
  383. coclass AdapterInfo
  384. {
  385. [default] interface IAdapterInfo;
  386. };
  387. [
  388. uuid(6F9942CA-C1B1-4AB5-93DA-6058991DC8F3),
  389. helpstring("EnumAdapterInfo Class")
  390. ]
  391. coclass EnumAdapterInfo
  392. {
  393. [default] interface IEnumAdapterInfo;
  394. };
  395. [
  396. uuid(D8A68E5E-2B37-426C-A329-C117C14C429E),
  397. helpstring("PendingProxyConnection Class")
  398. ]
  399. coclass PendingProxyConnection
  400. {
  401. [default] interface IPendingProxyConnection;
  402. };
  403. [
  404. uuid(BBB36F15-408D-4056-8C27-920843D40BE5),
  405. helpstring("DataChannel Class")
  406. ]
  407. coclass DataChannel
  408. {
  409. [default] interface IDataChannel;
  410. };
  411. [
  412. uuid(BC9B54AB-7883-4C13-909F-033D03267990),
  413. helpstring("PersistentDataChannel Class")
  414. ]
  415. coclass PersistentDataChannel
  416. {
  417. [default] interface IPersistentDataChannel;
  418. };
  419. };