-
Notifications
You must be signed in to change notification settings - Fork 56
/
utils.go
56 lines (53 loc) · 893 Bytes
/
utils.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package dns_server
import (
"encoding/binary"
"io"
)
var recordTypesMapping = map[uint16]string{
1: "A",
28: "AAAA",
18: "AFSDB",
42: "APL",
257: "CAA",
60: "CDNSKEY",
59: "CDS",
37: "CERT",
5: "CNAME",
62: "CSYNC",
49: "DHCID",
32769: "DLV",
39: "DNAME",
48: "DNSKEY",
43: "DS",
13: "HINFO",
55: "HIP",
65: "HTTPS",
45: "IPSECKEY",
25: "KEY",
36: "KX",
29: "LOC",
15: "MX",
35: "NAPTR",
2: "NS",
47: "NSEC",
61: "OPENPGPKEY",
12: "PTR",
46: "RRSIG",
17: "RP",
24: "SIG",
53: "SMIMEA",
6: "SOA",
33: "SRV",
44: "SSHFP",
64: "SVCB",
32768: "TA",
249: "TKEY",
52: "TLSA",
250: "TSIG",
16: "TXT",
256: "URI",
63: "ZONEMD",
}
func Write(w io.Writer, data interface{}) error {
return binary.Write(w, binary.BigEndian, data)
}