mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
clean up public vs. private items
This commit is contained in:
@@ -240,23 +240,38 @@ static dns_adbhandle_t *
|
|||||||
new_adbhandle(dns_adb_t *adb)
|
new_adbhandle(dns_adb_t *adb)
|
||||||
{
|
{
|
||||||
dns_adbhandle_t *h;
|
dns_adbhandle_t *h;
|
||||||
|
isc_result_t result;
|
||||||
|
|
||||||
h = isc_mempool_get(adb->ahmp);
|
h = isc_mempool_get(adb->ahmp);
|
||||||
if (h == NULL)
|
if (h == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
h->magic = DNS_ADBHANDLE_MAGIC;
|
/*
|
||||||
|
* public members
|
||||||
|
*/
|
||||||
|
h->magic = 0;
|
||||||
h->adb = adb;
|
h->adb = adb;
|
||||||
|
ISC_LIST_INIT(h->list);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* private members
|
||||||
|
*/
|
||||||
|
result = isc_mutex_init(&h->lock);
|
||||||
|
if (result != ISC_R_SUCCESS) {
|
||||||
|
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||||
|
"isc_mutex_init failed in new_adbhandle()");
|
||||||
|
isc_mempool_put(adb->ahmp, h);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
h->task = NULL;
|
h->task = NULL;
|
||||||
h->taskaction = NULL;
|
h->taskaction = NULL;
|
||||||
h->arg = NULL;
|
h->arg = NULL;
|
||||||
dns_name_init(&h->zone, NULL);
|
|
||||||
ISC_LIST_INIT(h->list);
|
|
||||||
ISC_LINK_INIT(h, link);
|
ISC_LINK_INIT(h, link);
|
||||||
|
|
||||||
ISC_EVENT_INIT(&h->event, sizeof (isc_event_t), 0, 0, 0, NULL, NULL,
|
ISC_EVENT_INIT(&h->event, sizeof (isc_event_t), 0, 0, 0, NULL, NULL,
|
||||||
NULL, NULL, h);
|
NULL, NULL, h);
|
||||||
|
|
||||||
|
h->magic = DNS_ADBHANDLE_MAGIC;
|
||||||
return (h);
|
return (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -115,12 +115,16 @@ typedef struct dns_adbhandle dns_adbhandle_t;
|
|||||||
* The handle into our internal state of what is going on, where, when...
|
* The handle into our internal state of what is going on, where, when...
|
||||||
* This is returned to the user as a handle, so requests can be canceled,
|
* This is returned to the user as a handle, so requests can be canceled,
|
||||||
* etc.
|
* etc.
|
||||||
|
*
|
||||||
|
* On return, the client can safely use "list", and can reorder the list.
|
||||||
|
* Items may not be _deleted_ from this list, however, or added to it
|
||||||
|
* other than by using the dns_adb_*() API.
|
||||||
*/
|
*/
|
||||||
struct dns_adbhandle {
|
struct dns_adbhandle {
|
||||||
/* Public */
|
/* Public */
|
||||||
unsigned int magic; /* RO: magic */
|
unsigned int magic; /* RO: magic */
|
||||||
ISC_LIST(dns_adbaddrinfo_t) list; /* RO: list of addrs */
|
|
||||||
dns_adb_t *adb; /* RO: parent adb */
|
dns_adb_t *adb; /* RO: parent adb */
|
||||||
|
ISC_LIST(dns_adbaddrinfo_t) list; /* RO: list of addrs */
|
||||||
|
|
||||||
/* Private */
|
/* Private */
|
||||||
isc_mutex_t lock; /* locks all below */
|
isc_mutex_t lock; /* locks all below */
|
||||||
|
Reference in New Issue
Block a user