diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-04-13 18:36:24 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-04-13 18:36:24 +0000 |
commit | f358efc6510cb50c3781b6e0e0fa4c4fd67da17a (patch) | |
tree | 90b08bf26b370299bc2cb9ff54dae13529d40c91 /text2pcap.c | |
parent | 3a44a1d32e7c094eb6987e95ba643ed329256c08 (diff) |
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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5150 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'text2pcap.c')
-rw-r--r-- | text2pcap.c | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/text2pcap.c b/text2pcap.c index 92f7fcf540..a09f8d1caa 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -6,7 +6,7 @@ * * (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 * By Gerald Combs <gerald@ethereal.com> @@ -941,7 +941,9 @@ help (char *progname) " verification tag (in DECIMAL).\n" " Automatically prepends Ethernet and IP headers as well\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" " -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" @@ -999,11 +1001,9 @@ parse_options (int argc, char *argv[]) hdr_ethernet_proto = 0x800; break; - case 'S': - hdr_data_chunk = TRUE; case 's': - hdr_sctp = TRUE; - hdr_sctp_src = strtol(optarg, &p, 10); + hdr_sctp = TRUE; + 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]); @@ -1018,8 +1018,9 @@ parse_options (int argc, char *argv[]) if (p == optarg || (*p != ',' && *p != '\0')) { fprintf(stderr, "Bad dest port for '-s'\n"); help(argv[0]); - } if (*p == '\0') { - fprintf(stderr, "No dest port specified for '-%c'\n", c); + } + if (*p == '\0') { + fprintf(stderr, "No tag specified for '-%c'\n", c); help(argv[0]); } p++; @@ -1035,6 +1036,41 @@ parse_options (int argc, char *argv[]) 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')) { + 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 ppi specified for '-%c'\n", c); + help(argv[0]); + } + p++; + optarg = p; + hdr_data_chunk_ppid = strtol(optarg, &p, 10); + if (p == optarg || *p != '\0') { + fprintf(stderr, "Bad ppi for '-%c'\n", c); + help(argv[0]); + } + + hdr_ip = TRUE; + hdr_ip_proto = 132; + hdr_ethernet = TRUE; + hdr_ethernet_proto = 0x800; + break; case 't': ts_fmt = optarg; |