opt_41.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 1998-2002, 2004, 2005, 2007, 2009, 2011-2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Reviewed: Thu Mar 16 14:06:44 PST 2000 by gson */
/* RFC2671 */
#ifndef RDATA_GENERIC_OPT_41_C
#define RDATA_GENERIC_OPT_41_C
#define RRTYPE_OPT_ATTRIBUTES (DNS_RDATATYPEATTR_SINGLETON | \
static inline isc_result_t
/*
* OPT records do not have a text format.
*/
return (ISC_R_NOTIMPLEMENTED);
}
static inline isc_result_t
isc_region_t r;
char buf[sizeof("64000 64000")];
/*
* OPT records do not have a text format.
*/
dns_rdata_toregion(rdata, &r);
while (r.length > 0) {
option = uint16_fromregion(&r);
isc_region_consume(&r, 2);
length = uint16_fromregion(&r);
isc_region_consume(&r, 2);
if (length > 0) {
or = r;
else
target));
isc_region_consume(&r, length);
}
if (r.length > 0)
}
return (ISC_R_SUCCESS);
}
static inline isc_result_t
unsigned int total;
total = 0;
return (ISC_R_UNEXPECTEDEND);
total += 4;
return (ISC_R_UNEXPECTEDEND);
switch (opt) {
case DNS_OPT_CLIENT_SUBNET: {
if (length < 4)
return (DNS_R_OPTERR);
return (DNS_R_OPTERR);
switch (family) {
case 0:
/*
* XXXMUKS: In queries and replies, if
* FAMILY is set to 0, SOURCE
* PREFIX-LENGTH and SCOPE PREFIX-LENGTH
* must be 0 and ADDRESS should not be
* present as the address and prefix
* lengths don't make sense because the
* family is unknown.
*/
return (DNS_R_OPTERR);
break;
case 1:
return (DNS_R_OPTERR);
break;
case 2:
return (DNS_R_OPTERR);
break;
default:
return (DNS_R_OPTERR);
}
return (DNS_R_OPTERR);
return (DNS_R_OPTERR);
}
break;
}
case DNS_OPT_EXPIRE:
/*
* Request has zero length. Response is 32 bits.
*/
return (DNS_R_OPTERR);
break;
case DNS_OPT_COOKIE:
return (DNS_R_OPTERR);
break;
default:
break;
}
}
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
}
static inline isc_result_t
}
static inline int
}
static inline isc_result_t
return (ISC_R_UNEXPECTEDEND);
}
return (ISC_R_UNEXPECTEDEND);
}
static inline isc_result_t
isc_region_t r;
dns_rdata_toregion(rdata, &r);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
}
static inline void
return;
}
static inline isc_result_t
return (ISC_R_SUCCESS);
}
static inline isc_result_t
/*
* OPT records are not digested.
*/
return (ISC_R_NOTIMPLEMENTED);
}
static inline isc_boolean_t
}
static inline isc_boolean_t
return (ISC_TRUE);
}
static inline int
}
return (ISC_R_NOMORE);
return (ISC_R_SUCCESS);
}
isc_region_t r;
length = uint16_fromregion(&r);
return (ISC_R_NOMORE);
return (ISC_R_SUCCESS);
}
isc_region_t r;
isc_region_consume(&r, 2);
isc_region_consume(&r, 2);
return (ISC_R_SUCCESS);
}
#endif /* RDATA_GENERIC_OPT_41_C */