NATTable Methods



GetRows(AMaxRows as Integer, AFilterBy as Integer, AFilter as String) as Variant

Returns variant array with NAT table entries.

AMaxRows - maximum rows to return.

If 0 - all rows returned.

AFilterBy - enable/disable filter.

0 - filter disabled;

1 - filter by rule name;

2 - filter by source IP address.

AFilter - filter mask, for example can be "192.168.?.*" or "192.168.*"

 

Method GetRows returns variant array with NAT table rows.

Each element of array - String in format:

ID|RULE  NAME|PROTOCOL|SOURCE|DESTINATION|SECONDS|ACTIVE (0 OR 1)|KBytes FromSource / ToSource|URL (can be empty)

As you can see - each field separated by "|" symbol.

 

Example of real element:

12124968|MyNatRule|TCP|192.168.0.5:2765|17.254.3.183:80|120|1|2.6 / 9.5|http://www.routix.net/rpc

 

       12124968 - Unique ID of NAT item

MyNatRule - Name of rule
TCP - Protocol (can be TCP, UDP, ICMP...)
192.168.0.5:2765 - Source address and port
17.254.3.183:80 - Destination address and port
120 - Time created: 2 minutes.
1 - Active (0 - not active)
2.6 / 9.5 - 2.6 KBytes from source, 9.5 KBytes to source
http://www.routix.net/rpc - URL
 
VBScript example, how to parse returned array:
 
       'return no more 100 rows, filtering disabled
       AData = TrafficFilter.NATTable.GetRows(100, 0, "")
       For I = 0 To UBound(AData)
               sItem = AData(I)
               aItem = Split(sItem, "|", -1, 1)
 
               'aItem(0) ID
               'aItem(1) RULE
               'aItem(2) PROTOCOL
               'aItem(3) SOURCE
               'aItem(4) DEST
               'aItem(5) TIME (SECONDS)
               'aItem(6) ACTIVE IF "1" ELSE NOT ACTIVE IF "0"
               'aItem(7) TRAFFIC
               'aItem(8) URL IF HTTP, ELSE EMPTY
       Next