Leaked source code of windows server 2003
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.

292 lines
9.8 KiB

  1. // NATUPnP.idl : IDL source for NATUPnP.dll
  2. //
  3. // This file will be processed by the MIDL tool to
  4. // produce the type library (NATUPnP.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: natupnp.h")
  12. cpp_quote("//")
  13. import "oaidl.idl";
  14. import "ocidl.idl";
  15. interface IUPnPNAT;
  16. interface IDynamicPortMappingCollection;
  17. interface IDynamicPortMapping;
  18. interface IStaticPortMappingCollection;
  19. interface IStaticPortMapping;
  20. interface INATEventManager;
  21. //+---------------------------------------------------------------------------
  22. // IUPnPNAT - top-level client-side object to manage NAT traversal via UPnP
  23. //
  24. [
  25. object,
  26. uuid(B171C812-CC76-485A-94D8-B6B3A2794E99),
  27. dual,
  28. helpstring("IUPnPNAT Interface"),
  29. pointer_default(unique)
  30. ]
  31. interface IUPnPNAT : IDispatch
  32. {
  33. [propget, id(1), helpstring("property StaticPortMappingCollection")]
  34. HRESULT StaticPortMappingCollection ([out, retval] IStaticPortMappingCollection ** ppSPMs);
  35. [propget, id(2), helpstring("property DynamicPortMappingCollection")]
  36. HRESULT DynamicPortMappingCollection ([out, retval] IDynamicPortMappingCollection ** ppDPMs);
  37. [propget, id(3), helpstring("property NATEventManager")]
  38. HRESULT NATEventManager ([out, retval] INATEventManager ** ppNEM);
  39. };
  40. //+---------------------------------------------------------------------------
  41. // INATEventManager
  42. //
  43. [
  44. object,
  45. uuid(624BD588-9060-4109-B0B0-1ADBBCAC32DF),
  46. dual,
  47. helpstring("INATEventManager Interface"),
  48. pointer_default(unique)
  49. ]
  50. interface INATEventManager : IDispatch
  51. {
  52. [id(1), propput, helpstring("property External IP Address Callback")]
  53. HRESULT ExternalIPAddressCallback ([in] IUnknown * pUnk);
  54. [id(2), propput, helpstring("property Number Of Entries Callback")]
  55. HRESULT NumberOfEntriesCallback ([in] IUnknown * pUnk);
  56. };
  57. [
  58. object,
  59. uuid(9C416740-A34E-446F-BA06-ABD04C3149AE),
  60. helpstring("INATExternalIPAddressCallback Interface"),
  61. pointer_default(unique)
  62. ]
  63. interface INATExternalIPAddressCallback : IUnknown
  64. {
  65. [id(0), helpstring("NewExternalIPAddress")]
  66. HRESULT NewExternalIPAddress ([in] BSTR bstrNewExternalIPAddress);
  67. };
  68. [
  69. object,
  70. uuid(C83A0A74-91EE-41B6-B67A-67E0F00BBD78),
  71. helpstring("INATNumberOfEntriesCallback Interface"),
  72. pointer_default(unique)
  73. ]
  74. interface INATNumberOfEntriesCallback : IUnknown
  75. {
  76. [id(0), helpstring("NewNumberOfEntries")]
  77. HRESULT NewNumberOfEntries ([in] long lNewNumberOfEntries);
  78. };
  79. //+---------------------------------------------------------------------------
  80. // IDynamicPortMappingCollection -
  81. //
  82. [
  83. object,
  84. uuid(B60DE00F-156E-4E8D-9EC1-3A2342C10899),
  85. dual,
  86. helpstring("IDynamicPortMappingCollection Interface"),
  87. pointer_default(unique)
  88. ]
  89. interface IDynamicPortMappingCollection : IDispatch
  90. {
  91. [propget, id(DISPID_NEWENUM), helpstring("property _NewEnum"), hidden, restricted]
  92. HRESULT _NewEnum([out, retval] IUnknown* *pVal);
  93. [propget, id(DISPID_VALUE), helpstring("property Item")]
  94. HRESULT Item(
  95. [in] BSTR bstrRemoteHost,
  96. [in] long lExternalPort,
  97. [in] BSTR bstrProtocol,
  98. [out, retval] IDynamicPortMapping ** ppDPM);
  99. [propget, id(1), helpstring("property Count")]
  100. HRESULT Count([out, retval] long *pVal);
  101. [id(2), helpstring("method Remove")]
  102. HRESULT Remove(
  103. [in] BSTR bstrRemoteHost,
  104. [in] long lExternalPort,
  105. [in] BSTR bstrProtocol);
  106. [id(3), helpstring("method Add")]
  107. HRESULT Add(
  108. [in] BSTR bstrRemoteHost,
  109. [in] long lExternalPort,
  110. [in] BSTR bstrProtocol,
  111. [in] long lInternalPort,
  112. [in] BSTR bstrInternalClient,
  113. [in] VARIANT_BOOL bEnabled,
  114. [in] BSTR bstrDescription,
  115. [in] long lLeaseDuration,
  116. [out, retval] IDynamicPortMapping ** ppDPM);
  117. };
  118. [
  119. object,
  120. uuid(4FC80282-23B6-4378-9A27-CD8F17C9400C),
  121. dual,
  122. helpstring("IDynamicPortMapping Interface"),
  123. pointer_default(unique)
  124. ]
  125. interface IDynamicPortMapping : IDispatch
  126. {
  127. [propget, id(1), helpstring("property External IP Address")]
  128. HRESULT ExternalIPAddress ([out, retval] BSTR *pVal);
  129. [propget, id(2), helpstring("property Remote Host")]
  130. HRESULT RemoteHost ([out, retval] BSTR *pVal);
  131. [propget, id(3), helpstring("property External Port")]
  132. HRESULT ExternalPort([out, retval] long *pVal);
  133. [propget, id(4), helpstring("property Protocol")]
  134. HRESULT Protocol([out, retval] BSTR *pVal);
  135. [propget, id(5), helpstring("property Internal Port")]
  136. HRESULT InternalPort([out, retval] long *pVal);
  137. [propget, id(6), helpstring("property Internal Client")]
  138. HRESULT InternalClient([out, retval] BSTR *pVal);
  139. [propget, id(7), helpstring("property Enabled")]
  140. HRESULT Enabled([out, retval] VARIANT_BOOL *pVal);
  141. [propget, id(8), helpstring("property Description")]
  142. HRESULT Description([out, retval] BSTR *pVal);
  143. [propget, id(9), helpstring("property Lease Duration")]
  144. HRESULT LeaseDuration([out, retval] long *pVal);
  145. [id(10), helpstring("method Renew Lease (in seconds)")]
  146. HRESULT RenewLease([in] long lLeaseDurationDesired,
  147. [out, retval] long * pLeaseDurationReturned);
  148. [id(11), helpstring("method to Edit Internal Client")]
  149. HRESULT EditInternalClient ([in] BSTR bstrInternalClient);
  150. [id(12), helpstring("method to Enable/disable Port Mapping")]
  151. HRESULT Enable ([in] VARIANT_BOOL vb);
  152. [id(13), helpstring("method to Edit Description")]
  153. HRESULT EditDescription ([in] BSTR bstrDescription);
  154. [id(14), helpstring("method to Edit Internal Port")]
  155. HRESULT EditInternalPort ([in] long lInternalPort);
  156. };
  157. //+---------------------------------------------------------------------------
  158. // IStaticPortMappingCollection - collection of static port mappings
  159. //
  160. [
  161. object,
  162. uuid(CD1F3E77-66D6-4664-82C7-36DBB641D0F1),
  163. dual,
  164. helpstring("IStaticPortMappingCollection Interface"),
  165. pointer_default(unique)
  166. ]
  167. interface IStaticPortMappingCollection : IDispatch
  168. {
  169. [propget, id(DISPID_NEWENUM), helpstring("property _NewEnum"), hidden, restricted]
  170. HRESULT _NewEnum([out, retval] IUnknown* *pVal);
  171. [propget, id(DISPID_VALUE), helpstring("property Item")]
  172. HRESULT Item(
  173. [in] long lExternalPort,
  174. [in] BSTR bstrProtocol,
  175. [out, retval] IStaticPortMapping ** ppSPM);
  176. [propget, id(1), helpstring("property Count")]
  177. HRESULT Count([out, retval] long *pVal);
  178. [id(2), helpstring("method Remove")]
  179. HRESULT Remove(
  180. [in] long lExternalPort,
  181. [in] BSTR bstrProtocol);
  182. [id(3), helpstring("method Add")]
  183. HRESULT Add(
  184. [in] long lExternalPort,
  185. [in] BSTR bstrProtocol,
  186. [in] long lInternalPort,
  187. [in] BSTR bstrInternalClient,
  188. [in] VARIANT_BOOL bEnabled,
  189. [in] BSTR bstrDescription,
  190. [out, retval] IStaticPortMapping ** ppSPM);
  191. };
  192. [
  193. object,
  194. uuid(6F10711F-729B-41E5-93B8-F21D0F818DF1),
  195. dual,
  196. helpstring("IStaticPortMapping Interface"),
  197. pointer_default(unique)
  198. ]
  199. interface IStaticPortMapping : IDispatch
  200. {
  201. [propget, id(1), helpstring("property External IP Address")]
  202. HRESULT ExternalIPAddress ([out, retval] BSTR *pVal);
  203. [propget, id(2), helpstring("property External Port")]
  204. HRESULT ExternalPort([out, retval] long *pVal);
  205. [propget, id(3), helpstring("property Internal Port")]
  206. HRESULT InternalPort([out, retval] long *pVal);
  207. [propget, id(4), helpstring("property Protocol")]
  208. HRESULT Protocol([out, retval] BSTR *pVal);
  209. [propget, id(5), helpstring("property Internal Client")]
  210. HRESULT InternalClient([out, retval] BSTR *pVal);
  211. [propget, id(6), helpstring("property Enabled")]
  212. HRESULT Enabled([out, retval] VARIANT_BOOL *pVal);
  213. [propget, id(7), helpstring("property Description")]
  214. HRESULT Description([out, retval] BSTR *pVal);
  215. [id(8), helpstring("method to Edit Internal Client")]
  216. HRESULT EditInternalClient ([in] BSTR bstrInternalClient);
  217. [id(9), helpstring("method to Enable/disable Port Mapping")]
  218. HRESULT Enable ([in] VARIANT_BOOL vb);
  219. [id(10), helpstring("method to Edit Description")]
  220. HRESULT EditDescription ([in] BSTR bstrDescription);
  221. [id(11), helpstring("method to Edit Internal Port")]
  222. HRESULT EditInternalPort ([in] long lInternalPort);
  223. };
  224. [
  225. uuid(1C565858-F302-471E-B409-F180AA4ABEC6),
  226. version(1.0),
  227. helpstring("NATUPnP 1.0 Type Library")
  228. ]
  229. library NATUPNPLib
  230. {
  231. importlib("stdole32.tlb");
  232. importlib("stdole2.tlb");
  233. [
  234. uuid(AE1E00AA-3FD5-403C-8A27-2BBDC30CD0E1),
  235. helpstring("UPnPNAT Class")
  236. ]
  237. coclass UPnPNAT
  238. {
  239. [default] interface IUPnPNAT;
  240. };
  241. };