Skip to content
Snippets Groups Projects
Commit ea30d637 authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Fixed descriptors.

Fixed enum dnslib_rr_type - must explicitly set numbers for
  types which do not follow the previous ones in numbering.
Fixed naming of mxrdtln enum items to contain prefix DNSLIB_.
parent fb5099c5
Branches
Tags
No related merge requests found
......@@ -75,7 +75,7 @@ static dnslib_rrtype_descriptor_t dnslib_rrtype_descriptors[DNSLIB_RRTYPE_DESCRI
{ DNSLIB_RRTYPE_MX, "MX", 2,
{ DNSLIB_RDATA_WF_SHORT, DNSLIB_RDATA_WF_COMPRESSED_DNAME }, true },
/* 16 */ /* This is obscure, but I guess there's no other way */
{ DNSLIB_RRTYPE_TXT, "TXT", MAX_RDATA_ITEMS,
{ DNSLIB_RRTYPE_TXT, "TXT", DNSLIB_MAX_RDATA_ITEMS,
{ DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT,
DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT,
DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT,
......@@ -166,7 +166,7 @@ static dnslib_rrtype_descriptor_t dnslib_rrtype_descriptors[DNSLIB_RRTYPE_DESCRI
{ DNSLIB_RRTYPE_OPT, "OPT", 1,
{ DNSLIB_RDATA_WF_BINARY }, true },
/* 42 */
{ DNSLIB_RRTYPE_APL, "APL", MAX_RDATA_ITEMS,
{ DNSLIB_RRTYPE_APL, "APL", DNSLIB_MAX_RDATA_ITEMS,
{ DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL,
DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL,
DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL, DNSLIB_RDATA_WF_APL,
......@@ -229,7 +229,7 @@ static dnslib_rrtype_descriptor_t dnslib_rrtype_descriptors[DNSLIB_RRTYPE_DESCRI
/* There's a GNU extension that works like this: [first ... last] = value */
/* 99 */
[99] = { DNSLIB_RRTYPE_SPF, "SPF", MAX_RDATA_ITEMS,
[99] = { DNSLIB_RRTYPE_SPF, "SPF", DNSLIB_MAX_RDATA_ITEMS,
{ DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT,
DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT,
DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT, DNSLIB_RDATA_WF_TEXT,
......
......@@ -17,9 +17,10 @@
enum mxrdtln
{
MAX_RDATA_ITEMS = 64,
MAX_RDATA_ITEM_SIZE = 255,
MAX_RDATA_WIRE_SIZE = MAX_RDATA_ITEMS * MAX_RDATA_ITEM_SIZE
DNSLIB_MAX_RDATA_ITEMS = 64,
DNSLIB_MAX_RDATA_ITEM_SIZE = 255,
DNSLIB_MAX_RDATA_WIRE_SIZE =
DNSLIB_MAX_RDATA_ITEMS * DNSLIB_MAX_RDATA_ITEM_SIZE
};
//#define MAXRDATALEN 64
......@@ -76,30 +77,27 @@ enum dnslib_rr_type
DNSLIB_RRTYPE_RT, /* 21 - RFC1183 */
DNSLIB_RRTYPE_NSAP, /* 22 - RFC1706 */
DNSLIB_RRTYPE_SIG, /* 24 - 2535typecode */
DNSLIB_RRTYPE_SIG = 24, /* 24 - 2535typecode */
DNSLIB_RRTYPE_KEY, /* 25 - 2535typecode */
DNSLIB_RRTYPE_PX, /* 26 - RFC2163 */
DNSLIB_RRTYPE_AAAA, /* 28 - ipv6 address */
DNSLIB_RRTYPE_AAAA = 28, /* 28 - ipv6 address */
DNSLIB_RRTYPE_LOC, /* 29 - LOC record RFC1876 */
DNSLIB_RRTYPE_NXT, /* 30 - 2535typecode */
DNSLIB_RRTYPE_SRV, /* 33 - SRV record RFC2782 */
DNSLIB_RRTYPE_SRV = 33, /* 33 - SRV record RFC2782 */
DNSLIB_RRTYPE_NAPTR, /* 35 - RFC2915 */
DNSLIB_RRTYPE_NAPTR = 35, /* 35 - RFC2915 */
DNSLIB_RRTYPE_KX, /* 36 - RFC2230 Key Exchange Delegation Record */
DNSLIB_RRTYPE_CERT, /* 37 - RFC2538 */
DNSLIB_RRTYPE_A6, /* 38 - RFC2874 */
DNSLIB_RRTYPE_DNAME, /* 39 - RFC2672 */
DNSLIB_RRTYPE_A6, /* 38 - RFC2874 */
DNSLIB_RRTYPE_DNAME, /* 39 - RFC2672 */
DNSLIB_RRTYPE_OPT, /* 41 - Pseudo OPT record... */
DNSLIB_RRTYPE_OPT = 41, /* 41 - Pseudo OPT record... */
DNSLIB_RRTYPE_APL, /* 42 - RFC3123 */
DNSLIB_RRTYPE_DS, /* 43 - RFC 4033, 4034, and 4035 */
DNSLIB_RRTYPE_SSHFP, /* 44 - SSH Key Fingerprint */
DNSLIB_RRTYPE_IPSECKEY, /* 45 - public key for ipsec use. RFC 4025 */
DNSLIB_RRTYPE_RRSIG, /* 46 - RFC 4033, 4034, and 4035 */
DNSLIB_RRTYPE_NSEC, /* 47 - RFC 4033, 4034, and 4035 */
DNSLIB_RRTYPE_DNSKEY, /* 48 - RFC 4033, 4034, and 4035 */
......@@ -160,7 +158,7 @@ struct dnslib_rrtype_descriptor
uint16_t type; /* RR type */
const char *name; /* Textual name. */
uint8_t length; /* Maximum number of RDATA items. */
uint8_t wireformat[MAX_RDATA_ITEMS]; /* rdata_wireformat_type */
uint8_t wireformat[DNSLIB_MAX_RDATA_ITEMS]; /* rdata_wireformat_type */
bool fixed_items; /* Has fixed number of RDATA items? */
};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment