isdn_20.c revision 82ca33427bdd4f3bc4ed3431e86bd810fe751674
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright (C) 1999, 2000 Internet Software Consortium.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * Permission to use, copy, modify, and distribute this software for any
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * purpose with or without fee is hereby granted, provided that the above
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * copyright notice and this permission notice appear in all copies.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
82ca33427bdd4f3bc4ed3431e86bd810fe751674Andreas Gustafsson/* $Id: isdn_20.c,v 1.17 2000/04/28 01:24:01 gson Exp $ */
d0fe07af9cd5278b86bfba65c9a8391e007cd8c9Brian Wellington/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
d0fe07af9cd5278b86bfba65c9a8391e007cd8c9Brian Wellington/* RFC 1183 */
d981ca645597116d227a48bf37cc5edc061c854dBob Halleyfromtext_isdn(dns_rdataclass_t rdclass, dns_rdatatype_t type,
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews /* ISDN-address */
5dcb42f5bbd41da02a0b32a11a1912f7b90686a8Andreas Gustafsson RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE));
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews RETERR(txt_fromtext(&token.value.as_textregion, target));
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews /* sa: optional */
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_TRUE));
5dcb42f5bbd41da02a0b32a11a1912f7b90686a8Andreas Gustafsson if (token.type != isc_tokentype_string &&
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews return (txt_fromtext(&token.value.as_textregion, target));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssontotext_isdn(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
d981ca645597116d227a48bf37cc5edc061c854dBob Halleyfromwire_isdn(dns_rdataclass_t rdclass, dns_rdatatype_t type,
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewstowire_isdn(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews return (mem_tobuffer(target, rdata->data, rdata->length));
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline int
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrewscompare_isdn(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
d981ca645597116d227a48bf37cc5edc061c854dBob Halleyfromstruct_isdn(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrewstostruct_isdn(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline void
d981ca645597116d227a48bf37cc5edc061c854dBob Halleyadditionaldata_isdn(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halleydigest_isdn(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg) {
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews#endif /* RDATA_GENERIC_ISDN_20_C */