Ethereal-dev: Re: [Ethereal-dev] dissector handoff boolean

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

From: Hartmut Mueller <hartmut@xxxxxxxxxxxxxxxxx>
Date: Fri, 23 Feb 2001 16:46:44 +0100
Hi again,

Thanks to Jeff this is working now.

Great. Hartmut

On Friday, 23. February 2001 16:10, you wrote:
> From: Hartmut Mueller [mailto:hartmut@xxxxxxxxxxxxxxxxx]
> Sent: Friday, February 23, 2001 8:09 AM
>
> > is it possible to refer to a boolean in a dissector call? Using the code
> > below results in the following error:
> >
> > packet-bacnet.c: In function `dissect_bacnet':
> > packet-bacnet.c:473: `bacnet' undeclared (first use in this function)
> >
> > in packet-bacnet.c: --------------
> > if (!dissector_try_port(bacnet_dissector_table,
> >         bacnet.control_net, next_tvb, pinfo, tree)) {  /* line 473 */
> >                 dissect_data(next_tvb, offset, pinfo, tree);
[...]
>
> The second parameter to the dissector_try_port is a guint32. You can
> use a boolean value, you just have to convert it to an guint32.
> Before this dissector_try_port call you have to extract this value
> from the packet data.  A possible example for your code -
>
> 	guint8 bacnet_control_net;
>
> 	bacnet_control_net = guint8( tvb, offset, 1);
> or
> 	bacnet_control_net = guint8( tvb, offset, 1) & bac_control_net_mask;
>
> then the call would become -
>
> 	dissector_try_port(bacnet_dissector_table,
> 	if (!dissector_try_port(bacnet_dissector_table,
>       	  bacnet_control_net, next_tvb, pinfo, tree)) {  /* line 473 */
>             	     dissect_data(next_tvb, offset, pinfo, tree);
>
>
> Jeff Foster
> jfoste@xxxxxxxxxxxx
>
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev