ostinato.protocols.textproto_pb2 module¶
Customize and configure any Text based protocol attributes for packet streams, including port number, encoding, text content, and end-of-line settings
To add and configure TextProtocol in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kTextProtocolFieldNumber
and access the TextProtocol object from the Protocol object's Extensions
dictionary using the key textproto_pb2.textProtocol
from ostinato.protocols import textproto_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kTextProtocolFieldNumber
my_textProtocol = proto.Extensions[textproto_pb2.textProtocol]
my_textProtocol.<attribute>
TextProtocol class¶
Class constants¶
EndOfLine¶
TextProtocol.kCr
TextProtocol.kLf
TextProtocol.kCrLf
TextEncoding¶
TextProtocol.kUtf8
Class attributes¶
port_num¶
TextProtocol.port_num : long
encoding¶
TextProtocol.encoding : TextEncoding
See TextEncoding
text¶
TextProtocol.text : str(unicode)
eol¶
TextProtocol.eol : EndOfLine
See EndOfLine