msgToSignature converts msg into it's signature represented in bytes.
(msg *dns.Msg)
| 84 | |
| 85 | // msgToSignature converts msg into it's signature represented in bytes. |
| 86 | func msgToSignature(msg *dns.Msg) (sig []byte) { |
| 87 | sig = make([]byte, uint16sz*2+netutil.MaxDomainNameLen) |
| 88 | // The binary.BigEndian byte order is used everywhere except when the real |
| 89 | // machine's endianness is needed. |
| 90 | byteOrder := binary.BigEndian |
| 91 | byteOrder.PutUint16(sig[0:], msg.Id) |
| 92 | q := msg.Question[0] |
| 93 | byteOrder.PutUint16(sig[uint16sz:], q.Qtype) |
| 94 | copy(sig[2*uint16sz:], []byte(q.Name)) |
| 95 | |
| 96 | return sig |
| 97 | } |
no outgoing calls
searching dependent graphs…