Sub Process_Globals
Dim sh As Shell
Dim inet As JavaObject
End Sub
Sub AppStart (Args() As String)
inet.InitializeStatic("java.net.InetAddress")
sh.Initialize("sh","arp",Array As String("-a"))
sh.Run(8000)
StartMessageLoop
End Sub
Sub sh_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
If Success Then
For Each line As String In Regex.Split(Chr(10),StdOut)
If line.Trim = "" Then Continue
If line.Trim.Contains("dynamic") Or line.trim.Contains("static") Then
Dim address As String = Regex.Split(" ",line.Trim)(0)
Dim baddress() As String = Regex.Split("\.",address.trim)
Dim addrs(4) As Byte
For t = 0 To 3
addrs(t) = baddress(t)
Next
Dim host As String = inet.RunMethodJO("getByAddress",Array(addrs)).RunMethod("getCanonicalHostName",Null)
If host = address Then host="Unknown"
Dim addType As String
If line.Trim.Contains("dynamic") Then
addType = "dynamic"
Else
addType = "static"
End If
Log("Host Name : ["&host&"] IP Address : "&address&" Mac Address : <"&Regex.Split("[ ]{2,}",line.Trim)(1)&">"&" Type : "&addType)
End If
Next
End If
StopMessageLoop
End Sub