ostinato.protocols.icmp_pb2 module

To add and configure Icmp in a stream, add a protocol to the stream, set the protocol id to ost_pb.Protocol.kIcmpFieldNumber and access the Icmp object from the Protocol object's Extensions dictionary using the key icmp_pb2.icmp

from ostinato.protocols import icmp_pb2
...
# stream is an object of type ost_pb.Stream
proto = stream.protocol.add()
proto.protocol_id.id = ost_pb.Protocol.kIcmpFieldNumber
my_icmp = proto.Extensions[icmp_pb2.icmp]

You can then set Icmp attributes using my_icmp.<attribute>

Icmp class

Class constants

Version

Icmp.kIcmp4 
Icmp.kIcmp6

Class attributes

icmp_version

Icmp.icmp_version : Version

Optional. If not set, defaults to kIcmp4.

See Version

is_override_checksum

Icmp.is_override_checksum : boolean

Optional. If not set, defaults to False.

type

Icmp.type : long

Optional. If not set, defaults to 8.

code

Icmp.code : long

Optional. If not set, defaults to 0.

checksum

Icmp.checksum : long

Optional. If not set, defaults to 0.

identifier

Icmp.identifier : long

Optional. If not set, defaults to 1234.

sequence

Icmp.sequence : long

Optional. If not set, defaults to 0.

results matching ""

    No results matching ""