scapy.contrib.igmpv3¶
-
class
scapy.contrib.igmpv3.
IGMPv3
(*args, **kargs)[source]¶ Bases:
scapy.base_classes.Gen
[scapy.packet.Packet
]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
¶
-
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
¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | MRCODE | CHKSUM | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. IGMPv3
IGMPv3 fields¶ type
17
mrcode
20
chksum
None
-
igmpv3types
= {17: 'Membership Query', 34: 'Version 3 Membership Report', 48: 'Multicast Router Advertisement', 49: 'Multicast Router Solicitation', 50: 'Multicast Router Termination'}¶
-
-
class
scapy.contrib.igmpv3.
IGMPv3gr
(*args, **kargs)[source]¶ Bases:
scapy.base_classes.Gen
[scapy.packet.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
¶
-
fields_desc
¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RTYPE | AUXDLEN | NUMSRC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MADDR | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCADDRS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. IGMPv3gr
IGMPv3gr fields¶ rtype
1
auxdlen
0
numsrc
None
maddr
'0.0.0.0'
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'}¶
-
-
class
scapy.contrib.igmpv3.
IGMPv3mq
(*args, **kargs)[source]¶ Bases:
scapy.base_classes.Gen
[scapy.packet.Packet
]IGMPv3 Membership Query. Payload of IGMPv3 when type=0x11
-
aliastypes
¶
-
fields_desc
¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | GADDR | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESV |S| QRV | QQIC | NUMSRC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCADDRS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. IGMPv3mq
IGMPv3mq fields¶ gaddr
'0.0.0.0'
resv
BitField
(4 bits)0
s
BitField
(1 bit)0
qrv
BitField
(3 bits)0
qqic
0
numsrc
None
srcaddrs
[]
-
-
class
scapy.contrib.igmpv3.
IGMPv3mr
(*args, **kargs)[source]¶ Bases:
scapy.base_classes.Gen
[scapy.packet.Packet
]IGMP Membership Report extension for IGMPv3. Payload of IGMPv3 when type=0x22
-
aliastypes
¶
-
fields_desc
¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RES2 | NUMGRP | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RECORDS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. IGMPv3mr
IGMPv3mr fields¶ res2
0
numgrp
None
records
[]
-
-
class
scapy.contrib.igmpv3.
IGMPv3mra
(*args, **kargs)[source]¶ Bases:
scapy.base_classes.Gen
[scapy.packet.Packet
]IGMP Multicast Router Advertisement extension for IGMPv3. Payload of IGMPv3 when type=0x30
-
aliastypes
¶
-
fields_desc
¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | QRYINTVL | ROBUST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. IGMPv3mra
IGMPv3mra fields¶ qryIntvl
0
robust
0
-