Commit e27a69f8 authored by Bob Halley's avatar Bob Halley
Browse files

add digest support

parent 20dbb03b
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: tsig_250.c,v 1.16 1999/08/25 14:22:38 bwelling Exp $ */
/* $Id: tsig_250.c,v 1.17 1999/08/31 22:05:52 halley Exp $ */
/* draft-ietf-dnsind-tsig-07.txt */
......@@ -486,4 +486,17 @@ additionaldata_any_tsig(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_any_tsig(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255);
(void)digest;
(void)arg;
return (DNS_R_NOTIMPLEMENTED);
}
#endif /* RDATA_ANY_255_TSIG_250_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: afsdb_18.c,v 1.11 1999/08/12 01:32:29 halley Exp $ */
/* $Id: afsdb_18.c,v 1.12 1999/08/31 22:05:53 halley Exp $ */
/* RFC 1183 */
......@@ -218,4 +218,24 @@ additionaldata_afsdb(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return ((add)(arg, &name, dns_rdatatype_a));
}
static inline dns_result_t
digest_afsdb(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r1, r2;
isc_result_t result;
dns_name_t name;
REQUIRE(rdata->type == 18);
dns_rdata_toregion(rdata, &r1);
r2 = r1;
isc_region_consume(&r2, 2);
r1.length = 2;
result = (digest)(arg, &r1);
if (result != ISC_R_SUCCESS)
return (result);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r2);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_AFSDB_18_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cert_37.c,v 1.12 1999/08/12 01:32:29 halley Exp $ */
/* $Id: cert_37.c,v 1.13 1999/08/31 22:05:53 halley Exp $ */
/* draft-ietf-dnssec-certs-04.txt */
......@@ -206,4 +206,15 @@ additionaldata_cert(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_cert(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
REQUIRE(rdata->type == 37);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
#endif /* RDATA_GENERIC_CERT_37_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cname_5.c,v 1.16 1999/08/12 01:32:29 halley Exp $ */
/* $Id: cname_5.c,v 1.17 1999/08/31 22:05:53 halley Exp $ */
#ifndef RDATA_GENERIC_CNAME_5_C
#define RDATA_GENERIC_CNAME_5_C
......@@ -171,4 +171,18 @@ additionaldata_cname(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_cname(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 5);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_CNAME_5_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: dname_39.c,v 1.9 1999/08/12 01:32:30 halley Exp $ */
/* $Id: dname_39.c,v 1.10 1999/08/31 22:05:53 halley Exp $ */
/* draft-ietf-dnsind-dname-02.txt */
......@@ -171,4 +171,18 @@ additionaldata_dname(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_dname(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 39);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_DNAME_39_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: gpos_27.c,v 1.7 1999/08/12 01:32:30 halley Exp $ */
/* $Id: gpos_27.c,v 1.8 1999/08/31 22:05:53 halley Exp $ */
/* RFC 1712 */
......@@ -152,4 +152,15 @@ additionaldata_gpos(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_gpos(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
REQUIRE(rdata->type == 27);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
#endif /* RDATA_GENERIC_GPOS_27_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: hinfo_13.c,v 1.15 1999/08/12 01:32:30 halley Exp $ */
/* $Id: hinfo_13.c,v 1.16 1999/08/31 22:05:53 halley Exp $ */
#ifndef RDATA_GENERIC_HINFO_13_C
#define RDATA_GENERIC_HINFO_13_C
......@@ -142,4 +142,15 @@ additionaldata_hinfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_hinfo(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
REQUIRE(rdata->type == 13);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
#endif /* RDATA_GENERIC_HINFO_13_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: isdn_20.c,v 1.8 1999/08/12 01:32:30 halley Exp $ */
/* $Id: isdn_20.c,v 1.9 1999/08/31 22:05:53 halley Exp $ */
/* RFC 1183 */
......@@ -153,4 +153,15 @@ additionaldata_isdn(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_isdn(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
REQUIRE(rdata->type == 20);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
#endif /* RDATA_GENERIC_ISDN_20_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: key_25.c,v 1.10 1999/08/12 01:32:30 halley Exp $ */
/* $Id: key_25.c,v 1.11 1999/08/31 22:05:53 halley Exp $ */
/* RFC 2065 */
......@@ -201,4 +201,15 @@ additionaldata_key(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_key(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
REQUIRE(rdata->type == 25);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
#endif /* RDATA_GENERIC_KEY_25_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: loc_29.c,v 1.7 1999/08/12 01:32:30 halley Exp $ */
/* $Id: loc_29.c,v 1.8 1999/08/31 22:05:53 halley Exp $ */
/* RFC 1876 */
......@@ -606,4 +606,15 @@ additionaldata_loc(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_loc(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
REQUIRE(rdata->type == 29);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
#endif /* RDATA_GENERIC_LOC_29_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mb_7.c,v 1.17 1999/08/12 01:32:30 halley Exp $ */
/* $Id: mb_7.c,v 1.18 1999/08/31 22:05:53 halley Exp $ */
#ifndef RDATA_GENERIC_MB_7_C
#define RDATA_GENERIC_MB_7_C
......@@ -174,4 +174,18 @@ additionaldata_mb(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return ((add)(arg, &name, dns_rdatatype_a));
}
static inline dns_result_t
digest_mb(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 7);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_MB_7_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: md_3.c,v 1.17 1999/08/12 01:32:30 halley Exp $ */
/* $Id: md_3.c,v 1.18 1999/08/31 22:05:53 halley Exp $ */
#ifndef RDATA_GENERIC_MD_3_C
#define RDATA_GENERIC_MD_3_C
......@@ -174,4 +174,18 @@ additionaldata_md(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return ((add)(arg, &name, dns_rdatatype_a));
}
static inline dns_result_t
digest_md(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 3);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_MD_3_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mf_4.c,v 1.16 1999/08/12 01:32:30 halley Exp $ */
/* $Id: mf_4.c,v 1.17 1999/08/31 22:05:53 halley Exp $ */
#ifndef RDATA_GENERIC_MF_4_C
#define RDATA_GENERIC_MF_4_C
......@@ -174,4 +174,18 @@ additionaldata_mf(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return ((add)(arg, &name, dns_rdatatype_a));
}
static inline dns_result_t
digest_mf(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 4);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_MF_4_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mg_8.c,v 1.15 1999/08/12 01:32:30 halley Exp $ */
/* $Id: mg_8.c,v 1.16 1999/08/31 22:05:54 halley Exp $ */
#ifndef RDATA_GENERIC_MG_8_C
#define RDATA_GENERIC_MG_8_C
......@@ -170,4 +170,18 @@ additionaldata_mg(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_mg(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 8);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_MG_8_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: minfo_14.c,v 1.16 1999/08/12 01:32:30 halley Exp $ */
/* $Id: minfo_14.c,v 1.17 1999/08/31 22:05:54 halley Exp $ */
#ifndef RDATA_GENERIC_MINFO_14_C
#define RDATA_GENERIC_MINFO_14_C
......@@ -216,4 +216,25 @@ additionaldata_minfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_minfo(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
dns_result_t result;
REQUIRE(rdata->type == 14);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
result = dns_name_digest(&name, digest, arg);
if (result != DNS_R_SUCCESS)
return (result);
isc_region_consume(&r, name_length(&name));
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_MINFO_14_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mr_9.c,v 1.15 1999/08/12 01:32:31 halley Exp $ */
/* $Id: mr_9.c,v 1.16 1999/08/31 22:05:54 halley Exp $ */
#ifndef RDATA_GENERIC_MR_9_C
#define RDATA_GENERIC_MR_9_C
......@@ -170,4 +170,18 @@ additionaldata_mr(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_mr(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 9);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_MR_9_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mx_15.c,v 1.19 1999/08/12 01:32:31 halley Exp $ */
/* $Id: mx_15.c,v 1.20 1999/08/31 22:05:54 halley Exp $ */
#ifndef RDATA_GENERIC_MX_15_C
#define RDATA_GENERIC_MX_15_C
......@@ -212,4 +212,24 @@ additionaldata_mx(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return ((add)(arg, &name, dns_rdatatype_a));
}
static inline dns_result_t
digest_mx(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r1, r2;
isc_result_t result;
dns_name_t name;
REQUIRE(rdata->type == 15);
dns_rdata_toregion(rdata, &r1);
r2 = r1;
isc_region_consume(&r2, 2);
r1.length = 2;
result = (digest)(arg, &r1);
if (result != ISC_R_SUCCESS)
return (result);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r2);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_MX_15_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: ns_2.c,v 1.16 1999/08/12 01:32:31 halley Exp $ */
/* $Id: ns_2.c,v 1.17 1999/08/31 22:05:54 halley Exp $ */
#ifndef RDATA_GENERIC_NS_2_C
#define RDATA_GENERIC_NS_2_C
......@@ -184,4 +184,18 @@ additionaldata_ns(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return ((add)(arg, &name, dns_rdatatype_a));
}
static inline dns_result_t
digest_ns(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
REQUIRE(rdata->type == 2);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
return (dns_name_digest(&name, digest, arg));
}
#endif /* RDATA_GENERIC_NS_2_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: null_10.c,v 1.12 1999/08/12 01:32:31 halley Exp $ */
/* $Id: null_10.c,v 1.13 1999/08/31 22:05:54 halley Exp $ */
#ifndef RDATA_GENERIC_NULL_10_C
#define RDATA_GENERIC_NULL_10_C
......@@ -140,4 +140,15 @@ additionaldata_null(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_null(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
REQUIRE(rdata->type == 10);
(void)digest;
(void)arg;
return (DNS_R_SUCCESS);
}
#endif /* RDATA_GENERIC_NULL_10_C */
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: nxt_30.c,v 1.14 1999/08/28 01:48:48 halley Exp $ */
/* $Id: nxt_30.c,v 1.15 1999/08/31 22:05:54 halley Exp $ */
/* RFC 2065 */
......@@ -240,4 +240,23 @@ additionaldata_nxt(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
return (DNS_R_SUCCESS);
}
static inline dns_result_t
digest_nxt(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
isc_region_t r;
dns_name_t name;
dns_result_t result;
REQUIRE(rdata->type == 30);
dns_rdata_toregion(rdata, &r);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &r);
result = dns_name_digest(&name, digest, arg);
if (result != DNS_R_SUCCESS)
return (result);
isc_region_consume(&r, name_length(&name));
return ((digest)(arg, &r));
}
#endif /* RDATA_GENERIC_NXT_30_C */
Markdown is supported
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