Skip to content

ostinato.protocols.ip4over6_pb2 module

To configure IPv4 over IPv6 in an Ostinato stream, access IPv6 and IPv4 attributes separately via the Protocol object's Extensions dict for customization

Ip4over6 is a combination of Ip6 followed by Ip4.

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

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

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

Back to top