PS_MODIFIER

code: 178

# set
<module-index>/<port-index> PS_MODIFIER [<stream_index>, <modifier_index>] <position> <mask> <action> <repetition>

# get
<module-index>/<port-index> PS_MODIFIER [<stream_index>, <modifier_index>] ?

Description

A packet modifier for a stream header. The headers of each packet transmitted for the stream will be varied according to the modifier specification. This command requires two sub-indices, one for the stream and one for the modifier. A modifier is positioned at a fixed place in the header, selects a number of consecutive bits starting from that position, and applies an action to those bits in each packet. Packets can be repeated so that a certain number of identical packets are transmitted before applying the next modification.

Actions

set, get

Parameters

  1. position: integer, the byte position from the start of the packet

  2. mask: hex4, the mask specifying which bits to affect. For 16-bit modifier, the mask is padded with 2-byte of zero on the right, e.g. 0xFFFF0000. For 24-bit modifier, the mask is padded with 1-byte of zero on the right, e.g. 0xFFFFFF00.

  3. action: byte, which action to perform on the affected bits

  • INC = 0

  • DEC = 1

  • RANDOM = 2

  1. repetition: integer, how many times to repeat on each packet

Example

# set
input:  0/1 PS_MODIFIER [0, 0] 14 0xFFFF INC 1
output: <OK>

# get
input:  0/1 PS_MODIFIER [0, 0] ?
output: 0/1 PS_MODIFIER [0, 0] 14 0xFFFF INC 1