peer.c revision 15a44745412679c30a6d022733925af70a38b715
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews/* $Id: peer.c,v 1.9 2000/07/27 09:46:20 tale Exp $ */
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews * Bit positions in the dns_peer_t structure flags field
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrewsdns_peerlist_new(isc_mem_t *mem, dns_peerlist_t **list) {
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrewsdns_peerlist_attach(dns_peerlist_t *source, dns_peerlist_t **target) {
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrewsdns_peerlist_addpeer(dns_peerlist_t *peers, dns_peer_t *peer) {
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrewsdns_peerlist_peerbyaddr(dns_peerlist_t *servers,
3dd63ba00f91f4d54ba45ba1831375950758c0a7Mark Andrews if (isc_netaddr_equal(addr, &server->address)) {
return (res);
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
dns_peer_t *p;
p = *peer;
p->refs--;
if (p->refs == 0) {
dns_peer_delete(&p);
return (ISC_R_SUCCESS);
static isc_result_t
dns_peer_t *p;
p = *peer;
p->magic = 0;
return (ISC_R_SUCCESS);
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);
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);