ostinato.protocols.mac_pb2 module¶
Configure MAC settings in your network stream using ostinato.protocols.mac_pb2. Customize fixed or varying mac addresses for layer 2 testing
To add and configure Mac in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kMacFieldNumber
and access the Mac object from the Protocol object's Extensions
dictionary using the key mac_pb2.mac
from ostinato.protocols import mac_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kMacFieldNumber
my_mac = proto.Extensions[mac_pb2.mac]
my_mac.<attribute>
Mac class¶
Class constants¶
MacAddrMode¶
Mac.e_mm_fixed
Mac.e_mm_inc
Mac.e_mm_dec
Mac.e_mm_resolve
Class attributes¶
dst_mac¶
Mac.dst_mac : long
dst_mac_mode¶
Mac.dst_mac_mode : MacAddrMode
See MacAddrMode
dst_mac_count¶
Mac.dst_mac_count : long
dst_mac_step¶
Mac.dst_mac_step : long
src_mac¶
Mac.src_mac : long
src_mac_mode¶
Mac.src_mac_mode : MacAddrMode
See MacAddrMode
src_mac_count¶
Mac.src_mac_count : long
src_mac_step¶
Mac.src_mac_step : long