aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ber.c
diff options
context:
space:
mode:
authorGraeme Lunt <graeme.lunt@smhs.co.uk>2006-09-22 17:39:02 +0000
committerGraeme Lunt <graeme.lunt@smhs.co.uk>2006-09-22 17:39:02 +0000
commit914d48e098e2f73010543c9f93e9d98cffb8d445 (patch)
treece490d981640f9e617cdf2060d77a07208a9aa56 /epan/dissectors/packet-ber.c
parent3001ad5169efabbc3e35d177047c714434ba5166 (diff)
Fix to show all the internal tokens. when configured, when dissecting an unknown piece of BER.
svn path=/trunk/; revision=19289
Diffstat (limited to 'epan/dissectors/packet-ber.c')
-rw-r--r--epan/dissectors/packet-ber.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 9aafe82d17..c0fe370d40 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -244,8 +244,10 @@ int dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tre
throwing an exception.
*/
- offset=dissect_ber_identifier(pinfo, tree, tvb, start_offset, &class, &pc, &tag);
- offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
+ if(show_internal_ber_fields) {
+ offset=dissect_ber_identifier(pinfo, tree, tvb, start_offset, &class, &pc, &tag);
+ offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
+ }
proto_tree_add_text(tree, tvb, offset, len, "BER: Error length:%u longer than tvb_length_ramaining:%d",len, tvb_length_remaining(tvb, offset));
return tvb_length(tvb);
}
@@ -317,6 +319,13 @@ int dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tre
case BER_CLASS_PRI:
default:
/* we can't dissect this directly as it is specific */
+
+ /* we dissect again if show_internal_ber_fields is set */
+ if(show_internal_ber_fields) {
+ offset=dissect_ber_identifier(pinfo, tree, tvb, start_offset, &class, &pc, &tag);
+ offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
+ }
+
pi = proto_tree_add_text(tree, tvb, offset, len, "[%s %d] ", val_to_str(class,ber_class_codes,"Unknown"), tag);
/* we may want to do better and show the bytes */
is_printable = TRUE;
@@ -344,6 +353,12 @@ int dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tre
case TRUE: /* this is constructed */
+ /* we dissect again if show_internal_ber_fields is set */
+ if(show_internal_ber_fields) {
+ offset=dissect_ber_identifier(pinfo, tree, tvb, start_offset, &class, &pc, &tag);
+ offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
+ }
+
switch(class) {
case BER_CLASS_UNI:
item=proto_tree_add_text(tree, tvb, offset, len, "%s", val_to_str(tag,ber_uni_tag_codes,"Unknown"));