*** ./nsock/src/nsock_connect.c.ORIG Wed Dec 14 22:56:57 2011 --- ./nsock/src/nsock_connect.c Wed Dec 14 22:57:15 2011 *************** *** 63,68 **** --- 63,72 ---- #include #include + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + extern struct timeval nsock_tod; /* Create the actual socket (nse->iod->sd) underlying the iod. This *** ./nsock/src/nsock_core.c.ORIG Wed Dec 14 22:57:28 2011 --- ./nsock/src/nsock_core.c Wed Dec 14 22:57:47 2011 *************** *** 86,91 **** --- 86,95 ---- static int pcap_read_on_nonselect(mspool *nsp); #endif + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + /* Nsock time of day -- we update this at least once per nsock_loop round (and after most calls that are likely to block). Other nsock files should grab this *** ./nsock/src/nsock_write.c.ORIG Wed Dec 14 22:57:59 2011 --- ./nsock/src/nsock_write.c Wed Dec 14 22:58:11 2011 *************** *** 63,68 **** --- 63,72 ---- #include #include + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + nsock_event_id nsock_sendto(nsock_pool ms_pool, nsock_iod ms_iod, nsock_ev_handler handler, int timeout_msecs, void *userdata, struct sockaddr *saddr, size_t sslen, *** ./nsock/src/nsock_pcap.c.ORIG Wed Dec 14 22:58:28 2011 --- ./nsock/src/nsock_pcap.c Wed Dec 14 22:58:52 2011 *************** *** 249,255 **** --- 249,257 ---- offset = 24;break; /* Anyone use this? */ #endif /* ifdef solaris */ #endif /* if freebsd || openbsd || netbsd || bsdi */ + #ifdef DLT_RAW case DLT_RAW: offset = 0; break; + #endif /* DLT_RAW */ case DLT_FDDI: offset = 21; break; #ifdef DLT_ENC case DLT_ENC: offset = 12; break; *** ./nbase/nbase_misc.c.ORIG Wed Dec 14 22:55:27 2011 --- ./nbase/nbase_misc.c Wed Dec 14 22:56:34 2011 *************** *** 117,122 **** --- 117,126 ---- #define INET6_ADDRSTRLEN 46 #endif + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + /* Returns the UNIX/Windows errno-equivalent. Note that the Windows call is socket/networking specific. The windows error number returned is like WSAMSGSIZE, but nbase.h includes #defines to *** ./libnetutil/netutil.cc.ORIG Wed Dec 14 23:03:48 2011 --- ./libnetutil/netutil.cc Wed Dec 14 23:09:07 2011 *************** *** 109,114 **** --- 109,120 ---- #if HAVE_SYS_SOCKIO_H #include /* SIOCGIFCONF for Solaris */ #endif + #if HAVE_NET_IF_H + #ifndef NET_IF_H /* This guarding is needed for at least some versions of OpenBSD */ + #include + #define NET_IF_H + #endif + #endif #include #if HAVE_NETINET_IN_H *************** *** 120,131 **** #define NETINET_IN_SYSTM_H #endif ! #if HAVE_NET_IF_H ! #ifndef NET_IF_H /* This guarding is needed for at least some versions of OpenBSD */ ! #include ! #define NET_IF_H ! #endif ! #endif #ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ #include #define NETINET_IP_H --- 126,132 ---- #define NETINET_IN_SYSTM_H #endif ! #include "netutil.h" #ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ #include #define NETINET_IP_H *************** *** 135,141 **** #include #endif ! #include "netutil.h" #define NBASE_MAX_ERR_STR_LEN 1024 /* Max length of an error message */ --- 136,142 ---- #include #endif ! //#include "netutil.h" #define NBASE_MAX_ERR_STR_LEN 1024 /* Max length of an error message */ *************** *** 2961,2966 **** --- 2962,2971 ---- return NULL; } + + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif /* Takes an IPv4 destination address (dst) and tries to determine the * source address and interface necessary to route to this address. *** ./nmap.h.ORIG Wed Dec 14 23:13:24 2011 --- ./nmap.h Wed Dec 14 23:15:56 2011 *************** *** 208,213 **** --- 208,214 ---- #include /* defines n_long needed for netinet/ip.h */ #define NETINET_IN_SYSTM_H #endif + #include "dnet.h" #ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ #include #define NETINET_IP_H *** ./tcpip.cc.ORIG Wed Dec 14 23:16:18 2011 --- ./tcpip.cc Wed Dec 14 23:43:21 2011 *************** *** 94,109 **** #include "nmap_winconfig.h" #endif #include "nbase.h" #include "portreasons.h" - #include - #include #include "tcpip.h" #include "NmapOps.h" #include "Target.h" #include "utils.h" - #if HAVE_SYS_TIME_H #include #endif --- 94,109 ---- #include "nmap_winconfig.h" #endif + #include "dnet.h" #include "nbase.h" #include "portreasons.h" #include "tcpip.h" + #include /* Needed before net/if_arp.h on AIX < 6 */ + #include #include "NmapOps.h" #include "Target.h" #include "utils.h" #if HAVE_SYS_TIME_H #include #endif *************** *** 379,393 **** // 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, const u8 *ipopt, ! int ipoptlen, int ip_tos, int ip_id, int ip_off, int ip_ttl, int 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_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; --- 379,393 ---- // 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, const u8 *ipopt, ! int AIXipoptlen, int AIXip_tos, int AIXip_id, int ip_off, int ip_ttl, int ip_p, const struct in_addr *ip_src, const struct in_addr *ip_dst) { ip->ip_v = 4; ! ip->ip_hl = 5 + (AIXipoptlen / 4); ! ip->ip_tos = AIXip_tos; ip->ip_len = htons(packetlen); ! ip->ip_id = htons(AIXip_id); ip->ip_off = htons(ip_off); ip->ip_ttl = ip_ttl; ip->ip_p = ip_p; *************** *** 394,404 **** ip->ip_src.s_addr = ip_src->s_addr; ip->ip_dst.s_addr = ip_dst->s_addr; ! if (ipoptlen) ! memcpy((u8 *) ip + sizeof(struct ip), ipopt, ipoptlen); // ip options source routing hack: ! if (ipoptlen && o.ipopt_firsthop && o.ipopt_lasthop) { u8 *ipo = (u8 *) ip + sizeof(struct ip); struct in_addr *newdst = (struct in_addr *) &ipo[o.ipopt_firsthop]; struct in_addr *olddst = (struct in_addr *) &ipo[o.ipopt_lasthop]; --- 394,404 ---- ip->ip_src.s_addr = ip_src->s_addr; ip->ip_dst.s_addr = ip_dst->s_addr; ! if (AIXipoptlen) ! memcpy((u8 *) ip + sizeof(struct ip), ipopt, AIXipoptlen); // ip options source routing hack: ! if (AIXipoptlen && o.ipopt_firsthop && o.ipopt_lasthop) { u8 *ipo = (u8 *) ip + sizeof(struct ip); struct in_addr *newdst = (struct in_addr *) &ipo[o.ipopt_firsthop]; struct in_addr *olddst = (struct in_addr *) &ipo[o.ipopt_lasthop]; *************** *** 412,420 **** #if HAVE_IP_IP_SUM ip->ip_sum = 0; ip->ip_sum = ! in_cksum((unsigned short *) ip, sizeof(struct ip) + ipoptlen); #endif ! return (sizeof(struct ip) + ipoptlen); } --- 412,420 ---- #if HAVE_IP_IP_SUM ip->ip_sum = 0; ip->ip_sum = ! in_cksum((unsigned short *) ip, sizeof(struct ip) + AIXipoptlen); #endif ! return (sizeof(struct ip) + AIXipoptlen); } *** ./nse_nsock.cc.ORIG Wed Dec 14 23:19:53 2011 --- ./nse_nsock.cc Wed Dec 14 23:20:32 2011 *************** *** 24,29 **** --- 24,33 ---- #include #include + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + #define NMAP_NSOCK_SOCKET "NMAP_NSOCK_SOCKET" #define NMAP_NSOCK_PCAP_SOCKET "NMAP_NSOCK_PCAP_SOCKET" *** ./traceroute.cc.ORIG Wed Dec 14 23:20:48 2011 --- ./traceroute.cc Wed Dec 14 23:21:00 2011 *************** *** 145,150 **** --- 145,154 ---- #include #include + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + extern NmapOps o; /* The highest TTL we go up to if the target itself doesn't respond. */ *** ./nmap_rpc.cc.ORIG Wed Dec 14 23:21:21 2011 --- ./nmap_rpc.cc Wed Dec 14 23:21:33 2011 *************** *** 102,107 **** --- 102,111 ---- #include "utils.h" #include "nbase.h" + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + extern NmapOps o; static struct rpc_info ri; static int udp_rpc_socket = -1; *** ./TargetGroup.cc.ORIG Wed Dec 14 23:22:17 2011 --- ./TargetGroup.cc Wed Dec 14 23:22:48 2011 *************** *** 92,97 **** --- 92,98 ---- /* $Id: TargetGroup.cc 21904 2011-01-21 00:04:16Z fyodor $ */ + #include "dnet.h" #include "tcpip.h" #include "TargetGroup.h" #include "NmapOps.h" *** ./ncat/ncat_main.c.ORIG Thu Dec 15 22:56:31 2011 --- ./ncat/ncat_main.c Thu Dec 15 22:57:24 2011 *************** *** 112,117 **** --- 112,121 ---- #include #endif + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + static int ncat_connect_mode(void); static int ncat_listen_mode(void); *** ./ncat/ncat_connect.c.ORIG Thu Dec 15 22:57:58 2011 --- ./ncat/ncat_connect.c Thu Dec 15 22:58:11 2011 *************** *** 110,115 **** --- 110,119 ---- #include #endif + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + struct conn_state { nsock_iod sock_nsi; nsock_iod stdin_nsi; *** ./ncat/ncat_listen.c.ORIG Thu Dec 15 22:58:21 2011 --- ./ncat/ncat_listen.c Thu Dec 15 22:58:32 2011 *************** *** 111,116 **** --- 111,120 ---- #include #endif + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + /* read_fds is the clients we are accepting data from. broadcast_fds is the clients were are sending data to. broadcast_fds doesn't include the listening socket and stdin. Network clients are not added to read_fds when --send-only *** ./ncat/ncat_proxy.c.ORIG Thu Dec 15 22:58:47 2011 --- ./ncat/ncat_proxy.c Thu Dec 15 22:59:01 2011 *************** *** 97,102 **** --- 97,106 ---- #include #endif + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + #ifndef WIN32 /* SIG_CHLD handler */ static void proxyreaper(int signo) *** ./ncat/util.c.ORIG Thu Dec 15 22:59:09 2011 --- ./ncat/util.c Thu Dec 15 22:59:19 2011 *************** *** 110,115 **** --- 110,119 ---- #include #endif + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + /* safely add 2 size_t */ size_t sadd(size_t l, size_t r) { *** ./ncat/configure.ORIG Thu Dec 15 22:59:39 2011 --- ./ncat/configure Thu Dec 15 23:00:03 2011 *************** *** 4147,4153 **** esac - $as_echo "#define malloc rpl_malloc" >>confdefs.h fi --- 4147,4152 ---- *************** *** 4214,4220 **** esac - $as_echo "#define realloc rpl_realloc" >>confdefs.h fi --- 4213,4218 ---- *** ./nping/nping.cc.ORIG Thu Dec 15 23:24:44 2011 --- ./nping/nping.cc Thu Dec 15 23:25:19 2011 *************** *** 88,93 **** --- 88,94 ---- * * ***************************************************************************/ + #include "dnet.h" #include "nping.h" #include "output.h" #include "NpingOps.h" *************** *** 102,108 **** #include "EchoServer.h" #include "ProbeMode.h" #include "common.h" - #include "dnet.h" #include "pcap.h" #include #include --- 103,108 ---- *** ./nping/EchoServer.cc.ORIG Thu Dec 15 23:43:42 2011 --- ./nping/EchoServer.cc Thu Dec 15 23:44:08 2011 *************** *** 98,103 **** --- 98,107 ---- #include "ProbeMode.h" #include + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + extern NpingOps o; extern EchoServer es; *** ./nping/utils_net.cc.ORIG Thu Dec 15 23:44:46 2011 --- ./nping/utils_net.cc Thu Dec 22 00:54:08 2011 *************** *** 87,92 **** --- 87,94 ---- * included with Nmap. * * * ***************************************************************************/ + #include "dnet.h" + #include #include "nping.h" #include "utils.h" #include "utils_net.h" *************** *** 95,102 **** #include "output.h" #include "nbase.h" #include "pcap.h" - #include "dnet.h" #include extern NpingOps o; --- 97,107 ---- #include "output.h" #include "nbase.h" #include "pcap.h" #include + + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif extern NpingOps o; *** ./nping/ProbeMode.cc.ORIG Thu Dec 15 23:45:15 2011 --- ./nping/ProbeMode.cc Thu Dec 15 23:45:30 2011 *************** *** 95,100 **** --- 95,104 ---- #include "NpingOps.h" #include "IPv4Header.h" + #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61)) + #define ss_family __ss_family + #endif + extern NpingOps o; *** ./nping/IPv4Header.cc.ORIG Thu Dec 15 23:45:53 2011 --- ./nping/IPv4Header.cc Thu Dec 22 00:47:43 2011 *************** *** 89,99 **** * * ***************************************************************************/ #include "IPv4Header.h" #include "nping.h" #include "common.h" #include "common_modified.h" - #include "dnet.h" #include "utils_net.h" --- 89,99 ---- * * ***************************************************************************/ + #include "dnet.h" #include "IPv4Header.h" #include "nping.h" #include "common.h" #include "common_modified.h" #include "utils_net.h" *** ./nping/utils_net.h.ORIG Thu Dec 22 00:45:27 2011 --- ./nping/utils_net.h Thu Dec 22 00:52:50 2011 *************** *** 98,104 **** #define NETINET_IN_SYSTM_H #endif #ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ ! #include #define NETINET_IP_H #endif --- 98,104 ---- #define NETINET_IN_SYSTM_H #endif #ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ ! #include "dnet.h" #define NETINET_IP_H #endif