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

Source Code for Module dpkt.ospf

 1  # $Id: ospf.py 23 2006-11-08 15:45:33Z dugsong $ 
 2  # -*- coding: utf-8 -*- 
 3  """Open Shortest Path First.""" 
 4  from __future__ import absolute_import 
 5   
 6  from . import dpkt 
 7   
 8  AUTH_NONE = 0 
 9  AUTH_PASSWORD = 1 
10  AUTH_CRYPTO = 2 
11   
12   
13 -class OSPF(dpkt.Packet):
14 """Open Shortest Path First. 15 16 TODO: Longer class information.... 17 18 Attributes: 19 __hdr__: Header fields of OSPF. 20 TODO. 21 """ 22 23 __hdr__ = ( 24 ('v', 'B', 0), 25 ('type', 'B', 0), 26 ('len', 'H', 0), 27 ('router', 'I', 0), 28 ('area', 'I', 0), 29 ('sum', 'H', 0), 30 ('atype', 'H', 0), 31 ('auth', '8s', '') 32 ) 33
34 - def __bytes__(self):
35 if not self.sum: 36 self.sum = dpkt.in_cksum(dpkt.Packet.__bytes__(self)) 37 return dpkt.Packet.__bytes__(self)
38