diff options
author | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-10-11 22:49:52 +0000 |
---|---|---|
committer | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-10-11 22:49:52 +0000 |
commit | 45e3dd8ec13514731fc839c34f0ee6328f9d0589 (patch) | |
tree | 5020fe69d39ffb18020e7f4286428edb90f55531 /epan/dissectors/packet-tcap.c | |
parent | 3e287f34050eb3263058272c161c1559150cd47a (diff) |
Display TCAP parameter lengths in decimal (like packet-ber does). Fix hex-pane byte highlighting for primitive parameters with tags or lengths longer than 1 octet (contructed ones are OK). Finally, fix up the indenting in this function.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23154 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-tcap.c')
-rw-r--r-- | epan/dissectors/packet-tcap.c | 70 |
1 files changed, 42 insertions, 28 deletions
diff --git a/epan/dissectors/packet-tcap.c b/epan/dissectors/packet-tcap.c index 90595f5275..2e61515499 100644 --- a/epan/dissectors/packet-tcap.c +++ b/epan/dissectors/packet-tcap.c @@ -1,9 +1,9 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* ./packet-tcap.c */ -/* ../../tools/asn2wrs.py -b -e -p tcap -c tcap.cnf -s packet-tcap-template tcap.asn */ +/* ../../../tools/asn2wrs.py -b -p tcap -c ../../../asn1/tcap/tcap.cnf -s ../../../asn1/tcap/packet-tcap-template -D ../../../asn1/tcap tcap.asn */ -/* Input file: packet-tcap-template.c */ +/* Input file: ../../../asn1/tcap/packet-tcap-template.c */ #line 1 "packet-tcap-template.c" /* packet-tcap-template.c @@ -2627,7 +2627,7 @@ proto_register_tcap(void) }, { &hf_tcap_length, { "Length", "tcap.len", - FT_UINT8, BASE_HEX, NULL, 0, + FT_UINT8, BASE_DEC, NULL, 0, "", HFILL } }, { &hf_tcap_data, @@ -3350,6 +3350,8 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset gboolean pc; gint32 tag; guint32 len; + guint32 tag_length; + guint32 len_length; gboolean ind_field; while (tvb_reported_length_remaining(tvb, offset) > 0) @@ -3361,45 +3363,57 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset offset = get_ber_length(tvb, offset, &len, &ind_field); len_offset = offset; + tag_length = tag_offset - saved_offset; + len_length = len_offset - tag_offset; + if (pc) { - pi = - proto_tree_add_text(tree, tvb, saved_offset, len + (len_offset - saved_offset), "CONSTRUCTOR"); + pi = proto_tree_add_text(tree, tvb, saved_offset, + len + (len_offset - saved_offset), + "CONSTRUCTOR"); subtree = proto_item_add_subtree(pi, ett_param); proto_tree_add_uint_format(subtree, hf_tcap_tag, tvb, - saved_offset, tag_offset-saved_offset, tag, "CONSTRUCTOR Tag"); - proto_tree_add_uint(subtree, hf_tcap_tag, tvb, - saved_offset, tag_offset-saved_offset, class); - - proto_tree_add_uint(subtree, hf_tcap_length, tvb, - tag_offset, len_offset-tag_offset, len); - if (len-(2*ind_field)) /*should always be positive unless we get an empty contructor pointless? */ - { - next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field)); - dissect_tcap_param(actx, subtree,next_tvb,0); + saved_offset, tag_length, tag, + "CONSTRUCTOR Tag"); + proto_tree_add_uint(subtree, hf_tcap_tag, tvb, saved_offset, + tag_length, class); + + proto_tree_add_uint(subtree, hf_tcap_length, tvb, tag_offset, + len_length, len); + + if (len-(2*ind_field)) /*should always be positive unless we get an empty contructor pointless? */ + { + next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), + len-(2*ind_field)); + dissect_tcap_param(actx, subtree,next_tvb,0); } - if (ind_field) - proto_tree_add_text(subtree, tvb, offset+len-2, 2, "CONSTRUCTOR EOC"); + + if (ind_field) + proto_tree_add_text(subtree, tvb, offset+len-2, 2, "CONSTRUCTOR EOC"); + offset += len; } else { - pi = proto_tree_add_text(tree, tvb, - saved_offset, len + (len_offset - saved_offset), "Parameter (0x%.2x)", tag); + pi = proto_tree_add_text(tree, tvb, saved_offset, + len + (len_offset - saved_offset), + "Parameter (0x%.2x)", tag); subtree = proto_item_add_subtree(pi, ett_param); - proto_tree_add_uint(subtree, hf_tcap_tag, tvb, - saved_offset, 1, tag); + proto_tree_add_uint(subtree, hf_tcap_tag, tvb, saved_offset, + tag_length, tag); proto_tree_add_uint(subtree, hf_tcap_length, tvb, - saved_offset+1, 1, len); - if (len) /* check for NULLS */ - { - next_tvb = tvb_new_subset(tvb, offset, len, len); - dissect_ber_octet_string(TRUE, actx, tree, next_tvb, 0, hf_tcap_data, - NULL); - } + saved_offset+tag_length, len_length, len); + + if (len) /* check for NULLS */ + { + next_tvb = tvb_new_subset(tvb, offset, len, len); + dissect_ber_octet_string(TRUE, actx, tree, next_tvb, 0, + hf_tcap_data, NULL); + } + offset += len; } } |