lp_107.c revision e0a30050c8516a3d54a4f8dcdd88435704a8a3ed
503ffdad3bc62e6458e4b60e329aa448ce1803a1Tinderbox User * Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC")
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * purpose with or without fee is hereby granted, provided that the above
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * copyright notice and this permission notice appear in all copies.
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews * PERFORMANCE OF THIS SOFTWARE.
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews RETERR(uint16_tobuffer(token.value.as_ulong, target));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews buffer_fromregion(&buffer, &token.value.as_region);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (dns_name_fromtext(&name, &buffer, origin, options, target));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews unsigned short num;
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews sub = name_prefix(&name, tctx->origin, &prefix);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (dns_name_totext(&prefix, sub, target));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (dns_name_fromwire(&name, source, dctx, options, target));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (mem_tobuffer(target, rdata->data, rdata->length));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrewsstatic inline int
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (isc_region_compare(®ion1, ®ion2));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (isc_buffer_copyregion(target, ®ion));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrewsstatic inline void
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(lp->common.rdtype == dns_rdatatype_lp);
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrewsstatic inline int
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews return (dns_name_rdatacompare(&name1, &name2));
f1c1aab2c9e720399d66d8db5f40515d47c45ecfMark Andrews#endif /* RDATA_GENERIC_LP_107_C */