Ethereal-dev: Re: [Ethereal-dev] Patch to packet-isup to display cause value string.

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 20 Feb 2003 02:18:48 -0800
On Thu, Feb 20, 2003 at 08:47:19AM +0100, Anders Broman (EAB) wrote:
> Here's a patch to add printing of cause value string to packet-isup.c

It appears to have the same problem as the patch for packet-q931.c:

> +	octet = tvb_get_guint8(tvb, offset);
> +	proto_tree_add_text(tree, tvb, offset, 1,
> +             "Cause value: %s (%i)",
> +	    val_to_str(octet & 0x7F, q850_cause_code_vals,
> +	      "Unknown (0x%02X)"));

as you're not actually passing the cause value as an argument to
"proto_tree_add_text()" (so you'll get random junk), and you *are*
passing a string that includes a format operation to "val_to_str()" (so
the cause value will show up if it's unknown, along with random junk or,
if you pass the cause value as an argument, along with the cause value
in decimal.

That "dissect_q931_cause_ie()" appears to be almost identical to the one
in "packet-q931.c", except for the value_string table passed to
"val_to_str()"; if that's the case, you should probably, instead, add an
argument to "dissect_q931_cause_ie()" in "packet-q931.c", which supplies
a poitner to a value_string table, and pass different pointers in
"packet-q931.c" and "packet-isup.c".