implemented dns question structure and serialization

This commit is contained in:
2024-12-19 18:23:01 +03:00
parent db0e1f9223
commit 02e8002f2c
2 changed files with 32 additions and 32 deletions
-32
View File
@@ -1,33 +1 @@
package main
type DNSHeader struct {
ID uint16
Flags uint16
QDCount uint16
ANCount uint16
NSCount uint16
ARCount uint16
}
type DNSQuestion struct {
QName string
QType uint16
QClass uint16
}
type DNSRecord struct {
Name string
Type uint16
Class uint16
TTL uint32
RDLength uint16
RData []byte
}
type DNSMessage struct {
Header DNSHeader
Question []DNSQuestion
Answers []DNSRecord
Authorities []DNSRecord
Additionals []DNSRecord
}