Nmap Development mailing list archives
Patch: nbase.h and nsock.h
From: Gisle Vanem <gvanem () broadpark no>
Date: Thu, 16 Dec 2010 21:43:40 +0100
I'm using MingW to build nmap, nping and ncat. The noise-level is much redusedby including <ws2tcpip.h> in some headers. Besides TargetGroup.cc calls freeaddrinfo() which thus requires <ws2tcpip.h>. Hence I've added these <winsock2.h> and
<ws2tcpip.h> to "nsock.h". Also I've added <ws2tcpip.h> to "nbase.h" because these warnings: warning: 'struct sockaddr_storage' declared inside parameter list warning: 'struct sockaddr' declared inside parameter list warning: 'struct timeval' declared inside parameter list Patch below: --- SVN-Latest/nbase/nbase.h Sat Nov 20 16:55:47 2010 +++ ./nbase/nbase.h Sat Dec 04 15:09:57 2010 @@ -128,6 +128,7 @@ #include "nbase_config.h" #else #ifdef WIN32 +#include <winsock2.h> +#include <ws2tcpip.h> #include "nbase_winconfig.h" #endif /* WIN32 */ #endif /* HAVE_CONFIG_H */ --- SVN-Latest/nsock/include/nsock.h Sat Nov 20 16:55:42 2010 +++ ./nsock/include/nsock.h Sat Dec 04 15:08:07 2010 @@ -71,6 +71,7 @@ #include "nsock_config.h" #else #include "nsock_winconfig.h" +#include <winsock2.h> +#include <ws2tcpip.h> #endif #include <stdio.h> -------------------- PS. On MSVC <winsock2.h> is required ahead of <ws2tcpip.h>. On MingW that isn't needeed, but doesn't hurt. --gv _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- Patch: nbase.h and nsock.h Gisle Vanem (Dec 16)