All Classes Namespaces Files Functions Pages
Rx.Trigger.Basic Class Reference

Receive-side packet processor which counts the incoming frames, matching a filter. More...

Methods

 Counters.Clear
 Resets the counter values to zero and empties the Result.History. More...
 
 Counters.Get
 Returns the current values of the counter. More...
 
 Description.Get
 Returns a textual description of the object.
 
 Filter.Get
 Returns the current installed BPF filter string. More...
 
 Filter.Set bpfString
 Sets a BPF filter on a RX object. More...
 
 Parent.Get
 Returns the parent object.
 
 Result.Clear
 Resets the counter values to zero. More...
 
 Result.Get
 Returns the current result counters. More...
 
 Result.History.Get
 Returns the current History counters. More...
 

Class overview

Receive-side packet processor which counts the incoming frames, matching a filter.

This trigger is always active and starts counting frames as soon as it is created. Counting continues until the trigger is destructed.

Note
The initial (empty) filter string accepts all incoming frames. See Filter.Set for filtering information.

A basic trigger object can be created via a ByteBlowerPort, using ByteBlowerPort::Rx.Trigger.Add "basic"

This trigger processes frames received on the ByteBlower interface where its parent ByteBlowerPort is located.

Example

Receive all frames on "trunk-1-2" of some server, matching UDP source or destination port 67.

1 set port [ $server Port.Create "trunk-1-2" ]
2  set trigger [ $port Rx.Trigger.Basic.Add ]
3  $trigger Filter.Set "udp port 67"
4  $trigger Result.Clear

Definition at line 21520 of file api.tcl.

Method documentation

Rx.Trigger.Basic::Counters.Clear

Resets the counter values to zero and empties the Result.History.

Deprecated:
Use the Result.Clear method to clear the counters

Definition at line 21528 of file api.tcl.

Rx.Trigger.Basic::Counters.Get

Returns the current values of the counter.

Deprecated:
Use the Result.Get and Result.History.Get to retrieve the counters. These result-objects contain more detailed information.
Returns
Returns a list of name-value pairs with various frame counter values:
NrOfFrames
Number of frames received matching the filter.
Example

This example returns a list of name-value pairs of packet processor counter values.

1 $trigger Counters.Get

Returns:

NrOfFrames 1562 

Definition at line 21542 of file api.tcl.

Rx.Trigger.Basic::Filter.Get

Returns the current installed BPF filter string.

The filter string can be configured using Filter.Set

Returns
The current BPF filter string
Example

Suppose we configured the trigger with filter string:

1 $trigger Filter.Set "ip src [ $ipv4_1 Ip.Get ] and ip dst [ $ipv4_2 Ip.Get ] and len = ${frameSize}"

where $ipv4_1 and $ipv4_2 are Layer3.IPv4 objects and $frameSize is the (layer2) size of the frames (without CRC!). The BPF filter string would then become for example:

1 $trigger Filter.Get

Returns:

ip src 10.10.10.2 and ip dst 10.10.10.3 and len = 252 

Definition at line 21561 of file api.tcl.

Rx.Trigger.Basic::Filter.Set   bpfString  

Sets a BPF filter on a RX object.

Note
Configuring a new filter string does reset the counter values which were triggered by a previous filter string. Also the earlier collected history is invalidated.
Parameters
bpfStringValid BPF filter string. For creating valid BPF filter strings, please have a look at http://www.tcpdump.org/#documentation for more information.
Exceptions
ByteBlower.Rx.*When the {server-side} RX object could not be resolved.
ByteBlower.Rx.Filter.CompilationFailedWhen an invalid BPF filter string is given.
ByteBlower.InvalidFilterWhen an invalid BPF filter string is given.
Example

This will filter only UDP traffic.

1 $trigger Filter.Set "udp"

Set the filter on packets that match:

  • source and destination IPv4 address
  • UDP traffic with given destination and source UDP port
  • (layer2) frame length (without CRC!)
1 $trigger Filter.Set "ip src [ $ipv4_1 Ip.Get ] and ip dst [ $ipv4_2 Ip.Get ] and udp dst port ${dstUdpPort} and udp src port ${srcUdpPort} and len = ${frameSize}"

Definition at line 21582 of file api.tcl.

Rx.Trigger.Basic::Result.Clear

Resets the counter values to zero.

Since
2.1.0
Example
1 $trigger Result.Clear

Definition at line 21599 of file api.tcl.

Rx.Trigger.Basic::Result.Get

Returns the current result counters.

This method will return an object of Rx.Trigger.Basic.ResultSnapshot. It will contain all the current Cumulative counters. To update the counters, call Refresh on Rx.Trigger.Basic.ResultSnapshot

Returns
The OID of the Rx.Trigger.Basic.ResultSnapshot object.
Since
2.1.0
Example
1 $trigger Result.Get

Returns:

<Rx.Trigger.Basic.ResultSnapshot object> 

Definition at line 21615 of file api.tcl.

Rx.Trigger.Basic::Result.History.Get

Returns the current History counters.

This method returns a Rx.Trigger.Basic.ResultHistory Object. This will contain the Cumulative and the Interval counters over time. Use this to create results over time.

Since
2.1.0
Returns
The OID of the Rx.Trigger.Basic.ResultHistory object.
Example
1 $trigger Results.History.Get

Returns:

<Rx.Trigger.Basic.ResultHistory object> 

Definition at line 21631 of file api.tcl.