Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios/networking] - Implemented Darwin_embedded specific network imple…
…menation Removes darwin_embedded network implementation from standard posix network implementation Handles all CNetworkBase overloads specific to darwin_embedded platforms. As of ios11, it is not possible to retrieve interface MAC addresses, or to retrieve info from the devices ARP table. WOL/WakeOnAccess features are not possible without these. MAC address access was actually deprecated in ios7.
- Loading branch information
Showing
10 changed files
with
744 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set(SOURCES NetworkIOS.mm) | ||
|
||
set(HEADERS NetworkIOS.h | ||
route.h) | ||
|
||
core_add_library(platform_ios_network) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (C) 2005-2018 Team Kodi | ||
* This file is part of Kodi - https://kodi.tv | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-or-later | ||
* See LICENSES/README.md for more information. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "network/Network.h" | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
class CNetworkIOS; | ||
|
||
class CNetworkInterfaceIOS : public CNetworkInterface | ||
{ | ||
public: | ||
CNetworkInterfaceIOS(CNetworkIOS* network, std::string interfaceName); | ||
~CNetworkInterfaceIOS() override; | ||
|
||
bool IsEnabled() const override; | ||
bool IsConnected() const override; | ||
|
||
std::string GetMacAddress() const override; | ||
void GetMacAddressRaw(char rawMac[6]) const override; | ||
|
||
bool GetHostMacAddress(unsigned long host, std::string& mac) const override; | ||
|
||
std::string GetCurrentIPAddress() const override; | ||
std::string GetCurrentNetmask() const override; | ||
std::string GetCurrentDefaultGateway() const override; | ||
|
||
std::string GetInterfaceName() const; | ||
|
||
private: | ||
std::string m_interfaceName; | ||
CNetworkIOS* m_network; | ||
}; | ||
|
||
class CNetworkIOS : public CNetworkBase | ||
{ | ||
public: | ||
CNetworkIOS(); | ||
~CNetworkIOS() override; | ||
|
||
// Return the list of interfaces | ||
std::vector<CNetworkInterface*>& GetInterfaceList() override; | ||
CNetworkInterface* GetFirstConnectedInterface() override; | ||
|
||
// Ping remote host | ||
bool PingHost(unsigned long host, unsigned int timeout_ms = 2000) override; | ||
|
||
// Get/set the nameserver(s) | ||
std::vector<std::string> GetNameServers() override; | ||
|
||
friend class CNetworkInterfaceIOS; | ||
|
||
private: | ||
int GetSocket() { return m_sock; } | ||
void queryInterfaceList(); | ||
std::vector<CNetworkInterfaceIOS*> m_interfaces; | ||
int m_sock; | ||
}; | ||
|
||
using CNetwork = CNetworkIOS; |
Oops, something went wrong.