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.

87 lines
1.8 KiB

  1. // Copyright (c) 2001 Microsoft Corporation
  2. //
  3. // File: NetworkAdapterConfig.h
  4. //
  5. // Synopsis: Declares a NetworkAdapterConfig
  6. // This object has the knowledge for installing
  7. // using WMI to retrieve network adapter information
  8. //
  9. // History: 02/16/2001 JeffJon Created
  10. #ifndef __CYS_NETWORKADAPTERCONFIG_H
  11. #define __CYS_NETWORKADAPTERCONFIG_H
  12. #include "NetworkInterface.h"
  13. class NetworkAdapterConfig
  14. {
  15. public:
  16. // Constructor
  17. NetworkAdapterConfig();
  18. // Destructor
  19. ~NetworkAdapterConfig();
  20. // Initializer
  21. HRESULT
  22. Initialize();
  23. // Pulic methods
  24. unsigned int
  25. GetNICCount() const;
  26. NetworkInterface*
  27. GetNIC(unsigned int nicIndex);
  28. NetworkInterface*
  29. GetNICFromName(
  30. const String& name,
  31. bool& found);
  32. bool
  33. IsInitialized() const { return initialized; }
  34. void
  35. SetLocalNIC(
  36. const NetworkInterface& nic,
  37. bool setInRegistry = false);
  38. void
  39. SetLocalNIC(
  40. String guid,
  41. bool setInRegistry = false);
  42. NetworkInterface*
  43. GetLocalNIC();
  44. unsigned int
  45. FindNIC(const String& guid, bool& found) const;
  46. protected:
  47. void
  48. AddInterface(NetworkInterface* newInterface);
  49. private:
  50. void
  51. SetLocalNICInRegistry(const NetworkInterface& nic);
  52. bool initialized;
  53. unsigned int nicCount;
  54. int localNICIndex;
  55. typedef
  56. std::vector<
  57. NetworkInterface*,
  58. Burnslib::Heap::Allocator<NetworkInterface*> >
  59. NetworkInterfaceContainer;
  60. NetworkInterfaceContainer networkInterfaceContainer;
  61. };
  62. #endif // __CYS_NETWORKADAPTERCONFIG_H