xref: /netbsd-src/external/mpl/bind/dist/lib/dns/include/dns/opcode.h (revision bcda20f65a8566e103791ec395f7f499ef322704)
1*bcda20f6Schristos /*	$NetBSD: opcode.h,v 1.7 2025/01/26 16:25:28 christos Exp $	*/
2d68c78b8Schristos 
3d68c78b8Schristos /*
4d68c78b8Schristos  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5d68c78b8Schristos  *
68596601aSchristos  * SPDX-License-Identifier: MPL-2.0
78596601aSchristos  *
8d68c78b8Schristos  * This Source Code Form is subject to the terms of the Mozilla Public
9d68c78b8Schristos  * License, v. 2.0. If a copy of the MPL was not distributed with this
10fce770bdSchristos  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
11d68c78b8Schristos  *
12d68c78b8Schristos  * See the COPYRIGHT file distributed with this work for additional
13d68c78b8Schristos  * information regarding copyright ownership.
14d68c78b8Schristos  */
15d68c78b8Schristos 
16bb5aa156Schristos #pragma once
17d68c78b8Schristos 
18d68c78b8Schristos /*! \file dns/opcode.h */
19d68c78b8Schristos 
20d68c78b8Schristos #include <isc/lang.h>
21d68c78b8Schristos 
22d68c78b8Schristos #include <dns/types.h>
23d68c78b8Schristos 
24d68c78b8Schristos ISC_LANG_BEGINDECLS
25d68c78b8Schristos 
265606745fSchristos isc_result_t
275606745fSchristos dns_opcode_totext(dns_opcode_t opcode, isc_buffer_t *target);
28d68c78b8Schristos /*%<
29d68c78b8Schristos  * Put a textual representation of error 'opcode' into 'target'.
30d68c78b8Schristos  *
31d68c78b8Schristos  * Requires:
32d68c78b8Schristos  *\li	'opcode' is a valid opcode.
33d68c78b8Schristos  *
34d68c78b8Schristos  *\li	'target' is a valid text buffer.
35d68c78b8Schristos  *
36d68c78b8Schristos  * Ensures:
37d68c78b8Schristos  *\li	If the result is success:
38d68c78b8Schristos  *		The used space in 'target' is updated.
39d68c78b8Schristos  *
40d68c78b8Schristos  * Returns:
41d68c78b8Schristos  *\li	#ISC_R_SUCCESS			on success
42d68c78b8Schristos  *\li	#ISC_R_NOSPACE			target buffer is too small
43d68c78b8Schristos  */
44d68c78b8Schristos 
45d68c78b8Schristos ISC_LANG_ENDDECLS
46