日期:2014-05-16 浏览次数:20705 次
void dighost_shutdown(void) { isc_event_t *event = global_event; flush_lookup_list(); debug("dighost_shutdown()"); if (!in_use) { isc_app_shutdown(); return; } isc_task_send(global_task, &event); } static void printsoa(dns_rdata_t *rdata) { dns_rdata_soa_t soa; isc_result_t result; char namebuf[DNS_NAME_FORMATSIZE]; result = dns_rdata_tostruct(rdata, &soa, NULL); check_result(result, "dns_rdata_tostruct"); dns_name_format(&soa.origin, namebuf, sizeof(namebuf)); printf("\torigin = %s\n", namebuf); dns_name_format(&soa.contact, namebuf, sizeof(namebuf)); printf("\tmail addr = %s\n", namebuf); printf("\tserial = %u\n", soa.serial); printf("\trefresh = %u\n", soa.refresh); printf("\tretry = %u\n", soa.retry); printf("\texpire = %u\n", soa.expire); printf("\tminimum = %u\n", soa.minimum); dns_rdata_freestruct(&soa); } static void printa(dns_rdata_t *rdata) { isc_result_t result; char text[sizeof("255.255.255.255")]; isc_buffer_t b; isc_buffer_init(&b, text, sizeof(text)); result = dns_rdata_totext(rdata, NULL, &b); check_result(result, "dns_rdata_totext"); printf("Address: %.*s\n", (int)isc_buffer_usedlength(&b), (char *)isc_buffer_base(&b)); } #ifdef DIG_SIGCHASE /* Just for compatibility : not use in host program */ isc_result_t printrdataset(dns_name_t *owner_name, dns_rdataset_t *rdataset, isc_buffer_t *target) { UNUSED(owner_name); UNUSED(rdataset); UNUSED(target); return(ISC_FALSE); } #endif static void printrdata(dns_rdata_t *rdata) { isc_result_t result; isc_buffer_t *b = NULL; unsigned int size = 1024; isc_boolean_t done = ISC_FALSE; if (rdata->type < N_KNOWN_RRTYPES) printf("%s", rtypetext[rdata->type]); else printf("rdata_%d = ", rdata->type); while (!done) { result = isc_buffer_allocate(mctx, &b, size); if (result != ISC_R_SUCCESS) check_result(result, "isc_buffer_allocate"); result = dns_rdata_totext(rdata, NULL, b); if (result == ISC_R_SUCCESS) { printf("%.*s\n", (int)isc_buffer_usedlength(b), (char *)isc_buffer_base(b)); done = ISC_TRUE; } else if (result != ISC_R_NOSPACE) check_result(result, "dns_rdata_totext"); isc_buffer_free(&b); size *=