12#include "c-api/network.h"
39inline bool ATTR_DLL_LOCAL
WakeOnLan(
const std::string& mac)
41 using namespace ::kodi::addon;
43 return CPrivateBase::m_interface->toKodi->kodi_network->wake_on_lan(
44 CPrivateBase::m_interface->toKodi->kodiBase, mac.c_str());
68 using namespace ::kodi::addon;
71 char*
string = CPrivateBase::m_interface->toKodi->kodi_network->get_ip_address(
72 CPrivateBase::m_interface->toKodi->kodiBase);
73 if (
string !=
nullptr)
76 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
103 using namespace ::kodi::addon;
106 char*
string = CPrivateBase::m_interface->toKodi->kodi_network->get_hostname(
107 CPrivateBase::m_interface->toKodi->kodiBase);
108 if (
string !=
nullptr)
111 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
139 using namespace ::kodi::addon;
142 char*
string = CPrivateBase::m_interface->toKodi->kodi_network->get_user_agent(
143 CPrivateBase::m_interface->toKodi->kodiBase);
144 if (
string !=
nullptr)
147 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
173inline bool ATTR_DLL_LOCAL
IsLocalHost(
const std::string& hostname)
175 using namespace ::kodi::addon;
177 return CPrivateBase::m_interface->toKodi->kodi_network->is_local_host(
178 CPrivateBase::m_interface->toKodi->kodiBase, hostname.c_str());
190inline bool ATTR_DLL_LOCAL
IsHostOnLAN(
const std::string& hostname,
bool offLineCheck =
false)
192 using namespace kodi::addon;
194 return CPrivateBase::m_interface->toKodi->kodi_network->is_host_on_lan(
195 CPrivateBase::m_interface->toKodi->kodiBase, hostname.c_str(), offLineCheck);
224inline std::string ATTR_DLL_LOCAL
URLEncode(
const std::string& url)
226 using namespace ::kodi::addon;
228 std::string retString;
229 char*
string = CPrivateBase::m_interface->toKodi->kodi_network->url_encode(
230 CPrivateBase::m_interface->toKodi->kodiBase, url.c_str());
231 if (
string !=
nullptr)
234 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
267inline bool ATTR_DLL_LOCAL
DNSLookup(
const std::string& hostName, std::string& ipAddress)
269 using namespace ::kodi::addon;
272 char*
string = CPrivateBase::m_interface->toKodi->kodi_network->dns_lookup(
273 CPrivateBase::m_interface->toKodi->kodiBase, hostName.c_str(), &ret);
274 if (
string !=
nullptr)
277 CPrivateBase::m_interface->toKodi->free_string(CPrivateBase::m_interface->toKodi->kodiBase,
std::string ATTR_DLL_LOCAL URLEncode(const std::string &url)
URL encodes the given string.
Definition Network.h:224
std::string ATTR_DLL_LOCAL GetIPAddress()
To the current own ip address as a string.
Definition Network.h:66
bool ATTR_DLL_LOCAL WakeOnLan(const std::string &mac)
Send WakeOnLan magic packet.
Definition Network.h:39
bool ATTR_DLL_LOCAL IsLocalHost(const std::string &hostname)
Check given name or ip address corresponds to localhost.
Definition Network.h:173
bool ATTR_DLL_LOCAL IsHostOnLAN(const std::string &hostname, bool offLineCheck=false)
Checks whether the specified path refers to a local network.
Definition Network.h:190
std::string ATTR_DLL_LOCAL GetHostname()
Return our hostname.
Definition Network.h:101
bool ATTR_DLL_LOCAL DNSLookup(const std::string &hostName, std::string &ipAddress)
Lookup URL in DNS cache.
Definition Network.h:267
std::string ATTR_DLL_LOCAL GetUserAgent()
Returns Kodi's HTTP UserAgent string.
Definition Network.h:137