mirror of
https://github.com/andwati/dns-resolver.git
synced 2026-10-18 02:32:52 +00:00
implemented query types constants
This commit is contained in:
@@ -1 +1,11 @@
|
||||
package dns
|
||||
|
||||
const (
|
||||
QTypeA uint16 = 1
|
||||
QTypeAAAA uint16 = 28
|
||||
QTypeCNAME uint16 = 30
|
||||
)
|
||||
|
||||
const (
|
||||
QClassIN uint16 = 1
|
||||
)
|
||||
|
||||
@@ -1 +1,13 @@
|
||||
package dns
|
||||
|
||||
type DNSMessage struct {
|
||||
Header DNSHeader
|
||||
Question DNSQuestion
|
||||
}
|
||||
|
||||
// convert dns message into a byte slice
|
||||
func (m *DNSMessage) Serialize() []byte {
|
||||
header := m.Header.Serialize()
|
||||
question := m.Question.Serialize()
|
||||
return append(header, question...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user