![]() |
Kodi Docs 20.0
Kodi is an open source media player and entertainment hub.
|
Network functions
The network module offers functions that allow you to control it.
More...
Functions | |
bool ATTR_DLL_LOCAL | kodi::network::WakeOnLan (const std::string &mac) |
Send WakeOnLan magic packet. More... | |
std::string ATTR_DLL_LOCAL | kodi::network::GetIPAddress () |
To the current own ip address as a string. More... | |
std::string ATTR_DLL_LOCAL | kodi::network::GetHostname () |
Return our hostname. More... | |
std::string ATTR_DLL_LOCAL | kodi::network::GetUserAgent () |
Returns Kodi's HTTP UserAgent string. More... | |
bool ATTR_DLL_LOCAL | kodi::network::IsLocalHost (const std::string &hostname) |
Check given name or ip address corresponds to localhost. More... | |
bool ATTR_DLL_LOCAL | kodi::network::IsHostOnLAN (const std::string &hostname, bool offLineCheck=false) |
Checks whether the specified path refers to a local network. More... | |
std::string ATTR_DLL_LOCAL | kodi::network::URLEncode (const std::string &url) |
URL encodes the given string. More... | |
bool ATTR_DLL_LOCAL | kodi::network::DNSLookup (const std::string &hostName, std::string &ipAddress) |
Lookup URL in DNS cache. More... | |
Network functions
The network module offers functions that allow you to control it.
It has the header #include <kodi/Network.h> be included to enjoy it.
|
inline |
Lookup URL in DNS cache.
This test will get DNS record for a domain. The DNS lookup is done directly against the domain's authoritative name server, so changes to DNS Records should show up instantly. By default, the DNS lookup tool will return an IP address if you give it a name (e.g. www.example.com)
[in] | hostName | The code of the message to get. |
[out] | ipAddress | Returned address |
Example:
|
inline |
Return our hostname.
Example:
|
inline |
To the current own ip address as a string.
Example:
|
inline |
Returns Kodi's HTTP UserAgent string.
Example:
example output: Kodi/19.0-ALPHA1 (X11; Linux x86_64) Ubuntu/20.04 App_Bitness/64 Version/19.0-ALPHA1-Git:20200522-0076d136d3-dirty
|
inline |
Checks whether the specified path refers to a local network.
[in] | hostname | Hostname to check |
[in] | offLineCheck | Check if in private range, see https://en.wikipedia.org/wiki/Private_network |
|
inline |
Check given name or ip address corresponds to localhost.
[in] | hostname | Hostname to check |
Example:
|
inline |
URL encodes the given string.
This function converts the given input string to a URL encoded string and returns that as a new allocated string. All input characters that are not a-z, A-Z, 0-9, '-', '.', '_' or '~' are converted to their "URL escaped" version (NN where NN is a two-digit hexadecimal number).
[in] | url | The code of the message to get. |
Example:
For example, the string: François ,would be encoded as: FranC3A7ois
|
inline |
Send WakeOnLan magic packet.
[in] | mac | Network address of the host to wake. |