mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 07:32:09 -04:00
Add RR from RFC 1183
Update Copyright dates.
This commit is contained in:
parent
64ba6e4cc3
commit
1c31915286
45 changed files with 1693 additions and 115 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rdata.c,v 1.12 1999/01/22 01:27:29 marka Exp $ */
|
||||
/* $Id: rdata.c,v 1.13 1999/01/22 05:02:43 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -573,6 +573,8 @@ static isc_result_t
|
|||
uint16_tobuffer(unsigned long value, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
|
||||
if (value > 0xffff)
|
||||
return (DNS_R_RANGE);
|
||||
isc_buffer_available(target, ®ion);
|
||||
if (region.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
|
|
|
|||
177
lib/dns/rdata/generic/afsdb_18.c
Normal file
177
lib/dns/rdata/generic/afsdb_18.c
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: afsdb_18.c,v 1.1 1999/01/22 05:02:44 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_AFSDB_18_H
|
||||
#define RDATA_GENERIC_AFSDB_18_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_afsdb(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_buffer_t buffer;
|
||||
dns_name_t name;
|
||||
|
||||
REQUIRE(type == 18);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
/* subtype */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
|
||||
RETERR(uint16_tobuffer(token.value.as_ulong, target));
|
||||
|
||||
/* hostname */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
dns_name_init(&name, NULL);
|
||||
buffer_fromregion(&buffer, &token.value.as_region,
|
||||
ISC_BUFFERTYPE_TEXT);
|
||||
origin = (origin != NULL) ? origin : dns_rootname;
|
||||
return (dns_name_fromtext(&name, &buffer, origin, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_afsdb(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
isc_region_t region;
|
||||
char buf[sizeof "64000"];
|
||||
isc_boolean_t sub;
|
||||
unsigned int num;
|
||||
|
||||
|
||||
REQUIRE(rdata->type == 18);
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
num = uint16_fromregion(®ion);
|
||||
isc_region_consume(®ion, 2);
|
||||
sprintf(buf, "%u", num);
|
||||
RETERR(str_totext(buf, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, origin, &prefix);
|
||||
return(dns_name_totext(&prefix, sub, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_afsdb(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
isc_region_t sr;
|
||||
isc_region_t tr;
|
||||
|
||||
REQUIRE(type == 18);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
|
||||
isc_buffer_active(source, &sr);
|
||||
isc_buffer_available(target, &tr);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
if (sr.length < 2)
|
||||
return (DNS_R_UNEXPECTEDEND);
|
||||
memcpy(tr.base, sr.base, 2);
|
||||
isc_buffer_forward(source, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
return (dns_name_fromwire(&name, source, dctx, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_afsdb(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
isc_region_t tr;
|
||||
isc_region_t sr;
|
||||
dns_name_t name;
|
||||
|
||||
REQUIRE(rdata->type == 18);
|
||||
|
||||
isc_buffer_available(target, &tr);
|
||||
dns_rdata_toregion(rdata, &sr);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
memcpy(tr.base, sr.base, 2);
|
||||
isc_region_consume(&sr, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_afsdb(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
int result;
|
||||
dns_name_t name1;
|
||||
dns_name_t name2;
|
||||
isc_region_t region1;
|
||||
isc_region_t region2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 18);
|
||||
|
||||
result = memcmp(rdata1->data, rdata2->data, 2);
|
||||
if (result != 0)
|
||||
return (result < 0 ? -1 : 1);
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata1, ®ion1);
|
||||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
|
||||
isc_region_consume(®ion1, 2);
|
||||
isc_region_consume(®ion2, 2);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
return (dns_name_compare(&name1, &name2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_afsdb(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 18);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_afsdb(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 18);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_AFSDB_18_H */
|
||||
177
lib/dns/rdata/generic/afsdb_18.h
Normal file
177
lib/dns/rdata/generic/afsdb_18.h
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: afsdb_18.h,v 1.1 1999/01/22 05:02:44 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_AFSDB_18_H
|
||||
#define RDATA_GENERIC_AFSDB_18_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_afsdb(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_buffer_t buffer;
|
||||
dns_name_t name;
|
||||
|
||||
REQUIRE(type == 18);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
/* subtype */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
|
||||
RETERR(uint16_tobuffer(token.value.as_ulong, target));
|
||||
|
||||
/* hostname */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
dns_name_init(&name, NULL);
|
||||
buffer_fromregion(&buffer, &token.value.as_region,
|
||||
ISC_BUFFERTYPE_TEXT);
|
||||
origin = (origin != NULL) ? origin : dns_rootname;
|
||||
return (dns_name_fromtext(&name, &buffer, origin, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_afsdb(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
isc_region_t region;
|
||||
char buf[sizeof "64000"];
|
||||
isc_boolean_t sub;
|
||||
unsigned int num;
|
||||
|
||||
|
||||
REQUIRE(rdata->type == 18);
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
num = uint16_fromregion(®ion);
|
||||
isc_region_consume(®ion, 2);
|
||||
sprintf(buf, "%u", num);
|
||||
RETERR(str_totext(buf, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, origin, &prefix);
|
||||
return(dns_name_totext(&prefix, sub, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_afsdb(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
isc_region_t sr;
|
||||
isc_region_t tr;
|
||||
|
||||
REQUIRE(type == 18);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
|
||||
isc_buffer_active(source, &sr);
|
||||
isc_buffer_available(target, &tr);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
if (sr.length < 2)
|
||||
return (DNS_R_UNEXPECTEDEND);
|
||||
memcpy(tr.base, sr.base, 2);
|
||||
isc_buffer_forward(source, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
return (dns_name_fromwire(&name, source, dctx, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_afsdb(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
isc_region_t tr;
|
||||
isc_region_t sr;
|
||||
dns_name_t name;
|
||||
|
||||
REQUIRE(rdata->type == 18);
|
||||
|
||||
isc_buffer_available(target, &tr);
|
||||
dns_rdata_toregion(rdata, &sr);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
memcpy(tr.base, sr.base, 2);
|
||||
isc_region_consume(&sr, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, &sr);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_afsdb(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
int result;
|
||||
dns_name_t name1;
|
||||
dns_name_t name2;
|
||||
isc_region_t region1;
|
||||
isc_region_t region2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 18);
|
||||
|
||||
result = memcmp(rdata1->data, rdata2->data, 2);
|
||||
if (result != 0)
|
||||
return (result < 0 ? -1 : 1);
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata1, ®ion1);
|
||||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
|
||||
isc_region_consume(®ion1, 2);
|
||||
isc_region_consume(®ion2, 2);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
return (dns_name_compare(&name1, &name2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_afsdb(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 18);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_afsdb(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 18);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_AFSDB_18_H */
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: cname_5.c,v 1.5 1999/01/22 00:36:55 marka Exp $ */
|
||||
/* $Id: cname_5.c,v 1.6 1999/01/22 05:02:44 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_CNAME_5_H
|
||||
#define RDATA_GENERIC_CNAME_5_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: cname_5.h,v 1.5 1999/01/22 00:36:55 marka Exp $ */
|
||||
/* $Id: cname_5.h,v 1.6 1999/01/22 05:02:44 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_CNAME_5_H
|
||||
#define RDATA_GENERIC_CNAME_5_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: hinfo_13.c,v 1.7 1999/01/22 01:27:30 marka Exp $ */
|
||||
/* $Id: hinfo_13.c,v 1.8 1999/01/22 05:02:44 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_HINFO_13_H
|
||||
#define RDATA_GENERIC_HINFO_13_H
|
||||
|
|
@ -72,40 +72,26 @@ fromwire_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
|
|||
|
||||
static dns_result_t
|
||||
towire_hinfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
|
||||
REQUIRE(rdata->type == 13);
|
||||
|
||||
cctx = cctx;
|
||||
cctx = cctx; /*unused*/
|
||||
|
||||
isc_buffer_available(target, ®ion);
|
||||
if (region.length < rdata->length)
|
||||
return (DNS_R_NOSPACE);
|
||||
|
||||
memcpy(region.base, rdata->data, rdata->length);
|
||||
isc_buffer_add(target, rdata->length);
|
||||
|
||||
return (DNS_R_SUCCESS);
|
||||
return (mem_tobuffer(target, rdata->data, rdata->length));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_hinfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
int l;
|
||||
int result;
|
||||
isc_region_t r1;
|
||||
isc_region_t r2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 13);
|
||||
|
||||
l = (rdata1->length < rdata2->length) ? rdata1->length : rdata2->length;
|
||||
result = memcmp(rdata1->data, rdata2->data, l);
|
||||
|
||||
if (result != 0)
|
||||
result = (result < 0) ? -1 : 1;
|
||||
else if (rdata1->length != rdata2->length)
|
||||
result = (rdata1->length < rdata2->length) ? -1 : 1;
|
||||
|
||||
return (result);
|
||||
dns_rdata_toregion(rdata1, &r1);
|
||||
dns_rdata_toregion(rdata2, &r2);
|
||||
return (compare_region(&r1, &r2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: hinfo_13.h,v 1.7 1999/01/22 01:27:30 marka Exp $ */
|
||||
/* $Id: hinfo_13.h,v 1.8 1999/01/22 05:02:44 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_HINFO_13_H
|
||||
#define RDATA_GENERIC_HINFO_13_H
|
||||
|
|
@ -72,40 +72,26 @@ fromwire_hinfo(dns_rdataclass_t class, dns_rdatatype_t type,
|
|||
|
||||
static dns_result_t
|
||||
towire_hinfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
|
||||
REQUIRE(rdata->type == 13);
|
||||
|
||||
cctx = cctx;
|
||||
cctx = cctx; /*unused*/
|
||||
|
||||
isc_buffer_available(target, ®ion);
|
||||
if (region.length < rdata->length)
|
||||
return (DNS_R_NOSPACE);
|
||||
|
||||
memcpy(region.base, rdata->data, rdata->length);
|
||||
isc_buffer_add(target, rdata->length);
|
||||
|
||||
return (DNS_R_SUCCESS);
|
||||
return (mem_tobuffer(target, rdata->data, rdata->length));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_hinfo(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
int l;
|
||||
int result;
|
||||
isc_region_t r1;
|
||||
isc_region_t r2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 13);
|
||||
|
||||
l = (rdata1->length < rdata2->length) ? rdata1->length : rdata2->length;
|
||||
result = memcmp(rdata1->data, rdata2->data, l);
|
||||
|
||||
if (result != 0)
|
||||
result = (result < 0) ? -1 : 1;
|
||||
else if (rdata1->length != rdata2->length)
|
||||
result = (rdata1->length < rdata2->length) ? -1 : 1;
|
||||
|
||||
return (result);
|
||||
dns_rdata_toregion(rdata1, &r1);
|
||||
dns_rdata_toregion(rdata2, &r2);
|
||||
return (compare_region(&r1, &r2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
|
|
|
|||
130
lib/dns/rdata/generic/isdn_20.c
Normal file
130
lib/dns/rdata/generic/isdn_20.c
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id*/
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_ISDN_20_H
|
||||
#define RDATA_GENERIC_ISDN_20_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_isdn(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;
|
||||
|
||||
REQUIRE(type == 20);
|
||||
|
||||
class = class; /*unused*/
|
||||
origin = origin; /*unused*/
|
||||
downcase = downcase; /*unused*/
|
||||
|
||||
/* ISDN-address */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
RETERR(txt_fromtext(&token.value.as_textregion, target));
|
||||
|
||||
/* sa: optional */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_TRUE));
|
||||
if (token.type != isc_tokentype_string) {
|
||||
isc_lex_ungettoken(lexer, &token);
|
||||
return (DNS_R_SUCCESS);
|
||||
}
|
||||
return (txt_fromtext(&token.value.as_textregion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_isdn(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
|
||||
REQUIRE(rdata->type == 20);
|
||||
|
||||
origin = origin; /*unused*/
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
RETERR(txt_totext(®ion, target));
|
||||
if (region.length == 0)
|
||||
return (DNS_R_SUCCESS);
|
||||
RETERR(str_totext(" ", target));
|
||||
return (txt_totext(®ion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_isdn(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 20);
|
||||
|
||||
dctx = dctx; /* unused */
|
||||
class = class; /* unused */
|
||||
downcase = downcase; /* unused */
|
||||
|
||||
RETERR(txt_fromwire(source, target));
|
||||
if (buffer_empty(source))
|
||||
return (DNS_R_SUCCESS);
|
||||
return (txt_fromwire(source, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_isdn(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(rdata->type == 20);
|
||||
|
||||
cctx = cctx; /*unused*/
|
||||
|
||||
return (mem_tobuffer(target, rdata->data, rdata->length));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_isdn(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
isc_region_t r1;
|
||||
isc_region_t r2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 20);
|
||||
|
||||
dns_rdata_toregion(rdata1, &r1);
|
||||
dns_rdata_toregion(rdata2, &r2);
|
||||
return (compare_region(&r1, &r2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_isdn(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 20);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_isdn(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 20);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_ISDN_20_H */
|
||||
130
lib/dns/rdata/generic/isdn_20.h
Normal file
130
lib/dns/rdata/generic/isdn_20.h
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id*/
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_ISDN_20_H
|
||||
#define RDATA_GENERIC_ISDN_20_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_isdn(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;
|
||||
|
||||
REQUIRE(type == 20);
|
||||
|
||||
class = class; /*unused*/
|
||||
origin = origin; /*unused*/
|
||||
downcase = downcase; /*unused*/
|
||||
|
||||
/* ISDN-address */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
RETERR(txt_fromtext(&token.value.as_textregion, target));
|
||||
|
||||
/* sa: optional */
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_TRUE));
|
||||
if (token.type != isc_tokentype_string) {
|
||||
isc_lex_ungettoken(lexer, &token);
|
||||
return (DNS_R_SUCCESS);
|
||||
}
|
||||
return (txt_fromtext(&token.value.as_textregion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_isdn(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
|
||||
REQUIRE(rdata->type == 20);
|
||||
|
||||
origin = origin; /*unused*/
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
RETERR(txt_totext(®ion, target));
|
||||
if (region.length == 0)
|
||||
return (DNS_R_SUCCESS);
|
||||
RETERR(str_totext(" ", target));
|
||||
return (txt_totext(®ion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_isdn(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 20);
|
||||
|
||||
dctx = dctx; /* unused */
|
||||
class = class; /* unused */
|
||||
downcase = downcase; /* unused */
|
||||
|
||||
RETERR(txt_fromwire(source, target));
|
||||
if (buffer_empty(source))
|
||||
return (DNS_R_SUCCESS);
|
||||
return (txt_fromwire(source, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_isdn(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(rdata->type == 20);
|
||||
|
||||
cctx = cctx; /*unused*/
|
||||
|
||||
return (mem_tobuffer(target, rdata->data, rdata->length));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_isdn(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
isc_region_t r1;
|
||||
isc_region_t r2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 20);
|
||||
|
||||
dns_rdata_toregion(rdata1, &r1);
|
||||
dns_rdata_toregion(rdata2, &r2);
|
||||
return (compare_region(&r1, &r2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_isdn(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 20);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_isdn(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 20);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_ISDN_20_H */
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mb_7.c,v 1.5 1999/01/22 00:36:55 marka Exp $ */
|
||||
/* $Id: mb_7.c,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MB_7_H
|
||||
#define RDATA_GENERIC_MB_7_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mb_7.h,v 1.5 1999/01/22 00:36:55 marka Exp $ */
|
||||
/* $Id: mb_7.h,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MB_7_H
|
||||
#define RDATA_GENERIC_MB_7_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: md_3.c,v 1.5 1999/01/22 00:36:55 marka Exp $ */
|
||||
/* $Id: md_3.c,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MD_3_H
|
||||
#define RDATA_GENERIC_MD_3_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: md_3.h,v 1.5 1999/01/22 00:36:55 marka Exp $ */
|
||||
/* $Id: md_3.h,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MD_3_H
|
||||
#define RDATA_GENERIC_MD_3_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mf_4.c,v 1.5 1999/01/22 00:36:56 marka Exp $ */
|
||||
/* $Id: mf_4.c,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MF_4_H
|
||||
#define RDATA_GENERIC_MF_4_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mf_4.h,v 1.5 1999/01/22 00:36:56 marka Exp $ */
|
||||
/* $Id: mf_4.h,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MF_4_H
|
||||
#define RDATA_GENERIC_MF_4_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mg_8.c,v 1.5 1999/01/22 00:36:56 marka Exp $ */
|
||||
/* $Id: mg_8.c,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MG_8_H
|
||||
#define RDATA_GENERIC_MG_8_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mg_8.h,v 1.5 1999/01/22 00:36:56 marka Exp $ */
|
||||
/* $Id: mg_8.h,v 1.6 1999/01/22 05:02:45 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MG_8_H
|
||||
#define RDATA_GENERIC_MG_8_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: minfo_14.c,v 1.5 1999/01/22 00:36:56 marka Exp $ */
|
||||
/* $Id: minfo_14.c,v 1.6 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MINFO_14_H
|
||||
#define RDATA_GENERIC_MINFO_14_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: minfo_14.h,v 1.5 1999/01/22 00:36:56 marka Exp $ */
|
||||
/* $Id: minfo_14.h,v 1.6 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MINFO_14_H
|
||||
#define RDATA_GENERIC_MINFO_14_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mr_9.c,v 1.5 1999/01/22 00:36:57 marka Exp $ */
|
||||
/* $Id: mr_9.c,v 1.6 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MR_9_H
|
||||
#define RDATA_GENERIC_MR_9_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mr_9.h,v 1.5 1999/01/22 00:36:57 marka Exp $ */
|
||||
/* $Id: mr_9.h,v 1.6 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MR_9_H
|
||||
#define RDATA_GENERIC_MR_9_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mx_15.c,v 1.8 1999/01/22 00:36:57 marka Exp $ */
|
||||
/* $Id: mx_15.c,v 1.9 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MX_15_H
|
||||
#define RDATA_GENERIC_MX_15_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: mx_15.h,v 1.8 1999/01/22 00:36:57 marka Exp $ */
|
||||
/* $Id: mx_15.h,v 1.9 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_MX_15_H
|
||||
#define RDATA_GENERIC_MX_15_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: ns_2.c,v 1.5 1999/01/22 00:36:57 marka Exp $ */
|
||||
/* $Id: ns_2.c,v 1.6 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_NS_2_H
|
||||
#define RDATA_GENERIC_NS_2_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: ns_2.h,v 1.5 1999/01/22 00:36:57 marka Exp $ */
|
||||
/* $Id: ns_2.h,v 1.6 1999/01/22 05:02:46 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_NS_2_H
|
||||
#define RDATA_GENERIC_NS_2_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: null_10.c,v 1.4 1999/01/20 05:20:22 marka Exp $ */
|
||||
/* $Id: null_10.c,v 1.5 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_NULL_10_H
|
||||
#define RDATA_GENERIC_NULL_10_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: null_10.h,v 1.4 1999/01/20 05:20:22 marka Exp $ */
|
||||
/* $Id: null_10.h,v 1.5 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_NULL_10_H
|
||||
#define RDATA_GENERIC_NULL_10_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: proforma.c,v 1.4 1999/01/20 05:20:23 marka Exp $ */
|
||||
/* $Id: proforma.c,v 1.5 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_#_#_H
|
||||
#define RDATA_GENERIC_#_#_H
|
||||
|
|
@ -24,11 +24,13 @@ static dns_result_t
|
|||
fromtext_#(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_lex_t *lexer, dns_name_t *origin,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF;
|
||||
isc_token_t token;
|
||||
|
||||
REQUIRE(type == #);
|
||||
REQUIRE(class == #);
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
|
|
@ -63,13 +65,17 @@ towire_#(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
|||
|
||||
static int
|
||||
compare_#(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
isc_region_t r1;
|
||||
isc_region_t r2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == #);
|
||||
REQUIRE(rdata1->class == #);
|
||||
|
||||
return (-2);
|
||||
dns_rdata_toregion(rdata1, &r1);
|
||||
dns_rdata_toregion(rdata2, &r2);
|
||||
return (compare_region(&r1, &r2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: proforma.h,v 1.4 1999/01/20 05:20:23 marka Exp $ */
|
||||
/* $Id: proforma.h,v 1.5 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_#_#_H
|
||||
#define RDATA_GENERIC_#_#_H
|
||||
|
|
@ -24,11 +24,13 @@ static dns_result_t
|
|||
fromtext_#(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_lex_t *lexer, dns_name_t *origin,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF;
|
||||
isc_token_t token;
|
||||
|
||||
REQUIRE(type == #);
|
||||
REQUIRE(class == #);
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
|
|
@ -63,13 +65,17 @@ towire_#(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
|||
|
||||
static int
|
||||
compare_#(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
isc_region_t r1;
|
||||
isc_region_t r2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == #);
|
||||
REQUIRE(rdata1->class == #);
|
||||
|
||||
return (-2);
|
||||
dns_rdata_toregion(rdata1, &r1);
|
||||
dns_rdata_toregion(rdata2, &r2);
|
||||
return (compare_region(&r1, &r2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: ptr_12.c,v 1.5 1999/01/22 00:36:58 marka Exp $ */
|
||||
/* $Id: ptr_12.c,v 1.6 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_PTR_12_H
|
||||
#define RDATA_GENERIC_PTR_12_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: ptr_12.h,v 1.5 1999/01/22 00:36:58 marka Exp $ */
|
||||
/* $Id: ptr_12.h,v 1.6 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_PTR_12_H
|
||||
#define RDATA_GENERIC_PTR_12_H
|
||||
|
|
|
|||
186
lib/dns/rdata/generic/rp_17.c
Normal file
186
lib/dns/rdata/generic/rp_17.c
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rp_17.c,v 1.1 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_RP_17_H
|
||||
#define RDATA_GENERIC_RP_17_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_rp(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;
|
||||
dns_name_t name;
|
||||
isc_buffer_t buffer;
|
||||
int i;
|
||||
|
||||
REQUIRE(type == 17);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
for (i = 0; i < 2 ; i++) {
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string,
|
||||
ISC_FALSE));
|
||||
dns_name_init(&name, NULL);
|
||||
buffer_fromregion(&buffer, &token.value.as_region,
|
||||
ISC_BUFFERTYPE_TEXT);
|
||||
origin = (origin != NULL) ? origin : dns_rootname;
|
||||
RETERR(dns_name_fromtext(&name, &buffer, origin,
|
||||
downcase, target));
|
||||
}
|
||||
return (DNS_R_SUCCESS);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_rp(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
dns_name_t prefix;
|
||||
isc_boolean_t sub;
|
||||
|
||||
REQUIRE(rdata->type == 17);
|
||||
|
||||
dns_name_init(&rmail, NULL);
|
||||
dns_name_init(&email, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
dns_name_fromregion(&email, ®ion);
|
||||
isc_region_consume(®ion, email.length);
|
||||
|
||||
sub = name_prefix(&rmail, origin, &prefix);
|
||||
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
sub = name_prefix(&email, origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_rp(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
|
||||
REQUIRE(type == 17);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
dns_name_init(&rmail, NULL);
|
||||
dns_name_init(&email, NULL);
|
||||
|
||||
RETERR(dns_name_fromwire(&rmail, source, dctx, downcase, target));
|
||||
return (dns_name_fromwire(&email, source, dctx, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_rp(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
|
||||
REQUIRE(rdata->type == 17);
|
||||
|
||||
dns_name_init(&rmail, NULL);
|
||||
dns_name_init(&email, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
RETERR(dns_name_towire(&rmail, cctx, target));
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
return (dns_name_towire(&rmail, cctx, target));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_rp(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
isc_region_t region1;
|
||||
isc_region_t region2;
|
||||
dns_name_t name1;
|
||||
dns_name_t name2;
|
||||
int result;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 17);
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata1, ®ion1);
|
||||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
result = dns_name_compare(&name1, &name2);
|
||||
if (result != 0)
|
||||
return (result);
|
||||
|
||||
isc_region_consume(®ion1, name_length(&name1));
|
||||
isc_region_consume(®ion2, name_length(&name2));
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
result = dns_name_compare(&name1, &name2);
|
||||
return (result);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_rp(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 17);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_rp(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 17);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_RP_17_H */
|
||||
186
lib/dns/rdata/generic/rp_17.h
Normal file
186
lib/dns/rdata/generic/rp_17.h
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rp_17.h,v 1.1 1999/01/22 05:02:47 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_RP_17_H
|
||||
#define RDATA_GENERIC_RP_17_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_rp(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;
|
||||
dns_name_t name;
|
||||
isc_buffer_t buffer;
|
||||
int i;
|
||||
|
||||
REQUIRE(type == 17);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
for (i = 0; i < 2 ; i++) {
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string,
|
||||
ISC_FALSE));
|
||||
dns_name_init(&name, NULL);
|
||||
buffer_fromregion(&buffer, &token.value.as_region,
|
||||
ISC_BUFFERTYPE_TEXT);
|
||||
origin = (origin != NULL) ? origin : dns_rootname;
|
||||
RETERR(dns_name_fromtext(&name, &buffer, origin,
|
||||
downcase, target));
|
||||
}
|
||||
return (DNS_R_SUCCESS);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_rp(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
dns_name_t prefix;
|
||||
isc_boolean_t sub;
|
||||
|
||||
REQUIRE(rdata->type == 17);
|
||||
|
||||
dns_name_init(&rmail, NULL);
|
||||
dns_name_init(&email, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
dns_name_fromregion(&email, ®ion);
|
||||
isc_region_consume(®ion, email.length);
|
||||
|
||||
sub = name_prefix(&rmail, origin, &prefix);
|
||||
|
||||
RETERR(dns_name_totext(&prefix, sub, target));
|
||||
|
||||
RETERR(str_totext(" ", target));
|
||||
|
||||
sub = name_prefix(&email, origin, &prefix);
|
||||
return (dns_name_totext(&prefix, sub, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_rp(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
|
||||
REQUIRE(type == 17);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
dns_name_init(&rmail, NULL);
|
||||
dns_name_init(&email, NULL);
|
||||
|
||||
RETERR(dns_name_fromwire(&rmail, source, dctx, downcase, target));
|
||||
return (dns_name_fromwire(&email, source, dctx, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_rp(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
dns_name_t rmail;
|
||||
dns_name_t email;
|
||||
|
||||
REQUIRE(rdata->type == 17);
|
||||
|
||||
dns_name_init(&rmail, NULL);
|
||||
dns_name_init(&email, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
RETERR(dns_name_towire(&rmail, cctx, target));
|
||||
|
||||
dns_name_fromregion(&rmail, ®ion);
|
||||
isc_region_consume(®ion, rmail.length);
|
||||
|
||||
return (dns_name_towire(&rmail, cctx, target));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_rp(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
isc_region_t region1;
|
||||
isc_region_t region2;
|
||||
dns_name_t name1;
|
||||
dns_name_t name2;
|
||||
int result;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 17);
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata1, ®ion1);
|
||||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
result = dns_name_compare(&name1, &name2);
|
||||
if (result != 0)
|
||||
return (result);
|
||||
|
||||
isc_region_consume(®ion1, name_length(&name1));
|
||||
isc_region_consume(®ion2, name_length(&name2));
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
result = dns_name_compare(&name1, &name2);
|
||||
return (result);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_rp(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 17);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_rp(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 17);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_RP_17_H */
|
||||
176
lib/dns/rdata/generic/rt_21.c
Normal file
176
lib/dns/rdata/generic/rt_21.c
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rt_21.c,v 1.1 1999/01/22 05:02:48 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_RT_21_H
|
||||
#define RDATA_GENERIC_RT_21_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_rt(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;
|
||||
dns_name_t name;
|
||||
isc_buffer_t buffer;
|
||||
|
||||
REQUIRE(type == 21);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
|
||||
|
||||
RETERR(uint16_tobuffer(token.value.as_ulong, target));
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
buffer_fromregion(&buffer, &token.value.as_region,
|
||||
ISC_BUFFERTYPE_TEXT);
|
||||
origin = (origin != NULL) ? origin : dns_rootname;
|
||||
return (dns_name_fromtext(&name, &buffer, origin, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_rt(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
isc_boolean_t sub;
|
||||
char buf[sizeof "64000"];
|
||||
unsigned short num;
|
||||
|
||||
REQUIRE(rdata->type == 21);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
num = uint16_fromregion(®ion);
|
||||
isc_region_consume(®ion, 2);
|
||||
sprintf(buf, "%u", num);
|
||||
RETERR(str_totext(buf, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, origin, &prefix);
|
||||
return(dns_name_totext(&prefix, sub, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_rt(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
isc_region_t sregion;
|
||||
isc_region_t tregion;
|
||||
|
||||
REQUIRE(type == 21);
|
||||
class = class; /* unused */
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
|
||||
isc_buffer_active(source, &sregion);
|
||||
isc_buffer_available(target, &tregion);
|
||||
if (tregion.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
if (sregion.length < 2)
|
||||
return (DNS_R_UNEXPECTEDEND);
|
||||
memcpy(tregion.base, sregion.base, 2);
|
||||
isc_buffer_forward(source, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
return (dns_name_fromwire(&name, source, dctx, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_rt(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
isc_region_t region;
|
||||
isc_region_t tr;
|
||||
|
||||
REQUIRE(rdata->type == 21);
|
||||
|
||||
isc_buffer_available(target, &tr);
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
memcpy(tr.base, region.base, 2);
|
||||
isc_region_consume(®ion, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_rt(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
dns_name_t name1;
|
||||
dns_name_t name2;
|
||||
isc_region_t region1;
|
||||
isc_region_t region2;
|
||||
int result;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 21);
|
||||
|
||||
result = memcmp(rdata1->data, rdata2->data, 2);
|
||||
if (result != 0)
|
||||
return (result < 0 ? -1 : 1);
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata1, ®ion1);
|
||||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
|
||||
isc_region_consume(®ion1, 2);
|
||||
isc_region_consume(®ion2, 2);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
return (dns_name_compare(&name1, &name2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_rt(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 21);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_rt(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 21);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_RT_21_H */
|
||||
176
lib/dns/rdata/generic/rt_21.h
Normal file
176
lib/dns/rdata/generic/rt_21.h
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rt_21.h,v 1.1 1999/01/22 05:02:48 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_RT_21_H
|
||||
#define RDATA_GENERIC_RT_21_H
|
||||
|
||||
static dns_result_t
|
||||
fromtext_rt(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;
|
||||
dns_name_t name;
|
||||
isc_buffer_t buffer;
|
||||
|
||||
REQUIRE(type == 21);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
|
||||
|
||||
RETERR(uint16_tobuffer(token.value.as_ulong, target));
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
buffer_fromregion(&buffer, &token.value.as_region,
|
||||
ISC_BUFFERTYPE_TEXT);
|
||||
origin = (origin != NULL) ? origin : dns_rootname;
|
||||
return (dns_name_fromtext(&name, &buffer, origin, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_rt(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
dns_name_t name;
|
||||
dns_name_t prefix;
|
||||
isc_boolean_t sub;
|
||||
char buf[sizeof "64000"];
|
||||
unsigned short num;
|
||||
|
||||
REQUIRE(rdata->type == 21);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_init(&prefix, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
num = uint16_fromregion(®ion);
|
||||
isc_region_consume(®ion, 2);
|
||||
sprintf(buf, "%u", num);
|
||||
RETERR(str_totext(buf, target));
|
||||
RETERR(str_totext(" ", target));
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
sub = name_prefix(&name, origin, &prefix);
|
||||
return(dns_name_totext(&prefix, sub, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_rt(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
isc_region_t sregion;
|
||||
isc_region_t tregion;
|
||||
|
||||
REQUIRE(type == 21);
|
||||
class = class; /* unused */
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
|
||||
isc_buffer_active(source, &sregion);
|
||||
isc_buffer_available(target, &tregion);
|
||||
if (tregion.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
if (sregion.length < 2)
|
||||
return (DNS_R_UNEXPECTEDEND);
|
||||
memcpy(tregion.base, sregion.base, 2);
|
||||
isc_buffer_forward(source, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
return (dns_name_fromwire(&name, source, dctx, downcase, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_rt(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
dns_name_t name;
|
||||
isc_region_t region;
|
||||
isc_region_t tr;
|
||||
|
||||
REQUIRE(rdata->type == 21);
|
||||
|
||||
isc_buffer_available(target, &tr);
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
memcpy(tr.base, region.base, 2);
|
||||
isc_region_consume(®ion, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
||||
return (dns_name_towire(&name, cctx, target));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_rt(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
dns_name_t name1;
|
||||
dns_name_t name2;
|
||||
isc_region_t region1;
|
||||
isc_region_t region2;
|
||||
int result;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 21);
|
||||
|
||||
result = memcmp(rdata1->data, rdata2->data, 2);
|
||||
if (result != 0)
|
||||
return (result < 0 ? -1 : 1);
|
||||
|
||||
dns_name_init(&name1, NULL);
|
||||
dns_name_init(&name2, NULL);
|
||||
|
||||
dns_rdata_toregion(rdata1, ®ion1);
|
||||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
|
||||
isc_region_consume(®ion1, 2);
|
||||
isc_region_consume(®ion2, 2);
|
||||
|
||||
dns_name_fromregion(&name1, ®ion1);
|
||||
dns_name_fromregion(&name2, ®ion2);
|
||||
|
||||
return (dns_name_compare(&name1, &name2));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_rt(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 21);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_rt(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 21);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_RT_21_H */
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: soa_6.c,v 1.8 1999/01/22 00:36:58 marka Exp $ */
|
||||
/* $Id: soa_6.c,v 1.9 1999/01/22 05:02:48 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_SOA_6_H
|
||||
#define RDATA_GENERIC_SOA_6_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: soa_6.h,v 1.8 1999/01/22 00:36:58 marka Exp $ */
|
||||
/* $Id: soa_6.h,v 1.9 1999/01/22 05:02:48 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_SOA_6_H
|
||||
#define RDATA_GENERIC_SOA_6_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: txt_16.c,v 1.7 1999/01/22 01:27:30 marka Exp $ */
|
||||
/* $Id: txt_16.c,v 1.8 1999/01/22 05:02:48 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_TXT_16_H
|
||||
#define RDATA_GENERIC_TXT_16_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: txt_16.h,v 1.7 1999/01/22 01:27:30 marka Exp $ */
|
||||
/* $Id: txt_16.h,v 1.8 1999/01/22 05:02:48 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_GENERIC_TXT_16_H
|
||||
#define RDATA_GENERIC_TXT_16_H
|
||||
|
|
|
|||
127
lib/dns/rdata/generic/x25_19.c
Normal file
127
lib/dns/rdata/generic/x25_19.c
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: x25_19.c,v 1.1 1999/01/22 05:02:49 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_X25_19_H
|
||||
#define RDATA_GENERIC_X25_19_H
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
static dns_result_t
|
||||
fromtext_x25(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;
|
||||
unsigned int i;
|
||||
|
||||
REQUIRE(type == 19);
|
||||
|
||||
class = class; /*unused*/
|
||||
origin = origin; /*unused*/
|
||||
downcase = downcase; /*unused*/
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
for (i = 0; i < token.value.as_textregion.length; i++)
|
||||
if (!isascii(token.value.as_textregion.base[i]&0xff) ||
|
||||
!isdigit(token.value.as_textregion.base[i]&0xff))
|
||||
return (DNS_R_RANGE);
|
||||
return (txt_fromtext(&token.value.as_textregion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_x25(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
|
||||
REQUIRE(rdata->type == 19);
|
||||
|
||||
origin = origin; /*unused*/
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
return (txt_totext(®ion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_x25(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 19);
|
||||
|
||||
dctx = dctx; /* unused */
|
||||
class = class; /* unused */
|
||||
downcase = downcase; /* unused */
|
||||
|
||||
return (txt_fromwire(source, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_x25(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(rdata->type == 19);
|
||||
|
||||
cctx = cctx;
|
||||
|
||||
return (mem_tobuffer(target, rdata->data, rdata->length));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_x25(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
int l;
|
||||
int result;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 19);
|
||||
|
||||
l = (rdata1->length < rdata2->length) ? rdata1->length : rdata2->length;
|
||||
result = memcmp(rdata1->data, rdata2->data, l);
|
||||
|
||||
if (result != 0)
|
||||
result = (result < 0) ? -1 : 1;
|
||||
else if (rdata1->length != rdata2->length)
|
||||
result = (rdata1->length < rdata2->length) ? -1 : 1;
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_x25(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 19);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_x25(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 19);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_X25_19_H */
|
||||
127
lib/dns/rdata/generic/x25_19.h
Normal file
127
lib/dns/rdata/generic/x25_19.h
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: x25_19.h,v 1.1 1999/01/22 05:02:49 marka Exp $ */
|
||||
|
||||
/* RFC 1183 */
|
||||
|
||||
#ifndef RDATA_GENERIC_X25_19_H
|
||||
#define RDATA_GENERIC_X25_19_H
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
static dns_result_t
|
||||
fromtext_x25(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;
|
||||
unsigned int i;
|
||||
|
||||
REQUIRE(type == 19);
|
||||
|
||||
class = class; /*unused*/
|
||||
origin = origin; /*unused*/
|
||||
downcase = downcase; /*unused*/
|
||||
|
||||
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
|
||||
for (i = 0; i < token.value.as_textregion.length; i++)
|
||||
if (!isascii(token.value.as_textregion.base[i]&0xff) ||
|
||||
!isdigit(token.value.as_textregion.base[i]&0xff))
|
||||
return (DNS_R_RANGE);
|
||||
return (txt_fromtext(&token.value.as_textregion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
totext_x25(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
|
||||
isc_region_t region;
|
||||
|
||||
REQUIRE(rdata->type == 19);
|
||||
|
||||
origin = origin; /*unused*/
|
||||
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
return (txt_totext(®ion, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromwire_x25(dns_rdataclass_t class, dns_rdatatype_t type,
|
||||
isc_buffer_t *source, dns_decompress_t *dctx,
|
||||
isc_boolean_t downcase, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 19);
|
||||
|
||||
dctx = dctx; /* unused */
|
||||
class = class; /* unused */
|
||||
downcase = downcase; /* unused */
|
||||
|
||||
return (txt_fromwire(source, target));
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
towire_x25(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(rdata->type == 19);
|
||||
|
||||
cctx = cctx;
|
||||
|
||||
return (mem_tobuffer(target, rdata->data, rdata->length));
|
||||
}
|
||||
|
||||
static int
|
||||
compare_x25(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
|
||||
int l;
|
||||
int result;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->class == rdata2->class);
|
||||
REQUIRE(rdata1->type == 19);
|
||||
|
||||
l = (rdata1->length < rdata2->length) ? rdata1->length : rdata2->length;
|
||||
result = memcmp(rdata1->data, rdata2->data, l);
|
||||
|
||||
if (result != 0)
|
||||
result = (result < 0) ? -1 : 1;
|
||||
else if (rdata1->length != rdata2->length)
|
||||
result = (rdata1->length < rdata2->length) ? -1 : 1;
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
fromstruct_x25(dns_rdataclass_t class, dns_rdatatype_t type, void *source,
|
||||
isc_buffer_t *target) {
|
||||
|
||||
REQUIRE(type == 19);
|
||||
|
||||
class = class; /*unused*/
|
||||
|
||||
source = source;
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static dns_result_t
|
||||
tostruct_x25(dns_rdata_t *rdata, void *target) {
|
||||
|
||||
REQUIRE(rdata->type == 19);
|
||||
|
||||
target = target;
|
||||
|
||||
return (DNS_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* RDATA_GENERIC_X25_19_H */
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: a_1.c,v 1.7 1999/01/22 04:35:10 explorer Exp $ */
|
||||
/* $Id: a_1.c,v 1.8 1999/01/22 05:02:49 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_IN_1_A_1_H
|
||||
#define RDATA_IN_1_A_1_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1998-1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: a_1.h,v 1.7 1999/01/22 04:35:10 explorer Exp $ */
|
||||
/* $Id: a_1.h,v 1.8 1999/01/22 05:02:49 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_IN_1_A_1_H
|
||||
#define RDATA_IN_1_A_1_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: wks_11.c,v 1.3 1999/01/22 04:35:10 explorer Exp $ */
|
||||
/* $Id: wks_11.c,v 1.4 1999/01/22 05:02:49 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_IN_1_WKS_11_H
|
||||
#define RDATA_IN_1_WKS_11_H
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 1998 Internet Software Consortium.
|
||||
* Copyright (C) 1999 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: wks_11.h,v 1.3 1999/01/22 04:35:10 explorer Exp $ */
|
||||
/* $Id: wks_11.h,v 1.4 1999/01/22 05:02:49 marka Exp $ */
|
||||
|
||||
#ifndef RDATA_IN_1_WKS_11_H
|
||||
#define RDATA_IN_1_WKS_11_H
|
||||
|
|
|
|||
Loading…
Reference in a new issue