Skip to content

ostinato.protocols.payload_pb2 module

Add and configure packet payload in Ostinato streams via the Python API, setting data patterns for packet payloads efficiently

To add and configure Payload in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kPayloadFieldNumber and access the Payload object from the Protocol object's Extensions dictionary using the key payload_pb2.payload

from ostinato.protocols import payload_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kPayloadFieldNumber
my_payload = proto.Extensions[payload_pb2.payload]
You can then set Payload attributes using my_payload.<attribute>

Payload class

Class constants

DataPatternMode

Payload.e_dp_fixed_word 
Payload.e_dp_inc_byte 
Payload.e_dp_dec_byte 
Payload.e_dp_random 

Class attributes

pattern_mode

Payload.pattern_mode : DataPatternMode

See DataPatternMode

pattern

Payload.pattern : long
Optional. If not set, defaults to 0.

Back to top