Hi all,
I've come across an issue when using the -M option on tcpreplay to
specify the outgoing data rate.
I tend to use tcpreplay to replay pcap files that contain small numbers
of packets, but replay them with -l loops.
The issue that I found was that when replaying pcap files containing
single packets that the -M option would replay at
full speed instead of the requested rate.
Attached is a (very simple!) patch file against tcpreplay-3.0.1. I've
found this useful as it allows me to set rates for my
single packet pcap files.
Patch can be applied from within the tcpreplay-3.0.1 directory using:
patch -p2 < ../tcpreplay-3.0.1.patch
cheers,
Andrew Edgecombe
diff -Naur ./tcpreplay-3.0.1/src/send_packets.c ./tcpreplay-3.0.1.patched/src/send_packets.c
--- ./tcpreplay-3.0.1/src/send_packets.c 2007-05-02 14:40:41.000000000 +1000
+++ ./tcpreplay-3.0.1.patched/src/send_packets.c 2007-05-15 15:05:04.000000000 +1000
@@ -74,13 +74,17 @@
static u_char *get_next_packet(pcap_t *pcap, struct pcap_pkthdr *pkthdr, int file_idx, packet_cache_t **prev_packet);
/*
+ * Global timeval for the timestamp on the last packet sent
+ */
+struct timeval last = { 0, 0 };
+
+/*
* the main loop function. This is where we figure out
* what to do with each packet
*/
void
send_packets(pcap_t *pcap, int cache_file_idx)
{
- struct timeval last = { 0, 0 };
COUNTER packetnum = 0;
struct pcap_pkthdr pkthdr;
const u_char *pktdata = NULL;
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Tcpreplay-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users