Skip to content

ostinato.protocols.hexdump_pb2 module

To add and configure HexDump in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kHexDumpFieldNumber and access the HexDump object from the Protocol object's Extensions dictionary using the key hexdump_pb2.hexDump

from ostinato.protocols import hexdump_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kHexDumpFieldNumber
my_hexDump = proto.Extensions[hexdump_pb2.hexDump]

You can then set HexDump attributes using my_hexDump.<attribute>

HexDump class

Class attributes

content

HexDump.content : bytes(python3)/str(python2)

Optional. If not set, defaults to "".

pad_until_end

HexDump.pad_until_end : boolean

Optional. If not set, defaults to true.

Back to top