From Michael Tuexen:
The -S option has been changed such that the payload protocol identifier can be specified instead of the verification tag. The error messages for -s -S have been corrected. Update the text2pcap man page to reflect the "-S" change. svn path=/trunk/; revision=5150
This commit is contained in:
parent
4fc2cbb888
commit
c3b66ffa9c
|
@ -137,17 +137,23 @@ appropriate Ethernet and IP headers with each packet. Example: I<-u
|
||||||
|
|
||||||
=item -s srcport,destport,tag
|
=item -s srcport,destport,tag
|
||||||
|
|
||||||
Include dummy SCTP headers before each packet. Specify the source and
|
Include dummy SCTP headers before each packet. Specify, in decimal, the
|
||||||
destination SCTP ports, and verification tag, for the packet in decimal.
|
source and destination SCTP ports, and verification tag, for the packet.
|
||||||
Use this option if your dump is the SCTP payload of a packet but does not
|
Use this option if your dump is the SCTP payload of a packet but does
|
||||||
include any SCTP, IP or Ethernet headers. Note that this automatically
|
not include any SCTP, IP or Ethernet headers. Note that this
|
||||||
includes appropriate Ethernet and IP headers with each packet. A CRC32C
|
automatically includes appropriate Ethernet and IP headers with each
|
||||||
checksum will be put into the SCTP header.
|
packet. A CRC32C checksum will be put into the SCTP header.
|
||||||
|
|
||||||
=item -S srcport,destport,tag
|
=item -S srcport,destport,ppi
|
||||||
|
|
||||||
Like B<-s>, but it also includes the DATA chunk header, for input files
|
Include dummy SCTP headers before each packet. Specify, in decimal, the
|
||||||
that contain only the SCTP payload.
|
source and destination SCTP ports, and a verification tag of 0, for the
|
||||||
|
packet, and prepend a dummy SCTP DATA chunk header with a payload
|
||||||
|
protocol identifier if I<ppi>. Use this option if your dump is the SCTP
|
||||||
|
payload of a packet but does not include any SCTP, IP or Ethernet
|
||||||
|
headers. Note that this automatically includes appropriate Ethernet and
|
||||||
|
IP headers with each packet. A CRC32C checksum will be put into the
|
||||||
|
SCTP header.
|
||||||
|
|
||||||
=item -t timefmt
|
=item -t timefmt
|
||||||
|
|
||||||
|
|
54
text2pcap.c
54
text2pcap.c
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com>
|
* (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com>
|
||||||
*
|
*
|
||||||
* $Id: text2pcap.c,v 1.14 2002/01/30 10:19:43 guy Exp $
|
* $Id: text2pcap.c,v 1.15 2002/04/13 18:36:23 guy Exp $
|
||||||
*
|
*
|
||||||
* Ethereal - Network traffic analyzer
|
* Ethereal - Network traffic analyzer
|
||||||
* By Gerald Combs <gerald@ethereal.com>
|
* By Gerald Combs <gerald@ethereal.com>
|
||||||
|
@ -941,7 +941,9 @@ help (char *progname)
|
||||||
" verification tag (in DECIMAL).\n"
|
" verification tag (in DECIMAL).\n"
|
||||||
" Automatically prepends Ethernet and IP headers as well\n"
|
" Automatically prepends Ethernet and IP headers as well\n"
|
||||||
" Example: -s 30,40,34\n"
|
" Example: -s 30,40,34\n"
|
||||||
" -S srcp,dstp,tag: Same as -s srcp,dstp,tag but also prepends a DATA chunk header.\n"
|
" -S srcp,dstp,ppi: Prepend dummy SCTP header with specified dest/source ports and\n"
|
||||||
|
" verification tag 0. It also prepends a dummy SCTP DATA chunk header\n"
|
||||||
|
" with payload protocol identifier ppi.\n"
|
||||||
" Example: -S 30,40,34\n"
|
" Example: -S 30,40,34\n"
|
||||||
" -t timefmt : Treats the text before the packet as a date/time code; the\n"
|
" -t timefmt : Treats the text before the packet as a date/time code; the\n"
|
||||||
" specified argument is a format string of the sort supported\n"
|
" specified argument is a format string of the sort supported\n"
|
||||||
|
@ -999,11 +1001,45 @@ parse_options (int argc, char *argv[])
|
||||||
hdr_ethernet_proto = 0x800;
|
hdr_ethernet_proto = 0x800;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
|
||||||
hdr_data_chunk = TRUE;
|
|
||||||
case 's':
|
case 's':
|
||||||
hdr_sctp = TRUE;
|
hdr_sctp = TRUE;
|
||||||
hdr_sctp_src = strtol(optarg, &p, 10);
|
hdr_sctp_src = strtol(optarg, &p, 10);
|
||||||
|
if (p == optarg || (*p != ',' && *p != '\0')) {
|
||||||
|
fprintf(stderr, "Bad src port for '-%c'\n", c);
|
||||||
|
help(argv[0]);
|
||||||
|
}
|
||||||
|
if (*p == '\0') {
|
||||||
|
fprintf(stderr, "No dest port specified for '-%c'\n", c);
|
||||||
|
help(argv[0]);
|
||||||
|
}
|
||||||
|
p++;
|
||||||
|
optarg = p;
|
||||||
|
hdr_sctp_dest = strtol(optarg, &p, 10);
|
||||||
|
if (p == optarg || (*p != ',' && *p != '\0')) {
|
||||||
|
fprintf(stderr, "Bad dest port for '-s'\n");
|
||||||
|
help(argv[0]);
|
||||||
|
}
|
||||||
|
if (*p == '\0') {
|
||||||
|
fprintf(stderr, "No tag specified for '-%c'\n", c);
|
||||||
|
help(argv[0]);
|
||||||
|
}
|
||||||
|
p++;
|
||||||
|
optarg = p;
|
||||||
|
hdr_sctp_tag = strtol(optarg, &p, 10);
|
||||||
|
if (p == optarg || *p != '\0') {
|
||||||
|
fprintf(stderr, "Bad tag for '-%c'\n", c);
|
||||||
|
help(argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
hdr_ip = TRUE;
|
||||||
|
hdr_ip_proto = 132;
|
||||||
|
hdr_ethernet = TRUE;
|
||||||
|
hdr_ethernet_proto = 0x800;
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
hdr_sctp = TRUE;
|
||||||
|
hdr_data_chunk = TRUE;
|
||||||
|
hdr_sctp_src = strtol(optarg, &p, 10);
|
||||||
if (p == optarg || (*p != ',' && *p != '\0')) {
|
if (p == optarg || (*p != ',' && *p != '\0')) {
|
||||||
fprintf(stderr, "Bad src port for '-%c'\n", c);
|
fprintf(stderr, "Bad src port for '-%c'\n", c);
|
||||||
help(argv[0]);
|
help(argv[0]);
|
||||||
|
@ -1019,14 +1055,14 @@ parse_options (int argc, char *argv[])
|
||||||
fprintf(stderr, "Bad dest port for '-s'\n");
|
fprintf(stderr, "Bad dest port for '-s'\n");
|
||||||
help(argv[0]);
|
help(argv[0]);
|
||||||
} if (*p == '\0') {
|
} if (*p == '\0') {
|
||||||
fprintf(stderr, "No dest port specified for '-%c'\n", c);
|
fprintf(stderr, "No ppi specified for '-%c'\n", c);
|
||||||
help(argv[0]);
|
help(argv[0]);
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
optarg = p;
|
optarg = p;
|
||||||
hdr_sctp_tag = strtol(optarg, &p, 10);
|
hdr_data_chunk_ppid = strtol(optarg, &p, 10);
|
||||||
if (p == optarg || *p != '\0') {
|
if (p == optarg || *p != '\0') {
|
||||||
fprintf(stderr, "Bad tag for '-%c'\n", c);
|
fprintf(stderr, "Bad ppi for '-%c'\n", c);
|
||||||
help(argv[0]);
|
help(argv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue