Skip to content

Network Interface API

Nenkai edited this page Jul 14, 2024 · 2 revisions

< MNetworkInterface Reference Class >

Get Connected to Internet

if (pdistd::MNetworkInterface::isUp())
{
    // ...
}

Get MAC Address

var mac = pdistd::MNetworkInterface::getMacAddress();

Get Local IP Address

var ip = pdistd::MNetworkInterface::getIpAddress();

Get NAT Info

var nat_info = pdistd::MNetworkInterface::getNatInfo();

/* 
nat_info contains:
- "address" - (String)
- "nat" - (Int)
- "stun" - (Int)
- "upnp" - (Int)
*/

Get Proxy

var proxy = pdistd::MNetworkInterface::getProxy();
/*
Array with elements:
[0] Enabled (Bool)
[1] Server (String)
[2] Port (Int)
*/

Is Wi-fi

var wireless = pdistd::MNetworkInterface::isDeviceWireless();