1
2
3 """PPP-over-Ethernet."""
4
5 import dpkt, ppp
6
7
8 PPPoE_PADI = 0x09
9 PPPoE_PADO = 0x07
10 PPPoE_PADR = 0x19
11 PPPoE_PADS = 0x65
12 PPPoE_PADT = 0xA7
13 PPPoE_SESSION = 0x00
14
16 __hdr__ = (
17 ('v_type', 'B', 0x11),
18 ('code', 'B', 0),
19 ('session', 'H', 0),
20 ('len', 'H', 0)
21 )
22 - def _get_v(self): return self.v_type >> 4
23 - def _set_v(self, v): self.v_type = (v << 4) | (self.v_type & 0xf)
24 v = property(_get_v, _set_v)
25
26 - def _get_type(self): return self.v_type & 0xf
27 - def _set_type(self, t): self.v_type = (self.v_type & 0xf0) | t
28 type = property(_get_type, _set_type)
29
37
38
39