Index: Makefile.in =================================================================== --- Makefile.in.orig 2006-12-07 20:53:47.000000000 -0600 +++ Makefile.in 2006-12-18 22:40:44.000000000 -0600 @@ -36,6 +36,7 @@ SHTOOL = ./shtool INSTALL = $(SHTOOL) install MAKEDEPEND = @MAKEDEPEND@ + () HAVE_GXX@MAKEFILE_DEP = makefile.dep export RPMTDIR=$(HOME)/rpm @@ -63,7 +64,7 @@ $(TARGET): $(DEPS) @PCAP_DEPENDS@ @PCRE_DEPENDS@ @DNET_DEPENDS@ $(NBASEDIR)/libnbase.a $(NSOCKDIR)/src/libnsock.a $(OBJS) @echo Compiling nmap rm -f $@ - $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) # This empty rule is used to force execution of certain rules where I can't conveniently specify # all of the prerequisites (e.g. recursive makes and such) @@ -147,8 +148,8 @@ distclean: my_clean my_distclean @PCAP_DIST_CLEAN@ @PCRE_DIST_CLEAN@ @DNET_DIST_CLEAN@ nmapfe_dist_clean nbase_dist_clean nsock_dist_clean my_distclean: - rm -f Makefile Makefile.bak makefile.dep config.h stamp-h stamp-h.in \ - config.cache config.log config.status + rm -f Makefile Makefile.bak config.h stamp-h stamp-h.in \ + config.cache config.log config.status $(MAKEFILE_DEP) install-nmap: $(TARGET) $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(nmapdatadir) @@ -177,3 +178,4 @@ -makefile.dep: - $(CXX) -MM $(CXXFLAGS) $(CPPFLAGS) $(SRCS) > $@ -include makefile.dep + () HAVE_GXX@makefile.dep: + () HAVE_GXX@ $(CXX) -MM $(CXXFLAGS) $(CPPFLAGS) $(SRCS) > $@ + + () HAVE_GXX@include makefile.dep Index: config.h.in =================================================================== --- config.h.in.orig 2006-08-24 20:47:58.000000000 -0500 +++ config.h.in 2006-12-18 22:11:55.000000000 -0600 @@ -112,7 +112,9 @@ #undef HAVE_IP_IP_SUM +#ifndef __cplusplus #undef inline +#endif #undef STDC_HEADERS @@ -199,4 +201,7 @@ #undef NETBSD #undef MACOSX +#undef HAVE_VA_COPY +#undef HAVE___VA_COPY + #endif /* CONFIG_H */ Index: libdnet-stripped/config/acinclude.m4 =================================================================== --- libdnet-stripped/config/acinclude.m4.orig 2005-02-25 17:09:06.000000000 -0600 +++ libdnet-stripped/config/acinclude.m4 2006-12-16 09:57:14.000000000 -0600 @@ -4,7 +4,7 @@ dnl usage: AC_DNET_SOCKADDR_SA_LEN dnl results: HAVE_SOCKADDR_SA_LEN (defined) dnl -AC_DEFUN(AC_DNET_SOCKADDR_SA_LEN, +AC_DEFUN([AC_DNET_SOCKADDR_SA_LEN], [AC_MSG_CHECKING(for sa_len in sockaddr struct) AC_CACHE_VAL(ac_cv_dnet_sockaddr_has_sa_len, AC_TRY_COMPILE([ @@ -28,7 +28,7 @@ dnl usage: AC_DNET_SOCKADDR_IN6 dnl results: HAVE_SOCKADDR_IN6 dnl -AC_DEFUN(AC_DNET_SOCKADDR_IN6, +AC_DEFUN([AC_DNET_SOCKADDR_IN6], [AC_MSG_CHECKING(for sockaddr_in6 struct in ) AC_CACHE_VAL(ac_cv_dnet_netinet_in_h_has_sockaddr_in6, AC_TRY_COMPILE([ @@ -50,7 +50,7 @@ dnl usage: AC_DNET_ARPREQ_ARP_DEV dnl results: HAVE_ARPREQ_ARP_DEV (defined) dnl -AC_DEFUN(AC_DNET_ARPREQ_ARP_DEV, +AC_DEFUN([AC_DNET_ARPREQ_ARP_DEV], [AC_MSG_CHECKING(for arp_dev in arpreq struct) AC_CACHE_VAL(ac_cv_dnet_arpreq_has_arp_dev, AC_TRY_COMPILE([ @@ -72,7 +72,7 @@ dnl usage: AC_DNET_ROUTE_RT_MSGHDR dnl results: HAVE_ROUTE_RT_MSGHDR dnl -AC_DEFUN(AC_DNET_ROUTE_RT_MSGHDR, +AC_DEFUN([AC_DNET_ROUTE_RT_MSGHDR], [AC_MSG_CHECKING(for rt_msghdr struct in ) AC_CACHE_VAL(ac_cv_dnet_route_h_has_rt_msghdr, AC_TRY_COMPILE([ @@ -95,7 +95,7 @@ dnl usage: AC_DNET_BSD_BPF dnl results: HAVE_BSD_BPF dnl -AC_DEFUN(AC_DNET_BSD_BPF, +AC_DEFUN([AC_DNET_BSD_BPF], [AC_MSG_CHECKING(for Berkeley Packet Filter) AC_CACHE_VAL(ac_cv_dnet_bsd_bpf, if test -c /dev/bpf0 ; then @@ -115,7 +115,7 @@ dnl usage: AC_DNET_LINUX_PROCFS dnl results: HAVE_LINUX_PROCFS dnl -AC_DEFUN(AC_DNET_LINUX_PROCFS, +AC_DEFUN([AC_DNET_LINUX_PROCFS], [AC_MSG_CHECKING(for Linux proc filesystem) AC_CACHE_VAL(ac_cv_dnet_linux_procfs, if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then @@ -135,7 +135,7 @@ dnl usage: AC_DNET_LINUX_PF_PACKET dnl results: HAVE_LINUX_PF_PACKET dnl -AC_DEFUN(AC_DNET_LINUX_PF_PACKET, +AC_DEFUN([AC_DNET_LINUX_PF_PACKET], [AC_MSG_CHECKING(for Linux PF_PACKET sockets) AC_CACHE_VAL(ac_cv_dnet_linux_pf_packet, if test -f /usr/include/netpacket/packet.h ; then @@ -155,7 +155,7 @@ dnl usage: AC_DNET_STREAMS_MIB2 dnl results: HAVE_STREAMS_MIB2 dnl -AC_DEFUN(AC_DNET_STREAMS_MIB2, +AC_DEFUN([AC_DNET_STREAMS_MIB2], [AC_MSG_CHECKING(for SNMP MIB2 STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_mib2, if test -f /usr/include/inet/mib2.h -a -c /dev/ip ; then @@ -175,7 +175,7 @@ dnl usage: AC_DNET_STREAMS_ROUTE dnl results: HAVE_STREAMS_ROUTE dnl -AC_DEFUN(AC_DNET_STREAMS_ROUTE, +AC_DEFUN([AC_DNET_STREAMS_ROUTE], [AC_MSG_CHECKING(for route(7) STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_route, if grep RTSTR_SEND /usr/include/net/route.h >/dev/null 2>&1 ; then @@ -195,7 +195,7 @@ dnl usage: AC_DNET_IOCTL_ARP dnl results: HAVE_IOCTL_ARP dnl -AC_DEFUN(AC_DNET_IOCTL_ARP, +AC_DEFUN([AC_DNET_IOCTL_ARP], [AC_MSG_CHECKING(for arp(7) ioctls) AC_CACHE_VAL(ac_cv_dnet_ioctl_arp, AC_EGREP_CPP(werd, [ @@ -223,7 +223,7 @@ dnl usage: AC_DNET_RAWIP_HOST_OFFLEN dnl results: HAVE_RAWIP_HOST_OFFLEN dnl -AC_DEFUN(AC_DNET_RAWIP_HOST_OFFLEN, +AC_DEFUN([AC_DNET_RAWIP_HOST_OFFLEN], [AC_MSG_CHECKING([for raw IP sockets ip_{len,off} host byte ordering]) AC_CACHE_VAL(ac_cv_dnet_rawip_host_offlen, [ case "$host_os" in @@ -246,7 +246,7 @@ dnl usage: AC_DNET_RAWIP_COOKED dnl results: HAVE_RAWIP_COOKED dnl -AC_DEFUN(AC_DNET_RAWIP_COOKED, +AC_DEFUN([AC_DNET_RAWIP_COOKED], [AC_MSG_CHECKING(for cooked raw IP sockets) AC_CACHE_VAL(ac_cv_dnet_rawip_cooked, [ case "$host_os" in @@ -296,7 +296,7 @@ dnl statically and happen to have a libresolv.a lying around (and no dnl libnsl.a). dnl -AC_DEFUN(AC_LBL_LIBRARY_NET, [ +AC_DEFUN([AC_LBL_LIBRARY_NET], [ # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): AC_CHECK_FUNC(gethostbyname, , Index: libdnet-stripped/configure.in =================================================================== --- libdnet-stripped/configure.in.orig 2006-02-01 20:20:46.000000000 -0600 +++ libdnet-stripped/configure.in 2006-12-16 09:57:14.000000000 -0600 @@ -59,6 +60,9 @@ fi ;; esac +], +[ + AC_MSG_RESULT(no) ]) AC_SUBST(PYTHON) AC_SUBST(TCLINC) @@ -223,6 +227,8 @@ dnl Check for Ethernet interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([eth-win32]) +elif test "$ac_cv_header_sys_ndd_var_h" = yes ; then + AC_LIBOBJ([eth-ndd]) elif test "$ac_cv_header_net_pfilt_h" = yes ; then AC_LIBOBJ([eth-pfilt]) elif test "$ac_cv_dnet_bsd_bpf" = yes ; then @@ -231,8 +237,6 @@ AC_LIBOBJ([eth-linux]) elif test "$ac_cv_header_net_raw_h" = yes ; then AC_LIBOBJ([eth-snoop]) -elif test "$ac_cv_header_sys_ndd_var_h" = yes ; then - AC_LIBOBJ([eth-ndd]) elif test "$ac_cv_header_sys_dlpi_h" = yes || \ test "$ac_cv_header_sys_dlpihdr_h" = yes ; then AC_LIBOBJ([eth-dlpi]) Index: nbase/configure.ac =================================================================== --- nbase/configure.ac.orig 2006-06-26 02:58:50.000000000 -0500 +++ nbase/configure.ac 2006-12-18 09:05:55.000000000 -0600 @@ -206,16 +206,50 @@ AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) -dnl Checks for library functions. -dnl AC_TYPE_SIGNAL -AC_CHECK_FUNCS( bzero snprintf vsnprintf memcpy nanosleep strerror strcasestr strcasecmp strncasecmp signal ) -needsnprintf=no -AC_CHECK_FUNCS(vsnprintf snprintf asprintf asnprintf vasprintf vasnprintf,, - [needsnprintf=yes]) -if test $needsnprintf = yes; then - AC_LIBOBJ([snprintf]) -fi + +AC_CHECK_FUNCS( bzero snprintf vsnprintf memcpy nanosleep strerror strcasestr strcasecmp strncasecmp signal ) + +AC_CHECK_FUNCS(asprintf asnprintf vasprintf vasnprintf) +AC_CHECK_FUNCS(snprintf,[ + AC_LANG_PUSH(C++) + AC_TRY_LINK([#include ],[ +char buffer[10]; +snprintf (buffer, 10, "foo");], ,[ + AC_MSG_CHECKING([if snprintf needs custom prototype]) + AC_TRY_LINK([ +#include + +extern "C" int snprintf (char *, size_t, const char *, ...);],[ +char buffer[10]; +snprintf (buffer, 10, "foo");],[ + AC_MSG_RESULT(yes) + AC_DEFINE(NEED_SNPRINTF_PROTO)],[ + AC_MSG_RESULT(not found) + AC_LIBOBJ([snprintf])])]) + AC_LANG_POP(C++)],[ + AC_LIBOBJ([snprintf])]) + +AC_CHECK_FUNCS(vsnprintf,[ + AC_LANG_PUSH(C++) + AC_TRY_LINK([#include +#include ],[ +char buffer[10]; +va_list arg; +vsnprintf (buffer, 10, "foo", arg);], ,[ + AC_MSG_CHECKING([if vsnprintf needs custom prototype]) + AC_TRY_LINK([ +#include +#include + +extern "C" int vsnprintf (char *, size_t, const char *, va_list);],[ +char buffer[10]; +va_list arg; +vsnprintf (buffer, 10, "foo", arg);],[ + AC_MSG_RESULT(yes) + AC_DEFINE(NEED_VSNPRINTF_PROTO)], + AC_MSG_RESULT(not found))]) + AC_LANG_POP(C++)]) AC_CHECK_FUNCS(usleep gettimeofday sleep, , [ AC_LIBOBJ([nbase_time]) ]) Index: nbase/nbase_config.h.in =================================================================== --- nbase/nbase_config.h.in.orig 2006-08-29 00:42:46.000000000 -0500 +++ nbase/nbase_config.h.in 2006-12-16 09:57:14.000000000 -0600 @@ -111,7 +111,9 @@ #undef HAVE_IP_IP_SUM +#ifndef __cplusplus #undef inline +#endif #undef STDC_HEADERS Index: nsock/src/configure.ac =================================================================== --- nsock/src/configure.ac.orig 2005-04-14 20:23:53.000000000 -0500 +++ nsock/src/configure.ac 2006-12-16 09:57:14.000000000 -0600 @@ -77,7 +77,7 @@ AC_SUBST(LIBNBASE_LIBS) AC_SUBST(NBASEDIR) - +gl_TYPE_SOCKLEN_T # First we test whether they specified openssl desires explicitly use_openssl="yes" specialssldir="" Index: nsock/src/nsock_config.h.in =================================================================== --- nsock/src/nsock_config.h.in.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/src/nsock_config.h.in 2006-12-16 09:57:14.000000000 -0600 @@ -62,4 +62,6 @@ #undef IN_ADDR_DEEPSTRUCT #undef SPRINTF_RETURNS_STRING - +#ifndef socklen_t +#undef socklen_t +#endif Index: nsock/src/onceonly_2_57.m4 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ nsock/src/onceonly_2_57.m4 2006-12-16 09:57:14.000000000 -0600 @@ -0,0 +1,86 @@ +# onceonly_2_57.m4 serial 3 +dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl This file defines some "once only" variants of standard autoconf macros. +dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS +dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS +dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS +dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC +dnl The advantage is that the check for each of the headers/functions/decls +dnl will be put only once into the 'configure' file. It keeps the size of +dnl the 'configure' file down, and avoids redundant output when 'configure' +dnl is run. +dnl The drawback is that the checks cannot be conditionalized. If you write +dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi +dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to +dnl empty, and the check will be inserted before the body of the AC_DEFUNed +dnl function. + +dnl This is like onceonly.m4, except that it uses diversions to named sections +dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once, +dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The +dnl size reduction is ca. 9%. + +dnl Autoconf version 2.57 or newer is recommended. +AC_PREREQ(2.57) + +# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of +# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). +AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ + : + AC_FOREACH([gl_HEADER_NAME], [$1], [ + AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, + [./-], [___])), [ + m4_divert_text([INIT_PREPARE], + [gl_header_list="$gl_header_list gl_HEADER_NAME"]) + gl_HEADERS_EXPANSION + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])), + [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.]) + ]) + AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, + [./-], [___]))) + ]) +]) +m4_define([gl_HEADERS_EXPANSION], [ + m4_divert_text([DEFAULTS], [gl_header_list=]) + AC_CHECK_HEADERS([$gl_header_list]) + m4_define([gl_HEADERS_EXPANSION], []) +]) + +# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of +# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). +AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ + : + AC_FOREACH([gl_FUNC_NAME], [$1], [ + AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ + m4_divert_text([INIT_PREPARE], + [gl_func_list="$gl_func_list gl_FUNC_NAME"]) + gl_FUNCS_EXPANSION + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])), + [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.]) + ]) + AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) + ]) +]) +m4_define([gl_FUNCS_EXPANSION], [ + m4_divert_text([DEFAULTS], [gl_func_list=]) + AC_CHECK_FUNCS([$gl_func_list]) + m4_define([gl_FUNCS_EXPANSION], []) +]) + +# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of +# AC_CHECK_DECLS(DECL1, DECL2, ...). +AC_DEFUN([AC_CHECK_DECLS_ONCE], [ + : + AC_FOREACH([gl_DECL_NAME], [$1], [ + AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ + AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) + ]) + AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) + ]) +]) Index: nsock/src/socklen.m4 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ nsock/src/socklen.m4 2006-12-16 09:57:14.000000000 -0600 @@ -0,0 +1,52 @@ +# socklen.m4 serial 4 +dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Albert Chin, Windows fixes from Simon Josefsson. + +dnl Check for socklen_t: historically on BSD it is an int, and in +dnl POSIX 1g it is a type of its own, but some platforms use different +dnl types for the argument to getsockopt, getpeername, etc. So we +dnl have to test to find something that will work. + +dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find +dnl it there first. That file is included by gnulib's socket_.h, which +dnl all users of this module should include. Cygwin must not include +dnl ws2tcpip.h. +AC_DEFUN([gl_TYPE_SOCKLEN_T], + [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl + AC_CHECK_TYPE([socklen_t], , + [AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv], + [# Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + AC_TRY_COMPILE( + [#include + #include + + int getpeername (int, $arg2 *, $t *);], + [$t len; + getpeername (0, 0, &len);], + [gl_cv_socklen_t_equiv="$t"]) + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ]) + if test "$gl_cv_socklen_t_equiv" = ""; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) + AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], + [type to use in place of socklen_t if not defined])], + [#include + #if HAVE_SYS_SOCKET_H + # include + #elif HAVE_WS2TCPIP_H + # include + #endif])]) Index: nsock/src/sys_socket_h.m4 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ nsock/src/sys_socket_h.m4 2006-12-16 09:57:14.000000000 -0600 @@ -0,0 +1,23 @@ +# sys_socket_h.m4 serial 2 +dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson. + +AC_DEFUN([gl_HEADER_SYS_SOCKET], +[ + AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = yes; then + SYS_SOCKET_H='' + else + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([winsock2.h ws2tcpip.h]) + SYS_SOCKET_H='sys/socket.h' + fi + AC_SUBST(SYS_SOCKET_H) +]) Index: MACLookup.cc =================================================================== --- MACLookup.cc.orig 2006-11-05 20:14:45.000000000 -0600 +++ MACLookup.cc 2006-12-16 09:57:14.000000000 -0600 @@ -232,8 +232,8 @@ is not particularly efficient and so should be rewriteen if it is called often */ bool MACCorp2Prefix(const char *vendorstr, u8 *mac_data) { - if (!vendorstr) fatal("%s: vendorstr is NULL", __FUNCTION__); - if (!mac_data) fatal("%s: mac_data is NULL", __FUNCTION__); + if (!vendorstr) fatal("%s: vendorstr is NULL","MACCorp2Prefix"); + if (!mac_data) fatal("%s: mac_data is NULL", "MACCorp2Prefix"); mac_prefix_init(); for(int i = 0; i < MacTable.table_capacity; i++ ) { Index: idle_scan.cc =================================================================== --- idle_scan.cc.orig 2006-09-05 03:39:45.000000000 -0500 +++ idle_scan.cc 2006-12-16 09:57:14.000000000 -0600 @@ -370,17 +370,17 @@ if ((o.sendpref & PACKET_SEND_ETH) && proxy->host.ifType() == devt_ethernet) { if (!setTargetNextHopMAC(&proxy->host)) fatal("%s: Failed to determine dst MAC address for Idle proxy", - __FUNCTION__); + "initialize_idleproxy"); memcpy(proxy->eth.srcmac, proxy->host.SrcMACAddress(), 6); memcpy(proxy->eth.dstmac, proxy->host.NextHopMACAddress(), 6); proxy->eth.ethsd = eth_open_cached(proxy->host.deviceName()); if (proxy->eth.ethsd == NULL) - fatal("%s: Failed to open ethernet device (%s)", __FUNCTION__, proxy->host.deviceName()); + fatal("%s: Failed to open ethernet device (%s)", "initialize_idleproxy", proxy->host.deviceName()); proxy->rawsd = -1; proxy->ethptr = &proxy->eth; } else { if ((proxy->rawsd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0 ) - pfatal("socket troubles in %s", __FUNCTION__); + pfatal("socket troubles in %s", "initialize_idleproxy"); unblock_socket(proxy->rawsd); broadcast_socket(proxy->rawsd); #ifndef WIN32 @@ -671,12 +671,12 @@ if (proxy->rawsd < 0) { if (!setTargetNextHopMAC(target)) fatal("%s: Failed to determine dst MAC address for Idle proxy", - __FUNCTION__); + "idlescan_countopen2"); memcpy(eth.srcmac, target->SrcMACAddress(), 6); memcpy(eth.dstmac, target->NextHopMACAddress(), 6); eth.ethsd = eth_open_cached(target->deviceName()); if (eth.ethsd == NULL) - fatal("%s: Failed to open ethernet device (%s)", __FUNCTION__, target->deviceName()); + fatal("%s: Failed to open ethernet device (%s)", "idlescan_countopen2", target->deviceName()); } else eth.ethsd = NULL; /* I start by sending out the SYN pr0bez */ Index: nmapfe/nmapfe.c =================================================================== --- nmapfe/nmapfe.c.orig 2006-09-26 02:49:21.000000000 -0500 +++ nmapfe/nmapfe.c 2006-12-16 09:57:15.000000000 -0600 @@ -520,14 +520,14 @@ /* Scan page (first in notebook) */ nblabel = gtk_label_new("Scan"); - // nbpage = gtk_vbox_new(FALSE, 5); + /* nbpage = gtk_vbox_new(FALSE, 5); */ nbpage = gtk_table_new(5, 3, TRUE); gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5); gtk_table_set_row_spacings(GTK_TABLE(nbpage), 5); gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5); frame = gtk_frame_new("Scan Type"); - // gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); + /* gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); */ gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 2, 0, 3); table = gtk_table_new(2, 4, FALSE); @@ -629,7 +629,7 @@ frame = gtk_frame_new("Scan Extensions"); - // gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); + /* gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); */ gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 2, 3, 5); table = gtk_table_new(1, 4, FALSE); @@ -674,20 +674,20 @@ /* Discover/Ping page (second in notebook) */ nblabel = gtk_label_new("Discover"); nbpage = gtk_table_new(4, 4, FALSE); - // nbpage = gtk_vbox_new(FALSE, 5); + /* nbpage = gtk_vbox_new(FALSE, 5); */ gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5); opt.dontPing = gtk_check_button_new_with_label("Don't Ping"); g_signal_connect(GTK_OBJECT(opt.dontPing), "released", GTK_SIGNAL_FUNC(pingButton_toggled_cb), opt.dontPing); gtk_table_attach_defaults(GTK_TABLE(nbpage), opt.dontPing, 0, 1, 0, 1); - // gtk_box_pack_start(GTK_BOX(nbpage), opt.dontPing, FALSE, FALSE, 0); + /* gtk_box_pack_start(GTK_BOX(nbpage), opt.dontPing, FALSE, FALSE, * 0); */ gtk_widget_show(opt.dontPing); frame = gtk_frame_new("Ping Types"); gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 3, 1, 4); - // gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); + /* gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); */ table = gtk_table_new(3, 4, FALSE); gtk_container_set_border_width(GTK_CONTAINER(table), 5); @@ -1037,7 +1037,7 @@ nblabel = gtk_label_new("Files"); nbpage = gtk_hbox_new(TRUE, 5); gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5); - // gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5); + /* gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5); */ frame = gtk_frame_new("Input File"); gtk_box_pack_start(GTK_BOX(nbpage), frame, TRUE, TRUE, 0); @@ -1251,7 +1251,7 @@ table = gtk_table_new(4, 2, FALSE); gtk_container_set_border_width(GTK_CONTAINER(table), 5); - // gtk_table_set_col_spacings(GTK_TABLE(table), 5); + /* gtk_table_set_col_spacings(GTK_TABLE(table), 5); */ gtk_container_add(GTK_CONTAINER(frame), table); opt.useSourceDevice = gtk_check_button_new_with_label("Device"); Index: nmapfe/nmapfe.h =================================================================== --- nmapfe/nmapfe.h.orig 2006-09-26 02:49:21.000000000 -0500 +++ nmapfe/nmapfe.h 2006-12-16 09:57:15.000000000 -0600 @@ -143,7 +143,7 @@ HELP_MENU = 400, HELPHELP_MENU, HELPVERSION_MENU, - HELPABOUT_MENU, + HELPABOUT_MENU }; Index: nmapfe/nmapfe_sig.c =================================================================== --- nmapfe/nmapfe_sig.c.orig 2006-11-02 23:36:54.000000000 -0600 +++ nmapfe/nmapfe_sig.c 2006-12-16 09:57:15.000000000 -0600 @@ -201,7 +201,7 @@ return 0; } -// tokensz is the total size of token in characters +/* tokensz is the total size of token in characters */ static char *next_token(char *buf, char *token, int tokensz) { if ((buf != NULL) && (token != NULL)) { @@ -239,13 +239,13 @@ int command_size = 2560; /* Find how much to malloc() */ - // size = strlen(gtk_entry_get_text(GTK_ENTRY(opt.range_text))) + - // strlen(gtk_entry_get_text(GTK_ENTRY(opt.Decoy))) + - // strlen(gtk_entry_get_text(GTK_ENTRY(opt.inputFilename))) + - // strlen(gtk_entry_get_text(GTK_ENTRY(opt.SourceDevice)))+ - // strlen(gtk_entry_get_text(GTK_ENTRY(opt.scanRelay)))+ - // strlen(gtk_entry_get_text(GTK_ENTRY(opt.targetHost))) + - // 2560; + /* size = strlen(gtk_entry_get_text(GTK_ENTRY(opt.range_text))) + */ + /* strlen(gtk_entry_get_text(GTK_ENTRY(opt.Decoy))) + */ + /* strlen(gtk_entry_get_text(GTK_ENTRY(opt.inputFilename))) + */ + /* strlen(gtk_entry_get_text(GTK_ENTRY(opt.SourceDevice)))+ */ + /* strlen(gtk_entry_get_text(GTK_ENTRY(opt.scanRelay)))+ */ + /* strlen(gtk_entry_get_text(GTK_ENTRY(opt.targetHost))) + */ + /* 2560; */ /* We get 60 from the chars required for each option */ if (!command) @@ -713,7 +713,7 @@ if (eol != NULL) { char *bol = buf; - int linelen = MIN(bufsz - 1, eol - buf + 1); // we can't exceed buffer size + int linelen = MIN(bufsz - 1, eol - buf + 1); /* we can't exceed buffer size */ /* copy line including \n to line */ memcpy(line, buf, linelen); @@ -1014,13 +1014,13 @@ opt.scanValue = user[k].scantype; if ((opt.scanValue == PING_SCAN) || (opt.scanValue == LIST_SCAN)) { - // gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), FALSE); + /* gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), * FALSE); */ gtk_widget_set_sensitive(GTK_WIDGET(opt.protportType), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(opt.protportLabel), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(opt.protportRange), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(opt.OSInfo), FALSE); } else { - // gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), TRUE); + /* gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), TRUE); */ gtk_widget_set_sensitive(GTK_WIDGET(opt.protportType), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(opt.protportLabel), (opt.protportValue == GIVEN_PROTPORT)); Index: nsock/include/nsock.h =================================================================== --- nsock/include/nsock.h.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/include/nsock.h 2006-12-16 09:57:15.000000000 -0600 @@ -71,10 +71,10 @@ extern "C" { #endif -// The read calls will generally return after reading at least this -// much data so that the caller can process it and so that the -// connection spewing data doesn't monopolize resources. The caller -// can always initiate another read request to ask for more. +/* The read calls will generally return after reading at least this */ +/* much data so that the caller can process it and so that the */ +/* connection spewing data doesn't monopolize resources. The caller */ +/* can always initiate another read request to ask for more. */ #define NSOCK_READ_CHUNK_SIZE 0x8FFFF /********************* TYPEDEFS ********************/ @@ -133,11 +133,11 @@ /* Every nsp has an ID that is unique across the program execution */ unsigned long nsp_getid(nsock_pool nsp); -// Note that nsi_get1_ssl_session will increment the usage count -// of the SSL_SESSION, since nsock does a free when the nsi is -// destroyed. It's up to any calling function/etc to do a -// SSL_SESSION_free() on it. nsi_get0_ssl_session doesn't -// increment, and is for informational purposes only. +/* Note that nsi_get1_ssl_session will increment the usage count */ +/* of the SSL_SESSION, since nsock does a free when the nsi is */ +/* destroyed. It's up to any calling function/etc to do a */ +/* SSL_SESSION_free() on it. nsi_get0_ssl_session doesn't */ +/* increment, and is for informational purposes only. */ nsock_ssl_session nsi_get1_ssl_session(nsock_iod nsockiod); nsock_ssl_session nsi_get0_ssl_session(nsock_iod nsockiod); Index: nsock/src/filespace.h =================================================================== --- nsock/src/filespace.h.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/src/filespace.h 2006-12-16 09:57:15.000000000 -0600 @@ -136,7 +136,7 @@ if (len < 0) return -1; if (len == 0) return 0; -// printf("fscat: current_alloc=%d; current_size=%d; len=%d\n", fs->current_alloc, fs->current_size, len); +/* printf("fscat: current_alloc=%d; current_size=%d; len=%d\n", fs->current_alloc, fs->current_size, len); */ if (fs->current_alloc - fs->current_size < len + 2) { fs->current_alloc = (int) (fs->current_alloc * 1.4 + 1 ); Index: nsock/src/nsock_connect.c =================================================================== --- nsock/src/nsock_connect.c.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/src/nsock_connect.c 2006-12-16 09:57:15.000000000 -0600 @@ -194,7 +194,7 @@ userdata); assert(nse); - // Set our SSL_SESSION so we can benefit from session-id reuse. + /* Set our SSL_SESSION so we can benefit from session-id reuse. */ nsi_set_ssl_session(nsi, (SSL_SESSION *) ssl_session); if (ms->tracelevel > 0) Index: nsock/src/nsock_core.c =================================================================== --- nsock/src/nsock_core.c.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/src/nsock_core.c 2006-12-16 09:57:15.000000000 -0600 @@ -115,7 +115,7 @@ no timeout) */ combined_msecs = MIN((unsigned) event_msecs, (unsigned) msec_timeout); - // printf("wait_for_events: starting wait -- combined_msecs=%d\n", combined_msecs); + /* printf("wait_for_events: starting wait -- combined_msecs=%d\n", combined_msecs); */ /* Set up the timeval pointer we will give to select() */ memset(&select_tv, 0, sizeof(select_tv)); if (combined_msecs > 0) { @@ -468,15 +468,16 @@ return -1; } - // Sometimes a service just spews and spews data. So we return - // after a somewhat large amount to avoid monopolizing resources - // and avoid DOS attacks. + /* Sometimes a service just spews and spews data. So we return */ + /* after a somewhat large amount to avoid monopolizing resources */ + /* and avoid DOS attacks. */ if (FILESPACE_LENGTH(&nse->iobuf) > max_chunk) return FILESPACE_LENGTH(&nse->iobuf) - startlen; - // No good reason to read again if we we were successful in the read but - // didn't fill up the buffer. I'll insist on it being TCP too, because I - // think UDP might only give me one packet worth at a time (I dunno ...). + /* No good reason to read again if we we were successful in the */ + /* read but didn't fill up the buffer. I'll insist on it being */ + /* TCP too, because I think UDP might only give me one packet */ + /* worth at a time (I dunno ...). */ if (buflen > 0 && buflen < sizeof(buf) && iod->lastproto == IPPROTO_TCP) return FILESPACE_LENGTH(&nse->iobuf) - startlen; } @@ -502,9 +503,9 @@ return -1; } - // Sometimes a service just spews and spews data. So we return - // after a somewhat large amount to avoid monopolizing resources - // and avoid DOS attacks. + /* Sometimes a service just spews and spews data. So we return */ + /* after a somewhat large amount to avoid monopolizing resources */ + /* and avoid DOS attacks. */ if (FILESPACE_LENGTH(&nse->iobuf) > NSOCK_READ_CHUNK_SIZE) return FILESPACE_LENGTH(&nse->iobuf) - startlen; } @@ -622,8 +623,8 @@ FD_CLR(iod->sd, &ms->mioi.fds_results_w); } - // Note -- I only want to decrement IOD if there are no other events hinging on it. - // For example, there could be a READ and WRITE outstanding at once + /* Note -- I only want to decrement IOD if there are no other events hinging on it. */ + /* For example, there could be a READ and WRITE outstanding at once */ if (iod->events_pending <= 1 && ms->mioi.max_sd == iod->sd) ms->mioi.max_sd--; } @@ -657,12 +658,7 @@ #if HAVE_OPENSSL int desire_r = 0, desire_w = 0; #endif - gh_list *event_lists[] = { &nsp->evl.connect_events, - &nsp->evl.read_events, - &nsp->evl.write_events, - &nsp->evl.timer_events, - 0 - }; + gh_list *event_lists[5]; int current_list_idx; nsp->evl.next_ev.tv_sec = 0; /* Clear it -- We will find the next event as we go through the list */ @@ -677,6 +673,12 @@ leads to write(). */ + event_lists[0] = &nsp->evl.connect_events; + event_lists[1] = &nsp->evl.read_events; + event_lists[2] = &nsp->evl.write_events; + event_lists[3] = &nsp->evl.timer_events; + event_lists[4] = 0; + /* foreach list */ for(current_list_idx = 0; event_lists[current_list_idx] != NULL; current_list_idx++) { @@ -954,7 +956,7 @@ snprintf(errstr, sizeof(errstr), "[%s (%d)] ", strerror(nse->errnum), nse->errnum); } else errstr[0] = '\0'; - // Some types have special tracing treatment + /* Some types have special tracing treatment */ switch(nse->type) { case NSE_TYPE_CONNECT: case NSE_TYPE_CONNECT_SSL: Index: nsock/src/nsock_iod.c =================================================================== --- nsock/src/nsock_iod.c.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/src/nsock_iod.c 2006-12-16 09:57:15.000000000 -0600 @@ -162,8 +162,8 @@ currev = (msevent *) GH_LIST_ELEM_DATA(currev_elem); next_elem = GH_LIST_ELEM_NEXT(currev_elem); if (currev->iod == nsi) { - // OK - we found an event pending on this IOD. Kill it. - // printf("Found an outstanding event (out of %d), removing\n", nsi->events_pending); + /* OK - we found an event pending on this IOD. Kill it. */ + /* printf("Found an outstanding event (out of %d), removing\n", nsi->events_pending); */ msevent_cancel(nsi->nsp, currev, elist_ar[elist], currev_elem, pending_response == NSOCK_PENDING_NOTIFY); } if (nsi->events_pending == 0) Index: nsock/src/nsock_pool.c =================================================================== --- nsock/src/nsock_pool.c.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/src/nsock_pool.c 2006-12-16 09:57:15.000000000 -0600 @@ -188,17 +188,18 @@ deleted. */ void nsp_delete(nsock_pool ms_pool) { mspool *nsp = (mspool *) ms_pool; - gh_list *event_lists[] = { &nsp->evl.connect_events, - &nsp->evl.read_events, - &nsp->evl.write_events, - &nsp->evl.timer_events, - 0 - }; + gh_list *event_lists[5]; int current_list_idx; msevent *nse; msiod *nsi; gh_list_elem *current, *next; + event_lists[0] = &nsp->evl.connect_events; + event_lists[1] = &nsp->evl.read_events; + event_lists[2] = &nsp->evl.write_events; + event_lists[3] = &nsp->evl.timer_events; + event_lists[4] = 0; + assert(nsp); Index: nsock/src/nsock_ssl.c =================================================================== --- nsock/src/nsock_ssl.c.orig 2006-08-24 20:48:01.000000000 -0500 +++ nsock/src/nsock_ssl.c 2006-12-16 09:57:15.000000000 -0600 @@ -123,7 +123,7 @@ SSL_CTX_set_session_cache_mode( sslnfo->ctx, SSL_SESS_CACHE_OFF | SSL_SESS_CACHE_NO_AUTO_CLEAR ); SSL_CTX_sess_set_cache_size( sslnfo->ctx, 1 ); - SSL_CTX_set_timeout( sslnfo->ctx, 3600); // pretty unnecessary + SSL_CTX_set_timeout( sslnfo->ctx, 3600); /* pretty unnecessary */ } Index: osscan.cc =================================================================== --- osscan.cc.orig 2006-12-07 21:01:19.000000000 -0600 +++ osscan.cc 2006-12-17 05:02:21.000000000 -0600 @@ -542,7 +542,7 @@ memcpy(eth.dstmac, target->NextHopMACAddress(), 6); eth.ethsd = eth_open_cached(target->deviceName()); if (eth.ethsd == NULL) - fatal("%s: Failed to open ethernet device (%s)", __FUNCTION__, target->deviceName()); + fatal("%s: Failed to open ethernet device (%s)", "get_fingerprint", target->deviceName()); rawsd = -1; ethptr = ð @@ -1260,10 +1260,10 @@ if (numtrue == 0) testfailed=1; if (points) { current_points = getattrbyname(points, current_ref->attribute); - if (!current_points) fatal("%s: Failed to find point amount for test %s.%s", __FUNCTION__, testGroupName? testGroupName : "", current_ref->attribute); + if (!current_points) fatal("%s: Failed to find point amount for test %s.%s", "AVal_match", testGroupName? testGroupName : "", current_ref->attribute); pointsThisTest = strtol(current_points->value, &endptr, 10); if (pointsThisTest < 1) - fatal("%s: Got bogus point amount (%s) for test %s.%s", __FUNCTION__, current_points->value, testGroupName? testGroupName : "", current_ref->attribute); + fatal("%s: Got bogus point amount (%s) for test %s.%s", "AVal_match", current_points->value, testGroupName? testGroupName : "", current_ref->attribute); } subtests += pointsThisTest; if (testfailed) { @@ -1308,7 +1308,7 @@ if (MatchPoints) { currentTestMatchPoints = gettestbyname(MatchPoints, currentReferenceTest->name); if (!currentTestMatchPoints) - fatal("%s: Failed to locate test %s in MatchPoints directive of fingerprint file", __FUNCTION__, currentReferenceTest->name); + fatal("%s: Failed to locate test %s in MatchPoints directive of fingerprint file", "compare_fingerprints", currentReferenceTest->name); } else currentTestMatchPoints = NULL; AVal_match(currentReferenceTest->results, currentObservedTest, currentTestMatchPoints, @@ -2013,7 +2013,7 @@ char *p, *q; /* OH YEAH!!!! */ - if (!DB) fatal("non-allocated DB passed to %s", __FUNCTION__); + if (!DB) fatal("non-allocated DB passed to %s", "parse_fingerprint_file"); DB->prints = (FingerPrint **) safe_zalloc(sizeof(FingerPrint *) * max_records); Index: output.cc =================================================================== --- output.cc.orig 2006-12-07 21:01:19.000000000 -0600 +++ output.cc 2006-12-17 07:58:46.000000000 -0600 @@ -742,10 +742,12 @@ case LOG_MACHINE: case LOG_SKID: case LOG_XML: -#ifdef WIN32 - apcopy = ap; -#else +#if HAVE_VA_COPY va_copy(apcopy, ap); /* Needed in case we need to so a second vnsprintf */ +#elif HAVE___VA_COPY + __va_copy(apcopy, ap); /* Needed in case we need to so a second vnsprintf */ +#else + apcopy = ap; #endif l = logt; fileidx = 0; @@ -757,7 +759,7 @@ va_end(apcopy); return; } else if (len < 0) { - fprintf(stderr, "vnsprintf returned %d in %s -- bizarre. Quitting.\n", len, __FUNCTION__); + fprintf(stderr, "vnsprintf returned %d in %s -- bizarre. Quitting.\n", len, "log_vwrite"); exit(1); } else if (len >= writebuflen) { /* Didn't have enough space. Expand writebuf and try again */ @@ -766,7 +768,7 @@ writebuf = (char *) safe_malloc(writebuflen); len = vsnprintf(writebuf, writebuflen, fmt, apcopy); if (len <= 0 || len >= writebuflen) { - fprintf(stderr, "%s: vnsprintf failed. Even after increasing bufferlen to %d, vsnprintf returned %d (logt == %d). Please email this message to fyodor () insecure org Quitting.\n", __FUNCTION__, writebuflen, len, logt); + fprintf(stderr, "%s: vnsprintf failed. Even after increasing bufferlen to %d, vsnprintf returned %d (logt == %d). Please email this message to fyodor () insecure org Quitting.\n", "log_vwrite", writebuflen, len, logt); exit(1); } } Index: scan_engine.cc =================================================================== --- scan_engine.cc.orig 2006-11-19 03:35:31.000000000 -0600 +++ scan_engine.cc 2006-12-16 09:57:15.000000000 -0600 @@ -189,7 +189,7 @@ case PS_ARP: return "ARP"; default: - fatal("%s: Unknown type: %d", __FUNCTION__, type); + fatal("%s: Unknown type: %d", "pspectype2ascii", type); } return ""; // Unreached } @@ -677,7 +677,7 @@ type = UP_IP; if (ipv4->ip_v != 4) fatal("Bogus packet passed to %s -- only IPv4 packets allowed", - __FUNCTION__); + "UltraProbe::setIP"); assert(iplen >= 20); assert(iplen == (u32) ntohs(ipv4->ip_len)); probes.IP.ipid = ntohs(ipv4->ip_id); @@ -700,7 +700,7 @@ if (mypspec.proto == IPPROTO_TCP) return probes.IP.pd.tcp.seq; else - fatal("Bogus seq number request to %s -- type is %s", __FUNCTION__, + fatal("Bogus seq number request to %s -- type is %s", "UltraProbe::tcpseq", pspectype2ascii(mypspec.type)); return 0; // Unreached Index: targets.cc =================================================================== --- targets.cc.orig 2006-11-19 03:35:31.000000000 -0600 +++ targets.cc 2006-12-16 09:57:15.000000000 -0600 @@ -1735,7 +1735,7 @@ )) { hs->hostbatch[hidx]->TargetSockAddr(&ss, &sslen); if (!route_dst(&ss, &rnfo)) { - fatal("%s: failed to determine route to %s", __FUNCTION__, hs->hostbatch[hidx]->NameIP()); + fatal("%s: failed to determine route to %s", "nexthost", hs->hostbatch[hidx]->NameIP()); } if (rnfo.direct_connect) { hs->hostbatch[hidx]->setDirectlyConnected(true); @@ -1814,7 +1814,7 @@ !hs->hostbatch[i]->timedOut(&now)) if (!setTargetNextHopMAC(hs->hostbatch[i])) fatal("%s: Failed to determine dst MAC address for target %s", - __FUNCTION__, hs->hostbatch[i]->NameIP()); + "nexthost", hs->hostbatch[i]->NameIP()); } /* TODO: Maybe I should allow real ping scan of directly connected Index: tcpip.cc =================================================================== --- tcpip.cc.orig 2006-12-07 21:01:19.000000000 -0600 +++ tcpip.cc 2006-12-16 09:57:15.000000000 -0600 @@ -133,6 +133,10 @@ #endif /* NETINET_IF_ETHER_H */ #endif /* HAVE_NETINET_IF_ETHER_H */ +#ifndef INET_ADDRSTRLEN +#define INET_ADDRSTRLEN 16 +#endif + extern NmapOps o; #ifdef WIN32 @@ -1015,22 +1019,21 @@ } return; } - // fill ip header. no error check. // This function is also changing what's needed from host to network order. static inline int fill_ip_raw( struct ip *ip, int packetlen, u8* ipopt, int ipoptlen, - int ip_tos, int ip_id, int ip_off, int ip_ttl, int ip_p, + int in_ip_tos, int in_ip_id, int in_ip_off, int in_ip_ttl, int in_ip_p, const struct in_addr *ip_src, const struct in_addr *ip_dst) { ip->ip_v = 4; ip->ip_hl = 5 + (ipoptlen/4); - ip->ip_tos = ip_tos; + ip->ip_tos = in_ip_tos; ip->ip_len = htons(packetlen); - ip->ip_id = htons(ip_id); - ip->ip_off = htons(ip_off); - ip->ip_ttl = ip_ttl; - ip->ip_p = ip_p; + ip->ip_id = htons(in_ip_id); + ip->ip_off = htons(in_ip_off); + ip->ip_ttl = in_ip_ttl; + ip->ip_p = in_ip_p; ip->ip_src.s_addr = ip_src->s_addr; ip->ip_dst.s_addr = ip_dst->s_addr; @@ -2071,7 +2074,7 @@ if (to_usec < 0) { if (!warning) { warning = 1; - error("WARNING: Negative timeout value (%lu) passed to %s() -- using 0", to_usec, __FUNCTION__); + error("WARNING: Negative timeout value (%lu) passed to %s() -- using 0", to_usec, "read_arp_reply_pcap"); } to_usec = 0; } @@ -2251,7 +2254,7 @@ bool foundit = false; if (targetsin->sin_family != AF_INET || srcsin->sin_family != AF_INET) - fatal("%s can only handle IPv4 addresses", __FUNCTION__); + fatal("%s can only handle IPv4 addresses", "doArp"); /* Start listening */ pd = my_pcap_open_live(dev, 50, 1, 25); @@ -2259,7 +2262,7 @@ /* Prepare probe and sending stuff */ ethsd = eth_open_cached(dev); - if (!ethsd) fatal("%s: failed to open device %s", __FUNCTION__, dev); + if (!ethsd) fatal("%s: failed to open device %s", "doArp", dev); eth_pack_hdr(frame, ETH_ADDR_BROADCAST, *srcmac, ETH_TYPE_ARP); arp_pack_hdr_ethip(frame + ETH_HDR_LEN, ARP_OP_REQUEST, *srcmac, srcsin->sin_addr, ETH_ADDR_BROADCAST, @@ -2271,7 +2274,7 @@ /* Send the sucker */ rc = eth_send(ethsd, frame, sizeof(frame)); if (rc != sizeof(frame)) { - error("WARNING: %s: eth_send of ARP packet returned %u rather than expected %d bytes\n", __FUNCTION__, rc, (int) sizeof(frame)); + error("WARNING: %s: eth_send of ARP packet returned %u rather than expected %d bytes\n", "doArp", rc, (int) sizeof(frame)); } PacketTrace::traceArp(PacketTrace::SENT, (u8 *) frame, sizeof(frame), &now); num_sends++; @@ -2288,7 +2291,7 @@ /* Now listen until we reach our next timeout or get an answer */ rc = read_arp_reply_pcap(pd, targetmac, &rcvdIP, timeleft, &rcvdtime); if (rc == -1) fatal("%s: Received -1 response from readarp_reply_pcap", - __FUNCTION__); + "doArp"); if (rc == 1) { /* Yay, I got one! But is it the right one? */ if (rcvdIP.s_addr != targetsin->sin_addr.s_addr) @@ -2339,7 +2342,8 @@ target->TargetSockAddr(&targetss, &sslen); } else { if (!target->nextHop(&targetss, &sslen)) - fatal("%s: Failed to determine nextHop to target", __FUNCTION__); + fatal("%s: Failed to determine nextHop to target", + "setTargetNextHopMAC"); } /* First, let us check the Nmap arp cache ... */ @@ -2585,9 +2589,9 @@ dcrn.ifaces = mydevs; dcrn.numifaces = 0; it = intf_open(); - if (!it) fatal("%s: intf_open() failed", __FUNCTION__); + if (!it) fatal("%s: intf_open() failed", "getinterfaces"); if (intf_loop(it, collect_dnet_interfaces, &dcrn) != 0) - fatal("%s: intf_loop() failed", __FUNCTION__); + fatal("%s: intf_loop() failed", "getinterfaces"); intf_close(it); mydevs = dcrn.ifaces; numifaces = dcrn.numifaces; @@ -2692,11 +2696,11 @@ eth_addr_t ethaddr; if (!ethsd) - fatal("%s: Failed to open ethernet interface (%s). A possible cause on BSD operating systems is running out of BPF devices (see http://seclists.org/lists/nmap-dev/2006/Jan-Mar/0014.html).", __FUNCTION__, + fatal("%s: Failed to open ethernet interface (%s). A possible cause on BSD operating systems is running out of BPF devices (see http://seclists.org/lists/nmap-dev/2006/Jan-Mar/0014.html).","getinterfaces", mydevs[numifaces].devname); if (eth_get(ethsd, ðaddr) != 0) fatal("%s: Failed to obtain MAC address for ethernet interface (%s)", - __FUNCTION__, mydevs[numifaces].devname); + "getinterfaces", mydevs[numifaces].devname); memcpy(mydevs[numifaces].mac, ethaddr.data, 6); #endif /*SIOCGIFHWADDR*/ @@ -2734,7 +2738,7 @@ int ifnum; if (sin->sin_family != AF_INET) - fatal("%s called with non-IPv4 address", __FUNCTION__); + fatal("%s called with non-IPv4 address", "getInterfaceByIP"); ifaces = getinterfaces(&numifaces); @@ -2896,9 +2900,9 @@ dcrn.ifaces = ifaces; dcrn.numifaces = numifaces; route_t *dr = route_open(); - if (!dr) fatal("%s: route_open() failed", __FUNCTION__); + if (!dr) fatal("%s: route_open() failed", "getsysroutes"); if (route_loop(dr, collect_dnet_routes, &dcrn) != 0) { - fatal("%s: route_loop() failed", __FUNCTION__); + fatal("%s: route_loop() failed", "getsysroutes"); } route_close(dr); /* These values could have changed in the callback */ Index: tcpip.h =================================================================== --- tcpip.h.orig 2006-11-20 01:56:52.000000000 -0600 +++ tcpip.h 2006-12-16 09:57:16.000000000 -0600 @@ -158,6 +158,7 @@ #include +#include #if HAVE_NETINET_IN_H #include #endif @@ -228,8 +229,7 @@ #include #include #include -#include -#ifndef WIN32 +#if !defined(WIN32) #include #endif Index: libdnet-stripped/src/route-bsd.c =================================================================== --- libdnet-stripped/src/route-bsd.c.orig 2005-02-09 23:18:38.000000000 -0600 +++ libdnet-stripped/src/route-bsd.c 2006-12-16 09:57:16.000000000 -0600 @@ -213,7 +213,10 @@ return (0); } -#if defined(HAVE_SYS_SYSCTL_H) || defined(HAVE_STREAMS_ROUTE) +#if defined(HAVE_SYS_SYSCTL_H) || defined(HAVE_STREAMS_ROUTE) || defined(_AIX) +#ifdef _AIX +#include +#endif int route_loop(route_t *r, route_handler callback, void *arg) { @@ -222,7 +225,23 @@ struct sockaddr *sa; char *buf, *lim, *next; int ret; -#ifdef HAVE_SYS_SYSCTL_H +#ifdef _AIX + int len = getkerninfo(KINFO_RT_DUMP,0,0,0); + + if (len == 0) + return (0); + + if ((buf = malloc(len)) == NULL) + return (-1); + + if (getkerninfo(KINFO_RT_DUMP,buf,&len,0) < 0) { + free(buf); + return (-1); + } + lim = buf + len; + next = buf; + +#elif defined (HAVE_SYS_SYSCTL_H) int mib[6] = { CTL_NET, PF_ROUTE, 0, 0 /* XXX */, NET_RT_DUMP, 0 }; size_t len; Index: nmap.h =================================================================== --- nmap.h.orig 2006-09-30 16:08:10.000000000 -0500 +++ nmap.h 2006-12-16 09:57:16.000000000 -0600 @@ -123,139 +123,6 @@ #include -#if HAVE_UNISTD_H -#include -#endif - -#ifdef STDC_HEADERS -#include -#else -void *malloc(); -void *realloc(); -#endif - -#if STDC_HEADERS || HAVE_STRING_H -#include -#if !STDC_HEADERS && HAVE_MEMORY_H -#include -#endif -#endif -#if HAVE_STRINGS_H -#include -#endif - -#ifdef HAVE_BSTRING_H -#include -#endif - -#include -#include - -#ifndef WIN32 /* from nmapNT -- seems to work */ -#include -#endif /* !WIN32 */ - -#ifdef HAVE_SYS_PARAM_H -#include /* Defines MAXHOSTNAMELEN on BSD*/ -#endif - -/* Linux uses these defines in netinet/ip.h and netinet/tcp.h to - use the correct struct ip and struct tcphdr */ -#ifndef __FAVOR_BSD -#define __FAVOR_BSD -#endif -#ifndef __USE_BSD -#define __USE_BSD -#endif -#ifndef __BSD_SOURCE -#define __BSD_SOURCE -#endif - -/* BSDI needs this to insure the correct struct ip */ -#undef _IP_VHL - -#include - -#if HAVE_RPC_TYPES_H -#include -#endif - -#if HAVE_SYS_SOCKET_H -#include -#endif - -#include - -#if HAVE_NETINET_IN_H -#include -#endif - -#include - -#if HAVE_NETDB_H -#include -#endif - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include -#include - -#ifdef HAVE_PWD_H -#include -#endif - -#ifndef NETINET_IN_SYSTEM_H /* why does OpenBSD not do this? */ -#include /* defines n_long needed for netinet/ip.h */ -#define NETINET_IN_SYSTEM_H -#endif -#ifndef NETINET_IP_H /* why does OpenBSD not do this? */ -#include -#define NETINET_IP_H -#endif -// #include - -#if HAVE_ARPA_INET_H -#include -#endif - -#include -#include -#ifndef __FAVOR_BSD -#define __FAVOR_BSD -#endif -#ifndef NETINET_TCP_H /* why does OpenBSD not do this? */ -#include /*#include */ -#define NETINET_TCP_H -#endif - -#if HAVE_SYS_RESOURCE_H -#include -#endif - -/*#include *//* defines struct arphdr needed for if_ether.h */ -// #if HAVE_NET_IF_H -// #ifndef NET_IF_H /* why doesn't OpenBSD do this?! */ -// #include -// #define NET_IF_H -// #endif -// #endif -// #if HAVE_NETINET_IF_ETHER_H -// #ifndef NETINET_IF_ETHER_H -// #include -// #define NETINET_IF_ETHER_H -// #endif /* NETINET_IF_ETHER_H */ -// #endif /* HAVE_NETINET_IF_ETHER_H */ - /******* DEFINES ************/ /* User configurable #defines: */ @@ -405,11 +272,144 @@ # define recvfrom6_t int #endif + +#if HAVE_UNISTD_H +#include +#endif + +#ifdef STDC_HEADERS +#include +#else +void *malloc(); +void *realloc(); +#endif + +#if STDC_HEADERS || HAVE_STRING_H +#include +#if !STDC_HEADERS && HAVE_MEMORY_H +#include +#endif +#endif +#if HAVE_STRINGS_H +#include +#endif + +#ifdef HAVE_BSTRING_H +#include +#endif + +#include +#include + +#ifndef WIN32 /* from nmapNT -- seems to work */ +#include +#endif /* !WIN32 */ + +#ifdef HAVE_SYS_PARAM_H +#include /* Defines MAXHOSTNAMELEN on BSD*/ +#endif + +/* Linux uses these defines in netinet/ip.h and netinet/tcp.h to + use the correct struct ip and struct tcphdr */ +#ifndef __FAVOR_BSD +#define __FAVOR_BSD +#endif +#ifndef __USE_BSD +#define __USE_BSD +#endif +#ifndef __BSD_SOURCE +#define __BSD_SOURCE +#endif + +#include "tcpip.h" +/* BSDI needs this to insure the correct struct ip */ +#undef _IP_VHL + +#include + +#if HAVE_RPC_TYPES_H +#include +#endif + +#if HAVE_SYS_SOCKET_H +#include +#endif + +#include + +#if HAVE_NETINET_IN_H +#include +#endif + +#include + +#if HAVE_NETDB_H +#include +#endif + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include +#include + +#ifdef HAVE_PWD_H +#include +#endif + +#ifndef NETINET_IN_SYSTEM_H /* why does OpenBSD not do this? */ +#include /* defines n_long needed for netinet/ip.h */ +#define NETINET_IN_SYSTEM_H +#endif +#ifndef NETINET_IP_H /* why does OpenBSD not do this? */ +#include +#define NETINET_IP_H +#endif +// #include + +#if HAVE_ARPA_INET_H +#include +#endif + +#include +#include +#ifndef __FAVOR_BSD +#define __FAVOR_BSD +#endif +#ifndef NETINET_TCP_H /* why does OpenBSD not do this? */ +#include /*#include */ +#define NETINET_TCP_H +#endif + +#if HAVE_SYS_RESOURCE_H +#include +#endif + +/*#include *//* defines struct arphdr needed for if_ether.h */ +// #if HAVE_NET_IF_H +// #ifndef NET_IF_H /* why doesn't OpenBSD do this?! */ +// #include +// #define NET_IF_H +// #endif +// #endif +// #if HAVE_NETINET_IF_ETHER_H +// #ifndef NETINET_IF_ETHER_H +// #include +// #define NETINET_IF_ETHER_H +// #endif /* NETINET_IF_ETHER_H */ +// #endif /* HAVE_NETINET_IF_ETHER_H */ /********************** LOCAL INCLUDES *****************************/ #include "output.h" #include "portlist.h" -#include "tcpip.h" #include "global_structures.h" #include "nmap_error.h" #include "utils.h" Index: libdnet-stripped/src/eth-ndd.c =================================================================== --- libdnet-stripped/src/eth-ndd.c.orig 2005-01-25 15:30:40.000000000 -0600 +++ libdnet-stripped/src/eth-ndd.c 2006-12-16 09:57:16.000000000 -0600 @@ -32,25 +32,35 @@ { struct sockaddr_ndd_8022 sa; eth_t *e; - if ((e = calloc(1, sizeof(*e))) == NULL) return (NULL); - + memset(&sa,0,sizeof(sa)); if ((e->fd = socket(AF_NDD, SOCK_DGRAM, NDD_PROT_ETHER)) < 0) + { + /* fprintf(stderr,"socket failed: %s\n",strerror(errno));*/ return (eth_close(e)); - + } sa.sndd_8022_family = AF_NDD; sa.sndd_8022_len = sizeof(sa); sa.sndd_8022_filtertype = NS_ETHERTYPE; sa.sndd_8022_ethertype = ETH_TYPE_IP; sa.sndd_8022_filterlen = sizeof(struct ns_8022); strlcpy(sa.sndd_8022_nddname, device, sizeof(sa.sndd_8022_nddname)); + strlcpy(e->device, device, sizeof(e->device)); if (bind(e->fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) - return (eth_close(e)); + { + /* fprintf(stderr,"bind failed: %s\n",strerror(errno));*/ + /* return (eth_close(e)); */ + /* don't actually fail here, some stuff might still work + * without using eth_ */ + } if (connect(e->fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) + { + /* fprintf(stderr,"connect failed: %s\n",strerror(errno));*/ return (eth_close(e)); + } /* XXX - SO_BROADCAST needed? */ @@ -60,7 +70,11 @@ ssize_t eth_send(eth_t *e, const void *buf, size_t len) { - return (write(e->fd, buf, len)); + ssize_t numbytes = write(e->fd, buf, len); + /*if (0== numbytes) { + fprintf(stderr,"write failed: %s\n",strerror(errno)); + }*/ + return (numbytes); } eth_t * @@ -98,6 +112,7 @@ if (strcmp(nddp->ndd_alias, e->device) == 0 || strcmp(nddp->ndd_name, e->device) == 0) { memcpy(ea, nddp->ndd_addr, sizeof(*ea)); + break; } } free(nddp); Index: libdnet-stripped/include/dnet/icmp.h =================================================================== --- libdnet-stripped/include/dnet/icmp.h.orig 2006-06-09 18:59:33.000000000 -0500 +++ libdnet-stripped/include/dnet/icmp.h 2006-12-16 09:57:16.000000000 -0600 @@ -97,14 +97,14 @@ #define ICMP_PHOTURIS_NEED_AUTHN 4 /* no authentication */ #define ICMP_PHOTURIS_NEED_AUTHZ 5 /* no authorization */ #define ICMP_TYPE_MAX 40 - +#ifndef _AIX #define ICMP_INFOTYPE(type) \ ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ (type) == ICMP_RTRADVERT || (type) == ICMP_RTRSOLICIT || \ (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ (type) == ICMP_INFO || (type) == ICMP_INFOREPLY || \ (type) == ICMP_MASK || (type) == ICMP_MASKREPLY) - +#endif /* * Echo message data */ @@ -129,8 +129,10 @@ */ struct icmp_msg_quote { uint32_t icmp_void; /* must be zero */ +#ifndef _AIX #define icmp_gwaddr icmp_void /* router IP address to use */ #define icmp_pptr icmp_void /* ptr to bad octet field */ +#endif uint8_t icmp_ip __flexarr; /* IP hdr + 8 bytes of pkt */ }; @@ -143,7 +145,9 @@ uint16_t icmp_lifetime; /* route lifetime in seconds */ struct icmp_msg_rtr_data { uint32_t icmp_void; +#ifndef _AIX #define icmp_gwaddr icmp_void /* router IP address */ +#endif uint32_t icmp_pref; /* router preference (usu 0) */ } icmp_rtr __flexarr; /* variable # of routers */ }; Index: NmapOps.cc =================================================================== --- NmapOps.cc.orig 2006-10-13 20:26:52.000000000 -0500 +++ NmapOps.cc 2006-12-16 09:57:16.000000000 -0600 @@ -358,8 +358,12 @@ #ifdef WIN32 sendpref = PACKET_SEND_ETH_STRONG; #else +#ifdef _AIX + sendpref = PACKET_SEND_IP_STRONG; +#else sendpref = PACKET_SEND_IP_WEAK; #endif +#endif } /* We start with stuff users should not do if they are not root */ if (!isr00t) { Index: osscan2.cc =================================================================== --- osscan2.cc.orig 2006-12-07 20:11:08.000000000 -0600 +++ osscan2.cc 2006-12-17 06:10:59.000000000 -0600 @@ -924,7 +924,7 @@ memcpy(eth.srcmac, t->SrcMACAddress(), 6); memcpy(eth.dstmac, t->NextHopMACAddress(), 6); if ((eth.ethsd = eth_open_cached(t->deviceName())) == NULL) - fatal("%s: Failed to open ethernet device (%s)", __FUNCTION__, t->deviceName()); + fatal("%s: Failed to open ethernet device (%s)", "HostOsScan::HostOsScan", t->deviceName()); rawsd = -1; ethptr = ð } else { Index: configure.ac =================================================================== --- configure.ac.orig 2006-12-18 22:08:21.000000000 -0600 +++ configure.ac 2006-12-19 06:35:31.000000000 -0600 @@ -47,11 +47,17 @@ AC_MSG_ERROR([Could not locate a C++ compiler. If it exists, add it to your PATH or give configure the CXX=path_to_compiler argument. Otherwise, install a C++ compiler such as g++ or install a binary package of Nmap (see http://www.insecure.org/nmap/nmap_download.html ))]) fi + +HAVE_GXX='# ' +AC_SUBST(HAVE_GXX) + nmap_gcc_major_version=0 AC_MSG_CHECKING([whether the compiler is gcc 4 or greater]) -if test x"$GXX" = xno; then - AC_MSG_RESULT([no]) -else +if test x"$GXX" = xyes; then + HAVE_GXX= + # I have no idea why we check for g++ above and mess with gcc + # below ... + # On some distros, there are snapshots available as gcc4 if test -z "$ac_cv_prog_CC" || test x"$CC" = xgcc4; then our_gcc="$CC" @@ -78,6 +84,8 @@ else AC_MSG_RESULT([no]) fi +else + AC_MSG_RESULT([no]) fi # Remember that all following tests will run with this CXXFLAGS by default @@ -338,10 +346,10 @@ have_libpcap=no ;; *) - _cppflags=$CXXFLAGS + _cppflags=$CPPFLAGS _ldflags=$LDFLAGS - CXXFLAGS="-I$with_libpcap/include $CXXFLAGS" + CPPFLAGS="-I$with_libpcap/include $CPPFLAGS" LDFLAGS="-L$with_libpcap/lib $LDFLAGS" AC_CHECK_HEADER(pcap.h,[ @@ -351,7 +359,7 @@ LIBPCAP_LIB=$with_libpcap/lib])]) LDFLAGS=$_ldflags - CXXFLAGS=$_cppflags + CPPFLAGS=$_cppflags ;; esac] ) @@ -366,7 +374,7 @@ if test $have_libpcap = yes; then if test "${LIBPCAP_INC+set}" = "set"; then - _cflags=$CXXFLAGS + _cxxflags=$CXXFLAGS _ldflags=$LDFLAGS CXXFLAGS="-I$LIBPCAP_INC $CXXFLAGS" @@ -376,9 +384,11 @@ # link with -lpcap for the purposes of this test LIBS_OLD="$LIBS" LIBS="$LIBS -lpcap" + AC_LANG_PUSH(C++) AC_MSG_CHECKING(if libpcap version is recent enough) AC_TRY_RUN([ #include +#include extern char pcap_version[]; int main() { int major, minor1, minor2; @@ -391,10 +401,11 @@ exit(1); exit(0); }], -[AC_MSG_RESULT(yes); have_libpcap=yes], -[AC_MSG_RESULT(no); have_libpcap=no], -[AC_MSG_RESULT(no); have_libpcap=no]) -LIBS="$LIBS_OLD" + [AC_MSG_RESULT(yes); have_libpcap=yes], + [AC_MSG_RESULT(no); have_libpcap=no], + [AC_MSG_RESULT(no); have_libpcap=no]) + AC_LANG_POP(C++) + LIBS="$LIBS_OLD" fi @@ -422,6 +433,10 @@ AC_SUBST(PCAP_DIST_CLEAN) AC_SUBST(LIBPCAP_LIBS) +# AIX needs -lodm -lcfg for -lpcap +AC_SEARCH_LIBS(getminor, [cfg]) +AC_SEARCH_LIBS(odm_lock, [odm]) + have_pcre=no requested_included_pcre=no LIBPCREDIR=libpcre @@ -502,6 +517,7 @@ DNET_DEPENDS="$LIBDNETDIR/src/.libs/libdnet.a" DNET_CLEAN="dnet_clean" DNET_DIST_CLEAN="dnet_dist_clean" + else LIBDNET_LIBS="-ldnet" DNET_DEPENDS="" @@ -558,6 +574,8 @@ exit 1 fi fi +else + AC_MSG_RESULT([no]) fi AC_SUBST(CXXFLAGS) @@ -683,6 +701,35 @@ AC_MSG_RESULT(yes) AC_DEFINE(NEED_GETHOSTNAME_PROTO)], AC_MSG_RESULT(not found))]) + + +AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy, + AC_TRY_LINK( + [#include ], + [va_list ap1, ap2; + va_copy(ap1,ap2); + ], + [ac_cv_c_va_copy="yes"], + [ac_cv_c_va_copy="no"]) + ) +if test "$ac_cv_c_va_copy" = "yes" +then + AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy]) +fi +AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy, + AC_TRY_LINK( + [#include ], + [va_list ap1, ap2; + __va_copy(ap1,ap2); + ], + [ac_cv_c___va_copy="yes"], + [ac_cv_c___va_copy="no"]) + ) +if test "$ac_cv_c___va_copy" = "yes" +then + AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy]) +fi + AC_LANG_POP(C++) RECVFROM_ARG6_TYPE @@ -720,7 +767,7 @@ esac] ) -LDFLAGS="$LDFLAGS -L$NSOCKDIR/src/" +LDFLAGS="$LDFLAGS -L$NSOCKDIR/src" CXXFLAGS="$CXXFLAGS -I$NSOCKDIR/include" LIBNSOCK_LIBS="-lnsock"