a6_38.c revision 7c7d67b5d88fba9d6fe7b4a93ef154e113153df2
/*
* Copyright (C) 1999, 2000 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: a6_38.c,v 1.30 2000/05/13 22:07:57 tale Exp $ */
#ifndef RDATA_IN_1_A6_28_C
#define RDATA_IN_1_A6_28_C
#define RRTYPE_A6_ATTRIBUTES (0)
static inline isc_result_t
{
unsigned char addr[16];
unsigned char prefixlen;
unsigned char octets;
unsigned char mask;
/* prefix length */
return (DNS_R_RANGE);
/* suffix */
if (prefixlen != 128) {
/* prefix 0..127 */
/* octets 0..15 */
ISC_FALSE));
return (DNS_R_BADAAAA);
}
if (prefixlen == 0)
return (ISC_R_SUCCESS);
}
static inline isc_result_t
{
unsigned char addr[16];
unsigned char prefixlen;
unsigned char octets;
unsigned char mask;
char buf[sizeof "128"];
if (prefixlen != 128) {
return (ISC_R_NOSPACE);
}
if (prefixlen == 0)
return (ISC_R_SUCCESS);
}
static inline isc_result_t
{
unsigned char prefixlen;
unsigned char octets;
unsigned char mask;
/* prefix length */
return (ISC_R_UNEXPECTEDEND);
if (prefixlen > 128)
return (DNS_R_RANGE);
/* suffix */
if (prefixlen != 128) {
return (ISC_R_UNEXPECTEDEND);
}
if (prefixlen == 0)
return (ISC_R_SUCCESS);
}
static inline isc_result_t
unsigned char prefixlen;
unsigned char octets;
if (prefixlen == 0)
return (ISC_R_SUCCESS);
}
static inline int
int order;
unsigned char prefixlen1, prefixlen2;
unsigned char octets;
if (prefixlen1 < prefixlen2)
return (-1);
else if (prefixlen1 > prefixlen2)
return (1);
/*
* Prefix lengths are equal.
*/
if (octets > 0) {
if (order < 0)
return (-1);
else if (order > 0)
return (1);
/*
* Address suffixes are equal.
*/
if (prefixlen1 == 0)
return (order);
}
}
static inline isc_result_t
{
unsigned char prefixlen;
unsigned char octets;
return (DNS_R_RANGE);
/* XXX fix this! */
}
/*
* XXXDCL shut up IRIX compiler until this function is finished.
*/
return (ISC_R_NOTIMPLEMENTED);
}
static inline isc_result_t
{
unsigned char octets;
isc_region_t r;
dns_rdata_toregion(rdata, &r);
isc_region_consume(&r, 1);
/* suffix */
isc_region_consume(&r, octets);
}
/* prefix */
dns_name_fromregion(&name, &r);
}
return (ISC_R_SUCCESS);
}
static inline void
freestruct_in_a6(void *source)
{
return;
}
static inline isc_result_t
void *arg)
{
return (ISC_R_SUCCESS);
}
static inline isc_result_t
{
if (result != ISC_R_SUCCESS)
return (result);
if (prefixlen == 0)
return (ISC_R_SUCCESS);
}
#endif /* RDATA_IN_1_A6_38_C */