peer.c revision b3e77535185043f089b346166440402d092030c3
/*
* Copyright (C) 2000 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.
*/
#include <config.h>
#include <string.h>
#include <isc/assertions.h>
/*
* Bit positions in the dns_peer_t structure flags field
*/
#define BOGUS_BIT 0
#define SERVER_TRANSFER_FORMAT_BIT 1
#define TRANSFERS_BIT 2
#define PROVIDE_IXFR_BIT 3
#define REQUEST_IXFR_BIT 4
static isc_result_t
static isc_result_t
dns_peerlist_t *l;
l = isc_mem_get(mem, sizeof *l);
if (l == NULL) {
return (ISC_R_NOMEMORY);
}
ISC_LIST_INIT(l->elements);
l->refs = 1;
l->magic = DNS_PEERLIST_MAGIC;
*list = l;
return (ISC_R_SUCCESS);
}
void
}
void
}
}
static isc_result_t
dns_peerlist_t *l;
isc_result_t r;
l = *list;
r = dns_peer_detach(&server);
if (r != ISC_R_SUCCESS) {
return (r);
}
}
l->magic = 0;
isc_mem_put(l->mem, l, sizeof *l);
return (ISC_R_SUCCESS);
}
void
dns_peer_t *p = NULL;
dns_peer_attach(peer, &p);
}
{
break;
}
}
res = ISC_R_SUCCESS;
} else {
}
return (res);
}
dns_peer_t *p = NULL;
dns_peer_attach(p, retval);
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;
}
isc_mem_put(mem, p, sizeof *p);
return (ISC_R_SUCCESS);
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
}
return (ISC_R_SUCCESS);
} else
return (ISC_R_NOTFOUND);
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
}
return (ISC_R_SUCCESS);
} else {
return (ISC_R_NOTFOUND);
}
}
}
}
}
}