Skip to content

Commit

Permalink
NINFO, RKEY, RESINFO, WALLET, CLA and TA RR types
Browse files Browse the repository at this point in the history
  • Loading branch information
wtoorop committed Nov 15, 2024
1 parent a1bdfb0 commit a8994c4
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
26 changes: 23 additions & 3 deletions dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static lookup_table_type dns_rrclasses[] = {
{ 0, NULL }
};

static rrtype_descriptor_type rrtype_descriptors[(RRTYPE_DESCRIPTORS_LENGTH+1)] = {
static rrtype_descriptor_type rrtype_descriptors[(RRTYPE_DESCRIPTORS_LENGTH+2)] = {
/* 0 */
{ 0, NULL, 1, 1, { RDATA_WF_BINARY }, { RDATA_ZF_UNKNOWN } },
/* 1 */
Expand Down Expand Up @@ -287,9 +287,14 @@ static rrtype_descriptor_type rrtype_descriptors[(RRTYPE_DESCRIPTORS_LENGTH+1)]
/* 55 - HIP [RFC 5205] */
{ 55, NULL, 1, 1, { RDATA_WF_BINARY }, { RDATA_ZF_UNKNOWN } },
/* 56 - NINFO */
{ 56, NULL, 1, 1, { RDATA_WF_BINARY }, { RDATA_ZF_UNKNOWN } },
{ TYPE_NINFO, "NINFO", 1, 1,
{ RDATA_WF_TEXTS },
{ RDATA_ZF_TEXTS } },
/* 57 - RKEY */
{ 57, NULL, 1, 1, { RDATA_WF_BINARY }, { RDATA_ZF_UNKNOWN } },
{ TYPE_RKEY, "RKEY", 4, 4,
{ RDATA_WF_SHORT, RDATA_WF_BYTE, RDATA_WF_BYTE, RDATA_WF_BINARY },
{ RDATA_ZF_SHORT, RDATA_ZF_BYTE, RDATA_ZF_ALGORITHM,
RDATA_ZF_BASE64 } },
/* 58 - TALINK */
{ 58, NULL, 1, 1, { RDATA_WF_BINARY }, { RDATA_ZF_UNKNOWN } },
/* 59 - CDS */
Expand Down Expand Up @@ -846,8 +851,21 @@ static rrtype_descriptor_type rrtype_descriptors[(RRTYPE_DESCRIPTORS_LENGTH+1)]
{ TYPE_AVC, "AVC", 1, 1,
{ RDATA_WF_TEXTS },
{ RDATA_ZF_TEXTS } },
/* 259 - DOA */
{ 259, NULL, 1, 1, { RDATA_WF_BINARY }, { RDATA_ZF_UNKNOWN } },
/* 260 - AMTRELAY */
{ 260, NULL, 1, 1, { RDATA_WF_BINARY }, { RDATA_ZF_UNKNOWN } },
/* 261 - RESINFO */
{ TYPE_RESINFO, "RESINFO", 1, 1, { RDATA_WF_TEXTS }, { RDATA_ZF_TEXTS } },
/* 262 - WALLET */
{ TYPE_WALLET, "WALLET", 1, 1, { RDATA_WF_TEXTS }, { RDATA_ZF_TEXTS } },
/* 263 - CLA */
{ TYPE_CLA, "CLA", 1, 1, { RDATA_WF_TEXTS }, { RDATA_ZF_TEXTS } },

/* 32768 - TA */
{ TYPE_TA, "TA", 4, 4,
{ RDATA_WF_SHORT, RDATA_WF_BYTE, RDATA_WF_BYTE, RDATA_WF_BINARY },
{ RDATA_ZF_SHORT, RDATA_ZF_ALGORITHM, RDATA_ZF_BYTE, RDATA_ZF_HEX } },
/* 32769 */
{ TYPE_DLV, "DLV", 4, 4,
{ RDATA_WF_SHORT, RDATA_WF_BYTE, RDATA_WF_BYTE, RDATA_WF_BINARY },
Expand All @@ -861,6 +879,8 @@ rrtype_descriptor_by_type(uint16_t type)
return &rrtype_descriptors[type];
else if (type == TYPE_DLV)
return &rrtype_descriptors[PSEUDO_TYPE_DLV];
else if (type == TYPE_TA)
return &rrtype_descriptors[PSEUDO_TYPE_TA];
return &rrtype_descriptors[0];
}

Expand Down
21 changes: 14 additions & 7 deletions dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,14 @@ typedef enum nsd_rc nsd_rc_type;
#define TYPE_NAPTR 35 /* RFC2915 */
#define TYPE_KX 36 /* RFC2230 Key Exchange Delegation Record */
#define TYPE_CERT 37 /* RFC2538 */

#define TYPE_A6 38 /* RFC2874 */

#define TYPE_DNAME 39 /* RFC2672 */

#define TYPE_OPT 41 /* Pseudo OPT record... */
#define TYPE_APL 42 /* RFC3123 */
#define TYPE_DS 43 /* RFC 4033, 4034, and 4035 */
#define TYPE_SSHFP 44 /* SSH Key Fingerprint */
#define TYPE_IPSECKEY 45 /* public key for ipsec use. RFC 4025 */

#define TYPE_RRSIG 46 /* RFC 4033, 4034, and 4035 */
#define TYPE_NSEC 47 /* RFC 4033, 4034, and 4035 */
#define TYPE_DNSKEY 48 /* RFC 4033, 4034, and 4035 */
Expand All @@ -137,6 +134,10 @@ typedef enum nsd_rc nsd_rc_type;
#define TYPE_NSEC3PARAM 51 /* NSEC3PARAM at zone apex nsec3 parameters */
#define TYPE_TLSA 52 /* RFC 6698 */
#define TYPE_SMIMEA 53 /* RFC 8162 */

#define TYPE_NINFO 56 /* NINFO/ninfo-completed-template */
#define TYPE_RKEY 57 /* RKEY/rkey-completed-template */

#define TYPE_CDS 59 /* RFC 7344 */
#define TYPE_CDNSKEY 60 /* RFC 7344 */
#define TYPE_OPENPGPKEY 61 /* RFC 7929 */
Expand All @@ -162,10 +163,16 @@ typedef enum nsd_rc nsd_rc_type;
#define TYPE_ANY 255 /* any type (wildcard) */
#define TYPE_URI 256 /* RFC 7553 */
#define TYPE_CAA 257 /* RFC 6844 */
#define TYPE_AVC 258
#define TYPE_AVC 258 /* AVC/avc-completed-template */

#define TYPE_RESINFO 261 /* RFC 9606 */
#define TYPE_WALLET 262 /* WALLET/wallet-completed-template */
#define TYPE_CLA 263 /* CLA/cla-completed-template */

#define TYPE_TA 32768 /* http://www.watson.org/~weiler/INI1999-19.pdf */
#define TYPE_DLV 32769 /* RFC 4431 */
#define PSEUDO_TYPE_DLV RRTYPE_DESCRIPTORS_LENGTH
#define PSEUDO_TYPE_TA RRTYPE_DESCRIPTORS_LENGTH
#define PSEUDO_TYPE_DLV (RRTYPE_DESCRIPTORS_LENGTH + 1)

#define SVCB_KEY_MANDATORY 0
#define SVCB_KEY_ALPN 1
Expand Down Expand Up @@ -278,9 +285,9 @@ typedef struct rrtype_descriptor rrtype_descriptor_type;
* Indexed by type. The special type "0" can be used to get a
* descriptor for unknown types (with one binary rdata).
*
* AVC + 1
* CLA + 1
*/
#define RRTYPE_DESCRIPTORS_LENGTH (TYPE_AVC + 1)
#define RRTYPE_DESCRIPTORS_LENGTH (TYPE_CLA + 1)
rrtype_descriptor_type *rrtype_descriptor_by_name(const char *name);
rrtype_descriptor_type *rrtype_descriptor_by_type(uint16_t type);

Expand Down
9 changes: 9 additions & 0 deletions tpkg/rr-test.tdir/rr-test.cmp_zone

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions tpkg/rr-test.tdir/rr-test.zone
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,13 @@ eui64 IN EUI64 00-00-5e-ef-00-00-00-2a
mail IN TXT Test-String"Test-String"
mail IN TXT foo.bar.test
csync IN CSYNC 66 3 A NS AAAA

ninfo IN NINFO "This zone is for testing parsing and printing of the different RR types"
rkey IN RKEY 512 255 2 ACDtkdVR2HWmc0HPEwkrM+SOrWZd8yPTAytLYZj2u33KgwABAgAg6jav 9rTK68C8j+kfLv7+re8KAb1qJXqdSrmL+1l3Js4=
resinfo IN RESINFO qnamemin exterr=15-17 infourl=https://resolver.example.com/guide
wallet IN WALLET BTC 1H6WkSHdqVahBKczJrs9bBfFYhUHrP5R2F
IN WALLET BCH 1PdRYCYMv7RA8PwxQZ1Q3aCYC4gxKVwFPu
IN WALLET NMC MwKMAXMaXPFQTSCiVD5zHucmA6r3gaAnra
cla IN CLA CP-V4-V6 TCP-V6-V7
ta IN TA 56039 13 2 4104805B43928FC573F0704A2C1B5A10BAA2878DE26B8535DDE77517 C154CE9F
dlv IN DLV 56039 13 2 4104805B43928FC573F0704A2C1B5A10BAA2878DE26B8535DDE77517C154CE9F

0 comments on commit a8994c4

Please sign in to comment.