Home | Trees | Indices | Help |
|
---|
|
1 # $Id: ah.py 34 2007-01-28 07:54:20Z dugsong $ 2 # -*- coding: utf-8 -*- 3 4 """Authentication Header.""" 5 from __future__ import absolute_import 6 7 from . import dpkt 8 911 """Authentication Header. 12 13 TODO: Longer class information.... 14 15 Attributes: 16 __hdr__: Header fields of AH. 17 auth: Authentication body. 18 data: Message data. 19 """ 20 21 __hdr__ = ( 22 ('nxt', 'B', 0), 23 ('len', 'B', 0), # payload length 24 ('rsvd', 'H', 0), 25 ('spi', 'I', 0), 26 ('seq', 'I', 0) 27 ) 28 auth = b'' 294731 dpkt.Packet.unpack(self, buf) 32 self.auth = self.data[:self.len] 33 buf = self.data[self.len:] 34 from . import ip 35 36 try: 37 self.data = ip.IP.get_proto(self.nxt)(buf) 38 setattr(self, self.data.__class__.__name__.lower(), self.data) 39 except (KeyError, dpkt.UnpackError): 40 self.data = buf41 44
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Apr 29 23:17:55 2019 | http://epydoc.sourceforge.net |