func (m *Header) Encode(b *dns.Wirebuf) {
	dns.Octets2(m.ID).Encode(b)
	var w uint16
	if m.QR {
		w |= 1
	}

	w <<= 4
	w |= uint16(m.Opcode) & 0xF

	w <<= 1
	if m.AA {
		w |= 1
	}
	w <<= 1
	if m.TC {
		w |= 1
	}
	w <<= 1
	if m.RD {
		w |= 1
	}
	w <<= 1
	if m.RA {
		w |= 1
	}

	w <<= 1
	if m.Z {
		w |= 1
	}

	w <<= 1
	if m.AD {
		w |= 1
	}

	w <<= 1
	if m.CD {
		w |= 1
	}

	w <<= 4
	w |= uint16(m.RCODE) & 0xF
	dns.Octets2(w).Encode(b)
	dns.Octets2(m.QDCOUNT).Encode(b)
	dns.Octets2(m.ANCOUNT).Encode(b)
	dns.Octets2(m.NSCOUNT).Encode(b)
	dns.Octets2(m.ARCOUNT).Encode(b)
}
// Implementation of dns.Wirer
Implementation of dns.Wirer
// Implementation of dns . Wirer
func (m *Header) Encode(b *dns.Wirebuf) {
	dns.Octets2(m.ID).Encode(b)
	var w uint16
	if m.QR {
		w |= 1
	}
	w <<= 4
	w |= uint16(m.Opcode) & 0xF
	w <<= 1
	if m.AA {
		w |= 1
	}
	w <<= 1
	if m.TC {
		w |= 1
	}
	w <<= 1
	if m.RD {
		w |= 1
	}
	w <<= 1
	if m.RA {
		w |= 1
	}
	w <<= 1
	if m.Z {
		w |= 1
	}
	w <<= 1
	if m.AD {
		w |= 1
	}
	w <<= 1
	if m.CD {
		w |= 1
	}
	w <<= 4
	w |= uint16(m.RCODE) & 0xF
	dns.Octets2(w).Encode(b)
	dns.Octets2(m.QDCOUNT).Encode(b)
	dns.Octets2(m.ANCOUNT).Encode(b)
	dns.Octets2(m.NSCOUNT).Encode(b)
	dns.Octets2(m.ARCOUNT).Encode(b)
}
func ( m * Header ) Encode ( b * dns . Wirebuf ) { dns . Octets2 ( m . ID ) . Encode ( b ) var w uint16 if m . QR { w |= 1 } w <<= 4 w |= uint16 ( m . Opcode ) & 0xF w <<= 1 if m . AA { w |= 1 } w <<= 1 if m . TC { w |= 1 } w <<= 1 if m . RD { w |= 1 } w <<= 1 if m . RA { w |= 1 } w <<= 1 if m . Z { w |= 1 } w <<= 1 if m . AD { w |= 1 } w <<= 1 if m . CD { w |= 1 } w <<= 4 w |= uint16 ( m . RCODE ) & 0xF dns . Octets2 ( w ) . Encode ( b ) dns . Octets2 ( m . QDCOUNT ) . Encode ( b ) dns . Octets2 ( m . ANCOUNT ) . Encode ( b ) dns . Octets2 ( m . NSCOUNT ) . Encode ( b ) dns . Octets2 ( m . ARCOUNT ) . Encode ( b ) }
Implementation of dns.Wirer
Implementation of dns . Wirer