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.

67 lines
1.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000.
  5. //
  6. // File: I N T E R F A C E L I S T . H
  7. //
  8. // Contents: Common code to manage the list of network interfaces
  9. //
  10. // Notes:
  11. //
  12. // Author: mbend 29 Dec 2000
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "upsync.h"
  17. #include "ulist.h"
  18. #include "InterfaceManager.h"
  19. class CUPnPInterfaceChange
  20. {
  21. public:
  22. virtual void OnInterfaceChange(const InterfaceMappingList & interfaceMappingList) = 0;
  23. };
  24. class CUPnPInterfaceList
  25. {
  26. public:
  27. ~CUPnPInterfaceList();
  28. static CUPnPInterfaceList & Instance();
  29. HRESULT HrInitialize();
  30. HRESULT HrShutdown();
  31. BOOL FShouldSendOnInterface(DWORD dwIpAddr);
  32. BOOL FShouldSendOnIndex(DWORD dwIndex);
  33. HRESULT HrSetGlobalEnable();
  34. HRESULT HrClearGlobalEnable();
  35. HRESULT HrSetICSInterfaces(long nCount, GUID * arInterfaceGuidsToAllow);
  36. HRESULT HrSetICSOff();
  37. HRESULT HrRegisterInterfaceChange(CUPnPInterfaceChange * pInterfaceChange);
  38. private:
  39. CUPnPInterfaceList();
  40. CUPnPInterfaceList(const CUPnPInterfaceList &);
  41. CUPnPInterfaceList & operator=(const CUPnPInterfaceList &);
  42. typedef CUArray<CUPnPInterfaceChange*> InterfaceChangeList;
  43. static CUPnPInterfaceList s_instance;
  44. static void CALLBACK InterfaceChangeCallback(void *, BOOLEAN);
  45. HRESULT HrBuildIPAddressList();
  46. CUCriticalSection m_critSec;
  47. IpAddressList m_ipAddressList;
  48. IndexList m_indexList;
  49. InterfaceList m_interfaceList;
  50. InterfaceChangeList m_interfaceChangeList;
  51. BOOL m_bGlobalEnable;
  52. BOOL m_bICSEnabled;
  53. HANDLE m_hInterfaceChangeWait;
  54. OVERLAPPED m_olInterfaceChangeEvent;
  55. };