[Javanetsim-cvs] IceScan iceoutput.h, 1.1, 1.2 icescan.cc, 1.1, 1.2 icediscover.h, 1.1, 1.2
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-11-28 18:59:21
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30003 Modified Files: iceoutput.h icescan.cc icediscover.h Log Message: no message Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** icescan.cc 28 Nov 2006 17:57:54 -0000 1.1 --- icescan.cc 28 Nov 2006 18:59:18 -0000 1.2 *************** *** 177,180 **** --- 177,181 ---- } + const char iceoutput::endl[] = "\n"; int main(int argc, char *argv[]){ *************** *** 183,187 **** iceparams par; ! ice_service_name_database isnd("services"); char version_string[255]; --- 184,188 ---- iceparams par; ! ice_service_name_database isnd("services"); char version_string[255]; *************** *** 190,212 **** std::cout << version_string << std::endl; ! ! ! if(! parse_input(argc, argv, &par) ) ! return 1; ! ! //return 0; ! ! //DBGOUTPUT((par.verbose)); ! ! par.by_default_init(); ! ! ctarget t(par.target, &par, &out, &isnd); ! t.discover(); ! t.scan(); ! ! //DBGOUTPUT("Finishing...."); ! return 0; } --- 191,207 ---- std::cout << version_string << std::endl; ! ! ! if(! parse_input(argc, argv, &par) ) ! return 1; ! ! par.by_default_init(); ! ! ctarget t(par.target, &par, &out, &isnd); ! t.discover(); ! t.scan(); ! return 0; } Index: icediscover.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icediscover.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** icediscover.h 28 Nov 2006 17:57:54 -0000 1.1 --- icediscover.h 28 Nov 2006 18:59:18 -0000 1.2 *************** *** 26,30 **** if(par->verbose>0) ! out->line("Starting ack host discovery (aka ACK ping)..."); int rc = s.connect(hostname, ACK_PING_STANDART_PORT, 4); --- 26,30 ---- if(par->verbose>0) ! *out << "Starting ack host discovery (aka ACK ping)..." << iceoutput::endl; int rc = s.connect(hostname, ACK_PING_STANDART_PORT, 4); *************** *** 33,39 **** if(!rc){ ! if(par->verbose>0) out->line("Ack host discovery successfull!"); return true; ! }else if(par->verbose>0) out->line("Ack host discovery failed!"); return false; --- 33,39 ---- if(!rc){ ! if(par->verbose>0) *out << "Ack host discovery successfull!" << iceoutput::endl; return true; ! }else if(par->verbose>0) *out << "Ack host discovery failed!" << iceoutput::endl; return false; *************** *** 137,153 **** bool host_discover(char *hostname, iceparams *par, iceoutput *out){ - char output_line[1024]; ! if(par->verbose>0){ ! bzero(output_line, 1024); ! sprintf(output_line, "Starting discovery of host %s...", hostname); ! out->line(output_line); ! } ! if( tcp_ack_ping(hostname, par, out) ) return true; ! if( icmp_echo_ping(hostname, par, out) ) return true; ! return false; } --- 137,149 ---- bool host_discover(char *hostname, iceparams *par, iceoutput *out){ ! if(par->verbose>0) ! *out << "Starting discovery of host " << hostname << "...\n"; ! if( tcp_ack_ping(hostname, par, out) ) return true; ! if( icmp_echo_ping(hostname, par, out) ) return true; ! return false; } Index: iceoutput.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/iceoutput.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** iceoutput.h 28 Nov 2006 17:57:54 -0000 1.1 --- iceoutput.h 28 Nov 2006 18:59:18 -0000 1.2 *************** *** 13,19 **** bool xml_output; bool binary_output; ! ! iceoutput(){ ! text_output = true; xml_output = false; binary_output = false; --- 13,22 ---- bool xml_output; bool binary_output; ! ! static const char endl[]; ! ! iceoutput(){ ! ! text_output = true; xml_output = false; binary_output = false; *************** *** 22,28 **** ~iceoutput(){ } - //output(const char *format, ...){ - //} - void line(char *str){ std::cout << str << std::endl; --- 25,28 ---- *************** *** 38,41 **** --- 38,57 ---- void end_table(){ } + + iceoutput &operator<<(const int &i){ + std::cout << i; + } + + iceoutput &operator<<(const char *buf){ + std::cout << buf; + } + + iceoutput &operator<<(const string &str){ + std::cout << str; + } + + iceoutput &operator<<(const double &d){ + std::cout << d; + } }; |