Ethereal-dev: [ethereal-dev] Changed RADCOM packet reader not to do "fseek()"s

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: Wed, 1 Sep 1999 16:59:20 -0700 (PDT)
I checked in a change to "wiretap/radcom.c" to read the entire record
header into a structure, and pick out of that structure the fields we
care about, rather than "fseek()"ing around the stuff we don't use.

Some implementations of the standard I/O library routines appear not to
be clever enough to handle seeks that occur within the buffer by moving
the current buffer position; instead, they do a seek on the underlying
file descriptor *and* appear to throw out the buffer, forcing them to do
another read.  (Solaris 2.5.1, at least, has this problem; FreeBSD, and
probably other BSDs, don't have this problem.  I don't know whether
later Solarises, or any other UNIX-flavored OSes, have this problem.)

This change made a significant difference when reading a RADCOM capture
in on a Solaris 2.5.1 box (although it made no difference on a FreeBSD
3.2 box), by significantly reducing the number of "read()" calls.

It also skips over the FCS in LAPB captures by reading it rather than
seeking around it; should we put it in the pseudo-header, along with the
DCE/DTE flag?

I'll see what other ones have this problem (the "snoop" reader I did
does...).