From eb9838680969c5793072575d41fcc8835129f559 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 22 Jan 2013 23:40:16 +0000 Subject: [PATCH] Remove vestiges of nsp_settrace. Now you call nsock_set_log_function then nsock_set_loglevel. http://seclists.org/nmap-dev/2013/q1/72 --- nmap.h | 3 --- nsock/examples/nsock_telnet.c | 11 ++--------- nsock/examples/nsock_test_timers.c | 2 -- nsock/include/nsock.h | 9 --------- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/nmap.h b/nmap.h index f74e716d6..d8ae18805 100644 --- a/nmap.h +++ b/nmap.h @@ -274,9 +274,6 @@ void *realloc(); #define MAXFALLBACKS 20 /* How many comma separated fallbacks are allowed in the service-probes file? */ -/* The trace level to give to nsp_settrace with --packet-trace et al. */ -#define NSOCK_TRACE_LEVEL 2 - /* Default maximum send delay between probes to the same host */ #ifndef MAX_TCP_SCAN_DELAY #define MAX_TCP_SCAN_DELAY 1000 diff --git a/nsock/examples/nsock_telnet.c b/nsock/examples/nsock_telnet.c index 7d2fd1f30..ffd29e2f1 100644 --- a/nsock/examples/nsock_telnet.c +++ b/nsock/examples/nsock_telnet.c @@ -186,7 +186,7 @@ void telnet_event_handler(nsock_pool nsp, nsock_event nse, void *mydata) { } void usage() { - fprintf(stderr, "\nUsage: nsock_telnet [-s] [-t tracelevel] [portnum]\n" " Where -s enables SSL for the connection\n\n"); + fprintf(stderr, "\nUsage: nsock_telnet [-s] [portnum]\n" " Where -s enables SSL for the connection\n\n"); exit(1); } @@ -199,21 +199,16 @@ int main(int argc, char *argv[]) { struct telnet_state ts; int c; int usessl = 0; - int tracelevel = 0; struct timeval now; struct sockaddr_in taddr; ts.stdin_nsi = NULL; - while ((c = getopt(argc, argv, "st:")) != -1) { + while ((c = getopt(argc, argv, "s")) != -1) { switch (c) { case 's': usessl = 1; break; - case 't': - tracelevel = atoi(optarg); - assert(tracelevel >= 0); - break; default: usage(); break; @@ -243,8 +238,6 @@ int main(int argc, char *argv[]) { gettimeofday(&now, NULL); - nsp_settrace(nsp, NULL, tracelevel, &now); - if ((ts.tcp_nsi = nsi_new(nsp, NULL)) == NULL) { fprintf(stderr, "Failed to create new nsock_iod. QUITTING.\n"); exit(1); diff --git a/nsock/examples/nsock_test_timers.c b/nsock/examples/nsock_test_timers.c index e3c059a3d..1cf96743b 100644 --- a/nsock/examples/nsock_test_timers.c +++ b/nsock/examples/nsock_test_timers.c @@ -140,8 +140,6 @@ int main(int argc, char *argv[]) { exit(1); } - nsp_settrace(nsp, NULL, 10, NULL); - ev_ids[num_ids++] = request_timer(nsp, timer_handler, 1800, NULL); ev_ids[num_ids++] = request_timer(nsp, timer_handler, 800, NULL); ev_ids[num_ids++] = request_timer(nsp, timer_handler, 1300, NULL); diff --git a/nsock/include/nsock.h b/nsock/include/nsock.h index 3d01cc13f..bd6b6e57f 100644 --- a/nsock/include/nsock.h +++ b/nsock/include/nsock.h @@ -211,15 +211,6 @@ void nsp_setud(nsock_pool nsp, void *data); * retrieve that data ... */ void *nsp_getud(nsock_pool nsp); -/* Sets a trace/debug level and stream. A level of 0 (the default) turns - * tracing off, while higher numbers are more verbose. If the stream given is - * NULL, it defaults to stdout. This is generally only used for debugging - * purposes. A level of 1 or 2 is usually sufficient, but 10 will ensure you get - * everything. The basetime can be NULL to print trace lines with the current - * time, otherwise the difference between the current time and basetime will be - * used (the time program execution starts would be a good candidate) */ -void nsp_settrace(nsock_pool nsp, FILE *file, int level, const struct timeval *basetime); - /* Turns on or off broadcast support on new sockets. Default is off (0, false) * set in nsp_new(). Any non-zero (true) value sets SO_BROADCAST on all new * sockets (value of optval will be used directly in the setsockopt() call). */