[Javanetsim-cvs] IceScan icescan.cc, 1.25, 1.26 udpscan.h, 1.3, 1.4 icediscover.h, 1.18, 1.19 csubt
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-16 10:23:10
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv529 Modified Files: icescan.cc udpscan.h icediscover.h csubtarget.h Log Message: no message Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** icescan.cc 16 Dec 2006 10:02:50 -0000 1.25 --- icescan.cc 16 Dec 2006 10:23:07 -0000 1.26 *************** *** 17,22 **** "\t-PA: ACK Ping host discovery\n" "\t-PR: ARP host discovery\n" ! "\t-PE: ICMP Echo (aka standart ping) host discovery\n" ! "\t-PT: ICMP Timestamp host discovery\n" "\t-r: no reverse-dns lookups\n" "SCAN TYPES:\n" --- 17,21 ---- "\t-PA: ACK Ping host discovery\n" "\t-PR: ARP host discovery\n" ! "\t-PE/PT/PM: ICMP Echo/Timestamp/Mask host discovery\n" "\t-r: no reverse-dns lookups\n" "SCAN TYPES:\n" *************** *** 201,204 **** --- 200,207 ---- par->icmp_timestamp_ping_discovery = true; break; + + case 'M': + par->icmp_mask_ping_discovery = true; + break; default: Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** csubtarget.h 16 Dec 2006 10:02:50 -0000 1.28 --- csubtarget.h 16 Dec 2006 10:23:07 -0000 1.29 *************** *** 412,418 **** int recvsize = UDP_SCAN_RECVSIZE; ! sudp.bind(hostname.c_str(), sudp.getMagicPort(), 0); sudp.nonblock(true); sicmp.nonblock(true); //sicmp.setsockopt(SOL_SOCKET, SO_RCVBUF, &recvsize, sizeof(recvsize)); // sicmp.setsockopt(SOL_SOCKET, SO_RCVBUF, &recvsize, sizeof(recvsize)); --- 412,424 ---- int recvsize = UDP_SCAN_RECVSIZE; ! sudp.bind(hostname.c_str(), 0, 0); sudp.nonblock(true); sicmp.nonblock(true); + + int size = 60 * 1024; + int attempts = 0; + + setsockopt(SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); + //sicmp.setsockopt(SOL_SOCKET, SO_RCVBUF, &recvsize, sizeof(recvsize)); // sicmp.setsockopt(SOL_SOCKET, SO_RCVBUF, &recvsize, sizeof(recvsize)); Index: icediscover.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icediscover.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** icediscover.h 16 Dec 2006 10:02:50 -0000 1.18 --- icediscover.h 16 Dec 2006 10:23:07 -0000 1.19 *************** *** 13,17 **** #define ATTEMPTS 5 ! enum Icmp_type {ECHO, TIMESTAMP}; bool tcp_ack_ping(const char *hostname, iceparams *par, iceoutput *out){ --- 13,17 ---- #define ATTEMPTS 5 ! enum Icmp_type {ECHO, TIMESTAMP, MASK}; bool tcp_ack_ping(const char *hostname, iceparams *par, iceoutput *out){ *************** *** 66,76 **** char buf[sizeof(struct timeval) + 1]; if(icmp_type == ECHO){ gettimeofday( ( struct timeval *) buf, NULL); if(par->verbose>0) out->line("Sending icmp ping host discovery request (echo_request)..."); }else if(icmp_type == TIMESTAMP){ ! if(par->verbose>0) out->line("Sending icmp timestamp host discovery request..."); ! bzero(buf, sizeof(struct timeval) + 1); msg_type = ICMP_TSTAMP; } --- 66,80 ---- char buf[sizeof(struct timeval) + 1]; + bzero(buf, sizeof(struct timeval) + 1); + if(icmp_type == ECHO){ gettimeofday( ( struct timeval *) buf, NULL); if(par->verbose>0) out->line("Sending icmp ping host discovery request (echo_request)..."); }else if(icmp_type == TIMESTAMP){ ! if(par->verbose>0) out->line("Sending icmp timestamp host discovery request..."); msg_type = ICMP_TSTAMP; + }else if(icmp_type == MASK){ + if(par->verbose>0) out->line("Sending icmp netmask host discovery request..."); + msg_type = ICMP_MASKREQ; } *************** *** 107,110 **** --- 111,121 ---- *out << "Recieved icmp timestamp host discovery reply: " << make_uptime(t) << ".\n"; } + }else if(icmp -> icmp_type == ICMP_MASKREPLY && icmp_type == MASK){ + result = true; + if(par->verbose>0){ + char netmask[24]; + sprintf(netmask, "%08x", ntohl(icmp->icmp_mask)); + *out << "Recieved icmp netmask host discovery reply: " << netmask << ".\n"; + } } if(result){ *************** *** 166,169 **** --- 177,182 ---- if(par->icmp_timestamp_ping_discovery) if( icmp_ping(hostname, par, out, TIMESTAMP) ) return true; + + if(par->icmp_mask_ping_discovery) if( icmp_ping(hostname, par, out, MASK) ) return true; if(par->arp_discovery) if( arp_discovery(hostname, par, out) ) return true; Index: udpscan.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/udpscan.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** udpscan.h 16 Dec 2006 10:02:50 -0000 1.3 --- udpscan.h 16 Dec 2006 10:23:07 -0000 1.4 *************** *** 72,75 **** --- 72,77 ---- int size = 60 * 1024; int attempts = 0; + + r.setsockopt(SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); |