order.h 2.36 KB
Newer Older
Mark Andrews's avatar
Mark Andrews committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Copyright (C) 2002  Internet Software Consortium.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

18 19 20 21
/* $Id: order.h,v 1.2 2002/03/07 07:48:47 bwelling Exp $ */

#ifndef DNS_ORDER_H
#define DNS_ORDER_H 1
Mark Andrews's avatar
Mark Andrews committed
22 23 24 25 26 27 28 29 30

#include <isc/lang.h>
#include <isc/types.h>

#include <dns/types.h>

ISC_LANG_BEGINDECLS

isc_result_t
31
dns_order_create(isc_mem_t *mctx, dns_order_t **orderp);
Mark Andrews's avatar
Mark Andrews committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
/*
 * Create a order object.
 *
 * Requires:
 * 	'orderp' to be non NULL and '*orderp == NULL'.
 *	'mctx' to be valid.
 *
 * Returns:
 *	ISC_R_SUCCESS
 *	ISC_R_NOMEMORY
 */

isc_result_t
dns_order_add(dns_order_t *order, dns_name_t *name,
	      dns_rdatatype_t rdtype, dns_rdataclass_t rdclass,
	      unsigned int mode);
/*
 * Add a entry to the end of the order list.
 *
 * Requires:
 * 	'order' to be valid.
 *	'name' to be valid.
 *	'mode' to be one of DNS_RDATASERATTR_RANDOMIZE,
 *		DNS_RDATASERATTR_RANDOMIZE or zero (DNS_RDATASERATTR_CYCLIC).
 *
 * Returns:
 *	ISC_R_SUCCESS
 *	ISC_R_NOMEMORY
 */

unsigned int
dns_order_find(dns_order_t *order, dns_name_t *name,
	       dns_rdatatype_t rdtype, dns_rdataclass_t rdclass);
/*
 * Find the first matching entry on the list.
 *
 * Requires:
 *	'order' to be valid.
 *	'name' to be valid.
 *
 * Returns the mode set by dns_order_add() or zero.
 */

void
dns_order_attach(dns_order_t *source, dns_order_t **target);
/*
 * Attach to the 'source' object.
 *
 * Requires:
 * 	'source' to be valid.
 *	'target' to be non NULL and '*target == NULL'.
 */

void
dns_order_detach(dns_order_t **orderp);
/*
 * Detach from the object.  Clean up if last this was the last
 * reference.
 *
 * Requires:
 *	'*orderp' to be valid.
 */

ISC_LANG_ENDDECLS
96 97

#endif /* DNS_ORDER_H */