1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-12 10:49:02 +00:00

Merged nsock-logging from nmap-exp/henri/nsock-logging/

Reworked the logging infrastructure to make it more flexible
and consistent.

Updated nmap, nping and ncat accordingly.  Nsock log level can
now be adjusted at runtime by pressing d/D in nmap.
This commit is contained in:
henri
2012-12-15 10:59:30 +00:00
parent 26816736b5
commit 809f1eda68
31 changed files with 563 additions and 330 deletions

View File

@@ -67,6 +67,7 @@
#include <errno.h>
#include "nsock_internal.h"
#include "nsock_log.h"
#if HAVE_PCAP
#include "nsock_pcap.h"
@@ -236,8 +237,7 @@ int kqueue_loop(mspool *nsp, int msec_timeout) {
}
do {
if (nsp->tracelevel > 6)
nsock_trace(nsp, "wait_for_events");
nsock_log_debug_all(nsp, "wait_for_events");
if (nsp->next_ev.tv_sec == 0)
event_msecs = -1; /* None of the events specified a timeout */
@@ -287,7 +287,7 @@ int kqueue_loop(mspool *nsp, int msec_timeout) {
} while (results_left == -1 && sock_err == EINTR); /* repeat only if signal occurred */
if (results_left == -1 && sock_err != EINTR) {
nsock_trace(nsp, "nsock_loop error %d: %s", sock_err, socket_strerror(sock_err));
nsock_log_error(nsp, "nsock_loop error %d: %s", sock_err, socket_strerror(sock_err));
nsp->errnum = sock_err;
return -1;
}