Ethereal-users: Re: [Ethereal-users] Questions on Text2Pcap

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 31 Jul 2001 12:23:02 -0700 (PDT)
> Does anyone know if the text2pcap utility has a problem

It does.  The problem is that

	1) it's assuming that a program using "getopt()" can support
	   multiple arguments to a flag, of the sort that "-u" is
	   documented as taking - perhaps some implementations of
	   "getopt()" would let you do that by changing "optind" out
	   from under it, but I don't see anything in, say, the Solaris
	   2.6 "getopt(3C)" man page (which came from the AT&T man page,
	   and AT&T did "getopt()" originally) to indicate that it's
	   required to work, so it may well not work;

	2) it's not even changing "optind" out from under "getopt()".

The command-line option syntax specification that AT&T did didn't allow
a flag to take multiple arguments, as I remember.

Therefore, "162" was treated as a file name, not a UDP port number.

"text2pcap" should be fixed to, instead, take a single argument with a
comma-separated pair of port numbers, so you'd do

	text2pcap -u 161,162 file.txt