2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "network/Network.h"
12 #include "threads/CriticalSection.h"
18 #include <winrt/Windows.Networking.Connectivity.h>
22 class CNetworkInterfaceWin10
: public CNetworkInterface
25 CNetworkInterfaceWin10(const PIP_ADAPTER_ADDRESSES adapter
);
26 ~CNetworkInterfaceWin10(void);
28 virtual bool IsEnabled(void) const;
29 virtual bool IsConnected(void) const;
31 virtual std::string
GetMacAddress(void) const;
32 virtual void GetMacAddressRaw(char rawMac
[6]) const;
34 virtual bool GetHostMacAddress(unsigned long host
, std::string
& mac
) const;
36 virtual std::string
GetCurrentIPAddress() const;
37 virtual std::string
GetCurrentNetmask() const;
38 virtual std::string
GetCurrentDefaultGateway(void) const;
41 PIP_ADAPTER_ADDRESSES m_adapterAddr
;
45 class CNetworkWin10
: public CNetworkBase
49 virtual ~CNetworkWin10(void);
51 std::vector
<CNetworkInterface
*>& GetInterfaceList(void) override
;
52 CNetworkInterface
* GetFirstConnectedInterface() override
;
53 std::vector
<std::string
> GetNameServers(void) override
;
55 bool PingHost(unsigned long host
, unsigned int timeout_ms
= 2000) override
;
57 friend class CNetworkInterfaceWin10
;
60 int GetSocket() { return m_sock
; }
61 void queryInterfaceList();
62 void CleanInterfaceList();
64 std::vector
<CNetworkInterface
*> m_interfaces
;
66 CCriticalSection m_critSection
;
67 std::vector
<uint8_t> m_adapterAddresses
;