00001 /* 00002 * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") 00003 * Copyright (C) 1999-2001 Internet Software Consortium. 00004 * 00005 * Permission to use, copy, modify, and/or distribute this software for any 00006 * purpose with or without fee is hereby granted, provided that the above 00007 * copyright notice and this permission notice appear in all copies. 00008 * 00009 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 00010 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 00011 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 00012 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00013 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00014 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00015 * PERFORMANCE OF THIS SOFTWARE. 00016 */ 00017 00018 /* $Id: rcode.h,v 1.21 2008/09/25 04:02:39 tbox Exp $ */ 00019 00020 #ifndef DNS_RCODE_H 00021 #define DNS_RCODE_H 1 00022 00023 /*! \file dns/rcode.h */ 00024 00025 #include <isc/lang.h> 00026 00027 #include <dns/types.h> 00028 00029 ISC_LANG_BEGINDECLS 00030 00031 isc_result_t dns_rcode_fromtext(dns_rcode_t *rcodep, isc_textregion_t *source); 00032 /*%< 00033 * Convert the text 'source' refers to into a DNS error value. 00034 * 00035 * Requires: 00036 *\li 'rcodep' is a valid pointer. 00037 * 00038 *\li 'source' is a valid text region. 00039 * 00040 * Returns: 00041 *\li #ISC_R_SUCCESS on success 00042 *\li #DNS_R_UNKNOWN type is unknown 00043 */ 00044 00045 isc_result_t dns_rcode_totext(dns_rcode_t rcode, isc_buffer_t *target); 00046 /*%< 00047 * Put a textual representation of error 'rcode' into 'target'. 00048 * 00049 * Requires: 00050 *\li 'rcode' is a valid rcode. 00051 * 00052 *\li 'target' is a valid text buffer. 00053 * 00054 * Ensures: 00055 *\li If the result is success: 00056 * The used space in 'target' is updated. 00057 * 00058 * Returns: 00059 *\li #ISC_R_SUCCESS on success 00060 *\li #ISC_R_NOSPACE target buffer is too small 00061 */ 00062 00063 isc_result_t dns_tsigrcode_fromtext(dns_rcode_t *rcodep, 00064 isc_textregion_t *source); 00065 /*%< 00066 * Convert the text 'source' refers to into a TSIG/TKEY error value. 00067 * 00068 * Requires: 00069 *\li 'rcodep' is a valid pointer. 00070 * 00071 *\li 'source' is a valid text region. 00072 * 00073 * Returns: 00074 *\li #ISC_R_SUCCESS on success 00075 *\li #DNS_R_UNKNOWN type is unknown 00076 */ 00077 00078 isc_result_t dns_tsigrcode_totext(dns_rcode_t rcode, isc_buffer_t *target); 00079 /*%< 00080 * Put a textual representation of TSIG/TKEY error 'rcode' into 'target'. 00081 * 00082 * Requires: 00083 *\li 'rcode' is a valid TSIG/TKEY error code. 00084 * 00085 *\li 'target' is a valid text buffer. 00086 * 00087 * Ensures: 00088 *\li If the result is success: 00089 * The used space in 'target' is updated. 00090 * 00091 * Returns: 00092 *\li #ISC_R_SUCCESS on success 00093 *\li #ISC_R_NOSPACE target buffer is too small 00094 */ 00095 00096 isc_result_t 00097 dns_hashalg_fromtext(unsigned char *hashalg, isc_textregion_t *source); 00098 /*%< 00099 * Convert the text 'source' refers to into a has algorithm value. 00100 * 00101 * Requires: 00102 *\li 'hashalg' is a valid pointer. 00103 * 00104 *\li 'source' is a valid text region. 00105 * 00106 * Returns: 00107 *\li #ISC_R_SUCCESS on success 00108 *\li #DNS_R_UNKNOWN type is unknown 00109 */ 00110 00111 ISC_LANG_ENDDECLS 00112 00113 #endif /* DNS_RCODE_H */