#NEWLINE# def parse_record( data , offset , question = False ) : #NEWLINE# #INDENT# ( nlen , name ) = parse_name ( data , offset ) #NEWLINE# if ( not question ) : #NEWLINE# #INDENT# ( record_type , record_class , record_ttl , record_rdlength ) = struct . unpack ( '!HHiH' , data [ ( offset + nlen ) : ( ( offset + nlen ) + 10 ) ] ) #NEWLINE# ip = parse_ip ( record_type , data , record_rdlength , ( ( offset + nlen ) + 10 ) ) #NEWLINE# return ( ( ( nlen + 10 ) + record_rdlength ) , ( name , ip , record_type , nlen , record_ttl ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( record_type , record_class ) = struct . unpack ( '!HH' , data [ ( offset + nlen ) : ( ( offset + nlen ) + 4 ) ] ) #NEWLINE# return ( ( nlen + 4 ) , ( name , None , record_type , record_class , None , None ) )