AddPrefix adds a 2-byte prefix with the DNS message length.
(b []byte)
| 11 | |
| 12 | // AddPrefix adds a 2-byte prefix with the DNS message length. |
| 13 | func AddPrefix(b []byte) (m []byte) { |
| 14 | m = make([]byte, 2+len(b)) |
| 15 | binary.BigEndian.PutUint16(m, uint16(len(b))) |
| 16 | copy(m[2:], b) |
| 17 | |
| 18 | return m |
| 19 | } |
| 20 | |
| 21 | // IPFromRR returns the IP address from rr if any. |
| 22 | func IPFromRR(rr dns.RR) (ip netip.Addr) { |
no outgoing calls
searching dependent graphs…