Skip to content

Commit

Permalink
add 'truncate' option to config file and update man page
Browse files Browse the repository at this point in the history
  • Loading branch information
synfinatic committed Jul 18, 2003
1 parent 83d8070 commit c80e512
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
21 changes: 15 additions & 6 deletions man/tcpreplay.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $Id: tcpreplay.8,v 1.10 2003/07/16 22:30:39 aturner Exp $
.\" $Id: tcpreplay.8,v 1.11 2003/07/18 00:06:39 aturner Exp $
.TH TCPREPLAY 8
.SH NAME
tcpreplay \- replay packets from capture files
Expand Down Expand Up @@ -49,7 +49,9 @@ tcpreplay \- replay packets from capture files
] [
.B \-t
.I MTU
[ ]
] [
.B \-T
] [
.B \-C
CIDR...
] [
Expand Down Expand Up @@ -166,11 +168,18 @@ the IP header as necessary.
Specify the MTU in bytes of the interface(s) being used. Default is 1500 which
is standard for 10/100 Ethernet.
.TP
.B \-T or "truncate"
If a packet is larger then the MTU of the interface, the frame will be truncated
so that it can be sent. With out this, these frames are skipped. Not to be
confused with -u which pads/truncates packets which are larger then the snaplen
used to capture the packet.
.TP
.B \-u or "untruncate"
When a packet is truncated in the capture file, this option will
\fIpad\fR the end of the packet with zeros, or truncate (\fItrunc\fR)
it by re-adjusting the length in the IP header. The \fItrunc\fR
option will only alter IPv4 packets, all others will be sent unmodified.
When a packet is truncated in the capture file because the snaplen was too small,
this option will \fIpad\fR the end of the packet with zeros, or
truncate (\fItrunc\fR) it by re-adjusting the length in the IP header.
The \fItrunc\fR option will only alter IPv4 packets, all others will be sent
unmodified.
.TP
.B \-v or "verbose"
.br
Expand Down
5 changes: 4 additions & 1 deletion tcpreplay.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: tcpreplay.c,v 1.67 2003/07/18 00:01:28 aturner Exp $ */
/* $Id: tcpreplay.c,v 1.68 2003/07/18 00:06:39 aturner Exp $ */

/*
* Copyright (c) 2001, 2002, 2003 Aaron Turner, Matt Bing.
Expand Down Expand Up @@ -627,6 +627,9 @@ configfile(char *file)
else if (ARGS("verbose", 1)) {
options.verbose++;
}
else if (ARGS("truncate", 1)) {
options.truncate = 1;
}
else if (ARGS("untruncate", 2)) {
if (strcmp("pad", argv[1]) == 0) {
options.trunc = PAD_PACKET;
Expand Down

0 comments on commit c80e512

Please sign in to comment.