ostinato.protocols.dot2llc_pb2 module

(802.2 LLC)

Dot2llc is a combination of Dot3 followed by Llc.

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

from ostinato.protocols import dot3_pb2, llc_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kDot2llcFieldNumber
my_dot3 = proto.Extensions[dot3_pb2.dot3]
my_llc = proto.Extensions[llc_pb2.llc]

You can then set Dot3 attributes and Llc attributes using my_dot3.<attribute> and my_llc.<attribute> respectively.

results matching ""

    No results matching ""