All Classes Namespaces Files Functions Pages
FrameFieldModifier.Random Class Reference

A frame field modifier which will change the field value of the frame randomly between a minimum and maximum value. More...

Methods

 Description.Get
 Returns a textual description of the object.
 
 Length.Get
 Method to get the current configured field length. More...
 
 Length.Set length
 Sets the length of the frame field. More...
 
 Maximum.Get
 Method to get the current configured maximum field value. More...
 
 Maximum.Set maximum
 Sets the maximum value of the frame field for a random value field modifier. More...
 
 Minimum.Get
 Method to get the current configured minimum field value. More...
 
 Minimum.Set minimum
 Sets the Minimum value of the frame field for a random value field modifier. More...
 
 Offset.Get
 Method to get the current configured field offset within the frame content. More...
 
 Offset.Set offset
 Sets the offset of the frame field within the frame content. More...
 
 Parent.Get
 Returns the parent object.
 

Class overview

A frame field modifier which will change the field value of the frame randomly between a minimum and maximum value.

ByteBlower allows different modifiers on a Frame. Some modifiers work on the size of a frame, others content. The FrameFieldModifier.Random is a modifier which modifies a certain field in the frame content.

A frame field is a number of subsequent bytes in the frame content. The value is defined as host-ordering signed integer and will be written to the frame content as network-ordering signed integer.

A FrameFieldModifier.Random will change the value in the frame field randomly. The following parameters can be configured:

  1. Parameters related to the location of the field in the frame:

    Field offset
    Offset of the field counted in bytes from the start of the frame.
    Field length
    Length of the field counted in bytes. Minimum: 1Byte. Maximum: 8Bytes (depends on server version).

    The field cannot overwrite the 4 bytes Ethernet checksum. The allowed range for offset is 0 ... <ByteBlowerPort MDL>.

    • When the field offset is greater or equal than the actual frame size, nothing will be written to the frame.
    • When the field offset is smaller than the actual frame size, but the field offset + field length exceeds the frame size. Then the LSB part of the field will be written to the frame.

    Please note that in both cases the field value will still move on to the next value.

  2. Parameters related to the value written to the field:

    Minimum value
    The minimum field value.
    Maximum value
    The maximum field value.

    The field value range is defined by the minimum and maximum value (both values inclusive).

    So, a frame with a FrameFieldModifier.Random installed, will start sending frames with field values randomly chosen between <Minimum value> and <Maximum value>. Each time a frame is sent, a new value is selected.

Note
If automatic checksum and/or length calculations have been enabled on the Frame and the frame field overlaps one or more of those. Then the automatic fields will overrule the field modifier value. This depends on the configuration of the Frame. See the Frame documentation on how this can be done.
Since
2.3.0

Definition at line 4108 of file api.tcl.

Method documentation

FrameFieldModifier.Random::Length.Get

Method to get the current configured field length.

Returns
The field length which will be used for this random value field modifier.
Example

This example shows how to retrieve the current field length.

1 $frameFieldModifierRandom Length.Get

Returns:

2 

Definition at line 4125 of file api.tcl.

FrameFieldModifier.Random::Length.Set   length  

Sets the length of the frame field.

Parameters
lengthLength of the frame field. The value must be greater than zero and smaller than 8 (as for server version 2.3.x)
Default: 2
Exceptions
ByteBlower.Exception.API.ConfigErrorWhen the field length is not supported by the server.
Example

This example will set the field length to 4.

1 $frameFieldModifierRandom Length.Set 4

Definition at line 4139 of file api.tcl.

FrameFieldModifier.Random::Maximum.Get

Method to get the current configured maximum field value.

Returns
The maximum field value which will be used for this random value field modifier.
Example

This example shows how to retrieve the current maximum field value.

1 $frameFieldModifierRandom Maximum.Get

Returns:

65535 

Definition at line 4151 of file api.tcl.

FrameFieldModifier.Random::Maximum.Set   maximum  

Sets the maximum value of the frame field for a random value field modifier.

Parameters
maximumMaximum value for the frame field. This value is limited to 64-bit signed integer range. The value must always be greater than the <Minimum value> configured.
Default: 65535
Exceptions
ByteBlower.Exception.API.ConfigErrorMaximum too big or too small.
Example

This example will set the maximum value to 16383 bytes.

1 $$frameFieldModifierRandom Maximum.Set 16383

Definition at line 4165 of file api.tcl.

FrameFieldModifier.Random::Minimum.Get

Method to get the current configured minimum field value.

Returns
The minimum field value which will be used for this random value field modifier.
Example

This example shows how to retrieve the current minimum field value.

1 $frameFieldModifierRandom Minimum.Get

Returns:

0 

Definition at line 4177 of file api.tcl.

FrameFieldModifier.Random::Minimum.Set   minimum  

Sets the Minimum value of the frame field for a random value field modifier.

Parameters
minimumMinimum value for the frame field. This value is limited to 64-bit signed integer range. The value must always be less than the <Maximum value> configured.
Default: 0
Exceptions
ByteBlower.Exception.API.ConfigErrorMinimum too small or too big.
Example

This example will set the minimum value to 512.

1 $$frameFieldModifierRandom Minimum.Set 512

Definition at line 4191 of file api.tcl.

FrameFieldModifier.Random::Offset.Get

Method to get the current configured field offset within the frame content.

The field offset is the absolute offset from the start of the frame.

Returns
The field offset which will be used for this random value field modifier.
Example

This example shows how to retrieve the current field offset.

1 $frameFieldModifierRandom Offset.Get

Returns:

56 

Definition at line 4205 of file api.tcl.

FrameFieldModifier.Random::Offset.Set   offset  

Sets the offset of the frame field within the frame content.

Parameters
offsetOffset of the frame field within the frame content. This value is relative to the start of the frame. The value must be greater or equal than zero and must be smaller than the ByteBlowerPort MDL
Default: 56
Exceptions
ByteBlower.Exception.API.ConfigErrorWhen the field offset is out of valid range.
Example

This example will set the offset to 88.

1 $frameFieldModifierRandom Offset.Set 88

Definition at line 4219 of file api.tcl.