Changeset View
Changeset View
Standalone View
Standalone View
contrib/ldns/ldns/rr.h
Show All 30 Lines | |||||
#define LDNS_MAX_LABELLEN 63 | #define LDNS_MAX_LABELLEN 63 | ||||
/** Maximum length of a complete dname */ | /** Maximum length of a complete dname */ | ||||
#define LDNS_MAX_DOMAINLEN 255 | #define LDNS_MAX_DOMAINLEN 255 | ||||
/** Maximum number of pointers in 1 dname */ | /** Maximum number of pointers in 1 dname */ | ||||
#define LDNS_MAX_POINTERS 65535 | #define LDNS_MAX_POINTERS 65535 | ||||
/** The bytes TTL, CLASS and length use up in an rr */ | /** The bytes TTL, CLASS and length use up in an rr */ | ||||
#define LDNS_RR_OVERHEAD 10 | #define LDNS_RR_OVERHEAD 10 | ||||
/* The first fields are contiguous and can be referenced instantly */ | |||||
#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON 259 | |||||
/** | /** | ||||
* The different RR classes. | * The different RR classes. | ||||
*/ | */ | ||||
enum ldns_enum_rr_class | enum ldns_enum_rr_class | ||||
{ | { | ||||
/** the Internet */ | /** the Internet */ | ||||
LDNS_RR_CLASS_IN = 1, | LDNS_RR_CLASS_IN = 1, | ||||
/** Chaos class */ | /** Chaos class */ | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | enum ldns_enum_rr_type | ||||
/** RFC2538 */ | /** RFC2538 */ | ||||
LDNS_RR_TYPE_CERT = 37, | LDNS_RR_TYPE_CERT = 37, | ||||
/** RFC2874 */ | /** RFC2874 */ | ||||
LDNS_RR_TYPE_A6 = 38, | LDNS_RR_TYPE_A6 = 38, | ||||
/** RFC2672 */ | /** RFC2672 */ | ||||
LDNS_RR_TYPE_DNAME = 39, | LDNS_RR_TYPE_DNAME = 39, | ||||
/** dnsind-kitchen-sink-02.txt */ | /** dnsind-kitchen-sink-02.txt */ | ||||
LDNS_RR_TYPE_SINK = 40, | LDNS_RR_TYPE_SINK = 40, | ||||
/** Pseudo OPT record... */ | /** OPT record RFC 6891 */ | ||||
LDNS_RR_TYPE_OPT = 41, | LDNS_RR_TYPE_OPT = 41, | ||||
/** RFC3123 */ | /** RFC3123 */ | ||||
LDNS_RR_TYPE_APL = 42, | LDNS_RR_TYPE_APL = 42, | ||||
/** RFC4034, RFC3658 */ | /** RFC4034, RFC3658 */ | ||||
LDNS_RR_TYPE_DS = 43, | LDNS_RR_TYPE_DS = 43, | ||||
/** SSH Key Fingerprint */ | /** SSH Key Fingerprint */ | ||||
LDNS_RR_TYPE_SSHFP = 44, /* RFC 4255 */ | LDNS_RR_TYPE_SSHFP = 44, /* RFC 4255 */ | ||||
/** IPsec Key */ | /** IPsec Key */ | ||||
LDNS_RR_TYPE_IPSECKEY = 45, /* RFC 4025 */ | LDNS_RR_TYPE_IPSECKEY = 45, /* RFC 4025 */ | ||||
/** DNSSEC */ | /** DNSSEC */ | ||||
LDNS_RR_TYPE_RRSIG = 46, /* RFC 4034 */ | LDNS_RR_TYPE_RRSIG = 46, /* RFC 4034 */ | ||||
LDNS_RR_TYPE_NSEC = 47, /* RFC 4034 */ | LDNS_RR_TYPE_NSEC = 47, /* RFC 4034 */ | ||||
LDNS_RR_TYPE_DNSKEY = 48, /* RFC 4034 */ | LDNS_RR_TYPE_DNSKEY = 48, /* RFC 4034 */ | ||||
LDNS_RR_TYPE_DHCID = 49, /* RFC 4701 */ | LDNS_RR_TYPE_DHCID = 49, /* RFC 4701 */ | ||||
/* NSEC3 */ | /* NSEC3 */ | ||||
LDNS_RR_TYPE_NSEC3 = 50, /* RFC 5155 */ | LDNS_RR_TYPE_NSEC3 = 50, /* RFC 5155 */ | ||||
LDNS_RR_TYPE_NSEC3PARAM = 51, /* RFC 5155 */ | LDNS_RR_TYPE_NSEC3PARAM = 51, /* RFC 5155 */ | ||||
LDNS_RR_TYPE_NSEC3PARAMS = 51, | LDNS_RR_TYPE_NSEC3PARAMS = 51, | ||||
LDNS_RR_TYPE_TLSA = 52, /* RFC 6698 */ | LDNS_RR_TYPE_TLSA = 52, /* RFC 6698 */ | ||||
LDNS_RR_TYPE_SMIMEA = 53, /* draft-ietf-dane-smime */ | LDNS_RR_TYPE_SMIMEA = 53, /* RFC 8162 */ | ||||
LDNS_RR_TYPE_HIP = 55, /* RFC 5205 */ | LDNS_RR_TYPE_HIP = 55, /* RFC 5205 */ | ||||
/** draft-reid-dnsext-zs */ | /** draft-reid-dnsext-zs */ | ||||
LDNS_RR_TYPE_NINFO = 56, | LDNS_RR_TYPE_NINFO = 56, | ||||
/** draft-reid-dnsext-rkey */ | /** draft-reid-dnsext-rkey */ | ||||
LDNS_RR_TYPE_RKEY = 57, | LDNS_RR_TYPE_RKEY = 57, | ||||
/** draft-ietf-dnsop-trust-history */ | /** draft-ietf-dnsop-trust-history */ | ||||
LDNS_RR_TYPE_TALINK = 58, | LDNS_RR_TYPE_TALINK = 58, | ||||
LDNS_RR_TYPE_CDS = 59, /* RFC 7344 */ | LDNS_RR_TYPE_CDS = 59, /* RFC 7344 */ | ||||
LDNS_RR_TYPE_CDNSKEY = 60, /* RFC 7344 */ | LDNS_RR_TYPE_CDNSKEY = 60, /* RFC 7344 */ | ||||
LDNS_RR_TYPE_OPENPGPKEY = 61, /* RFC 7929 */ | LDNS_RR_TYPE_OPENPGPKEY = 61, /* RFC 7929 */ | ||||
LDNS_RR_TYPE_CSYNC = 62, /* RFC 7477 */ | LDNS_RR_TYPE_CSYNC = 62, /* RFC 7477 */ | ||||
LDNS_RR_TYPE_ZONEMD = 63, /* draft-ietf-dnsop-dns-zone-digest */ | |||||
LDNS_RR_TYPE_SVCB = 64, /* draft-ietf-dnsop-svcb-https */ | |||||
LDNS_RR_TYPE_HTTPS = 65, /* draft-ietf-dnsop-svcb-https */ | |||||
LDNS_RR_TYPE_SPF = 99, /* RFC 4408 */ | LDNS_RR_TYPE_SPF = 99, /* RFC 4408 */ | ||||
LDNS_RR_TYPE_UINFO = 100, | LDNS_RR_TYPE_UINFO = 100, | ||||
LDNS_RR_TYPE_UID = 101, | LDNS_RR_TYPE_UID = 101, | ||||
LDNS_RR_TYPE_GID = 102, | LDNS_RR_TYPE_GID = 102, | ||||
LDNS_RR_TYPE_UNSPEC = 103, | LDNS_RR_TYPE_UNSPEC = 103, | ||||
Show All 13 Lines | enum ldns_enum_rr_type | ||||
LDNS_RR_TYPE_MAILB = 253, | LDNS_RR_TYPE_MAILB = 253, | ||||
/** A request for mail agent RRs (Obsolete - see MX) */ | /** A request for mail agent RRs (Obsolete - see MX) */ | ||||
LDNS_RR_TYPE_MAILA = 254, | LDNS_RR_TYPE_MAILA = 254, | ||||
/** any type (wildcard) */ | /** any type (wildcard) */ | ||||
LDNS_RR_TYPE_ANY = 255, | LDNS_RR_TYPE_ANY = 255, | ||||
LDNS_RR_TYPE_URI = 256, /* RFC 7553 */ | LDNS_RR_TYPE_URI = 256, /* RFC 7553 */ | ||||
LDNS_RR_TYPE_CAA = 257, /* RFC 6844 */ | LDNS_RR_TYPE_CAA = 257, /* RFC 6844 */ | ||||
LDNS_RR_TYPE_AVC = 258, /* Cisco's DNS-AS RR, see www.dns-as.org */ | LDNS_RR_TYPE_AVC = 258, /* Cisco's DNS-AS RR, see www.dns-as.org */ | ||||
LDNS_RR_TYPE_DOA = 259, /* draft-durand-doa-over-dns */ | |||||
/** draft-ietf-mboned-driad-amt-discovery **/ | |||||
LDNS_RR_TYPE_AMTRELAY = 260, | |||||
/** DNSSEC Trust Authorities */ | /** DNSSEC Trust Authorities */ | ||||
LDNS_RR_TYPE_TA = 32768, | LDNS_RR_TYPE_TA = 32768, | ||||
/* RFC 4431, 5074, DNSSEC Lookaside Validation */ | /* RFC 4431, 5074, DNSSEC Lookaside Validation */ | ||||
LDNS_RR_TYPE_DLV = 32769, | LDNS_RR_TYPE_DLV = 32769, | ||||
/* type codes from nsec3 experimental phase | /* type codes from nsec3 experimental phase | ||||
LDNS_RR_TYPE_NSEC3 = 65324, | LDNS_RR_TYPE_NSEC3 = 65324, | ||||
LDNS_RR_TYPE_NSEC3PARAMS = 65325, */ | LDNS_RR_TYPE_NSEC3PARAMS = 65325, */ | ||||
LDNS_RR_TYPE_FIRST = 0, | LDNS_RR_TYPE_FIRST = 0, | ||||
LDNS_RR_TYPE_LAST = 65535, | LDNS_RR_TYPE_LAST = 65535, | ||||
LDNS_RR_TYPE_COUNT = LDNS_RR_TYPE_LAST - LDNS_RR_TYPE_FIRST + 1 | LDNS_RR_TYPE_COUNT = LDNS_RR_TYPE_LAST - LDNS_RR_TYPE_FIRST + 1 | ||||
}; | }; | ||||
typedef enum ldns_enum_rr_type ldns_rr_type; | typedef enum ldns_enum_rr_type ldns_rr_type; | ||||
/* The first fields are contiguous and can be referenced instantly */ | |||||
#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON (LDNS_RR_TYPE_AMTRELAY + 1) | |||||
/** | /** | ||||
* Resource Record | * Resource Record | ||||
* | * | ||||
* This is the basic DNS element that contains actual data | * This is the basic DNS element that contains actual data | ||||
* | * | ||||
* From RFC1035: | * From RFC1035: | ||||
* <pre> | * <pre> | ||||
3.2.1. Format | 3.2.1. Format | ||||
▲ Show 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | |||||
void ldns_rr_set_class(ldns_rr *rr, ldns_rr_class rr_class); | void ldns_rr_set_class(ldns_rr *rr, ldns_rr_class rr_class); | ||||
/** | /** | ||||
* sets a rdf member, it will be set on the | * sets a rdf member, it will be set on the | ||||
* position given. The old value is returned, like pop. | * position given. The old value is returned, like pop. | ||||
* \param[in] *rr the rr to operate on | * \param[in] *rr the rr to operate on | ||||
* \param[in] *f the rdf to set | * \param[in] *f the rdf to set | ||||
* \param[in] position the position the set the rdf | * \param[in] position the position the set the rdf | ||||
* \return the old value in the rr, NULL on failyre | * \return the old value in the rr, NULL on failure | ||||
*/ | */ | ||||
ldns_rdf* ldns_rr_set_rdf(ldns_rr *rr, const ldns_rdf *f, size_t position); | ldns_rdf* ldns_rr_set_rdf(ldns_rr *rr, const ldns_rdf *f, size_t position); | ||||
/** | /** | ||||
* sets rd_field member, it will be | * sets rd_field member, it will be | ||||
* placed in the next available spot. | * placed in the next available spot. | ||||
* \param[in] *rr rr to operate on | * \param[in] *rr rr to operate on | ||||
* \param[in] *f the data field member to set | * \param[in] *f the data field member to set | ||||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | |||||
* same DNSKEY record as the other record | * same DNSKEY record as the other record | ||||
* \param[in] rr1 the first rr | * \param[in] rr1 the first rr | ||||
* \param[in] rr2 the second rr | * \param[in] rr2 the second rr | ||||
* \return true if equal otherwise false | * \return true if equal otherwise false | ||||
*/ | */ | ||||
bool ldns_rr_compare_ds(const ldns_rr *rr1, const ldns_rr *rr2); | bool ldns_rr_compare_ds(const ldns_rr *rr1, const ldns_rr *rr2); | ||||
/** | /** | ||||
* compares two rr listss. | * compares two rr lists. | ||||
* \param[in] rrl1 the first one | * \param[in] rrl1 the first one | ||||
* \param[in] rrl2 the second one | * \param[in] rrl2 the second one | ||||
* \return 0 if equal | * \return 0 if equal | ||||
* -1 if rrl1 comes before rrl2 | * -1 if rrl1 comes before rrl2 | ||||
* +1 if rrl2 comes before rrl1 | * +1 if rrl2 comes before rrl1 | ||||
*/ | */ | ||||
int ldns_rr_list_compare(const ldns_rr_list *rrl1, const ldns_rr_list *rrl2); | int ldns_rr_list_compare(const ldns_rr_list *rrl1, const ldns_rr_list *rrl2); | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |