[video] Fix the refresh of movies with additional versions or extras
[xbmc.git] / xbmc / platform / win10 / network / NetworkWin10.h
blob3c191ed4962fc7360c80ebe0aa65e11d8cfb0db7
1 /*
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.
7 */
9 #pragma once
11 #include "network/Network.h"
12 #include "threads/CriticalSection.h"
14 #include <string>
15 #include <vector>
17 #include <IPTypes.h>
18 #include <winrt/Windows.Networking.Connectivity.h>
20 class CNetworkWin10;
22 class CNetworkInterfaceWin10 : public CNetworkInterface
24 public:
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;
40 private:
41 PIP_ADAPTER_ADDRESSES m_adapterAddr;
45 class CNetworkWin10 : public CNetworkBase
47 public:
48 CNetworkWin10();
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;
59 private:
60 int GetSocket() { return m_sock; }
61 void queryInterfaceList();
62 void CleanInterfaceList();
64 std::vector<CNetworkInterface*> m_interfaces;
65 int m_sock;
66 CCriticalSection m_critSection;
67 std::vector<uint8_t> m_adapterAddresses;