/
types.go
53 lines (48 loc) 路 912 Bytes
/
types.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
package dnsanalyzer
// SOA is ...
type SOA struct {
MName string
RName string
Serial uint32
Refresh uint32
Retry uint32
Expire uint32
TTL uint32
}
// Question is ...
type Question struct {
Name string
Type string
Class string
}
// Record is ...
type Record struct {
Name string
Type string
Class string
TTL uint32
Data string `json:",omitempty"`
IP string `json:",omitempty"`
NS string `json:",omitempty"`
CNAME string `json:",omitempty"`
PTR string `json:",omitempty"`
TXT []string `json:",omitempty"`
SOA SOA `json:",omitempty"`
}
// DNS is ...
type DNS struct {
ID uint16
QR bool
OpCode string
AA bool
TC bool
ResponseCode string
Questions []Question
Answers []Record
Authorities []Record
Additionals []Record
}
// Key is ...
func (d *DNS) Key() string {
return "dns"
}