Package dpkt :: Module dtp
[hide private]
[frames] | no frames]

Source Code for Module dpkt.dtp

 1  # $Id: dtp.py 271 2006-01-11 16:03:33Z dugsong $ 
 2   
 3  """Dynamic Trunking Protocol.""" 
 4   
 5  import struct 
 6  import dpkt 
 7   
8 -class DTP(dpkt.Packet):
9 __hdr__ = ( 10 ('v', 'B', 0), 11 ) # rest is TLVs
12 - def unpack(self, buf):
13 dpkt.Packet.unpack(self, buf) 14 buf = self.data 15 tvs = [] 16 while buf: 17 t, l = struct.unpack('>HH', buf[:4]) 18 v, buf = buf[4:4+l], buf[4+l:] 19 tvs.append((t, v)) 20 self.data = tvs
21 22 TRUNK_NAME = 0x01 23 MAC_ADDR = 0x04 24