soa.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2007, 2009  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 2000, 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: soa.h,v 1.12 2009/09/10 01:47:09 each Exp $ */
00019 
00020 #ifndef DNS_SOA_H
00021 #define DNS_SOA_H 1
00022 
00023 /*****
00024  ***** Module Info
00025  *****/
00026 
00027 /*! \file dns/soa.h
00028  * \brief
00029  * SOA utilities.
00030  */
00031 
00032 /***
00033  *** Imports
00034  ***/
00035 
00036 #include <isc/lang.h>
00037 #include <isc/types.h>
00038 
00039 #include <dns/types.h>
00040 
00041 ISC_LANG_BEGINDECLS
00042 
00043 #define DNS_SOA_BUFFERSIZE      ((2 * DNS_NAME_MAXWIRE) + (4 * 5))
00044 
00045 isc_result_t
00046 dns_soa_buildrdata(dns_name_t *origin, dns_name_t *contact,
00047                    dns_rdataclass_t rdclass,
00048                    isc_uint32_t serial, isc_uint32_t refresh,
00049                    isc_uint32_t retry, isc_uint32_t expire,
00050                    isc_uint32_t minimum, unsigned char *buffer,
00051                    dns_rdata_t *rdata);
00052 /*%<
00053  * Build the rdata of an SOA record.
00054  *
00055  * Requires:
00056  *\li   buffer  Points to a temporary buffer of at least
00057  *              DNS_SOA_BUFFERSIZE bytes.
00058  *\li   rdata   Points to an initialized dns_rdata_t.
00059  *
00060  * Ensures:
00061  *  \li    *rdata       Contains a valid SOA rdata.  The 'data' member
00062  *                      refers to 'buffer'.
00063  */
00064 
00065 isc_uint32_t
00066 dns_soa_getserial(dns_rdata_t *rdata);
00067 isc_uint32_t
00068 dns_soa_getrefresh(dns_rdata_t *rdata);
00069 isc_uint32_t
00070 dns_soa_getretry(dns_rdata_t *rdata);
00071 isc_uint32_t
00072 dns_soa_getexpire(dns_rdata_t *rdata);
00073 isc_uint32_t
00074 dns_soa_getminimum(dns_rdata_t *rdata);
00075 /*
00076  * Extract an integer field from the rdata of a SOA record.
00077  *
00078  * Requires:
00079  *      rdata refers to the rdata of a well-formed SOA record.
00080  */
00081 
00082 void
00083 dns_soa_setserial(isc_uint32_t val, dns_rdata_t *rdata);
00084 void
00085 dns_soa_setrefresh(isc_uint32_t val, dns_rdata_t *rdata);
00086 void
00087 dns_soa_setretry(isc_uint32_t val, dns_rdata_t *rdata);
00088 void
00089 dns_soa_setexpire(isc_uint32_t val, dns_rdata_t *rdata);
00090 void
00091 dns_soa_setminimum(isc_uint32_t val, dns_rdata_t *rdata);
00092 /*
00093  * Change an integer field of a SOA record by modifying the
00094  * rdata in-place.
00095  *
00096  * Requires:
00097  *      rdata refers to the rdata of a well-formed SOA record.
00098  */
00099 
00100 
00101 ISC_LANG_ENDDECLS
00102 
00103 #endif /* DNS_SOA_H */

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