Nmap Development mailing list archives

Re: nmap-poll branch results


From: majek04 <majek04+nmap-dev () gmail com>
Date: Mon, 31 Aug 2009 16:58:15 +0200

On Fri, Aug 28, 2009 at 22:05, David Fifield<david () bamsoftware com> wrote:
On Wed, Aug 26, 2009 at 04:01:10PM +0200, Florian Vichot wrote:
I realise I may be a little late to the conversation, but why not use
something like libevent (http://www.monkey.org/~provos/libevent/)?

The biggest difference between nsock and libevent is that
nsock manages memory for the programmer, while in libevent
the memory managment is left to the programmer.

This results in significant difference in usage of both libraries.
In nsock you just pass callbacks, one after another.
In libevent, in most cases you have only one callback
for a descriptor, and than people dispatch events in this
callback.
This difference is not a huge problem, you can probably write
another abstraction layer and emulate both behaviours,
but it shows that the libraries aren't exactly servng the same
purpose.

Also, using libevent is a bit risky. Most of the core funtions
are stable and reliable, but there are a lot of side libraries
that aren't well tested, and aren't really supported by
the community. So you have choose carefully what parts
of libevent to use and what don't.
http://www.mail-archive.com/libevent-users () monkey org/msg01658.html
http://www.mail-archive.com/libevent-users () monkey org/msg01672.html

Libevent has issues with descriptors that aren't network sockets.
For example few versions ago I was able to use fifo file descriptor
in libevent, now it just doesn't work. Nsock also had simillar
issues, just remember the discussion about using stdin in ncat :)

Another issue is the support of pcap in nsock (disclaimer: I'm the author).
Though it's not widely used in nmap, it's really a powerfull
feature.

For example, right now in nmap you first have to do ping scan,
than syn scan, and then nse. This is due to the fact, that
historically we weren't able to mix pcap operations with
nsock-like socket operations. Right now it's possible,
so theoretically we could have in the same time some hosts
scanned using syn, in the same time have nse running against
other targets, and do ping scan to search for new hosts.

Libevent doesn't know how to play with pcap,
and adding support for that is not trivial.

Nsock is really a nice library, and serves well it's purpose.
Though, I'd also like to see support for epoll in it :)

Cheers :)
  Marek Majkowski

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


Current thread: