Nmap Development mailing list archives

Re: Any Win32 porting clues?


From: kx <kxmail () gmail com>
Date: Wed, 28 May 2008 23:14:23 +0200

I am a sick, I love windows porting issues.

Nmap compile, has always thrown errors due to the type we pass being a
size_t (unsigned int), while the Windows connect expects an int:
http://msdn.microsoft.com/en-us/library/ms737625(VS.85).aspx

This is due to calling sizeof to get the socklen, and sizeof returns size_t:
http://www.google.com/codesearch?hl=en&q=+package:http://mirror.sg.depaul.edu/pub/security/nmap/nmap-4.20ALPHA7.tar.bz2+connect+show:IHdYyO1Kv0g:tQLRT-Xsd9g:sNZvRmj5rjs&sa=N&cd=10&ct=rc&cs_p=http://mirror.sg.depaul.edu/pub/security/nmap/nmap-4.20ALPHA7.tar.bz2&cs_f=nmap-4.20ALPHA7/nmap.cc#l2147

Thus, if you want to tweak it for windows, just
http://www.google.com/codesearch?q=%22typedef+int+socklen_t%22 as have
many others.

BTW, I really wish I could browse the SVN, so I tried to submit it to
Google Code Search. Not sure how it will work, especially with the
Nmap SVN requiring the username guest and blank password. I also
singly added http://nmap.org/dist/nmap-4.60.tar.bz2, but maybe Fyodor
could create a Code Search Site Map for the dist directory?
http://www.google.com/support/webmasters/bin/answer.py?answer=75225

Maybe one of the SoCer's could talk to someone at Google to see if
they could get Nmap specially added. ;)

I did find source up to 4.20
http://www.google.com/codesearch?hl=en&q=show:0_HSknGU4wk:N4XpI_EX270&sa=N&ct=rdp&cs_p=http://mirror.sg.depaul.edu&cs_f=pub/security/nmap

Unfortunately, the page is no longer indexed/up.

Cheers,
  kx

On Wed, May 28, 2008 at 1:17 AM,  <doug () hcsw org> wrote:
On Tue, May 27, 2008 at 11:09:34PM +0200 or thereabouts,  mixter () gmail com wrote:
Currently, I'm stuck with missing definitions....

ncat\sys_wrap.h(41) : error C2061: syntax error : identifier 'socklen_t'

I think this might help:

http://curl.haxx.se/mail/lib-2007-03/0131.html

Incidentally, socklen_t was kinda a POSIX mistake. From accept(2):

Quoting Linus Torvalds: _Any_ sane library _must_ have "socklen_t" be the same size as int. Anything else breaks any 
BSD socket layer stuff. POSIX initially _did_ make it a size_t, and I (and hopefully others, but obviously not too 
many) complained to them very loudly indeed. Making it a size_t is completely broken, exactly because size_t very 
seldom is the same size as "int" on 64-bit architectures, for example. And it _has_ to be the same size as "int" 
because that's what the BSD socket interface is. Anyway, the POSIX people eventually got a clue, and created 
"socklen_t". They shouldn't have touched it in the first place, but once they did they felt it had to have a named 
type for some unfathomable reason (probably somebody didn't like losing face over having done the original stupid 
thing, so they silently just renamed their blunder).

(Native
Windows one of the few things in development I've managed to avoid in
many years;)

Ah yes, in a perfect world. :)

Best,

Doug

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFIPJZ/3LTjmOMguVMRApBTAJ4mCAD73eahN6hcMkIzjGqH/uxw4ACfcRLT
SEUSNbnN3oGT64bd9N5CVTk=
=bFTR
-----END PGP SIGNATURE-----


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


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


Current thread: