On Sun, Mar 18, 2001 at 10:21:25PM +0100, Guillaume Le Malet wrote:
> I've some more things with the "conversation" system,
> and it doesnt seem to work with RFB proto (the proto I'm
> trying to dissect).
What about it doesn't seem to work?
> And finaly, I've got a little question:
> what is "offset = next_offset" used for in smtp.c ?
It's used to move through the packet, a line at a time.
As per my previous mail, SMTP is a "line-oriented" protocol; each
command is a line, and a reply consists of one or more lines.
Furthermore, the body of a mail message is interpreted as a sequence of
lines.
Ethereal has a routine that will search for an end-of-line indication in
a tvbuff, starting at a given offset, and will return the length of the
line (not including the end-of-line indication), and will also return,
through a pointer argument, the offset of the character at the beginning
of the next line.
Therefore, a loop that processes data, a line at a time, might be
while (tvb_offset_exists(tvb, offset)) {
/*
* Find the end of the line.
*/
linelen = tvb_find_line_end(tvb, offset, -1, &next_offset);
/*
* Process the line.
*/
<code here would process the line, adding stuff to the
protocol tree>
/*
* Step past this line.
*/
offset = next_offset;
}
The "offset = next_offset" statement sets the current offset in the
frame to the offset of the beginning of the next line, so that the next
iteration through the loop would process the next line.
> PS: I've got only one week left to finish this dissector....so if
> anyone's
> interested in having a look to RFB protocol....you're welcome ;) .
Is that the Remote Frame Buffer protocol used by, for example, the VNC
software for updating the display on a remote computer, as developed
either by the Olivetti research labs or the AT&T research labs in
Cambridge in the UK? (I don't know whether they developed it before
Olivetti sold the lab to AT&T or after, although I think it might have
been before.)
http://www.uk.research.att.com/rfb.html