Skip to content

ostinato.protocols.ip6over4_pb2 module

Set both IPv4 and IPv6 settings for IPv6 over IPv6 tunnel testing by incorporating the Ip6over4 protocol using ostinato.protocols.ip4_pb2 and ip6_pb2

Ip6over4 is a combination of Ip4 followed by Ip6.

To add and configure Ip6over4 in a stream, add a protocol to the stream and set the protocol id to ost_pb.Protocol.kIp6over4FieldNumber. However, unlike other protocols, the Ip6over4 object accessed via the Protocol object's Extensions dictionary using the key ip6over4_pb2.ip6over4 does not have any attributes of its own. Instead you need to access the individual Ip4 and Ip6 objects from the Protocol object's Extensions dictionary using their respective keys.

from ostinato.protocols import ip4_pb2, ip6_pb2
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add() = ost_pb.Protocol.kIp6over4FieldNumber
my_ip4 = proto.Extensions[ip4_pb2.ip4]
my_ip6 = proto.Extensions[ip6_pb2.ip6]

You can then set Ip4 attributes and Ip6 attributes using my_ip4.<attribute> and my_ip6.<attribute> respectively.

Back to top