scapy.contrib.pim

References

class scapy.contrib.pim.PIMv2GroupAddrs(_pkt, /, *, addr_family=1, encoding_type=0, bidirection=0, reserved=0, admin_scope_zone=0, mask_len=32, gaddr=None, num_joins=None, num_prunes=None, join_ips=[], prune_ips=[])[source]

Bases: _PIMGenericTlvBase

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  ADDR FAMILY  | ENCODING TYPE |B|  RESERVED |A|    MASK LEN   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             GADDR                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           NUM JOINS           |           NUM PRUNES          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            JOIN IPS           |           PRUNE IPS           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Fig. PIMv2GroupAddrs                       
PIMv2GroupAddrs fields

addr_family

ByteField

1

encoding_type

ByteField

0

bidirection

BitField (1 bit)

0

reserved

BitField (6 bits)

0

admin_scope_zone

BitField (1 bit)

0

mask_len

ByteField

32

gaddr

MultipleTypeField (IP6Field, IPField)

'0.0.0.0'

num_joins

BitFieldLenField (16 bits)

None

num_prunes

BitFieldLenField (16 bits)

None

join_ips

PacketListField

[]

prune_ips

PacketListField

[]

class scapy.contrib.pim.PIMv2Hdr(_pkt, /, *, version=2, type=0, reserved=0, chksum=None)[source]

Bases: Packet

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|VERSION|  TYPE |    RESERVED   |             CHKSUM            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Fig. PIMv2Hdr                           
PIMv2Hdr fields

version

BitField (4 bits)

2

type

BitEnumField

0

reserved

ByteField

0

chksum

XShortField

None

payload_guess

Possible sublayers: PIMv2Hello, PIMv2JoinPrune

post_build(p, pay)[source]
Called implicitly before a packet is sent to compute and

place PIM checksum.

Parameters:
  • class (self The instantiation of an PIMv2Hdr)

  • order (p The PIMv2Hdr message in hex in network byte)

  • message (pay Additional payload for the PIMv2Hdr)

class scapy.contrib.pim.PIMv2Hello(_pkt, /, *, option=[])[source]

Bases: Packet

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             OPTION            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                         Fig. PIMv2Hello                          
PIMv2Hello fields

option

_PIMv2HelloListField

[]

class scapy.contrib.pim.PIMv2HelloAddrList(_pkt, /, *, type=24, length=None, value=[<PIMv2HelloAddrListValue  |>])[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              TYPE             |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             VALUE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. PIMv2HelloAddrList                      
PIMv2HelloAddrList fields

type

ShortField

24

length

FieldLenField

None

value

PacketListField

[<PIMv2HelloAddrListValue  |>]

class scapy.contrib.pim.PIMv2HelloAddrListValue(_pkt, /, *, addr_family=1, encoding_type=0, prefix='::')[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  ADDR FAMILY  | ENCODING TYPE |             PREFIX            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. PIMv2HelloAddrListValue                   
PIMv2HelloAddrListValue fields

addr_family

ByteField

1

encoding_type

ByteField

0

prefix

IP6Field

'::'

class scapy.contrib.pim.PIMv2HelloDRPriority(_pkt, /, *, type=19, length=None, dr_priority=1)[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              TYPE             |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          DR PRIORITY                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. PIMv2HelloDRPriority                     
PIMv2HelloDRPriority fields

type

ShortField

19

length

FieldLenField

None

dr_priority

IntField

1

class scapy.contrib.pim.PIMv2HelloGenerationID(_pkt, /, *, type=20, length=None, generation_id=<RandInt>)[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              TYPE             |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         GENERATION ID                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. PIMv2HelloGenerationID                    
PIMv2HelloGenerationID fields

type

ShortField

20

length

FieldLenField

None

generation_id

IntField

<RandInt>

class scapy.contrib.pim.PIMv2HelloHoldtime(_pkt, /, *, type=1, length=None, holdtime=105)[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              TYPE             |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            HOLDTIME           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. PIMv2HelloHoldtime                      
PIMv2HelloHoldtime fields

type

ShortField

1

length

FieldLenField

None

holdtime

ShortField

105

class scapy.contrib.pim.PIMv2HelloLANPruneDelay(_pkt, /, *, type=2, length=None, value=[<PIMv2HelloLANPruneDelayValue  |>])[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              TYPE             |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             VALUE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. PIMv2HelloLANPruneDelay                   
PIMv2HelloLANPruneDelay fields

type

ShortField

2

length

FieldLenField

None

value

PacketListField

[<PIMv2HelloLANPruneDelayValue  |>]

class scapy.contrib.pim.PIMv2HelloLANPruneDelayValue(_pkt, /, *, t=0, propagation_delay=500, override_interval=2500)[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|T|      PROPAGATION DELAY      |       OVERRIDE INTERVAL       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                Fig. PIMv2HelloLANPruneDelayValue                 
PIMv2HelloLANPruneDelayValue fields

t

BitField (1 bit)

0

propagation_delay

BitField (15 bits)

500

override_interval

ShortField

2500

class scapy.contrib.pim.PIMv2HelloStateRefresh(_pkt, /, *, type=21, length=None, value=[<PIMv2HelloStateRefreshValue  |>])[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              TYPE             |             LENGTH            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             VALUE             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. PIMv2HelloStateRefresh                    
PIMv2HelloStateRefresh fields

type

ShortField

21

length

FieldLenField

None

value

PacketListField

[<PIMv2HelloStateRefreshValue  |>]

class scapy.contrib.pim.PIMv2HelloStateRefreshValue(_pkt, /, *, version=1, interval=0, reserved=0)[source]

Bases: _PIMv2GenericHello

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    VERSION    |    INTERVAL   |            RESERVED           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Fig. PIMv2HelloStateRefreshValue                 
PIMv2HelloStateRefreshValue fields

version

ByteField

1

interval

ByteField

0

reserved

ShortField

0

class scapy.contrib.pim.PIMv2JoinAddrs(_pkt, /, *, addr_family=1, encoding_type=0, rsrvd=0, sparse=0, wildcard=0, rpt=1, mask_len=32, src_ip=None)[source]

Bases: PIMv2JoinPruneAddrsBase

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  ADDR FAMILY  | ENCODING TYPE |  RSRVD  |S|W|R|    MASK LEN   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             SRC IP                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Fig. PIMv2JoinAddrs                        
PIMv2JoinAddrs fields

addr_family

ByteField

1

encoding_type

ByteField

0

rsrvd

BitField (5 bits)

0

sparse

BitField (1 bit)

0

wildcard

BitField (1 bit)

0

rpt

BitField (1 bit)

1

mask_len

ByteField

32

src_ip

MultipleTypeField (IP6Field, IPField)

'0.0.0.0'

class scapy.contrib.pim.PIMv2JoinPrune(_pkt, /, *, up_addr_family=1, up_encoding_type=0, up_neighbor_ip=None, reserved=0, num_group=None, holdtime=210, jp_ips=[])[source]

Bases: _PIMGenericTlvBase

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| UP ADDR FAMILY|UP ENCODING TYP|         UP NEIGHBOR IP        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |    RESERVED   |   NUM GROUP   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            HOLDTIME           |             JP IPS            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Fig. PIMv2JoinPrune                        
PIMv2JoinPrune fields

up_addr_family

ByteField

1

up_encoding_type

ByteField

0

up_neighbor_ip

MultipleTypeField (IP6Field, IPField)

'0.0.0.0'

reserved

ByteField

0

num_group

FieldLenField

None

holdtime

ShortField

210

jp_ips

PacketListField

[]

class scapy.contrib.pim.PIMv2JoinPruneAddrsBase(_pkt, /, *, addr_family=1, encoding_type=0, rsrvd=0, sparse=0, wildcard=0, rpt=1, mask_len=32, src_ip=None)[source]

Bases: _PIMGenericTlvBase

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  ADDR FAMILY  | ENCODING TYPE |  RSRVD  |S|W|R|    MASK LEN   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             SRC IP                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. PIMv2JoinPruneAddrsBase                   
PIMv2JoinPruneAddrsBase fields

addr_family

ByteField

1

encoding_type

ByteField

0

rsrvd

BitField (5 bits)

0

sparse

BitField (1 bit)

0

wildcard

BitField (1 bit)

0

rpt

BitField (1 bit)

1

mask_len

ByteField

32

src_ip

MultipleTypeField (IP6Field, IPField)

'0.0.0.0'

class scapy.contrib.pim.PIMv2PruneAddrs(_pkt, /, *, addr_family=1, encoding_type=0, rsrvd=0, sparse=0, wildcard=0, rpt=1, mask_len=32, src_ip=None)[source]

Bases: PIMv2JoinPruneAddrsBase

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  ADDR FAMILY  | ENCODING TYPE |  RSRVD  |S|W|R|    MASK LEN   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             SRC IP                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Fig. PIMv2PruneAddrs                       
PIMv2PruneAddrs fields

addr_family

ByteField

1

encoding_type

ByteField

0

rsrvd

BitField (5 bits)

0

sparse

BitField (1 bit)

0

wildcard

BitField (1 bit)

0

rpt

BitField (1 bit)

1

mask_len

ByteField

32

src_ip

MultipleTypeField (IP6Field, IPField)

'0.0.0.0'