aboutsummaryrefslogtreecommitdiff
path: root/lib/dns/server.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-11-14 17:46:02 +0700
committerShulhan <ms@kilabit.info>2021-11-14 17:52:52 +0700
commit3f02602db8cfe6fbb09d550ac723fc251eb81f1d (patch)
treee0e15a163ee22aa5cce3d9e7e45d2dc5cad4a658 /lib/dns/server.go
parent207a7fa24fe58619628e98a9298a3f877ed16146 (diff)
downloadpakakeh.go-3f02602db8cfe6fbb09d550ac723fc251eb81f1d.tar.xz
lib/dns: refactoring, create type RecordType to represent type of RR
Previously, we use uint16 to represent type for ResourceRecord Type or Question type. To make the code more strict, where parameter or return value, must be expected as record type, we add new type to represent the RR type: RecordType. This changes also rename any variable name of QType or qtype to RType or rtype because QType is misleading. The type defined the ResourceRecord to be queried not only question.
Diffstat (limited to 'lib/dns/server.go')
-rw-r--r--lib/dns/server.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/dns/server.go b/lib/dns/server.go
index 95d151be..8f11471a 100644
--- a/lib/dns/server.go
+++ b/lib/dns/server.go
@@ -648,12 +648,12 @@ func (srv *Server) isImplemented(msg *Message) bool {
return false
}
- if msg.Question.Type >= QueryTypeA && msg.Question.Type <= QueryTypeTXT {
+ if msg.Question.Type >= RecordTypeA && msg.Question.Type <= RecordTypeTXT {
return true
}
switch msg.Question.Type {
- case QueryTypeAAAA, QueryTypeSRV, QueryTypeOPT, QueryTypeAXFR,
- QueryTypeMAILB, QueryTypeMAILA:
+ case RecordTypeAAAA, RecordTypeSRV, RecordTypeOPT, RecordTypeAXFR,
+ RecordTypeMAILB, RecordTypeMAILA:
return true
}