isdn_20.c revision 503ffdad3bc62e6458e4b60e329aa448ce1803a1
ca41b452ede6feaa9d8739ec3cae19389a7b0d03Bob Halley * Copyright (C) 2004, 2005, 2007, 2009, 2013-2015 Internet Systems Consortium, Inc. ("ISC")
615eff12e0e3565c52758292e10080a25d872941William King * Copyright (C) 1999-2002 Internet Software Consortium.
615eff12e0e3565c52758292e10080a25d872941William King * Permission to use, copy, modify, and/or distribute this software for any
615eff12e0e3565c52758292e10080a25d872941William King * purpose with or without fee is hereby granted, provided that the above
615eff12e0e3565c52758292e10080a25d872941William King * copyright notice and this permission notice appear in all copies.
615eff12e0e3565c52758292e10080a25d872941William King * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
615eff12e0e3565c52758292e10080a25d872941William King * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
615eff12e0e3565c52758292e10080a25d872941William King * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
615eff12e0e3565c52758292e10080a25d872941William King * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
615eff12e0e3565c52758292e10080a25d872941William King * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
615eff12e0e3565c52758292e10080a25d872941William King * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
615eff12e0e3565c52758292e10080a25d872941William King * PERFORMANCE OF THIS SOFTWARE.
615eff12e0e3565c52758292e10080a25d872941William King/* $Id: isdn_20.c,v 1.40 2009/12/04 22:06:37 tbox Exp $ */
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
615eff12e0e3565c52758292e10080a25d872941William King /* ISDN-address */
615eff12e0e3565c52758292e10080a25d872941William King RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring,
615eff12e0e3565c52758292e10080a25d872941William King RETTOK(txt_fromtext(&token.value.as_textregion, target));
615eff12e0e3565c52758292e10080a25d872941William King /* sa: optional */
615eff12e0e3565c52758292e10080a25d872941William King RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring,
615eff12e0e3565c52758292e10080a25d872941William King RETTOK(txt_fromtext(&token.value.as_textregion, target));
615eff12e0e3565c52758292e10080a25d872941William King return (txt_totext(®ion, ISC_TRUE, target));
615eff12e0e3565c52758292e10080a25d872941William King return (mem_tobuffer(target, rdata->data, rdata->length));
615eff12e0e3565c52758292e10080a25d872941William Kingstatic inline int
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington RETERR(uint8_tobuffer(isdn->isdn_len, target));
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington RETERR(mem_tobuffer(target, isdn->isdn, isdn->isdn_len));
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington RETERR(uint8_tobuffer(isdn->subaddress_len, target));
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington return (mem_tobuffer(target, isdn->subaddress, isdn->subaddress_len));
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington REQUIRE(rdata->type == dns_rdatatype_isdn);
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington isdn->isdn = mem_maybedup(mctx, r.base, isdn->isdn_len);
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington isdn->subaddress_len = uint8_fromregion(&r);
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington isdn->subaddress = mem_maybedup(mctx, r.base,
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellingtonstatic inline void
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington isc_mem_free(isdn->mctx, isdn->subaddress);
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington REQUIRE(rdata->type == dns_rdatatype_isdn);
7c37bc1a67a80209e05f6b1c01fa7fde7d0dd200Brian Wellington REQUIRE(rdata->type == dns_rdatatype_isdn);
615eff12e0e3565c52758292e10080a25d872941William Kingstatic inline int
615eff12e0e3565c52758292e10080a25d872941William King#endif /* RDATA_GENERIC_ISDN_20_C */