1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

Make the line for received packets consistent in all modes. Before, RECV was being displayed for some modes. This was a suggestion made by Martin Koeppe (http://seclists.org/nmap-dev/2015/q4/206)

This commit is contained in:
luis
2015-12-12 22:34:23 +00:00
parent 3567d72b17
commit adc8e7be1c

View File

@@ -1962,13 +1962,13 @@ void ProbeMode::probe_tcpconnect_event_handler(nsock_pool nsp, nsock_event nse,
trg=o.targets.findTarget( &peer );
if(trg!=NULL){
if ( trg->getSuppliedHostName() )
nping_print(VB_0,"RECV (%.4fs) Handshake with %s:%d (%s:%d) completed",
nping_print(VB_0,"RCVD (%.4fs) Handshake with %s:%d (%s:%d) completed",
o.stats.elapsedRuntime(t), trg->getSuppliedHostName(), peerport, ipstring, peerport );
else
nping_print(VB_0,"RECV (%.4fs) Handshake with %s:%d completed", o.stats.elapsedRuntime(t), ipstring, peerport );
nping_print(VB_0,"RCVD (%.4fs) Handshake with %s:%d completed", o.stats.elapsedRuntime(t), ipstring, peerport );
trg->setProbeRecvTCP( peerport , 0);
}else{
nping_print(VB_0,"RECV (%.4fs) Handshake with %s:%d completed", o.stats.elapsedRuntime(t), ipstring, peerport );
nping_print(VB_0,"RCVD (%.4fs) Handshake with %s:%d completed", o.stats.elapsedRuntime(t), ipstring, peerport );
}
o.stats.addRecvPacket(40); /* Estimation Dst>We 1 TCP SYN|ACK */
break;
@@ -2061,7 +2061,7 @@ void ProbeMode::probe_tcpconnect_event_handler(nsock_pool nsp, nsock_event nse,
inet_ntop(AF_INET, &peer4->sin_addr, ipstring, sizeof(ipstring));
peerport=ntohs(peer4->sin_port);
}
nping_print(VB_0,"RECV (%.4fs) Possible TCP RST received from %s:%d --> %s", o.stats.elapsedRuntime(t),ipstring, peerport, strerror(nse_errorcode(nse)) );
nping_print(VB_0,"RCVD (%.4fs) Possible TCP RST received from %s:%d --> %s", o.stats.elapsedRuntime(t),ipstring, peerport, strerror(nse_errorcode(nse)) );
}
else
nping_warning(QT_2,"ERR: (%.4fs) %s to %s:%d failed: %s", o.stats.elapsedRuntime(t), nse_type2str(type), ipstring, peerport, strerror(socket_errno()));
@@ -2306,12 +2306,12 @@ void ProbeMode::probe_udpunpriv_event_handler(nsock_pool nsp, nsock_event nse, v
trg=o.targets.findTarget( &peer );
if(trg!=NULL){
if ( trg->getSuppliedHostName() )
nping_print(VB_0,"RECV (%.4fs) UDP packet with %d bytes from %s:%d (%s:%d)", o.stats.elapsedRuntime(NULL), readbytes, trg->getSuppliedHostName(), peerport, ipstring, peerport );
nping_print(VB_0,"RCVD (%.4fs) UDP packet with %d bytes from %s:%d (%s:%d)", o.stats.elapsedRuntime(NULL), readbytes, trg->getSuppliedHostName(), peerport, ipstring, peerport );
else
nping_print(VB_0,"RECV (%.4fs) UDP packet with %d bytes from %s:%d", o.stats.elapsedRuntime(NULL), readbytes, ipstring, peerport );
nping_print(VB_0,"RCVD (%.4fs) UDP packet with %d bytes from %s:%d", o.stats.elapsedRuntime(NULL), readbytes, ipstring, peerport );
trg->setProbeRecvUDP(peerport, 0);
}else{
nping_print(VB_0,"RECV (%.4fs) UDP packet with %d bytes from %s:%d", o.stats.elapsedRuntime(t), readbytes, ipstring, peerport );
nping_print(VB_0,"RCVD (%.4fs) UDP packet with %d bytes from %s:%d", o.stats.elapsedRuntime(t), readbytes, ipstring, peerport );
}
o.stats.addRecvPacket(readbytes);
break;