[Windows] Remove redundant DirectSound error codes
[xbmc.git] / xbmc / platform / android / network / NetworkAndroid.h
blob5886f8080f230a306440aace56f69c7d13e99515
1 /*
2 * Copyright (C) 2016 Christian Browet
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 "platform/android/activity/JNIXBMCConnectivityManagerNetworkCallback.h"
16 #include <androidjni/LinkProperties.h>
17 #include <androidjni/Network.h>
18 #include <androidjni/NetworkInterface.h>
20 class CNetworkInterfaceAndroid : public CNetworkInterface
22 public:
23 CNetworkInterfaceAndroid(const CJNINetwork& network,
24 const CJNILinkProperties& lp,
25 const CJNINetworkInterface& intf);
26 std::vector<std::string> GetNameServers();
28 // CNetworkInterface interface
29 public:
30 bool IsEnabled() const override;
31 bool IsConnected() const override;
32 std::string GetMacAddress() const override;
33 void GetMacAddressRaw(char rawMac[6]) const override;
34 bool GetHostMacAddress(unsigned long host_ip, std::string& mac) const override;
35 std::string GetCurrentIPAddress() const override;
36 std::string GetCurrentNetmask() const override;
37 std::string GetCurrentDefaultGateway() const override;
39 std::string GetHostName();
41 protected:
42 std::string m_name;
43 CJNINetwork m_network;
44 CJNILinkProperties m_lp;
45 CJNINetworkInterface m_intf;
48 class CNetworkAndroid : public CNetworkBase, public jni::CJNIXBMCConnectivityManagerNetworkCallback
51 public:
52 CNetworkAndroid();
53 ~CNetworkAndroid() override;
55 // CNetwork interface
56 public:
57 bool GetHostName(std::string& hostname) override;
58 std::vector<CNetworkInterface*>& GetInterfaceList() override;
59 CNetworkInterface* GetFirstConnectedInterface() override;
60 std::vector<std::string> GetNameServers() override;
62 // Ping remote host
63 using CNetworkBase::PingHost;
64 bool PingHost(unsigned long remote_ip, unsigned int timeout_ms = 2000) override;
66 protected:
67 void RetrieveInterfaces();
68 std::vector<CNetworkInterface*> m_interfaces;
69 std::vector<CNetworkInterface*> m_oldInterfaces;
70 CCriticalSection m_refreshMutex;
72 std::unique_ptr<CNetworkInterface> m_defaultInterface;
74 public:
75 void onAvailable(const CJNINetwork network) override;
76 void onLost(const CJNINetwork network) override;