2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

rdata code review

This commit is contained in:
Bob Halley 2000-03-16 22:42:32 +00:00
parent 76e9eb5ba6
commit 1db2e6b81a
2 changed files with 52 additions and 47 deletions

View File

@ -15,7 +15,11 @@
* SOFTWARE.
*/
/* $Id: hinfo_13.c,v 1.19 2000/02/03 23:42:59 halley Exp $ */
/* $Id: hinfo_13.c,v 1.20 2000/03/16 22:42:32 halley Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
*/
#ifndef RDATA_GENERIC_HINFO_13_C
#define RDATA_GENERIC_HINFO_13_C
@ -28,11 +32,11 @@ fromtext_hinfo(dns_rdataclass_t rdclass, dns_rdatatype_t type,
isc_token_t token;
int i;
REQUIRE(type == 13);
UNUSED(rdclass);
UNUSED(origin);
UNUSED(downcase);
rdclass = rdclass; /*unused*/
origin = origin; /*unused*/
downcase = downcase; /*unused*/
REQUIRE(type == 13);
for (i = 0; i < 2 ; i++) {
RETERR(gettoken(lexer, &token, isc_tokentype_qstring,
@ -48,9 +52,9 @@ totext_hinfo(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
{
isc_region_t region;
REQUIRE(rdata->type == 13);
UNUSED(tctx);
tctx = tctx; /*unused*/
REQUIRE(rdata->type == 13);
dns_rdata_toregion(rdata, &region);
RETERR(txt_totext(&region, target));
@ -64,11 +68,11 @@ fromwire_hinfo(dns_rdataclass_t rdclass, dns_rdatatype_t type,
isc_boolean_t downcase, isc_buffer_t *target)
{
REQUIRE(type == 13);
UNUSED(dctx);
UNUSED(rdclass);
UNUSED(downcase);
dctx = dctx; /* unused */
rdclass = rdclass; /* unused */
downcase = downcase; /* unused */
REQUIRE(type == 13);
RETERR(txt_fromwire(source, target));
return (txt_fromwire(source, target));
@ -77,9 +81,9 @@ fromwire_hinfo(dns_rdataclass_t rdclass, dns_rdatatype_t type,
static inline isc_result_t
towire_hinfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
REQUIRE(rdata->type == 13);
UNUSED(cctx);
cctx = cctx; /*unused*/
REQUIRE(rdata->type == 13);
return (mem_tobuffer(target, rdata->data, rdata->length));
}
@ -102,14 +106,12 @@ static inline isc_result_t
fromstruct_hinfo(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
isc_buffer_t *target)
{
UNUSED(rdclass);
UNUSED(source);
UNUSED(target);
REQUIRE(type == 13);
rdclass = rdclass; /*unused*/
source = source;
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
@ -118,8 +120,8 @@ tostruct_hinfo(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
REQUIRE(rdata->type == 13);
target = target;
mctx = mctx;
UNUSED(target);
UNUSED(mctx);
return (DNS_R_NOTIMPLEMENTED);
}
@ -134,10 +136,10 @@ static inline isc_result_t
additionaldata_hinfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
void *arg)
{
REQUIRE(rdata->type == 13);
UNUSED(add);
UNUSED(arg);
(void)add;
(void)arg;
REQUIRE(rdata->type == 13);
return (DNS_R_SUCCESS);
}

View File

@ -15,9 +15,13 @@
* SOFTWARE.
*/
/* $Id: key_25.c,v 1.16 2000/02/03 23:43:00 halley Exp $ */
/* $Id: key_25.c,v 1.17 2000/03/16 22:42:32 halley Exp $ */
/* RFC 2065 */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
*/
/* RFC 2535 */
#ifndef RDATA_GENERIC_KEY_25_C
#define RDATA_GENERIC_KEY_25_C
@ -32,11 +36,11 @@ fromtext_key(dns_rdataclass_t rdclass, dns_rdatatype_t type,
dns_secproto_t proto;
dns_keyflags_t flags;
REQUIRE(type == 25);
UNUSED(rdclass);
UNUSED(origin);
UNUSED(downcase);
rdclass = rdclass; /*unused*/
origin = origin; /*unused*/
downcase = downcase; /*unused*/
REQUIRE(type == 25);
/* flags */
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
@ -68,9 +72,9 @@ totext_key(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
char buf[sizeof "64000"];
unsigned int flags;
REQUIRE(rdata->type == 25);
UNUSED(tctx);
tctx = tctx; /*unused*/
REQUIRE(rdata->type == 25);
dns_rdata_toregion(rdata, &sr);
@ -115,11 +119,11 @@ fromwire_key(dns_rdataclass_t rdclass, dns_rdatatype_t type,
{
isc_region_t sr;
UNUSED(rdclass);
UNUSED(dctx);
UNUSED(downcase);
REQUIRE(type == 25);
rdclass = rdclass; /*unused*/
dctx = dctx; /*unused*/
downcase = downcase; /*unused*/
isc_buffer_active(source, &sr);
if (sr.length < 4)
@ -133,9 +137,9 @@ static inline isc_result_t
towire_key(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
isc_region_t sr;
REQUIRE(rdata->type == 25);
UNUSED(cctx);
cctx = cctx; /*unused*/
REQUIRE(rdata->type == 25);
dns_rdata_toregion(rdata, &sr);
return (mem_tobuffer(target, sr.base, sr.length));
@ -162,13 +166,12 @@ fromstruct_key(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
dns_rdata_generic_key_t *key;
isc_region_t tr;
UNUSED(rdclass);
UNUSED(source);
UNUSED(target);
REQUIRE(type == 25);
rdclass = rdclass; /*unused*/
source = source;
target = target;
key = (dns_rdata_generic_key_t *) source;
REQUIRE(key->mctx != NULL);
@ -198,10 +201,10 @@ tostruct_key(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
dns_rdata_generic_key_t *key;
isc_region_t sr;
UNUSED(target);
UNUSED(mctx);
REQUIRE(rdata->type == 25);
target = target;
mctx = mctx;
key = (dns_rdata_generic_key_t *) target;
key->common.rdclass = rdata->rdclass;
@ -260,8 +263,8 @@ additionaldata_key(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
{
REQUIRE(rdata->type == 25);
(void)add;
(void)arg;
UNUSED(add);
UNUSED(arg);
return (DNS_R_SUCCESS);
}