alg.idl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  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] ULONG* pulRemapDestinationAddress,
  164. [out] USHORT* pulRemapDestinationPort,
  165. [out] IAdapterInfo ** ppReceiveAdapter
  166. );
  167. };
  168. [
  169. object,
  170. uuid(A23F9D10-714C-41FE-8471-FFB19BC28454),
  171. pointer_default(unique)
  172. ]
  173. interface ISecondaryControlChannel : IUnknown
  174. {
  175. HRESULT Cancel();
  176. HRESULT GetChannelProperties(
  177. [out] ALG_SECONDARY_CHANNEL_PROPERTIES ** ppProperties
  178. );
  179. HRESULT GetOriginalDestinationInformation(
  180. [in] ULONG ulSourceAddress,
  181. [in] USHORT usSourcePort,
  182. [out] ULONG* pulOriginalDestinationAddress,
  183. [out] USHORT* pusOriginalDestinationPort,
  184. [out] IAdapterInfo** ppReceiveAdapter
  185. );
  186. };
  187. [
  188. object,
  189. uuid(A23F9D11-714C-41FE-8471-FFB19BC28454),
  190. pointer_default(unique)
  191. ]
  192. interface IEnumAdapterInfo : IUnknown
  193. {
  194. HRESULT Next(
  195. [in] ULONG celt,
  196. [out, size_is(celt), length_is(*pCeltFetched)] IAdapterInfo ** rgAI,
  197. [out] ULONG * pCeltFetched
  198. );
  199. HRESULT Skip(
  200. [in] ULONG celt
  201. );
  202. HRESULT Reset(
  203. );
  204. HRESULT Clone(
  205. [out] IEnumAdapterInfo ** ppEnum
  206. );
  207. }
  208. //
  209. // Implemented by ISV in there ALG proxy's
  210. //
  211. [
  212. object,
  213. uuid(44AB2DC3-23B2-47DE-8228-2E1CCEEB9911),
  214. helpstring("IAdapterNotificationSink Interface"),
  215. pointer_default(unique)
  216. ]
  217. interface IAdapterNotificationSink : IUnknown
  218. {
  219. HRESULT AdapterAdded(
  220. IAdapterInfo * pAdapter
  221. );
  222. HRESULT AdapterRemoved(
  223. IAdapterInfo* pAdapter
  224. );
  225. HRESULT AdapterModified(
  226. IAdapterInfo* pAdapter
  227. );
  228. };
  229. //
  230. // ALG main public interface
  231. //
  232. [
  233. object,
  234. uuid(5134842A-FDCE-485D-93CD-DE1640643BBE),
  235. pointer_default(unique)
  236. ]
  237. interface IApplicationGatewayServices : IUnknown
  238. {
  239. HRESULT CreatePrimaryControlChannel(
  240. [in] ALG_PROTOCOL eProtocol,
  241. [in] USHORT usPortToCapture,
  242. [in] ALG_CAPTURE eCaptureType,
  243. [in] BOOL fCaptureInbound,
  244. [in] ULONG ulListenAddress,
  245. [in] USHORT usListenPort,
  246. [out] IPrimaryControlChannel** ppIControlChannel
  247. );
  248. HRESULT CreateSecondaryControlChannel(
  249. [in] ALG_PROTOCOL eProtocol,
  250. [in] ULONG ulPrivateAddress,
  251. [in] USHORT usPrivatePort,
  252. [in] ULONG ulPublicAddress,
  253. [in] USHORT usPublicPort,
  254. [in] ULONG ulRemoteAddress,
  255. [in] USHORT usRemotePort,
  256. [in] ULONG ulListenAddress,
  257. [in] USHORT usListenPort,
  258. [in] ALG_DIRECTION eDirection,
  259. [in] BOOL fPersistent,
  260. [out] ISecondaryControlChannel** ppControlChannel
  261. );
  262. HRESULT GetBestSourceAddressForDestinationAddress(
  263. [in] ULONG ulDstAddress,
  264. [in] BOOL fDemandDial,
  265. [out] ULONG* pulBestSrcAddress
  266. );
  267. HRESULT PrepareProxyConnection(
  268. [in] ALG_PROTOCOL eProtocol,
  269. [in] ULONG ulSrcAddress,
  270. [in] USHORT usSrcPort,
  271. [in] ULONG ulDstAddress,
  272. [in] USHORT usDstPort,
  273. [in] BOOL fNoTimeout,
  274. [out] IPendingProxyConnection** ppPendingConnection
  275. );
  276. HRESULT PrepareSourceModifiedProxyConnection(
  277. [in] ALG_PROTOCOL eProtocol,
  278. [in] ULONG ulSrcAddress,
  279. [in] USHORT usSrcPort,
  280. [in] ULONG ulDstAddress,
  281. [in] USHORT usDstPort,
  282. [in] ULONG ulNewSrcAddress,
  283. [in] USHORT usNewSourcePort,
  284. [out] IPendingProxyConnection** ppPendingConnection
  285. );
  286. HRESULT CreateDataChannel(
  287. [in] ALG_PROTOCOL eProtocol,
  288. [in] ULONG ulPrivateAddress,
  289. [in] USHORT usPrivatePort,
  290. [in] ULONG ulPublicAddress,
  291. [in] USHORT usPublicPort,
  292. [in] ULONG ulRemoteAddress,
  293. [in] USHORT usRemotePort,
  294. [in] ALG_DIRECTION eDirection,
  295. [in] ALG_NOTIFICATION eDesiredNotification,
  296. [in] BOOL fNoTimeout,
  297. [out] IDataChannel** ppDataChannel
  298. );
  299. HRESULT CreatePersistentDataChannel(
  300. [in] ALG_PROTOCOL eProtocol,
  301. [in] ULONG ulPrivateAddress,
  302. [in] USHORT usPrivatePort,
  303. [in] ULONG ulPublicAddress,
  304. [in] USHORT usPublicPort,
  305. [in] ULONG ulRemoteAddress,
  306. [in] USHORT usRemotePort,
  307. [in] ALG_DIRECTION eDirection,
  308. [out] IPersistentDataChannel** ppIPersistentDataChannel
  309. );
  310. HRESULT ReservePort(
  311. [in] USHORT usPortCount,
  312. [out] USHORT* pusReservedPort
  313. );
  314. HRESULT ReleaseReservedPort(
  315. [in] USHORT usReservedPortBase,
  316. [in] USHORT usPortCount
  317. );
  318. HRESULT EnumerateAdapters(
  319. [out] IEnumAdapterInfo ** ppIEnumAdapterInfo
  320. );
  321. HRESULT StartAdapterNotifications(
  322. [in] IAdapterNotificationSink* pSink,
  323. [in] DWORD* pdwCookie
  324. );
  325. HRESULT StopAdapterNotifications(
  326. [in] DWORD dwCookieOfSink
  327. );
  328. };
  329. //
  330. // Implemented by the ISV ALG's
  331. //
  332. [
  333. object,
  334. uuid(5134842B-FDCE-485D-93CD-DE1640643BBE),
  335. pointer_default(unique)
  336. ]
  337. interface IApplicationGateway : IUnknown
  338. {
  339. HRESULT Initialize(
  340. [in] IApplicationGatewayServices* pAlgServices
  341. );
  342. HRESULT Stop(void);
  343. };
  344. //
  345. //
  346. // Must be implemented by the ALG Manager
  347. //
  348. [
  349. uuid(B6D1D098-E235-4B99-BA98-7C624FD875DB),
  350. version(1.0),
  351. helpstring("MyICS 1.0 Type Library")
  352. ]
  353. library ALGLib
  354. {
  355. importlib("stdole32.tlb");
  356. importlib("stdole2.tlb");
  357. [
  358. uuid(F8ADE1D3-49DF-4B75-9005-EF9508E6A337),
  359. helpstring("ApplicationGatewayServices Class")
  360. ]
  361. coclass ApplicationGatewayServices
  362. {
  363. [default] interface IApplicationGatewayServices;
  364. };
  365. [
  366. uuid(3CEB5509-C1CD-432F-9D8F-65D1E286AA80),
  367. helpstring("PrimaryControlChannel Class")
  368. ]
  369. coclass PrimaryControlChannel
  370. {
  371. [default] interface IPrimaryControlChannel;
  372. };
  373. [
  374. uuid(7B3181A0-C92F-4567-B0FA-CD9A10ECD7D1),
  375. helpstring("SecondaryControlChannel Class")
  376. ]
  377. coclass SecondaryControlChannel
  378. {
  379. [default] interface ISecondaryControlChannel;
  380. };
  381. [
  382. uuid(6F9942C9-C1B1-4AB5-93DA-6058991DC8F3),
  383. helpstring("AdapterInfo Class")
  384. ]
  385. coclass AdapterInfo
  386. {
  387. [default] interface IAdapterInfo;
  388. };
  389. [
  390. uuid(6F9942CA-C1B1-4AB5-93DA-6058991DC8F3),
  391. helpstring("EnumAdapterInfo Class")
  392. ]
  393. coclass EnumAdapterInfo
  394. {
  395. [default] interface IEnumAdapterInfo;
  396. };
  397. [
  398. uuid(D8A68E5E-2B37-426C-A329-C117C14C429E),
  399. helpstring("PendingProxyConnection Class")
  400. ]
  401. coclass PendingProxyConnection
  402. {
  403. [default] interface IPendingProxyConnection;
  404. };
  405. [
  406. uuid(BBB36F15-408D-4056-8C27-920843D40BE5),
  407. helpstring("DataChannel Class")
  408. ]
  409. coclass DataChannel
  410. {
  411. [default] interface IDataChannel;
  412. };
  413. [
  414. uuid(BC9B54AB-7883-4C13-909F-033D03267990),
  415. helpstring("PersistentDataChannel Class")
  416. ]
  417. coclass PersistentDataChannel
  418. {
  419. [default] interface IPersistentDataChannel;
  420. };
  421. };