Ethereal-dev: [Ethereal-dev] Re: Camel Patch

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

From: "Anders Broman" <a.broman@xxxxxxxxx>
Date: Sun, 1 May 2005 20:34:41 +0200
Hi,
The best would be to use the function from packet-q931.ch :

extern void dissect_q931_cause_ie(tvbuff_t *, int, int,
    proto_tree *, int, guint8 *);

See packet-isup.c for an example:
---- Snip ---
void
dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree
*parameter_tree, proto_item *parameter_item)
{ guint length = tvb_reported_length(parameter_tvb);
  proto_tree_add_text(parameter_tree, parameter_tvb,0, -1, "Cause indicators
(-> Q.850)");
  dissect_q931_cause_ie(parameter_tvb,0,length,
					    parameter_tree,
					    hf_isup_cause_indicator,
&tap_cause_value);
  proto_item_set_text(parameter_item, "Cause indicators, see Q.850 (%u
byte%s length)", length , plurality(length, "", "s"));
}
---- Snip ---
Very quickly looking at the code couldn't
ReleaseCallArg then just call dissect_q931_cause_ie with hf_camel_q850_cause


	{ &camel_q850_cause,
		{ "Cause indicator",  "camel.cause_indicator",
		FT_UINT8, BASE_DEC, VALS(q850_cause_code_vals), 0x7f,
		"", HFILL }},
Best regards
Anders

Can you update the patch to use value_strings such as the other value
strings in packet-camel-templace.c
and i will check it in.

Also, when using these value_strings  use a proper
proto_tree_add_item() to add them instead of the
proto_tree_add_text().

This makes the dissector much better and makes filtering work.


If not, please send me an example capture file and i can refactor the
patch as described above.



On 4/30/05, Javier Acuña <javier.acuna@xxxxxxxxxx> wrote:
> 
> 
> >The conformance magic for ReleaseCallArg is pretty big.
> >
> >Is it possible to refactor this and specify ReleaseCallArg in the ASN
> >file instead?
> 
> Hi, the cfn is indeed quite large. But according to the specification that
> I'm working with, ReleaseCall is an octet string encoded according to the
> "Cause" clause of ITU Q850.
> 
> ITU Q850 is specified in terms of bits and bytes. I don't know how to
> refactor something like that into ASN1, so please tell me any ideas you
> might have.
> 
> Best Regards
> Javier Acuña