Skip to content

ostinato.protocols.eth2_pb2 module

Configure Ethernet protocol in Ostinato streams with custom attributes to shape Ethernet packet behavior precisely

To add and configure Eth2 in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kEth2FieldNumber and access the Eth2 object from the Protocol object's Extensions dictionary using the key eth2_pb2.eth2

from ostinato.protocols import eth2_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kEth2FieldNumber
my_eth2 = proto.Extensions[eth2_pb2.eth2]
You can then set Eth2 attributes using my_eth2.<attribute>

Eth2 class

Class attributes

is_override_type

Eth2.is_override_type : boolean
Optional. If not set, defaults to False.

type

Eth2.type : long
Optional. If not set, defaults to 0.

Back to top