#NEWLINE# def read_handler( self ) : #NEWLINE# #INDENT# ip = struct . unpack ( '!I' , self . recv ( 4 ) ) [ 0 ] #NEWLINE# port = struct . unpack ( '!H' , self . recv ( 2 ) ) [ 0 ] #NEWLINE# length = struct . unpack ( 'i' , self . recv ( 4 ) ) [ 0 ] #NEWLINE# src = IpAddress ( ip ) #NEWLINE# src . port = port #NEWLINE# msg = self . recv ( length ) #NEWLINE# assert ( pdu == len ( msg ) ) #NEWLINE# tlv = BER_decode . get_tlv ( msg ) #NEWLINE# ( version , community , pdu ) = tlv . decode ( ) #NEWLINE# if ( version == 0 ) : #NEWLINE# #INDENT# pdu = _translate2v2 ( ip , community , pdu ) #NEWLINE# #UNINDENT# tr = TrapRecord ( now ( ) , src , community , pdu ) #NEWLINE# for handler in self . _handlers : #NEWLINE# #INDENT# if handler ( tr ) : #NEWLINE# #INDENT# break