00001 /* 00002 * Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") 00003 * 00004 * Permission to use, copy, modify, and/or distribute this software for any 00005 * purpose with or without fee is hereby granted, provided that the above 00006 * copyright notice and this permission notice appear in all copies. 00007 * 00008 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 00009 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 00010 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 00011 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00012 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00013 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00014 * PERFORMANCE OF THIS SOFTWARE. 00015 */ 00016 00017 /* $Id$ */ 00018 00019 #ifndef DNS_DSDIGEST_H 00020 #define DNS_DSDIGEST_H 1 00021 00022 /*! \file dns/dsdigest.h */ 00023 00024 #include <isc/lang.h> 00025 00026 #include <dns/types.h> 00027 00028 ISC_LANG_BEGINDECLS 00029 00030 isc_result_t 00031 dns_dsdigest_fromtext(dns_dsdigest_t *dsdigestp, isc_textregion_t *source); 00032 /*%< 00033 * Convert the text 'source' refers to into a DS/DLV digest type value. 00034 * The text may contain either a mnemonic digest name or a decimal 00035 * digest number. 00036 * 00037 * Requires: 00038 *\li 'dsdigestp' is a valid pointer. 00039 * 00040 *\li 'source' is a valid text region. 00041 * 00042 * Returns: 00043 *\li ISC_R_SUCCESS on success 00044 *\li ISC_R_RANGE numeric type is out of range 00045 *\li DNS_R_UNKNOWN mnemonic type is unknown 00046 */ 00047 00048 isc_result_t 00049 dns_dsdigest_totext(dns_dsdigest_t dsdigest, isc_buffer_t *target); 00050 /*%< 00051 * Put a textual representation of the DS/DLV digest type 'dsdigest' 00052 * into 'target'. 00053 * 00054 * Requires: 00055 *\li 'dsdigest' is a valid dsdigest. 00056 * 00057 *\li 'target' is a valid text buffer. 00058 * 00059 * Ensures, 00060 * if the result is success: 00061 *\li The used space in 'target' is updated. 00062 * 00063 * Returns: 00064 *\li ISC_R_SUCCESS on success 00065 *\li ISC_R_NOSPACE target buffer is too small 00066 */ 00067 00068 #define DNS_DSDIGEST_FORMATSIZE 20 00069 void 00070 dns_dsdigest_format(dns_dsdigest_t typ, char *cp, unsigned int size); 00071 /*%< 00072 * Wrapper for dns_dsdigest_totext(), writing text into 'cp' 00073 */ 00074 00075 ISC_LANG_ENDDECLS 00076 00077 #endif /* DNS_DSDIGEST_H */