Skip to content

ostinato.protocols.dot2snap_pb2 module

(802.2 SNAP)

Dot2Snap is a combination of Dot2llc followed by Snap.

To add and configure Dot2Snap in a stream, add a protocol to the stream and set the protocol id to ost_pb.Protocol.kDot2SnapFieldNumber. However, unlike other protocols, the Dot2Snap object accessed via the Protocol object's Extensions dictionary using the key dot2snap_pb2.dot2Snap does not have any attributes of its own. Instead you need to access the individual Dot2llc and Snap objects from the Protocol object's Extensions dictionary using their respective keys.

from ostinato.protocols import dot2llc_pb2, snap_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kDot2SnapFieldNumber
my_dot2llc = proto.Extensions[dot2llc_pb2.dot2llc]
my_snap = proto.Extensions[snap_pb2.snap]

You can then set Dot2llc attributes and Snap attributes using my_dot2llc.<attribute> and my_snap.<attribute> respectively.

Back to top