Ticket #443: tcpreplay-3.4.4-units.patch
| File tcpreplay-3.4.4-units.patch, 1.3 KB (added by aturner, 21 months ago) |
|---|
-
tcpreplay-3.4.4/src/send_packets.c
old new 436 436 * a constant 'rate' (bytes per second). 437 437 */ 438 438 if (pkts_sent != 0) { 439 n = (float)len / (options.speed.speed * 10 24 * 1024/ 8); /* convert Mbps to bps */439 n = (float)len / (options.speed.speed * 1000 * 1000 / 8); /* convert Mbps to bps */ 440 440 nap.tv_sec = n; 441 441 nap.tv_nsec = (n - nap.tv_sec) * 1000000000; 442 442 -
tcpreplay-3.4.4/src/common/utils.c
old new 141 141 if (timerisset(&diff)) { 142 142 if (bytes_sent){ 143 143 bytes_sec = bytes_sent / frac_sec; 144 mb_sec = (bytes_sec * 8) / (10 24 * 1024);144 mb_sec = (bytes_sec * 8) / (1000 * 1000); 145 145 } 146 146 if (pkts_sent) 147 147 pkts_sec = pkts_sent / frac_sec; 148 148 } 149 149 printf("Actual: " COUNTER_SPEC " packets (" COUNTER_SPEC " bytes) sent in %.02f seconds.", 150 150 pkts_sent, bytes_sent, frac_sec); 151 printf("\t\tRated: %.1f bps, %.2f Mbps, %.2f pps\n",151 printf("\t\tRated: %.1f Bps, %.2f Mbps, %.2f pps\n", 152 152 bytes_sec, mb_sec, pkts_sec); 153 153 154 154 if (failed)
