"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/dns/include/dns/secalg.h" (4 Sep 2020, 1704 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "secalg.h" see the Fossies "Dox" file reference documentation.

    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_SECALG_H
   13 #define DNS_SECALG_H 1
   14 
   15 /*! \file dns/secalg.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_secalg_fromtext(dns_secalg_t *secalgp, isc_textregion_t *source);
   25 /*%<
   26  * Convert the text 'source' refers to into a DNSSEC security algorithm value.
   27  * The text may contain either a mnemonic algorithm name or a decimal algorithm
   28  * number.
   29  *
   30  * Requires:
   31  *\li   'secalgp' 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_secalg_totext(dns_secalg_t secalg, isc_buffer_t *target);
   43 /*%<
   44  * Put a textual representation of the DNSSEC security algorithm 'secalg'
   45  * into 'target'.
   46  *
   47  * Requires:
   48  *\li   'secalg' is a valid secalg.
   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 #define DNS_SECALG_FORMATSIZE 20
   62 void
   63 dns_secalg_format(dns_secalg_t alg, char *cp, unsigned int size);
   64 /*%<
   65  * Wrapper for dns_secalg_totext(), writing text into 'cp'
   66  */
   67 
   68 ISC_LANG_ENDDECLS
   69 
   70 #endif /* DNS_SECALG_H */