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.

51 lines
1.4 KiB

  1. #pragma once
  2. #include "InternetGatewayDevice.h"
  3. #include "dispimpl2.h"
  4. #include "resource.h" // main symbols
  5. #include "upnphost.h"
  6. #include "hnetcfg.h"
  7. class ATL_NO_VTABLE CNATInfoService :
  8. public CComObjectRootEx<CComMultiThreadModel>,
  9. public IDelegatingDispImpl<INATInfoService>,
  10. public IUPnPEventSource
  11. {
  12. public:
  13. DECLARE_REGISTRY_RESOURCEID(IDR_SAMPLE_DEVICE)
  14. DECLARE_PROTECT_FINAL_CONSTRUCT()
  15. BEGIN_COM_MAP(CNATInfoService)
  16. COM_INTERFACE_ENTRY(INATInfoService)
  17. COM_INTERFACE_ENTRY(IDispatch)
  18. COM_INTERFACE_ENTRY(IUPnPEventSource)
  19. END_COM_MAP()
  20. CNATInfoService();
  21. // IUPnPEventSource methods
  22. STDMETHODIMP Advise(IUPnPEventSink* pesSubscriber);
  23. STDMETHODIMP Unadvise(IUPnPEventSink* pesSubscriber);
  24. // INATInfoService
  25. STDMETHODIMP get_IPList(BSTR* pIPList);
  26. STDMETHODIMP get_PublicIP(BSTR* pPublicIP);
  27. STDMETHODIMP get_Port(ULONG* pulPort);
  28. STDMETHODIMP get_Protocol(BSTR* pProtocol);
  29. STDMETHODIMP get_PrivateIP(BSTR* pPrivateIP);
  30. STDMETHODIMP GetPublicIPList(BSTR* pIPList);
  31. STDMETHODIMP GetPortMappingPrivateIP(BSTR PublicIP, ULONG ulPort, BSTR Protocol, BSTR* pPrivateIP);
  32. STDMETHODIMP GetPortMappingPublicIP(BSTR PrivateIP, ULONG ulPort, BSTR Protocol, BSTR* pPublicIP);
  33. HRESULT FinalConstruct();
  34. HRESULT FinalRelease();
  35. HRESULT Initialize(IHNetConnection* pHNetConnection);
  36. private:
  37. IUPnPEventSink* m_pEventSink;
  38. IHNetConnection* m_pHNetConnection;
  39. };