cNetwork: Added EnumLocalIPAddresses() function.

This commit is contained in:
Mattes D
2015-02-22 10:51:16 +01:00
parent 1bcc4abd68
commit c758482ece
7 changed files with 183 additions and 5 deletions
+6
View File
@@ -50,6 +50,12 @@ g_PluginInfo =
}, -- ParameterCombinations
}, -- close
ips =
{
HelpString = "Prints all locally available IP addresses",
Handler = HandleConsoleNetIps,
}, -- ips
listen =
{
HelpString = "Creates a new listening socket on the specified port with the specified service attached to it",
@@ -288,6 +288,19 @@ end
function HandleConsoleNetIps(a_Split)
local Addresses = cNetwork:EnumLocalIPAddresses()
LOG("IP addresses enumerated, " .. #Addresses .. " found")
for idx, addr in ipairs(Addresses) do
LOG(" IP #" .. idx .. ": " .. addr)
end
return true
end
function HandleConsoleNetLookup(a_Split)
-- Get the name to look up:
local Addr = a_Split[3] or "google.com"