'Read a wire format DNS message and build a dns.message.Message
object.'

def read(self):

    l = len(self.wire)
    if (l < 12):
        raise ShortHeader
    (self.message.id, self.message.flags, qcount, ancount, aucount, adcount) = struct.unpack('!HHHHHH', self.wire[:12])
    self.current = 12
    if dns.opcode.is_update(self.message.flags):
        self.updating = True
    self._get_question(qcount)
    if self.question_only:
        return
    self._get_section(self.message.answer, ancount)
    self._get_section(self.message.authority, aucount)
    self._get_section(self.message.additional, adcount)
    if ((not self.ignore_trailing) and (self.current != l)):
        raise TrailingJunk
    if (self.message.multi and self.message.tsig_ctx and (not self.message.had_tsig)):
        self.message.tsig_ctx.update(self.wire)
