mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
code review
This commit is contained in:
@@ -15,9 +15,11 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: nsap_22.c,v 1.12 2000/02/03 23:43:18 halley Exp $ */
|
/* $Id: nsap_22.c,v 1.13 2000/03/17 19:35:25 gson Exp $ */
|
||||||
|
|
||||||
/* RFC 1706 */
|
/* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */
|
||||||
|
|
||||||
|
/* RFC 1706 */
|
||||||
|
|
||||||
#ifndef RDATA_IN_1_NSAP_22_C
|
#ifndef RDATA_IN_1_NSAP_22_C
|
||||||
#define RDATA_IN_1_NSAP_22_C
|
#define RDATA_IN_1_NSAP_22_C
|
||||||
@@ -32,13 +34,13 @@ fromtext_in_nsap(dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
|||||||
isc_textregion_t *sr;
|
isc_textregion_t *sr;
|
||||||
int n;
|
int n;
|
||||||
int digits;
|
int digits;
|
||||||
unsigned char c;
|
unsigned char c = 0;
|
||||||
|
|
||||||
REQUIRE(type == 22);
|
REQUIRE(type == 22);
|
||||||
REQUIRE(rdclass == 1);
|
REQUIRE(rdclass == 1);
|
||||||
|
|
||||||
origin = origin; /*unused*/
|
UNUSED(origin);
|
||||||
downcase = downcase; /*unused*/
|
UNUSED(downcase);
|
||||||
|
|
||||||
/* 0x<hex.string.with.periods> */
|
/* 0x<hex.string.with.periods> */
|
||||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||||
@@ -81,11 +83,11 @@ totext_in_nsap(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
|
|||||||
REQUIRE(rdata->type == 22);
|
REQUIRE(rdata->type == 22);
|
||||||
REQUIRE(rdata->rdclass == 1);
|
REQUIRE(rdata->rdclass == 1);
|
||||||
|
|
||||||
tctx = tctx; /* unused */
|
UNUSED(tctx);
|
||||||
|
|
||||||
dns_rdata_toregion(rdata, ®ion);
|
dns_rdata_toregion(rdata, ®ion);
|
||||||
RETERR(str_totext("0x", target));
|
RETERR(str_totext("0x", target));
|
||||||
while (region.length) {
|
while (region.length != 0) {
|
||||||
sprintf(buf, "%02x", region.base[0]);
|
sprintf(buf, "%02x", region.base[0]);
|
||||||
isc_region_consume(®ion, 1);
|
isc_region_consume(®ion, 1);
|
||||||
RETERR(str_totext(buf, target));
|
RETERR(str_totext(buf, target));
|
||||||
@@ -103,9 +105,8 @@ fromwire_in_nsap(dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
|||||||
REQUIRE(type == 22);
|
REQUIRE(type == 22);
|
||||||
REQUIRE(rdclass == 1);
|
REQUIRE(rdclass == 1);
|
||||||
|
|
||||||
dctx = dctx; /* unused */
|
UNUSED(dctx);
|
||||||
downcase = downcase; /* unused */
|
UNUSED(downcase);
|
||||||
|
|
||||||
|
|
||||||
isc_buffer_active(source, ®ion);
|
isc_buffer_active(source, ®ion);
|
||||||
if (region.length < 1)
|
if (region.length < 1)
|
||||||
@@ -120,7 +121,7 @@ towire_in_nsap(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
|||||||
REQUIRE(rdata->type == 22);
|
REQUIRE(rdata->type == 22);
|
||||||
REQUIRE(rdata->rdclass == 1);
|
REQUIRE(rdata->rdclass == 1);
|
||||||
|
|
||||||
cctx = cctx; /*unused*/
|
UNUSED(cctx);
|
||||||
|
|
||||||
return (mem_tobuffer(target, rdata->data, rdata->length));
|
return (mem_tobuffer(target, rdata->data, rdata->length));
|
||||||
}
|
}
|
||||||
@@ -148,8 +149,8 @@ fromstruct_in_nsap(dns_rdataclass_t rdclass, dns_rdatatype_t type,
|
|||||||
REQUIRE(type == 22);
|
REQUIRE(type == 22);
|
||||||
REQUIRE(rdclass == 1);
|
REQUIRE(rdclass == 1);
|
||||||
|
|
||||||
source = source;
|
UNUSED(source);
|
||||||
target = target;
|
UNUSED(target);
|
||||||
|
|
||||||
return (DNS_R_NOTIMPLEMENTED);
|
return (DNS_R_NOTIMPLEMENTED);
|
||||||
}
|
}
|
||||||
@@ -160,8 +161,8 @@ tostruct_in_nsap(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
|
|||||||
REQUIRE(rdata->type == 22);
|
REQUIRE(rdata->type == 22);
|
||||||
REQUIRE(rdata->rdclass == 1);
|
REQUIRE(rdata->rdclass == 1);
|
||||||
|
|
||||||
target = target;
|
UNUSED(target);
|
||||||
mctx = mctx;
|
UNUSED(mctx);
|
||||||
|
|
||||||
return (DNS_R_NOTIMPLEMENTED);
|
return (DNS_R_NOTIMPLEMENTED);
|
||||||
}
|
}
|
||||||
@@ -169,7 +170,7 @@ tostruct_in_nsap(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
|
|||||||
static inline void
|
static inline void
|
||||||
freestruct_in_nsap(void *source) {
|
freestruct_in_nsap(void *source) {
|
||||||
REQUIRE(source != NULL);
|
REQUIRE(source != NULL);
|
||||||
REQUIRE(ISC_FALSE); /*XXX*/
|
REQUIRE(ISC_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline isc_result_t
|
static inline isc_result_t
|
||||||
@@ -179,8 +180,8 @@ additionaldata_in_nsap(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
|
|||||||
REQUIRE(rdata->type == 22);
|
REQUIRE(rdata->type == 22);
|
||||||
REQUIRE(rdata->rdclass == 1);
|
REQUIRE(rdata->rdclass == 1);
|
||||||
|
|
||||||
(void)add;
|
UNUSED(add);
|
||||||
(void)arg;
|
UNUSED(arg);
|
||||||
|
|
||||||
return (DNS_R_SUCCESS);
|
return (DNS_R_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@@ -15,9 +15,9 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: nsap_22.h,v 1.7 2000/02/03 23:43:18 halley Exp $ */
|
/* $Id: nsap_22.h,v 1.8 2000/03/17 19:35:25 gson Exp $ */
|
||||||
|
|
||||||
/* RFC 1706 */
|
/* RFC 1706 */
|
||||||
|
|
||||||
typedef struct dns_rdata_in_nsap {
|
typedef struct dns_rdata_in_nsap {
|
||||||
dns_rdatacommon_t common;
|
dns_rdatacommon_t common;
|
||||||
|
Reference in New Issue
Block a user