hinfo_13.c revision 1.8
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.8 2020/02/24 17:45:26 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 26#define RRTYPE_HINFO_ATTRIBUTES (0) 27 28static inline isc_result_t 29totext_hinfo(ARGS_TOTEXT) { 30 isc_region_t region; 31 32 UNUSED(tctx); 33 34 REQUIRE(rdata->type == dns_rdatatype_hinfo); 35 REQUIRE(rdata->length != 0); 36 37 dns_rdata_toregion(rdata, ®ion); 38 RETERR(txt_totext(®ion, ISC_TRUE, target)); 39 RETERR(str_totext(" ", target)); 40 return (txt_totext(®ion, ISC_TRUE, target)); 41} 42 43static inline isc_result_t 44fromwire_hinfo(ARGS_FROMWIRE) { 45 46 REQUIRE(type == dns_rdatatype_hinfo); 47 48 UNUSED(type); 49 UNUSED(dctx); 50 UNUSED(rdclass); 51 UNUSED(options); 52 53 RETERR(txt_fromwire(source, target)); 54 return (txt_fromwire(source, target)); 55} 56 57static inline isc_result_t 58towire_hinfo(ARGS_TOWIRE) { 59 60 UNUSED(cctx); 61 62 REQUIRE(rdata->type == dns_rdatatype_hinfo); 63 REQUIRE(rdata->length != 0); 64 65 return (mem_tobuffer(target, rdata->data, rdata->length)); 66} 67 68 69 70 71 72 73#endif /* RDATA_GENERIC_HINFO_13_C */ 74