1/* 2 * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") 3 * Copyright (C) 1999-2001 Internet Software Consortium. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 * PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18/* $Id: rcode.h,v 1.21 2008/09/25 04:02:39 tbox Exp $ */ 19 20#ifndef DNS_RCODE_H 21#define DNS_RCODE_H 1 22 23/*! \file dns/rcode.h */ 24 25#include <isc/lang.h> 26 27#include <dns/types.h> 28 29ISC_LANG_BEGINDECLS 30 31isc_result_t dns_rcode_fromtext(dns_rcode_t *rcodep, isc_textregion_t *source); 32/*%< 33 * Convert the text 'source' refers to into a DNS error value. 34 * 35 * Requires: 36 *\li 'rcodep' is a valid pointer. 37 * 38 *\li 'source' is a valid text region. 39 * 40 * Returns: 41 *\li #ISC_R_SUCCESS on success 42 *\li #DNS_R_UNKNOWN type is unknown 43 */ 44 45isc_result_t dns_rcode_totext(dns_rcode_t rcode, isc_buffer_t *target); 46/*%< 47 * Put a textual representation of error 'rcode' into 'target'. 48 * 49 * Requires: 50 *\li 'rcode' is a valid rcode. 51 * 52 *\li 'target' is a valid text buffer. 53 * 54 * Ensures: 55 *\li If the result is success: 56 * The used space in 'target' is updated. 57 * 58 * Returns: 59 *\li #ISC_R_SUCCESS on success 60 *\li #ISC_R_NOSPACE target buffer is too small 61 */ 62 63isc_result_t dns_tsigrcode_fromtext(dns_rcode_t *rcodep, 64 isc_textregion_t *source); 65/*%< 66 * Convert the text 'source' refers to into a TSIG/TKEY error value. 67 * 68 * Requires: 69 *\li 'rcodep' is a valid pointer. 70 * 71 *\li 'source' is a valid text region. 72 * 73 * Returns: 74 *\li #ISC_R_SUCCESS on success 75 *\li #DNS_R_UNKNOWN type is unknown 76 */ 77 78isc_result_t dns_tsigrcode_totext(dns_rcode_t rcode, isc_buffer_t *target); 79/*%< 80 * Put a textual representation of TSIG/TKEY error 'rcode' into 'target'. 81 * 82 * Requires: 83 *\li 'rcode' is a valid TSIG/TKEY error code. 84 * 85 *\li 'target' is a valid text buffer. 86 * 87 * Ensures: 88 *\li If the result is success: 89 * The used space in 'target' is updated. 90 * 91 * Returns: 92 *\li #ISC_R_SUCCESS on success 93 *\li #ISC_R_NOSPACE target buffer is too small 94 */ 95 96isc_result_t 97dns_hashalg_fromtext(unsigned char *hashalg, isc_textregion_t *source); 98/*%< 99 * Convert the text 'source' refers to into a has algorithm value. 100 * 101 * Requires: 102 *\li 'hashalg' is a valid pointer. 103 * 104 *\li 'source' is a valid text region. 105 * 106 * Returns: 107 *\li #ISC_R_SUCCESS on success 108 *\li #DNS_R_UNKNOWN type is unknown 109 */ 110 111ISC_LANG_ENDDECLS 112 113#endif /* DNS_RCODE_H */ 114