Nmap Development mailing list archives

Implementing nsock server mode


From: Henri Doreau <henri.doreau () gmail com>
Date: Tue, 11 Sep 2012 21:56:06 +0200

Hi,

adding server mode support to nsock is something that have been
discussed a couple times on this list. The patch attached is an
implementation proposal.

Briefly, I introduced two new functions to nsock.

The first one (nsock_listen()) is a regular nsock event registration
function that binds a socket to the desired address, enables listening
mode and associate it to the given IOD.

The second function (nsock_accept_client()) is aimed to be called from
within event handlers corresponding to nsock_listen events. It
basically does what accept(2) does.

In case we decide to land this patch, a couple additional safety
checks and extra comments would be needed, but I think the current
version can already be interesting to discuss.

Regards.

-- 
Henri

Attachment: nsock_server_mode.diff
Description:

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

Current thread: