Ethereal-dev: Re: [ethereal-dev] tvbuff + dissector_try_port

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

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Mon, 12 Jun 2000 15:44:50 -0500
On Mon, Jun 12, 2000 at 03:06:01PM -0500, Frank Singleton wrote:
> 
> 
> Hi,
> 
> What do I pass to dissector_try_port() if I am using tvbuffs.
> Can I create a new sub tvbuff with sub_new_subset, and somehow
> pass a ptr to that ?

Look at the example of tvb_compat() from packet-ppp.c:

  next_tvb = tvb_new_subset(tvb, proto_len, -1, -1);
  tvb_compat(next_tvb, &next_pd, &next_offset);

  /* do lookup with the subdissector table */
  if (dissector_try_port(subdissector_table, ppp_prot, next_pd, next_offset, pinfo->fd, tree))
      return TRUE;


--gilbert