tkey_249.c revision 8d3e74b1683f714a484bbcf73249e8ee470e36d7
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * Copyright (C) 1999 Internet Software Consortium.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * Permission to use, copy, modify, and distribute this software for any
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * purpose with or without fee is hereby granted, provided that the above
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * copyright notice and this permission notice appear in all copies.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* $Id: tkey_249.c,v 1.2 1999/02/04 06:38:43 marka Exp $ */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrewsfromtext_tkey(dns_rdataclass_t class, dns_rdatatype_t type,
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Algorithm */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews buffer_fromregion(&buffer, &token.value.as_region,
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews origin = (origin != NULL) ? origin : dns_rootname;
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(dns_name_fromtext(&name, &buffer, origin, downcase, target));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Inception */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(uint32_tobuffer(token.value.as_ulong, target));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Expiration */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(uint32_tobuffer(token.value.as_ulong, target));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(uint16_tobuffer(token.value.as_ulong, target));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews if (dns_rcode_fromtext(&rcode, &token.value.as_textregion)
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews rcode = strtol(token.value.as_pointer, &e, 10);
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews if (*e != 0)
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Signature Size */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(uint16_tobuffer(token.value.as_ulong, target));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Signature */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(base64_tobuffer(lexer, target, token.value.as_ulong));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Other Len */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(uint16_tobuffer(token.value.as_ulong, target));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Other Data */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews return (base64_tobuffer(lexer, target, token.value.as_ulong));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrewstotext_tkey(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target) {
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews unsigned long n;
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Algorithm */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Inception */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Expiration */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews if (dns_rcode_totext(n, target) == DNS_R_SUCCESS)
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Signature Size */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Signature */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Other Size */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrewsfromwire_tkey(dns_rdataclass_t class, dns_rdatatype_t type,
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews unsigned long n;
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Algorithm */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews RETERR(dns_name_fromwire(&name, source, dctx, downcase, target));
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * Inception: 4
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews * Expiration: 4
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Signature Length + Signature */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews /* Other Length + Other */
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrewstowire_tkey(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
int result;
return (result);
static dns_result_t
return (DNS_R_NOTIMPLEMENTED);
static dns_result_t
return (DNS_R_NOTIMPLEMENTED);