xref: /openbsd-src/usr.bin/dig/lib/dns/rdata/in_1/https_65.c (revision 38bad3e5b5d2d3914982f300641a375c9d1960da)
1 /*
2  * Copyright (C) 2022 Florian Obser <florian@openbsd.org>
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: https_65.c,v 1.1 2022/07/03 12:07:52 florian Exp $ */
18 
19 /* draft-ietf-dnsop-svcb-https-10 */
20 
21 #ifndef RDATA_IN_1_HTTPS_65_C
22 #define RDATA_IN_1_HTTPS_65_C
23 
24 static inline isc_result_t
totext_in_https(ARGS_TOTEXT)25 totext_in_https(ARGS_TOTEXT) {
26 	REQUIRE(rdata->type == dns_rdatatype_https);
27 	REQUIRE(rdata->rdclass == dns_rdataclass_in);
28 	REQUIRE(rdata->length != 0);
29 
30 	return (totext_in_svcb_https(rdata, tctx, target));
31 }
32 
33 static inline isc_result_t
fromwire_in_https(ARGS_FROMWIRE)34 fromwire_in_https(ARGS_FROMWIRE) {
35 	REQUIRE(type == dns_rdatatype_https);
36 	REQUIRE(rdclass == dns_rdataclass_in);
37 	return (fromwire_in_svcb_https(rdclass, type, source, dctx, options,
38 	    target));
39 }
40 
41 static inline isc_result_t
towire_in_https(ARGS_TOWIRE)42 towire_in_https(ARGS_TOWIRE) {
43 	REQUIRE(rdata->type == dns_rdatatype_https);
44 	REQUIRE(rdata->length != 0);
45 
46 	return (towire_in_svcb_https(rdata, cctx, target));
47 }
48 
49 
50 #endif	/* RDATA_IN_1_HTTPS_65_C */
51