ostinato.protocols.ip4_pb2 module¶
Configure the IPv4 addresses, DSCP, TTL and other packet fields in Ostinato streams to tailor your network testing
To add and configure Ip4 in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kIp4FieldNumber
and access the Ip4 object from the Protocol object's Extensions
dictionary using the key ip4_pb2.ip4
from ostinato.protocols import ip4_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kIp4FieldNumber
my_ip4 = proto.Extensions[ip4_pb2.ip4]
my_ip4.<attribute>
Ip4 class¶
Class constants¶
IpAddrMode¶
Ip4.e_im_fixed
Ip4.e_im_inc_host
Ip4.e_im_dec_host
Ip4.e_im_random_host
Class attributes¶
is_override_ver¶
Ip4.is_override_ver : boolean
is_override_hdrlen¶
Ip4.is_override_hdrlen : boolean
is_override_totlen¶
Ip4.is_override_totlen : boolean
is_override_proto¶
Ip4.is_override_proto : boolean
is_override_cksum¶
Ip4.is_override_cksum : boolean
ver_hdrlen¶
Ip4.ver_hdrlen : long
tos¶
Ip4.tos : long
totlen¶
Ip4.totlen : long
id¶
Ip4.id : long
flags¶
Ip4.flags : long
frag_ofs¶
Ip4.frag_ofs : long
ttl¶
Ip4.ttl : long
proto¶
Ip4.proto : long
cksum¶
Ip4.cksum : long
src_ip¶
Ip4.src_ip : int
src_ip_mode¶
Ip4.src_ip_mode : IpAddrMode
See IpAddrMode
src_ip_count¶
Ip4.src_ip_count : long
src_ip_mask¶
Ip4.src_ip_mask : int
dst_ip¶
Ip4.dst_ip : int
dst_ip_mode¶
Ip4.dst_ip_mode : IpAddrMode
See IpAddrMode
dst_ip_count¶
Ip4.dst_ip_count : long
dst_ip_mask¶
Ip4.dst_ip_mask : int
options¶
Ip4.options : bytes(python3)/str(python2)