ostinato.protocols.vlanstack_pb2 module

Vlanstack is a combination of Svlan followed by Vlan.

To add and configure Vlanstack in a stream, add a protocol to the stream and set the protocol id to ost_pb.Protocol.kVlanstackFieldNumber. However, unlike other protocols, the Vlanstack object accessed via the Protocol object's Extensions dictionary using the key vlanstack_pb2.vlanStack does not have any attributes of its own. Instead you need to access the individual Svlan and Vlan objects from the Protocol object's Extensions dictionary using their respective keys.

from ostinato.protocols import svlan_pb2, vlan_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kVlanstackFieldNumber
my_svlan = proto.Extensions[svlan_pb2.svlan]
my_vlan = proto.Extensions[vlan_pb2.vlan]

You can then set Svlan attributes and Vlan attributes using my_svlan.<attribute> and my_vlan.<attribute> respectively.

results matching ""

    No results matching ""