[Javanetsim-cvs] IceScan csubtarget.h,1.9,1.10
Status: Beta
Brought to you by:
darkkey
From: QweR <qw...@us...> - 2006-12-13 02:27:23
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1785 Modified Files: csubtarget.h Log Message: Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** csubtarget.h 12 Dec 2006 20:40:19 -0000 1.9 --- csubtarget.h 13 Dec 2006 02:27:18 -0000 1.10 *************** *** 14,19 **** #include "iceprotocol.h" ! #define CONNECT_TIMEOUT 24 ! #define ICE_FD_SETSIZE (1024) #define MAX_CLOSED 7 --- 14,19 ---- #include "iceprotocol.h" ! #define CONNECT_TIMEOUT 7 ! #define ICE_FD_SETSIZE (128) #define MAX_CLOSED 7 *************** *** 78,83 **** DBGOUTPUT("!!!!"); ! this->hostname = hostname; ! this->reversed_hostname = reverse_hostname; this->par = par; this->out = out; --- 78,83 ---- DBGOUTPUT("!!!!"); ! this->hostname.assign(hostname); ! this->reversed_hostname.assign(reverse_hostname); this->par = par; this->out = out; *************** *** 111,115 **** cprotocol_scan cps(par, out); ! //cps.test(hostname.c_str()); } --- 111,115 ---- cprotocol_scan cps(par, out); ! // cps.test(hostname.c_str()); } *************** *** 156,160 **** } int j = initiate_connect(scanning_ports); ! DBGOUTPUT(j); while( ! do_select_round(scanning_ports, subtarget_ports) ) usleep(1000); --- 156,160 ---- } int j = initiate_connect(scanning_ports); ! //DBGOUTPUT(j); while( ! do_select_round(scanning_ports, subtarget_ports) ) usleep(1000); *************** *** 180,184 **** sockets_size = ICE_FD_SETSIZE*2/3; ! scan_sockets = (struct scan_socket *) malloc(sockets_size); for(int i = 0; i < sockets_size; i++){ --- 180,184 ---- sockets_size = ICE_FD_SETSIZE*2/3; ! scan_sockets = (struct scan_socket *) malloc(sizeof(scan_socket) * (sockets_size+1)); for(int i = 0; i < sockets_size; i++){ *************** *** 242,246 **** for(i = scanning_ports.begin(); i!= scanning_ports.end(); ++i){ //check FD_SET ! DBGOUTPUT((*i).first); if((*i).second.socket_ptr != -1){ DBGOUTPUT("!!!!!"); --- 242,246 ---- for(i = scanning_ports.begin(); i!= scanning_ports.end(); ++i){ //check FD_SET ! //DBGOUTPUT((*i).first); if((*i).second.socket_ptr != -1){ DBGOUTPUT("!!!!!"); *************** *** 364,368 **** //(++scanning_ports.rend())->second.c->get_socketid() err = errno; ! //perror("select"); DBGOUTPUT(s); }while(s = -1 && err == EINTR); --- 364,368 ---- //(++scanning_ports.rend())->second.c->get_socketid() err = errno; ! // perror("select"); DBGOUTPUT(s); }while(s = -1 && err == EINTR); *************** *** 373,377 **** if((*i).second.done) continue; - if( (*i).second.socket_ptr == -1){ idle_status_dispatcher(scanning_ports, (*i).first); --- 373,376 ---- *************** *** 379,392 **** continue; } - enum port_status status = PORT_UNKNOWN; - - if(s >= 0 && (FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_rtmp) || FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_wtmp) || FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_xtmp))){ ! DBGOUTPUT( (*i).second.socket_ptr); csocket c(AF_INET, (int) domain, scan_sockets[(*i).second.socket_ptr].sid); --- 378,388 ---- continue; } enum port_status status = PORT_UNKNOWN; if(s >= 0 && (FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_rtmp) || FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_wtmp) || FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_xtmp))){ ! // DBGOUTPUT( (*i).second.socket_ptr); csocket c(AF_INET, (int) domain, scan_sockets[(*i).second.socket_ptr].sid); *************** *** 394,408 **** c.getsockopt(SOL_SOCKET, SO_ERROR, (char *) &sopt, (socklen_t *) &soptlen); ! DBGOUTPUT("!!!!"); ! ! switch(sopt){ ! case 0: if(FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_r)){ status = PORT_OPEN; }else{ ! DBGOUTPUT("WRITE"); usleep(20000); res = c.write("", 0, 0); ! DBGOUTPUT("/WRITE" << res); if(res < 0){ status = PORT_CLOSED; --- 390,407 ---- c.getsockopt(SOL_SOCKET, SO_ERROR, (char *) &sopt, (socklen_t *) &soptlen); ! // DBGOUTPUT("!!!!"); ! switch(sopt){ ! case 0: ! #ifdef __CYGWIN__ ! if(false){ ! #else if(FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_r)){ status = PORT_OPEN; + #endif }else{ ! //DBGOUTPUT("WRITE"); usleep(20000); res = c.write("", 0, 0); ! //DBGOUTPUT("/WRITE" << res); if(res < 0){ status = PORT_CLOSED; *************** *** 431,440 **** sp.port_number = (*i).first; ! DBGOUTPUT("!!!!"); sp.status = status; subtarget_ports.push_back(sp); ! DBGOUTPUT("very well"); print_port_status(sp.port_number, status); --- 430,439 ---- sp.port_number = (*i).first; ! // DBGOUTPUT("!!!!"); sp.status = status; subtarget_ports.push_back(sp); ! // DBGOUTPUT("very well"); print_port_status(sp.port_number, status); *************** *** 444,448 **** (*i).second.socket_ptr = -1; ! DBGOUTPUT("Erasing... :" << status); //scanning_ports.erase(i++); --- 443,447 ---- (*i).second.socket_ptr = -1; ! // DBGOUTPUT("Erasing... :" << status); //scanning_ports.erase(i++); |