Nmap Development mailing list archives

Re: general scanning engine - request for comments :)


From: majek04 <nmap () forest one pl>
Date: Sun, 16 Jul 2006 13:42:36 +0200

Diman Todorov wrote:
Hello,
maybe I am missing something, but how do asynchronous sockets
make your code so much more complicated?
I may be making a fool out of myself but still:
as I see it, you only have one socket per connection, regardless
of the length of the chain. As long as I/O in that 'tunnel' socket
is ordered, you shouldn't have any issues.
About your state diagram, Nsock provides a callback mechanism
which assists you in creating multiple sockets and synchronizing them.
If I am not missing anything, your state diagram is mostly covered
in Nsock. All you have to do is use the scheduling mechanism. 

I previously assumed that creating chain could be done in
the easiest possible way - using synchronous sockets.
I thought about something like that:
        socket  = new socket(chains[0].hostaddress, chains[0].hostport);
        for(i =0; i< chains.size()-1; i++){
                chains[i].connect( chains[i+1].hostaddress, chains[i+1].hostport);
                if chains[i].waitforanswer() != OK_CONNECTED
                        fatal(creating chain failed)
        }       

And that using asynchronous connections will be only in handling the
last step - scanning ports.

But now it's obvious that everything (including creating chains) must
be done asynchronous.

Yes, state-chart I provided is to be used with nsock events.

MM.


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


Current thread: