1
2
3 """Protocol Independent Multicast."""
4 from __future__ import absolute_import
5
6 from . import dpkt
7 from .decorators import deprecated
8
9
10 -class PIM(dpkt.Packet):
11 """Protocol Independent Multicast.
12
13 TODO: Longer class information....
14
15 Attributes:
16 __hdr__: Header fields of PIM.
17 TODO.
18 """
19
20 __hdr__ = (
21 ('_v_type', 'B', 0x20),
22 ('rsvd', 'B', 0),
23 ('sum', 'H', 0)
24 )
25
26 @property
29
30 @v.setter
33
34 @property
37
38 @type.setter
39 - def type(self, type):
41
46
48 pimdata = PIM(b'\x20\x00\x9f\xf4\x00\x01\x00\x02\x00\x69')
49 assert pimdata.v == 2
50 assert pimdata.type == 0
51
52
53 pimdata.v = 3
54 pimdata.type = 1
55 assert bytes(pimdata) == b'\x31\x00\x9f\xf4\x00\x01\x00\x02\x00\x69'
56