Nmap Development mailing list archives

Re: Missing nsp_settrace()


From: Henri Doreau <henri.doreau () gmail com>
Date: Wed, 23 Jan 2013 06:43:29 +0100

2013/1/23 David Fifield <david () bamsoftware com>:
On Tue, Jan 22, 2013 at 05:14:18PM -0600, Daniel Miller wrote:
On 01/22/2013 04:59 PM, Gisle Vanem wrote:
This function is in nsock.h and used in 'examples/nsock_telnet.c',
'examples/nsock_test_timers.c' (and 'ncrack.cc'). Also a comment
in nmap.h refers to it. But the implementation of it is gone.

My old ncrack repo had it though. What's the story here? Too bad
if tracing is deprecated.

This was probably related to Henri's enhanced Nsock logging project
(http://seclists.org/nmap-dev/2012/q4/401) that got merged in
r30403.

Looking at this now, I think that there should be a default logger
function that writes to stdout, so that you don't have to make a logger
function in test programs. Just setting the loglevel should be enough.
To go with this, nsock_loglevel_t should have a NSOCK_LOG_NONE with the
value 0, so that by default nothing is logged even though there is a log
function set.

What do you think, Henri?

David Fifield
Hi,

thanks fixing the nsock examples, I totally forgot them when switching
to the new logging system. Sorry for the nsock header, that was ugly
to forget this declaration there! :)

I didn't add such a NSOCK_LOG_NONE  because errors messages could not
be discarded initially and I wanted to preserve the behavior. I can
add a quiet mode but I wouldn't use it by default. Otherwise nsock
could fail a delivering events without any explanation.

There's a default logger (function nsock_stderr_logger() in
nsock_log.c), but it writes on stderr. Is this a problem? IIRC this is
what old nsock trace did too.

Regards

-- 
Henri
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: