Commit f7b99290 authored by Mark Andrews's avatar Mark Andrews
Browse files

Added INSIST's

parent f8c20700
......@@ -15,10 +15,10 @@
* SOFTWARE.
*/
/* $Id: cname_5.c,v 1.2 1999/01/19 05:38:32 marka Exp $ */
/* $Id: cname_5.c,v 1.3 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_TYPE_5_CNAME_H
#define RDATA_TYPE_5_CNAME_H
#ifndef RDATA_GENERIC_CNAME_5_H
#define RDATA_GENERIC_CNAME_5_H
static dns_result_t
fromtext_cname(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -98,6 +98,10 @@ compare_cname(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t region1;
isc_region_t region2;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 5);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -113,8 +117,11 @@ compare_cname(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
static dns_result_t
fromstruct_cname(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 5);
class = class; /*unused*/
source = source;
target = target;
......@@ -123,9 +130,11 @@ fromstruct_cname(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_cname(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 5);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif
#endif /* RDATA_GENERIC_CNAME_5_H */
......@@ -15,10 +15,10 @@
* SOFTWARE.
*/
/* $Id: cname_5.h,v 1.2 1999/01/19 05:38:32 marka Exp $ */
/* $Id: cname_5.h,v 1.3 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_TYPE_5_CNAME_H
#define RDATA_TYPE_5_CNAME_H
#ifndef RDATA_GENERIC_CNAME_5_H
#define RDATA_GENERIC_CNAME_5_H
static dns_result_t
fromtext_cname(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -98,6 +98,10 @@ compare_cname(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t region1;
isc_region_t region2;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 5);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -113,8 +117,11 @@ compare_cname(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
static dns_result_t
fromstruct_cname(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 5);
class = class; /*unused*/
source = source;
target = target;
......@@ -123,9 +130,11 @@ fromstruct_cname(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_cname(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 5);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif
#endif /* RDATA_GENERIC_CNAME_5_H */
......@@ -15,7 +15,10 @@
* SOFTWARE.
*/
/* $Id: hinfo_13.c,v 1.3 1999/01/19 05:38:32 marka Exp $ */
/* $Id: hinfo_13.c,v 1.4 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_GENERIC_HINFO_13_H
#define RDATA_GENERIC_HINFO_13_H
static dns_result_t
fromtext_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -24,6 +27,8 @@ fromtext_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
isc_token_t token;
dns_result_t result;
INSIST(type == 13);
class = class; /*unused*/
origin = origin; /*unused*/
downcase = downcase; /*unused*/
......@@ -49,6 +54,8 @@ totext_hinfo(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
isc_region_t region;
dns_result_t result;
INSIST(rdata->type == 13);
origin = origin; /*unused*/
dns_rdata_toregion(rdata, &region);
......@@ -71,12 +78,12 @@ fromwire_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
isc_boolean_t downcase, isc_buffer_t *target) {
dns_result_t result;
INSIST(type == 13);
dctx = dctx; /* unused */
class = class; /* unused */
downcase = downcase; /* unused */
INSIST(type == 13);
result = txt_fromwire(source, target);
if (result != DNS_R_SUCCESS)
return (result);
......@@ -88,6 +95,8 @@ static dns_result_t
towire_hinfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
isc_region_t region;
INSIST(rdata->type == 13);
cctx = cctx;
isc_buffer_available(target, &region);
......@@ -105,6 +114,10 @@ compare_hinfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
int l;
int result;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 13);
l = (rdata1->length < rdata2->length) ? rdata1->length : rdata2->length;
result = memcmp(rdata1->data, rdata2->data, l);
......@@ -120,8 +133,10 @@ static dns_result_t
fromstruct_hinfo(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 13);
class = class; /*unused*/
source = source;
target = target;
......@@ -130,8 +145,11 @@ fromstruct_hinfo(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_hinfo(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 13);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif /* RDATA_GENERIC_HINFO_13_H */
......@@ -15,7 +15,10 @@
* SOFTWARE.
*/
/* $Id: hinfo_13.h,v 1.3 1999/01/19 05:38:32 marka Exp $ */
/* $Id: hinfo_13.h,v 1.4 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_GENERIC_HINFO_13_H
#define RDATA_GENERIC_HINFO_13_H
static dns_result_t
fromtext_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -24,6 +27,8 @@ fromtext_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
isc_token_t token;
dns_result_t result;
INSIST(type == 13);
class = class; /*unused*/
origin = origin; /*unused*/
downcase = downcase; /*unused*/
......@@ -49,6 +54,8 @@ totext_hinfo(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
isc_region_t region;
dns_result_t result;
INSIST(rdata->type == 13);
origin = origin; /*unused*/
dns_rdata_toregion(rdata, &region);
......@@ -71,12 +78,12 @@ fromwire_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
isc_boolean_t downcase, isc_buffer_t *target) {
dns_result_t result;
INSIST(type == 13);
dctx = dctx; /* unused */
class = class; /* unused */
downcase = downcase; /* unused */
INSIST(type == 13);
result = txt_fromwire(source, target);
if (result != DNS_R_SUCCESS)
return (result);
......@@ -88,6 +95,8 @@ static dns_result_t
towire_hinfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
isc_region_t region;
INSIST(rdata->type == 13);
cctx = cctx;
isc_buffer_available(target, &region);
......@@ -105,6 +114,10 @@ compare_hinfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
int l;
int result;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 13);
l = (rdata1->length < rdata2->length) ? rdata1->length : rdata2->length;
result = memcmp(rdata1->data, rdata2->data, l);
......@@ -120,8 +133,10 @@ static dns_result_t
fromstruct_hinfo(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 13);
class = class; /*unused*/
source = source;
target = target;
......@@ -130,8 +145,11 @@ fromstruct_hinfo(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_hinfo(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 13);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif /* RDATA_GENERIC_HINFO_13_H */
......@@ -15,21 +15,21 @@
* SOFTWARE.
*/
/* $Id: mb_7.c,v 1.2 1999/01/19 05:38:32 marka Exp $ */
/* $Id: mb_7.c,v 1.3 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_TYPE_7_MB_H
#define RDATA_TYPE_7_MB_H
#ifndef RDATA_GENERIC_MB_7_H
#define RDATA_GENERIC_MB_7_H
static dns_result_t
fromtext_mb(dns_rdataclass_t class, dns_rdatatype_t type,
isc_lex_t *lexer, dns_name_t *origin,
isc_boolean_t downcase, isc_buffer_t *target) {
isc_token_t token;
isc_result_t result;
dns_name_t name;
isc_buffer_t buffer;
INSIST(type == 7);
class = class; /*unused*/
if (isc_lex_gettoken(lexer, 0, &token) != ISC_R_SUCCESS)
......@@ -71,7 +71,8 @@ fromwire_mb(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
INSIST(type == 7);
class = class;
class = class; /*unused*/
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -98,6 +99,10 @@ compare_mb(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t region1;
isc_region_t region2;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 7);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -113,8 +118,11 @@ compare_mb(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
static dns_result_t
fromstruct_mb(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 7);
class = class; /*unused*/
source = source;
target = target;
......@@ -123,9 +131,11 @@ fromstruct_mb(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_mb(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 7);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif
#endif /* RDATA_GENERIC_MB_7_H */
......@@ -15,21 +15,21 @@
* SOFTWARE.
*/
/* $Id: mb_7.h,v 1.2 1999/01/19 05:38:32 marka Exp $ */
/* $Id: mb_7.h,v 1.3 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_TYPE_7_MB_H
#define RDATA_TYPE_7_MB_H
#ifndef RDATA_GENERIC_MB_7_H
#define RDATA_GENERIC_MB_7_H
static dns_result_t
fromtext_mb(dns_rdataclass_t class, dns_rdatatype_t type,
isc_lex_t *lexer, dns_name_t *origin,
isc_boolean_t downcase, isc_buffer_t *target) {
isc_token_t token;
isc_result_t result;
dns_name_t name;
isc_buffer_t buffer;
INSIST(type == 7);
class = class; /*unused*/
if (isc_lex_gettoken(lexer, 0, &token) != ISC_R_SUCCESS)
......@@ -71,7 +71,8 @@ fromwire_mb(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
INSIST(type == 7);
class = class;
class = class; /*unused*/
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -98,6 +99,10 @@ compare_mb(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t region1;
isc_region_t region2;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 7);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -113,8 +118,11 @@ compare_mb(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
static dns_result_t
fromstruct_mb(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 7);
class = class; /*unused*/
source = source;
target = target;
......@@ -123,9 +131,11 @@ fromstruct_mb(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_mb(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 7);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif
#endif /* RDATA_GENERIC_MB_7_H */
......@@ -15,10 +15,10 @@
* SOFTWARE.
*/
/* $Id: md_3.c,v 1.2 1999/01/19 05:38:32 marka Exp $ */
/* $Id: md_3.c,v 1.3 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_TYPE_3_MD_H
#define RDATA_TYPE_3_MD_H
#ifndef RDATA_GENERIC_MD_3_H
#define RDATA_GENERIC_MD_3_H
static dns_result_t
fromtext_md(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -29,6 +29,8 @@ fromtext_md(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
isc_buffer_t buffer;
INSIST(type == 3);
class = class; /*unused*/
result = isc_lex_gettoken(lexer, 0, &token);
......@@ -69,7 +71,8 @@ fromwire_md(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
INSIST(type == 3);
class = class;
class = class; /*unused*/
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -96,6 +99,10 @@ compare_md(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t region1;
isc_region_t region2;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 3);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -111,8 +118,11 @@ compare_md(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
static dns_result_t
fromstruct_md(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 3);
class = class; /*unused*/
source = source;
target = target;
......@@ -121,9 +131,11 @@ fromstruct_md(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_md(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 3);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif
#endif /* RDATA_GENERIC_MD_3_H */
......@@ -15,10 +15,10 @@
* SOFTWARE.
*/
/* $Id: md_3.h,v 1.2 1999/01/19 05:38:32 marka Exp $ */
/* $Id: md_3.h,v 1.3 1999/01/19 06:49:29 marka Exp $ */
#ifndef RDATA_TYPE_3_MD_H
#define RDATA_TYPE_3_MD_H
#ifndef RDATA_GENERIC_MD_3_H
#define RDATA_GENERIC_MD_3_H
static dns_result_t
fromtext_md(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -29,6 +29,8 @@ fromtext_md(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
isc_buffer_t buffer;
INSIST(type == 3);
class = class; /*unused*/
result = isc_lex_gettoken(lexer, 0, &token);
......@@ -69,7 +71,8 @@ fromwire_md(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
INSIST(type == 3);
class = class;
class = class; /*unused*/
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -96,6 +99,10 @@ compare_md(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t region1;
isc_region_t region2;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 3);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -111,8 +118,11 @@ compare_md(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
static dns_result_t
fromstruct_md(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 3);
class = class; /*unused*/
source = source;
target = target;
......@@ -121,9 +131,11 @@ fromstruct_md(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_md(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 3);
target = target;
return (DNS_R_NOTIMPLEMENTED);
}
#endif
#endif /* RDATA_GENERIC_MD_3_H */
......@@ -15,10 +15,10 @@
* SOFTWARE.
*/
/* $Id: mf_4.c,v 1.2 1999/01/19 05:38:33 marka Exp $ */
/* $Id: mf_4.c,v 1.3 1999/01/19 06:49:30 marka Exp $ */
#ifndef RDATA_TYPE_4_MF_H
#define RDATA_TYPE_4_MF_H
#ifndef RDATA_GENERIC_MF_4_H
#define RDATA_GENERIC_MF_4_H
static dns_result_t
fromtext_mf(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -29,6 +29,8 @@ fromtext_mf(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
isc_buffer_t buffer;
INSIST(type == 4);
class = class; /*unused*/
result = isc_lex_gettoken(lexer, 0, &token);
......@@ -69,7 +71,8 @@ fromwire_mf(dns_rdataclass_t class, dns_rdatatype_t type,
dns_name_t name;
INSIST(type == 4);
class = class;
class = class; /*unused*/
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -96,6 +99,10 @@ compare_mf(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
isc_region_t region1;
isc_region_t region2;
INSIST(rdata1->type == rdata2->type);
INSIST(rdata1->class == rdata2->class);
INSIST(rdata1->type == 4);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -111,8 +118,11 @@ compare_mf(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
static dns_result_t
fromstruct_mf(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
isc_buffer_t *target) {
class = class;
type = type;
INSIST(type == 4);
class = class; /*unused*/
source = source;
target = target;
......@@ -121,9 +131,11 @@ fromstruct_mf(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
static dns_result_t
tostruct_mf(dns_rdata_t *rdata, void *target) {
rdata = rdata;
INSIST(rdata->type == 4);
target = target;
return (DNS_R_NOTIMPLEMENTED);