mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:25:38 +00:00
rdata code review
This commit is contained in:
@@ -15,7 +15,11 @@
|
|||||||
* SOFTWARE.
|
* 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
|
#ifndef RDATA_GENERIC_HINFO_13_C
|
||||||
#define 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;
|
isc_token_t token;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
REQUIRE(type == 13);
|
UNUSED(rdclass);
|
||||||
|
UNUSED(origin);
|
||||||
|
UNUSED(downcase);
|
||||||
|
|
||||||
rdclass = rdclass; /*unused*/
|
REQUIRE(type == 13);
|
||||||
origin = origin; /*unused*/
|
|
||||||
downcase = downcase; /*unused*/
|
|
||||||
|
|
||||||
for (i = 0; i < 2 ; i++) {
|
for (i = 0; i < 2 ; i++) {
|
||||||
RETERR(gettoken(lexer, &token, isc_tokentype_qstring,
|
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;
|
isc_region_t region;
|
||||||
|
|
||||||
REQUIRE(rdata->type == 13);
|
UNUSED(tctx);
|
||||||
|
|
||||||
tctx = tctx; /*unused*/
|
REQUIRE(rdata->type == 13);
|
||||||
|
|
||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
RETERR(txt_totext(®ion, target));
|
RETERR(txt_totext(®ion, target));
|
||||||
@@ -64,11 +68,11 @@ fromwire_hinfo(dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
|||||||
isc_boolean_t downcase, isc_buffer_t *target)
|
isc_boolean_t downcase, isc_buffer_t *target)
|
||||||
{
|
{
|
||||||
|
|
||||||
REQUIRE(type == 13);
|
UNUSED(dctx);
|
||||||
|
UNUSED(rdclass);
|
||||||
|
UNUSED(downcase);
|
||||||
|
|
||||||
dctx = dctx; /* unused */
|
REQUIRE(type == 13);
|
||||||
rdclass = rdclass; /* unused */
|
|
||||||
downcase = downcase; /* unused */
|
|
||||||
|
|
||||||
RETERR(txt_fromwire(source, target));
|
RETERR(txt_fromwire(source, target));
|
||||||
return (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
|
static inline isc_result_t
|
||||||
towire_hinfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
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));
|
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,
|
fromstruct_hinfo(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
|
||||||
isc_buffer_t *target)
|
isc_buffer_t *target)
|
||||||
{
|
{
|
||||||
|
UNUSED(rdclass);
|
||||||
|
UNUSED(source);
|
||||||
|
UNUSED(target);
|
||||||
|
|
||||||
REQUIRE(type == 13);
|
REQUIRE(type == 13);
|
||||||
|
|
||||||
rdclass = rdclass; /*unused*/
|
|
||||||
|
|
||||||
source = source;
|
|
||||||
target = target;
|
|
||||||
|
|
||||||
return (DNS_R_NOTIMPLEMENTED);
|
return (DNS_R_NOTIMPLEMENTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +120,8 @@ tostruct_hinfo(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
|
|||||||
|
|
||||||
REQUIRE(rdata->type == 13);
|
REQUIRE(rdata->type == 13);
|
||||||
|
|
||||||
target = target;
|
UNUSED(target);
|
||||||
mctx = mctx;
|
UNUSED(mctx);
|
||||||
|
|
||||||
return (DNS_R_NOTIMPLEMENTED);
|
return (DNS_R_NOTIMPLEMENTED);
|
||||||
}
|
}
|
||||||
@@ -134,10 +136,10 @@ static inline isc_result_t
|
|||||||
additionaldata_hinfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
|
additionaldata_hinfo(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
REQUIRE(rdata->type == 13);
|
UNUSED(add);
|
||||||
|
UNUSED(arg);
|
||||||
|
|
||||||
(void)add;
|
REQUIRE(rdata->type == 13);
|
||||||
(void)arg;
|
|
||||||
|
|
||||||
return (DNS_R_SUCCESS);
|
return (DNS_R_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@@ -15,9 +15,13 @@
|
|||||||
* SOFTWARE.
|
* 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
|
#ifndef RDATA_GENERIC_KEY_25_C
|
||||||
#define 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_secproto_t proto;
|
||||||
dns_keyflags_t flags;
|
dns_keyflags_t flags;
|
||||||
|
|
||||||
REQUIRE(type == 25);
|
UNUSED(rdclass);
|
||||||
|
UNUSED(origin);
|
||||||
|
UNUSED(downcase);
|
||||||
|
|
||||||
rdclass = rdclass; /*unused*/
|
REQUIRE(type == 25);
|
||||||
origin = origin; /*unused*/
|
|
||||||
downcase = downcase; /*unused*/
|
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
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"];
|
char buf[sizeof "64000"];
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
|
|
||||||
REQUIRE(rdata->type == 25);
|
UNUSED(tctx);
|
||||||
|
|
||||||
tctx = tctx; /*unused*/
|
REQUIRE(rdata->type == 25);
|
||||||
|
|
||||||
dns_rdata_toregion(rdata, &sr);
|
dns_rdata_toregion(rdata, &sr);
|
||||||
|
|
||||||
@@ -115,11 +119,11 @@ fromwire_key(dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
|||||||
{
|
{
|
||||||
isc_region_t sr;
|
isc_region_t sr;
|
||||||
|
|
||||||
|
UNUSED(rdclass);
|
||||||
|
UNUSED(dctx);
|
||||||
|
UNUSED(downcase);
|
||||||
|
|
||||||
REQUIRE(type == 25);
|
REQUIRE(type == 25);
|
||||||
|
|
||||||
rdclass = rdclass; /*unused*/
|
|
||||||
dctx = dctx; /*unused*/
|
|
||||||
downcase = downcase; /*unused*/
|
|
||||||
|
|
||||||
isc_buffer_active(source, &sr);
|
isc_buffer_active(source, &sr);
|
||||||
if (sr.length < 4)
|
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) {
|
towire_key(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||||
isc_region_t sr;
|
isc_region_t sr;
|
||||||
|
|
||||||
REQUIRE(rdata->type == 25);
|
UNUSED(cctx);
|
||||||
|
|
||||||
cctx = cctx; /*unused*/
|
REQUIRE(rdata->type == 25);
|
||||||
|
|
||||||
dns_rdata_toregion(rdata, &sr);
|
dns_rdata_toregion(rdata, &sr);
|
||||||
return (mem_tobuffer(target, sr.base, sr.length));
|
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;
|
dns_rdata_generic_key_t *key;
|
||||||
isc_region_t tr;
|
isc_region_t tr;
|
||||||
|
|
||||||
|
UNUSED(rdclass);
|
||||||
|
UNUSED(source);
|
||||||
|
UNUSED(target);
|
||||||
|
|
||||||
REQUIRE(type == 25);
|
REQUIRE(type == 25);
|
||||||
|
|
||||||
rdclass = rdclass; /*unused*/
|
|
||||||
|
|
||||||
source = source;
|
|
||||||
target = target;
|
|
||||||
|
|
||||||
key = (dns_rdata_generic_key_t *) source;
|
key = (dns_rdata_generic_key_t *) source;
|
||||||
REQUIRE(key->mctx != NULL);
|
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;
|
dns_rdata_generic_key_t *key;
|
||||||
isc_region_t sr;
|
isc_region_t sr;
|
||||||
|
|
||||||
|
UNUSED(target);
|
||||||
|
UNUSED(mctx);
|
||||||
|
|
||||||
REQUIRE(rdata->type == 25);
|
REQUIRE(rdata->type == 25);
|
||||||
|
|
||||||
target = target;
|
|
||||||
mctx = mctx;
|
|
||||||
|
|
||||||
key = (dns_rdata_generic_key_t *) target;
|
key = (dns_rdata_generic_key_t *) target;
|
||||||
key->common.rdclass = rdata->rdclass;
|
key->common.rdclass = rdata->rdclass;
|
||||||
@@ -260,8 +263,8 @@ additionaldata_key(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
|
|||||||
{
|
{
|
||||||
REQUIRE(rdata->type == 25);
|
REQUIRE(rdata->type == 25);
|
||||||
|
|
||||||
(void)add;
|
UNUSED(add);
|
||||||
(void)arg;
|
UNUSED(arg);
|
||||||
|
|
||||||
return (DNS_R_SUCCESS);
|
return (DNS_R_SUCCESS);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user