|
|
@@ -291,7 +291,7 @@ make_querymessage(dns_message_t *message, dns_name_t *qname0,
|
|
|
|
static inline void
|
|
|
|
static inline void
|
|
|
|
increment_entry(unsigned long *entryp) {
|
|
|
|
increment_entry(unsigned long *entryp) {
|
|
|
|
(*entryp)++;
|
|
|
|
(*entryp)++;
|
|
|
|
INSIST(*entryp != 0); /* check overflow */
|
|
|
|
INSIST(*entryp != 0U); /* check overflow */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
static void
|
|
|
@@ -390,57 +390,57 @@ update_stat(struct probe_trans *trans) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Update per domain statistics */
|
|
|
|
/* Update per domain statistics */
|
|
|
|
if (local_stat.ignore > 0) {
|
|
|
|
if (local_stat.ignore > 0U) {
|
|
|
|
if (verbose_level > 0)
|
|
|
|
if (verbose_level > 0)
|
|
|
|
printf("%s:ignore\n", trans->domain);
|
|
|
|
printf("%s:ignore\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.ignore);
|
|
|
|
increment_entry(&domain_stat.ignore);
|
|
|
|
err_count++;
|
|
|
|
err_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (local_stat.nxdomain > 0) {
|
|
|
|
if (local_stat.nxdomain > 0U) {
|
|
|
|
if (verbose_level > 0)
|
|
|
|
if (verbose_level > 0)
|
|
|
|
printf("%s:nxdomain\n", trans->domain);
|
|
|
|
printf("%s:nxdomain\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.nxdomain);
|
|
|
|
increment_entry(&domain_stat.nxdomain);
|
|
|
|
err_count++;
|
|
|
|
err_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (local_stat.othererr > 0) {
|
|
|
|
if (local_stat.othererr > 0U) {
|
|
|
|
if (verbose_level > 0)
|
|
|
|
if (verbose_level > 0)
|
|
|
|
printf("%s:othererr\n", trans->domain);
|
|
|
|
printf("%s:othererr\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.othererr);
|
|
|
|
increment_entry(&domain_stat.othererr);
|
|
|
|
err_count++;
|
|
|
|
err_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (local_stat.multiplesoa > 0) {
|
|
|
|
if (local_stat.multiplesoa > 0U) {
|
|
|
|
if (verbose_level > 0)
|
|
|
|
if (verbose_level > 0)
|
|
|
|
printf("%s:multiplesoa\n", trans->domain);
|
|
|
|
printf("%s:multiplesoa\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.multiplesoa);
|
|
|
|
increment_entry(&domain_stat.multiplesoa);
|
|
|
|
err_count++;
|
|
|
|
err_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (local_stat.multiplecname > 0) {
|
|
|
|
if (local_stat.multiplecname > 0U) {
|
|
|
|
if (verbose_level > 0)
|
|
|
|
if (verbose_level > 0)
|
|
|
|
printf("%s:multiplecname\n", trans->domain);
|
|
|
|
printf("%s:multiplecname\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.multiplecname);
|
|
|
|
increment_entry(&domain_stat.multiplecname);
|
|
|
|
err_count++;
|
|
|
|
err_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (local_stat.brokenanswer > 0) {
|
|
|
|
if (local_stat.brokenanswer > 0U) {
|
|
|
|
if (verbose_level > 0)
|
|
|
|
if (verbose_level > 0)
|
|
|
|
printf("%s:brokenanswer\n", trans->domain);
|
|
|
|
printf("%s:brokenanswer\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.brokenanswer);
|
|
|
|
increment_entry(&domain_stat.brokenanswer);
|
|
|
|
err_count++;
|
|
|
|
err_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (local_stat.lame > 0) {
|
|
|
|
if (local_stat.lame > 0U) {
|
|
|
|
if (verbose_level > 0)
|
|
|
|
if (verbose_level > 0)
|
|
|
|
printf("%s:lame\n", trans->domain);
|
|
|
|
printf("%s:lame\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.lame);
|
|
|
|
increment_entry(&domain_stat.lame);
|
|
|
|
err_count++;
|
|
|
|
err_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (err_count > 1)
|
|
|
|
if (err_count > 1U)
|
|
|
|
increment_entry(&multiple_error_domains);
|
|
|
|
increment_entry(&multiple_error_domains);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* We regard the domain as valid if and only if no authoritative server
|
|
|
|
* We regard the domain as valid if and only if no authoritative server
|
|
|
|
* has a problem and at least one server is known to be valid.
|
|
|
|
* has a problem and at least one server is known to be valid.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (local_stat.valid > 0 && err_count == 0) {
|
|
|
|
if (local_stat.valid > 0U && err_count == 0U) {
|
|
|
|
if (verbose_level > 1)
|
|
|
|
if (verbose_level > 1)
|
|
|
|
printf("%s:valid\n", trans->domain);
|
|
|
|
printf("%s:valid\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.valid);
|
|
|
|
increment_entry(&domain_stat.valid);
|
|
|
@@ -450,7 +450,7 @@ update_stat(struct probe_trans *trans) {
|
|
|
|
* If the domain has no available server or all servers have the
|
|
|
|
* If the domain has no available server or all servers have the
|
|
|
|
* 'unknown' result, the domain's result is also regarded as unknown.
|
|
|
|
* 'unknown' result, the domain's result is also regarded as unknown.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (local_stat.valid == 0 && err_count == 0) {
|
|
|
|
if (local_stat.valid == 0U && err_count == 0U) {
|
|
|
|
if (verbose_level > 1)
|
|
|
|
if (verbose_level > 1)
|
|
|
|
printf("%s:unknown\n", trans->domain);
|
|
|
|
printf("%s:unknown\n", trans->domain);
|
|
|
|
increment_entry(&domain_stat.unknown);
|
|
|
|
increment_entry(&domain_stat.unknown);
|
|
|
@@ -1216,5 +1216,5 @@ main(int argc, char *argv[]) {
|
|
|
|
isc_app_ctxfinish(actx);
|
|
|
|
isc_app_ctxfinish(actx);
|
|
|
|
ctxs_destroy(&mctx, &actx, &taskmgr, &socketmgr, &timermgr);
|
|
|
|
ctxs_destroy(&mctx, &actx, &taskmgr, &socketmgr, &timermgr);
|
|
|
|
|
|
|
|
|
|
|
|
exit(0);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|