#NEWLINE# @ classmethod #NEWLINE# def parser( cls , buf ) : #NEWLINE# #INDENT# if ( len ( buf ) < cls . _PACK_LEN ) : #NEWLINE# #INDENT# raise stream_parser . StreamParser . TooSmallException ( ( '%d < %d' % ( len ( tos ) , cls . _PACK_LEN ) ) ) #NEWLINE# #UNINDENT# link = buf [ : cls . _PACK_LEN ] #NEWLINE# rest = buf [ cls . _PACK_LEN : ] #NEWLINE# ( id_ , data , type_ , tos , metric ) = struct . unpack_from ( cls . _PACK_STR , six . binary_type ( link ) ) #NEWLINE# id_ = addrconv . ipv4 . bin_to_text ( id_ ) #NEWLINE# data = addrconv . ipv4 . bin_to_text ( data ) #NEWLINE# return ( cls ( id_ , data , type_ , tos , metric ) , rest )