hinfo_13.c revision 1.11
1/* 2 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 13 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14 * PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17/* $Id: hinfo_13.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */ 18 19/* 20 * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. 21 */ 22 23#ifndef RDATA_GENERIC_HINFO_13_C 24#define RDATA_GENERIC_HINFO_13_C 25 26static inline isc_result_t 27totext_hinfo(ARGS_TOTEXT) { 28 isc_region_t region; 29 30 UNUSED(tctx); 31 32 REQUIRE(rdata->type == dns_rdatatype_hinfo); 33 REQUIRE(rdata->length != 0); 34 35 dns_rdata_toregion(rdata, ®ion); 36 RETERR(txt_totext(®ion, ISC_TRUE, target)); 37 RETERR(str_totext(" ", target)); 38 return (txt_totext(®ion, ISC_TRUE, target)); 39} 40 41static inline isc_result_t 42fromwire_hinfo(ARGS_FROMWIRE) { 43 44 REQUIRE(type == dns_rdatatype_hinfo); 45 46 UNUSED(type); 47 UNUSED(dctx); 48 UNUSED(rdclass); 49 UNUSED(options); 50 51 RETERR(txt_fromwire(source, target)); 52 return (txt_fromwire(source, target)); 53} 54 55static inline isc_result_t 56towire_hinfo(ARGS_TOWIRE) { 57 58 UNUSED(cctx); 59 60 REQUIRE(rdata->type == dns_rdatatype_hinfo); 61 REQUIRE(rdata->length != 0); 62 63 return (isc_mem_tobuffer(target, rdata->data, rdata->length)); 64} 65 66#endif /* RDATA_GENERIC_HINFO_13_C */ 67