From c889e07be3b4991f5ef67c41ad1c0f76e5a2b4df Mon Sep 17 00:00:00 2001 From: Daniel Stirnimann Date: Thu, 30 May 2024 18:42:26 +0200 Subject: [PATCH] Add CSYNC support (#371) Co-authored-by: Daniel Stirnimann --- pkg/miekg/answers.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/miekg/answers.go b/pkg/miekg/answers.go index 0eb26a4d..635db9d2 100644 --- a/pkg/miekg/answers.go +++ b/pkg/miekg/answers.go @@ -57,6 +57,13 @@ type CERTAnswer struct { Certificate string `json:"certificate" groups:"short,normal,long,trace"` } +type CSYNCAnswer struct { + Answer + Serial uint32 `json:"serial" groups:"short,normal,long,trace"` + Flags uint16 `json:"flags" groups:"short,normal,long,trace"` + TypeBitMap string `json:"type_bit_map" groups:"short,normal,long,trace"` +} + type DNSKEYAnswer struct { Answer Flags uint16 `json:"flags" groups:"short,normal,long,trace"` @@ -767,6 +774,13 @@ func ParseAnswer(ans dns.RR) interface{} { Algorithm: cAns.Algorithm, PublicKey: cAns.PublicKey, } + case *dns.CSYNC: + return CSYNCAnswer{ + Answer: makeBaseAnswer(&cAns.Hdr, ""), + Serial: cAns.Serial, + Flags: cAns.Flags, + TypeBitMap: makeBitString(cAns.TypeBitMap), + } case *dns.AFSDB: return AFSDBAnswer{ Answer: makeBaseAnswer(&cAns.Hdr, ""),