(cls,packet)
Parse DNS packet data and return DNSRecord instance
            Recursively parses sections (calling appropriate parse method)
Parse DNS packet data and return DNSRecord instance
            Recursively parses sections (calling appropriate parse method)
Parse DNS packet data and return DNSRecord instance Recursively parses sections ( calling appropriate parse method )
def parse(cls,packet):
        """
            Parse DNS packet data and return DNSRecord instance
            Recursively parses sections (calling appropriate parse method)
        """
        buffer = DNSBuffer(packet)
        try:
            header = DNSHeader.parse(buffer)
            questions = []
            rr = []
            auth = []
            ar = []
            for i in range(header.q):
                questions.append(DNSQuestion.parse(buffer))
            for i in range(header.a):
                rr.append(RR.parse(buffer))
            for i in range(header.auth):
                auth.append(RR.parse(buffer))
            for i in range(header.ar):
                ar.append(RR.parse(buffer))
            return cls(header,questions,rr,auth=auth,ar=ar)
        except DNSError:
            raise
        except (BufferError,BimapError) as e:
            raise DNSError("Error unpacking DNSRecord [offset=%d]: %s" % (
                                    buffer.offset,e))
def parse ( cls , packet ) : buffer = DNSBuffer ( packet ) try : header = DNSHeader . parse ( buffer ) questions = [ ] rr = [ ] auth = [ ] ar = [ ] for i in range ( header . q ) : questions . append ( DNSQuestion . parse ( buffer ) ) for i in range ( header . a ) : rr . append ( RR . parse ( buffer ) ) for i in range ( header . auth ) : auth . append ( RR . parse ( buffer ) ) for i in range ( header . ar ) : ar . append ( RR . parse ( buffer ) ) return cls ( header , questions , rr , auth = auth , ar = ar ) except DNSError : raise except ( BufferError , BimapError ) as e : raise DNSError ( "Error unpacking DNSRecord [offset=%d]: %s" % ( buffer . offset , e ) )