1 /* 2 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 3 * 4 * This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 * 8 * See the COPYRIGHT file distributed with this work for additional 9 * information regarding copyright ownership. 10 */ 11 12 #ifndef DNS_SECPROTO_H 13 #define DNS_SECPROTO_H 1 14 15 /*! \file dns/secproto.h */ 16 17 #include <isc/lang.h> 18 19 #include <dns/types.h> 20 21 ISC_LANG_BEGINDECLS 22 23 isc_result_t 24 dns_secproto_fromtext(dns_secproto_t *secprotop, isc_textregion_t *source); 25 /*%< 26 * Convert the text 'source' refers to into a DNSSEC security protocol value. 27 * The text may contain either a mnemonic protocol name or a decimal protocol 28 * number. 29 * 30 * Requires: 31 *\li 'secprotop' is a valid pointer. 32 * 33 *\li 'source' is a valid text region. 34 * 35 * Returns: 36 *\li ISC_R_SUCCESS on success 37 *\li ISC_R_RANGE numeric type is out of range 38 *\li DNS_R_UNKNOWN mnemonic type is unknown 39 */ 40 41 isc_result_t 42 dns_secproto_totext(dns_secproto_t secproto, isc_buffer_t *target); 43 /*%< 44 * Put a textual representation of the DNSSEC security protocol 'secproto' 45 * into 'target'. 46 * 47 * Requires: 48 *\li 'secproto' is a valid secproto. 49 * 50 *\li 'target' is a valid text buffer. 51 * 52 * Ensures, 53 * if the result is success: 54 * \li The used space in 'target' is updated. 55 * 56 * Returns: 57 *\li ISC_R_SUCCESS on success 58 *\li ISC_R_NOSPACE target buffer is too small 59 */ 60 61 ISC_LANG_ENDDECLS 62 63 #endif /* DNS_SECPROTO_H */ 64