func (m *Message) Decode(b []byte, pos *int, sniffer dns.WireDecodeSniffer) (err error) {
	var p0 *byte
	if p0, err = bufp0(b, pos); err != nil {
		return
	}
	if err = m.Header.Decode(b, pos, sniffer); err != nil {
		return
	}

	m.Question = make([]*QuestionItem, m.QDCOUNT)
	if m.QDCOUNT != 0 {
		if err = m.Question.Decode(b, pos, sniffer); err != nil {
			return
		}
	}

	if m.ANCOUNT != 0 {
		if err = decodeRRs(&m.Answer, m.ANCOUNT, b, pos, sniffer); err != nil {
			return
		}
	}

	if m.NSCOUNT != 0 {
		if err = decodeRRs(&m.Authority, m.NSCOUNT, b, pos, sniffer); err != nil {
			return
		}
	}

	if m.ARCOUNT != 0 {
		if err = decodeRRs(&m.Additional, m.ARCOUNT, b, pos, sniffer); err != nil {
			return
		}
	}

	if *pos != len(b) {
		return fmt.Errorf("Message.Decode() - %d extra bytes", *pos-len(b))
	}

	if sniffer != nil {
		sniffer(p0, &b[*pos-1], dns.SniffMessage, m)
	}
	return
}
// Implementation of dns.Wirer
Implementation of dns.Wirer
// Implementation of dns . Wirer
func (m *Message) Decode(b []byte, pos *int, sniffer dns.WireDecodeSniffer) (err error) {
	var p0 *byte
	if p0, err = bufp0(b, pos); err != nil {
		return
	}
	if err = m.Header.Decode(b, pos, sniffer); err != nil {
		return
	}
	m.Question = make([]*QuestionItem, m.QDCOUNT)
	if m.QDCOUNT != 0 {
		if err = m.Question.Decode(b, pos, sniffer); err != nil {
			return
		}
	}
	if m.ANCOUNT != 0 {
		if err = decodeRRs(&m.Answer, m.ANCOUNT, b, pos, sniffer); err != nil {
			return
		}
	}
	if m.NSCOUNT != 0 {
		if err = decodeRRs(&m.Authority, m.NSCOUNT, b, pos, sniffer); err != nil {
			return
		}
	}
	if m.ARCOUNT != 0 {
		if err = decodeRRs(&m.Additional, m.ARCOUNT, b, pos, sniffer); err != nil {
			return
		}
	}
	if *pos != len(b) {
		return fmt.Errorf("Message.Decode() - %d extra bytes", *pos-len(b))
	}
	if sniffer != nil {
		sniffer(p0, &b[*pos-1], dns.SniffMessage, m)
	}
	return
}
func ( m * Message ) Decode ( b [ ] byte , pos * int , sniffer dns . WireDecodeSniffer ) ( err error ) { var p0 * byte if p0 , err = bufp0 ( b , pos ) ; err != nil { return } if err = m . Header . Decode ( b , pos , sniffer ) ; err != nil { return } m . Question = make ( [ ] * QuestionItem , m . QDCOUNT ) if m . QDCOUNT != 0 { if err = m . Question . Decode ( b , pos , sniffer ) ; err != nil { return } } if m . ANCOUNT != 0 { if err = decodeRRs ( & m . Answer , m . ANCOUNT , b , pos , sniffer ) ; err != nil { return } } if m . NSCOUNT != 0 { if err = decodeRRs ( & m . Authority , m . NSCOUNT , b , pos , sniffer ) ; err != nil { return } } if m . ARCOUNT != 0 { if err = decodeRRs ( & m . Additional , m . ARCOUNT , b , pos , sniffer ) ; err != nil { return } } if * pos != len ( b ) { return fmt . Errorf ( " " , * pos - len ( b ) ) } if sniffer != nil { sniffer ( p0 , & b [ * pos - 1 ] , dns . SniffMessage , m ) } return }
Implementation of dns.Wirer
Implementation of dns . Wirer