Ethereal-dev: Re: [ethereal-dev] Checked in Wiretap changes to eliminate "ftell()" calls

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

From: Olivier Abad <abad@xxxxxxxxxxxxx>
Date: Mon, 30 Aug 1999 21:08:31 +0200
On ven, aoû 27, 1999 at 07:25:44 -0700, Guy Harris wrote:
> > I tried all except for netmon and radcom. They're still readable.
> 
> Netmon was readable when I tried it; I don't have a RADCOM file handy
> (unless Olivier sent one to the list, or to me, and I forgot about it,
> or it's at the office but not home).

RADCOM files are not readable. Here is a patch to make it work. I'm also
attaching a RADCOM file (containing TCP and COTP over X.25).

Olivier

P.S. : I just came back from hollidays. That's why my reply is a little
late.

Index: wiretap/radcom.c
===================================================================
RCS file: /cvsroot/ethereal/wiretap/radcom.c,v
retrieving revision 1.5
diff -u -r1.5 radcom.c
--- radcom.c	1999/08/28 01:19:45	1.5
+++ radcom.c	1999/08/30 18:43:49
@@ -167,12 +167,12 @@
 
 	if (wth->file_encap == WTAP_ENCAP_ETHERNET) {
 		fseek(wth->fh, 294, SEEK_CUR);
-		wth->data_offset = 294;
 	} else if (wth->file_encap == WTAP_ENCAP_LAPB) {
 		fseek(wth->fh, 297, SEEK_CUR);
-		wth->data_offset = 297;
 	}
 
+	wth->data_offset = ftell(wth->fh);
+
 	return 1;
 
 read_error:
@@ -260,6 +260,7 @@
 	wth->phdr.pseudo_header.x25.flags = (dce & 0x1) ? 0x00 : 0x80;
 
 	fseek(wth->fh, 9, SEEK_CUR);
+	wth->data_offset += 9;
 
 	/*
 	 * Read the packet data.



-- 
Moore's Constant:
	Everybody sets out to do something, and everybody
	does something, but no one does what he sets out to do.

Attachment: enr2105.gz
Description: Binary data