Ethereal-dev: Re: [Ethereal-dev] Modification to packet-tns.c

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: Mon, 3 Feb 2003 13:33:16 -0800
On Mon, Feb 03, 2003 at 11:39:53AM -0800, David M. Lee wrote:
> Borrow a trick from our friend TFTP.  Parse TNS redirect messages to get TNS
> decoding on the redirected port.

One possible issue:

> +static void dissect_tns_redirect_string(tvbuff_t *tvb, int offset,
> +	packet_info *pinfo)
> +{
> +	/*
> +	 * Parse the redirect string for the port number to which we are
> +	 * reconnecting.  Then find that conversation and set it to use
> +	 * TNS as its decode.  It should also parse out the address portion,
> +	 * but maybe later...
> +	 */
> +	int rem = tvb_reported_length_remaining(tvb, offset);

That says how much data there was in the packet on the wire, not how
much was captured; the subsequent call

> +	char *connect_string = (char *)tvb_memdup(tvb, offset, rem);

would throw an exception if the capture doesn't have all the data in the
packet.  Perhaps that's not a problem, though - the frame really *is*
short if that happens.