peer.c revision 08c90261660649ca7d92065f6f13a61ec5a9a86d
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * Permission to use, copy, modify, and distribute this software for any
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * purpose with or without fee is hereby granted, provided that the above
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * copyright notice and this permission notice appear in all copies.
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * PERFORMANCE OF THIS SOFTWARE.
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley/* $Id: peer.c,v 1.24 2006/01/05 00:01:46 marka Exp $ */
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley * Bit positions in the dns_peer_t structure flags field
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halleydns_peerlist_new(isc_mem_t *mem, dns_peerlist_t **list) {
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halleydns_peerlist_attach(dns_peerlist_t *source, dns_peerlist_t **target) {
e0df061f35a26d2bbd0986aa889f88b3710b32d4Bob Halleydns_peerlist_addpeer(dns_peerlist_t *peers, dns_peer_t *peer) {
e0df061f35a26d2bbd0986aa889f88b3710b32d4Bob Halley * More specifics to front of list.
e0df061f35a26d2bbd0986aa889f88b3710b32d4Bob Halley ISC_LIST_INSERTBEFORE(peers->elements, p, peer, next);
55254a46f91419b92eee0d20dfb958e8dd52526cBob Halleydns_peerlist_currpeer(dns_peerlist_t *peers, dns_peer_t **retval) {
55254a46f91419b92eee0d20dfb958e8dd52526cBob Halleydns_peer_new(isc_mem_t *mem, isc_netaddr_t *addr, dns_peer_t **peerptr) {
55254a46f91419b92eee0d20dfb958e8dd52526cBob Halley unsigned int prefixlen = 0;
55254a46f91419b92eee0d20dfb958e8dd52526cBob Halley return (dns_peer_newprefix(mem, addr, prefixlen, peerptr));
55254a46f91419b92eee0d20dfb958e8dd52526cBob Halleydns_peer_newprefix(isc_mem_t *mem, isc_netaddr_t *addr, unsigned int prefixlen,
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley memset(&peer->bitflags, 0x0, sizeof(peer->bitflags));
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halleydns_peer_attach(dns_peer_t *source, dns_peer_t **target) {
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halley if (p->refs == 0)
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halleydns_peer_setbogus(dns_peer_t *peer, isc_boolean_t newval) {
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halley existed = DNS_BIT_CHECK(BOGUS_BIT, &peer->bitflags);
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halleydns_peer_getbogus(dns_peer_t *peer, isc_boolean_t *retval) {
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halleydns_peer_setprovideixfr(dns_peer_t *peer, isc_boolean_t newval) {
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halley existed = DNS_BIT_CHECK(PROVIDE_IXFR_BIT, &peer->bitflags);
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halleydns_peer_getprovideixfr(dns_peer_t *peer, isc_boolean_t *retval) {
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halley if (DNS_BIT_CHECK(PROVIDE_IXFR_BIT, &peer->bitflags)) {
c866769e664ba0a6a5e6f9375245f5ccca393009David Lawrencedns_peer_setrequestixfr(dns_peer_t *peer, isc_boolean_t newval) {
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halley existed = DNS_BIT_CHECK(REQUEST_IXFR_BIT, &peer->bitflags);
948eabe2a254a8a278ef6325f3790e75329ee656Bob Halleydns_peer_getrequestixfr(dns_peer_t *peer, isc_boolean_t *retval) {
4e142a5bccd2944174ad9ae58d86cf03e170054dBob Halley if (DNS_BIT_CHECK(REQUEST_IXFR_BIT, &peer->bitflags)) {
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
isc_buffer_t b;
return (result);
return (ISC_R_NOMEMORY);
return (result);
return (result);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);