Nmap Development mailing list archives

Re: [nmap-svn] r15082 - nmap-exp/luis/nping


From: Fyodor <fyodor () insecure org>
Date: Fri, 21 Aug 2009 16:08:44 -0700

On Fri, Aug 21, 2009 at 11:08:14AM +0100, Luis M. wrote:
Fyodor wrote:

Current hdump() and lamont_dump() use log_write() calls to print
information but log_write() is not on nbase. Would it be OK to use my
hexdump() even though it uses only regular printf() calls? Moving
log_write() to nbase is not an option because it uses log_vwrite() which
depends on the "NmapOps o" global.

Good points.  If you have a little bit of time, I think the best
solution would be:

1) Make your hexdump function return an allocated buffer with the
   ASCII dump, put it in Nbase

2) Make convenience functions (about 3 lines long) for Nmap and Nping
   which call hexdump(), print the results in their preferred way
   (log_write for Nmap, printf() for Nping), and then free the buffer.

3) Change Nmap and Nping to use these convenience functions rather
   than the old ones.  Remove the old versions (such as hdump and
   lamont_hdump).

Besides sharing some code, this would present the nice advantage of
having packet dumps look the same in both cases.

Cheers,
-F

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: