diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-11-13 14:16:06 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-11-13 14:16:06 +0000 |
commit | 2e13664c4b8e1c74c0a1ffabd5c7c14c65daea1a (patch) | |
tree | 0fa8d0df0546569d62f4da6350d0ae84bda0a547 /epan/dissectors/packet-ber.c | |
parent | a638e3681b501e35d659e5e6952df2d65bfbbdf2 (diff) |
add new integer dissector helper that is aware of implicit tags
svn path=/trunk/; revision=12519
Diffstat (limited to 'epan/dissectors/packet-ber.c')
-rw-r--r-- | epan/dissectors/packet-ber.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index a84c25ec7b..fbdf3ec0c7 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -362,7 +362,7 @@ int dissect_ber_octet_string_wcb(gboolean implicit_tag, packet_info *pinfo, prot int -dissect_ber_integer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value) +dissect_ber_integer_new(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value) { guint8 class; gboolean pc; @@ -372,10 +372,12 @@ dissect_ber_integer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int off gint64 val64; guint32 i; - offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL); - -/* if(class!=BER_CLASS_UNI)*/ + if(!implicit_tag){ + offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); + offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL); + } else { + len=tvb_length_remaining(tvb, offset); + } /* ok, we cant handle >4 byte integers so lets fake them */ if(len>8){ @@ -434,7 +436,12 @@ dissect_ber_integer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int off return offset; } - +/* XXX kludge until we fix up asn2eth and rebuild everything */ +int +dissect_ber_integer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gint hf_id, guint32 *value) +{ + return dissect_ber_integer_new(FALSE, pinfo, tree, tvb, offset, hf_id, value); +} |