scapy.contrib.igmpv3

class scapy.contrib.igmpv3.IGMPv3(_pkt, /, *, type=17, mrcode=20, chksum=None)[source]

Bases: IGMP

IGMP Message Class for v3.

This class is derived from class Packet. The fields defined below are a direct interpretation of the v3 Membership Query Message. Fields ‘type’ through ‘qqic’ are directly assignable. For ‘numsrc’, do not assign a value. Instead add to the ‘srcaddrs’ list to auto-set ‘numsrc’. To assign values to ‘srcaddrs’, use the following methods:

c = IGMPv3()
c.srcaddrs = ['1.2.3.4', '5.6.7.8']
c.srcaddrs += ['192.168.10.24']

At this point, ‘c.numsrc’ is three (3)

‘chksum’ is automagically calculated before the packet is sent.

‘mrcode’ is also the Advertisement Interval field

aliastypes = [<class 'scapy.contrib.igmpv3.IGMPv3'>, <class 'scapy.contrib.igmp.IGMP'>, <class 'scapy.packet.Packet'>]
classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]
encode_maxrespcode()[source]

Encode and replace the mrcode value to its IGMPv3 encoded time value if needed, # noqa: E501 as specified in rfc3376#section-4.1.1.

If value < 128, return the value specified. If >= 128, encode as a floating # noqa: E501 point value. Value can be 0 - 31744.

fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<ByteEnumField (IGMPv3).type>, <ByteField (IGMPv3).mrcode>, <XShortField (IGMPv3).chksum>]
igmpv3types = {17: 'Membership Query', 34: 'Version 3 Membership Report', 48: 'Multicast Router Advertisement', 49: 'Multicast Router Solicitation', 50: 'Multicast Router Termination'}
mysummary()[source]

Display a summary of the IGMPv3 object.

payload_guess: List[Tuple[Dict[str, Any], Type[Packet]]] = [({'type': 17}, <class 'scapy.contrib.igmpv3.IGMPv3mq'>), ({'mrcode': 0, 'type': 34}, <class 'scapy.contrib.igmpv3.IGMPv3mr'>), ({'type': 48}, <class 'scapy.contrib.igmpv3.IGMPv3mra'>)]
class scapy.contrib.igmpv3.IGMPv3gr(_pkt, /, *, rtype=1, auxdlen=0, numsrc=None, maddr='0.0.0.0', srcaddrs=[])[source]

Bases: Packet

IGMP Group Record for IGMPv3 Membership Report

This class is derived from class Packet and should be added in the records of an instantiation of class IGMPv3mr.

aliastypes = [<class 'scapy.contrib.igmpv3.IGMPv3gr'>, <class 'scapy.packet.Packet'>]
default_payload_class(payload)[source]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<ByteEnumField (IGMPv3gr).rtype>, <ByteField (IGMPv3gr).auxdlen>, <FieldLenField (IGMPv3gr).numsrc>, <IPField (IGMPv3gr).maddr>, <FieldListField (IGMPv3gr).srcaddrs>]
igmpv3grtypes = {1: 'Mode Is Include', 2: 'Mode Is Exclude', 3: 'Change To Include Mode', 4: 'Change To Exclude Mode', 5: 'Allow New Sources', 6: 'Block Old Sources'}
mysummary()[source]

Display a summary of the IGMPv3 group record.

class scapy.contrib.igmpv3.IGMPv3mq(_pkt, /, *, gaddr='0.0.0.0', resv=0, s=0, qrv=0, qqic=0, numsrc=None, srcaddrs=[])[source]

Bases: Packet

IGMPv3 Membership Query. Payload of IGMPv3 when type=0x11

aliastypes = [<class 'scapy.contrib.igmpv3.IGMPv3mq'>, <class 'scapy.packet.Packet'>]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<IPField (IGMPv3mq).gaddr>, <BitField (IGMPv3mq).resv>, <BitField (IGMPv3mq).s>, <BitField (IGMPv3mq).qrv>, <ByteField (IGMPv3mq).qqic>, <FieldLenField (IGMPv3mq).numsrc>, <FieldListField (IGMPv3mq).srcaddrs>]
class scapy.contrib.igmpv3.IGMPv3mr(_pkt, /, *, res2=0, numgrp=None, records=[])[source]

Bases: Packet

IGMP Membership Report extension for IGMPv3. Payload of IGMPv3 when type=0x22

aliastypes = [<class 'scapy.contrib.igmpv3.IGMPv3mr'>, <class 'scapy.packet.Packet'>]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<XShortField (IGMPv3mr).res2>, <FieldLenField (IGMPv3mr).numgrp>, <PacketListField (IGMPv3mr).records>]
class scapy.contrib.igmpv3.IGMPv3mra(_pkt, /, *, qryIntvl=0, robust=0)[source]

Bases: Packet

IGMP Multicast Router Advertisement extension for IGMPv3. Payload of IGMPv3 when type=0x30

aliastypes = [<class 'scapy.contrib.igmpv3.IGMPv3mra'>, <class 'scapy.packet.Packet'>]
fields_desc: ClassVar[List[Field[Any, Any] | _FieldContainer]] = [<ShortField (IGMPv3mra).qryIntvl>, <ShortField (IGMPv3mra).robust>]