NAT table



NATTable NAT.

 

:

 

'netcom.dll contains 'NetCom.Remote' object.

Set Remote = CreateObject("NetCom.Remote")

With Remote

       .Host = "192.168.0.1"

       .Port = 42566

       .UserName = "Administrator"

       .Password = "mypass"

       'Connect and query remote TrafficFilter object

       Set TrafficFilter = .CreateRoot

End With

 

Set NATTable = TrafficFilter.NATTable

With NATTable

   WScript.Echo "TrafficFilter.NATTable parameters:" & vbCrLf

   WScript.Echo "Entries count limit: " & .MaxItems

   WScript.Echo "TCP entries timeout: " & .ItemTimeoutMSecTCP

   WScript.Echo "TCP 'closed' entries timeout: " & .ItemTimeoutMSecTCPClosed

   WScript.Echo "UDP, ICMP entries timeout: " & .ItemTimeoutMSec

   WScript.Echo "Ports range: " & .PortsLo & "-" & .PortsHi

 

   WScript.Echo vbCrLf & vbCrLf & "TrafficFilter.NATTable state:" & vbCrLf

   WScript.Echo "At this moment in the NAT table " & .Count & " entries."

       

       'return no more 10 rows, filtering disabled

       AData = TrafficFilter.NATTable.GetRows(10, 0, "")

 

       If UBound(AData) >= 0 Then

           WScript.Echo "Some entries: "

               For I = 0 To UBound(AData)

                       sItem = AData(I)

                       aItem = Split(sItem, "|", -1, 1)

 

                       'aItem(0)

                       'aItem(1)

                       'aItem(2)

                       'aItem(3)

                       'aItem(4)

                       'aItem(5) ( )

                       'aItem(6) '1' - , '0' -

                       'aItem(7) /

                       'aItem(8) URL ( HTTP)

                       

                       WScript.Echo "Rule: " & aItem(1) & ", " & aItem(2) & ", " & aItem(3) & " -> " & aItem(4)

               Next

       End If

 

End With

 

Set NATTable = Nothing

Set TrafficFilter = Nothing

Remote.Disconnect

Set Remote = Nothing

 

WScript.Echo vbCrLf & "Press any key..."

WScript.StdIn.Read(1)