Ethereal-dev: Re: [Ethereal-dev] Role of subtpe_seek_read in wth stucture

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

From: "Guy Harris" <gharris@xxxxxxxxx>
Date: Thu, 11 May 2006 14:35:05 -0700 (PDT)
Raman Singla wrote:
> Kindly tell me the role of having a seek_read function (while writing for
> a new capture format).

Random access to the file, which is what Ethereal does - it does *NOT*
read the entire contents of the capture file into memory, it reads the
file once, and, if it later needs to look at a particular packet, it reads
it with wtap_seek_read(), passing the seek offset of the packet in the
file as an argument.

> but what is role of wriring of seek_read & intilizing
> wth->subtype_seek_read?

See above.

> what will happen when user will operate if one not writing seek_read &
> initialing
> wth->subtype_seek_read with NULL.

Ethereal will crash when Wiretap tries to dereference the null
subtype_seek_read pointer in wtap_seek_read().