Skip to content

Commit 27318b9

Browse files
committed
RFC 8490: Implement DSO type registry
Signed-off-by: Miek Gieben <[email protected]>
1 parent 01abd80 commit 27318b9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

reverse.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@ var StringToAlgorithm = reverseInt8(AlgorithmToString)
2323
// StringToHash is a map of names to hash IDs.
2424
var StringToHash = reverseInt8(HashToString)
2525

26-
// StringToCertType is the reverseof CertTypeToString.
26+
// StringToCertType is the reverse of CertTypeToString.
2727
var StringToCertType = reverseInt16(CertTypeToString)
2828

29+
// StringToStatefulType is the reverse of StatefulTypeToString.
30+
var StringToStatefulType = reverseInt16(StatefulTypeToString)
31+
2932
// Reverse a map
3033
func reverseInt8(m map[uint8]string) map[string]uint8 {
3134
n := make(map[string]uint8, len(m))

types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ const (
181181
AMTRELAYHost = IPSECGatewayHost
182182
)
183183

184+
// Stateful types as defined in RFC 8490.
185+
const (
186+
StatefulTypeKeepAlive uint16 = iota + 1
187+
StatefulTypeRetryDelay
188+
StatefulTypeEncryptionPadding
189+
)
190+
191+
var StatefulTypeToString = map[uint16]string{
192+
StatefulTypeKeepAlive: "KeepAlive",
193+
StatefulTypeRetryDelay: "RetryDelay",
194+
StatefulTypeEncryptionPadding: "EncryptionPadding",
195+
}
196+
184197
// Header is the wire format for the DNS packet header.
185198
type Header struct {
186199
Id uint16

0 commit comments

Comments
 (0)