rdatatype.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 1998-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: rdatatype.h,v 1.26 2008/09/25 04:02:39 tbox Exp $ */
00019 
00020 #ifndef DNS_RDATATYPE_H
00021 #define DNS_RDATATYPE_H 1
00022 
00023 /*! \file dns/rdatatype.h */
00024 
00025 #include <isc/lang.h>
00026 
00027 #include <dns/types.h>
00028 
00029 ISC_LANG_BEGINDECLS
00030 
00031 isc_result_t
00032 dns_rdatatype_fromtext(dns_rdatatype_t *typep, isc_textregion_t *source);
00033 /*%<
00034  * Convert the text 'source' refers to into a DNS rdata type.
00035  *
00036  * Requires:
00037  *\li   'typep' is a valid pointer.
00038  *
00039  *\li   'source' is a valid text region.
00040  *
00041  * Returns:
00042  *\li   ISC_R_SUCCESS                   on success
00043  *\li   DNS_R_UNKNOWN                   type is unknown
00044  */
00045 
00046 isc_result_t
00047 dns_rdatatype_totext(dns_rdatatype_t type, isc_buffer_t *target);
00048 /*%<
00049  * Put a textual representation of type 'type' into 'target'.
00050  *
00051  * Requires:
00052  *\li   'type' is a valid type.
00053  *
00054  *\li   'target' is a valid text buffer.
00055  *
00056  * Ensures,
00057  *      if the result is success:
00058  *\li           The used space in 'target' is updated.
00059  *
00060  * Returns:
00061  *\li   #ISC_R_SUCCESS                  on success
00062  *\li   #ISC_R_NOSPACE                  target buffer is too small
00063  */
00064 
00065 void
00066 dns_rdatatype_format(dns_rdatatype_t rdtype,
00067                      char *array, unsigned int size);
00068 /*%<
00069  * Format a human-readable representation of the type 'rdtype'
00070  * into the character array 'array', which is of size 'size'.
00071  * The resulting string is guaranteed to be null-terminated.
00072  */
00073 
00074 #define DNS_RDATATYPE_FORMATSIZE sizeof("NSEC3PARAM")
00075 
00076 /*%<
00077  * Minimum size of array to pass to dns_rdatatype_format().
00078  * May need to be adjusted if a new RR type with a very long
00079  * name is defined.
00080  */
00081 
00082 ISC_LANG_ENDDECLS
00083 
00084 #endif /* DNS_RDATATYPE_H */

Generated on Tue Apr 28 17:40:57 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha