aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2009-03-03 22:46:47 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2009-03-03 22:46:47 +0000
commit1c9cbffcdfeb7dbaf2c903b3c5969b0b4d55415b (patch)
treeb1bf1610692362c031ad2dfd1ffcc261c7326a3e /epan
parentb1d01b16c26c8ce37d6ba4baa0249716f3f369cc (diff)
From Neil Piercy (bug 3299):
Added support for length greater than 127 (less than 16K). svn path=/trunk/; revision=27603
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-per.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index fb59a7b170..c801e52b69 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -360,11 +360,18 @@ dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx _
if(tmp){
val|=1;
g_strlcat(str, "1", 256);
+ if (i==0) { /* bit 8 is 1, so not a single byte length */
+ num_bits = 16;
+ }
+ else if (i==1 && val==3) { /* bits 8 and 7 both 1, so unconstrained */
+ PER_NOT_DECODED_YET("10.9 Unconstrained");
+ return offset;
+ }
} else {
g_strlcat(str, "0", 256);
}
}
- if((val&0x80)==0){
+ if((val&0x80)==0 && num_bits==8){
*length = val;
if(hf_index!=-1){
pi = proto_tree_add_uint(tree, hf_index, tvb, (offset>>3)-1, 1, *length);
@@ -376,6 +383,18 @@ dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx _
return offset;
}
+ else if (num_bits==16) {
+ *length = val&0x3fff;
+ if(hf_index!=-1){
+ pi = proto_tree_add_uint(tree, hf_index, tvb, (offset>>3)-1, 1, *length);
+ if (display_internal_per_fields)
+ proto_item_append_text(pi," %s", str);
+ else
+ PROTO_ITEM_SET_HIDDEN(pi);
+ }
+
+ return offset;
+ }
PER_NOT_DECODED_YET("10.9 Unaligned");
return offset;