/
record_class.go
34 lines (28 loc) · 1.07 KB
/
record_class.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
// Copyright 2021, Shulhan <ms@kilabit.info>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dns
// RecordClass represent the class for resource record.
type RecordClass uint16
// List of known record class, ordered by value.
const (
RecordClassZERO RecordClass = iota // Empty query class.
RecordClassIN // The Internet
RecordClassCH // The CHAOS class
RecordClassHS // Hesiod [Dyer 87]
RecordClassANY RecordClass = 255 // Any class
)
// RecordClasses contains a mapping between string representation of record
// class to their numeric value, ordered by key alphabetically.
var RecordClasses = map[string]RecordClass{
"CH": RecordClassCH,
"HS": RecordClassHS,
"IN": RecordClassIN,
}
// RecordClassName contains a mapping between the record class value and its
// string representation, ordered by key alphabetically.
var RecordClassName = map[RecordClass]string{
RecordClassCH: "CH",
RecordClassHS: "HS",
RecordClassIN: "IN",
}