diff options
| author | radhitya <alif@radhitya.org> | 2026-06-24 14:53:57 +0700 |
|---|---|---|
| committer | radhitya <alif@radhitya.org> | 2026-06-24 14:53:57 +0700 |
| commit | e9f8cc47c4abf4bb1763efc96082fd1c6acfc709 (patch) | |
| tree | 05492f4a87e012259540f439dad4edad124ce440 | |
writing types
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | internal/dns/types.go | 47 |
2 files changed, 51 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..518c37e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +etc/ +misc/ +*.md diff --git a/internal/dns/types.go b/internal/dns/types.go new file mode 100644 index 0000000..059446c --- /dev/null +++ b/internal/dns/types.go @@ -0,0 +1,47 @@ +package dns + +// https://datatracker.ietf.org/doc/html/rfc6895#section-2.2 + +const ( + OpQuery = 0 + OpIQuery = 1 + OpStatus = 2 + OpNotify = 4 + OpUpdate = 5 +) + +// https://datatracker.ietf.org/doc/html/rfc6895 +const ( + RcodeNoError = 0 + RcodeFormError = 1 + RcodeServFail = 2 + RcodeNxDomain = 3 + RcodeNotImp = 4 + RcodeRefused = 5 + RcodeYxDomain = 6 + RcodeYxRrSet = 7 + RcodeNxRrSet = 8 + RcodeNotZone = 10 +) + +// https://datatracker.ietf.org/doc/html/rfc1035 +const ( + TypeA = 1 + TypeNS = 2 + TypeCNAME = 5 + typeSOA = 6 + typePTR = 12 + typeMX = 15 + typeTXT = 16 + typeAAAA = 28 // https://www.rfc-editor.org/info/rfc8499/ + typeOPT = 41 +) + +const ( + ClassIN = 1 + ClassCS = 2 + ClassCH = 3 + ClassHS = 4 + ClassNONE = 254 + ClassANY = 255 +) |
