diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2003-07-08 10:35:17 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2003-07-08 10:35:17 +0000 |
commit | 935237415101f46661bef0a0733d4ee21aa8ee5d (patch) | |
tree | 34990fca70a1ffdbf84070a0e490d1afb484d3b3 /packet-h245.c | |
parent | 9fb50f7318645cb78fd0c0b32668a8470118a97e (diff) | |
download | wireshark-935237415101f46661bef0a0733d4ee21aa8ee5d.tar.gz wireshark-935237415101f46661bef0a0733d4ee21aa8ee5d.tar.bz2 wireshark-935237415101f46661bef0a0733d4ee21aa8ee5d.zip |
when extensions are present to a sequence,
for the individualk bits in the bitmap field for whether each extension
is present or not, add "(<extension name> [is|is NOT] present)" to the
tree item.
this makes the dissection of the extension bitmap more meaningful
svn path=/trunk/; revision=7988
Diffstat (limited to 'packet-h245.c')
-rw-r--r-- | packet-h245.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/packet-h245.c b/packet-h245.c index 078f23eb76..a5ef9df03b 100644 --- a/packet-h245.c +++ b/packet-h245.c @@ -92,7 +92,7 @@ proper helper routines * Routines for H.245 packet dissection * 2003 Ronnie Sahlberg * - * $Id: packet-h245.c,v 1.7 2003/07/08 10:22:20 sahlberg Exp $ + * $Id: packet-h245.c,v 1.8 2003/07/08 10:35:17 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1599,8 +1599,8 @@ typedef struct _per_sequence_t { static const true_false_string tfs_extension_present_bit = { - "Extension is present", - "Extension is NOT present" + "", + "" }; static const true_false_string tfs_extension_bit = { "Extension bit is set", @@ -2335,6 +2335,22 @@ index_get_optional_name(per_sequence_t *sequence, int index) return "<unknown type>"; } +static char * +index_get_extension_name(per_sequence_t *sequence, int index) +{ + int i; + + for(i=0;sequence[i].name;i++){ + if(sequence[i].extension==NOT_EXTENSION_ROOT){ + if(index==0){ + return sequence[i].name; + } + index--; + } + } + return "<unknown type>"; +} + /* this functions decodes a SEQUENCE it can only handle SEQUENCES with at most 32 DEFAULT or OPTIONAL fields 18.1 extension bit @@ -2435,6 +2451,7 @@ DEBUG_ENTRY("dissect_per_sequence"); guint32 num_extensions; guint32 extension_mask; proto_tree *etr=NULL; + proto_item *it=NULL; if(display_internal_per_fields){ etr=tree; @@ -2443,8 +2460,15 @@ DEBUG_ENTRY("dissect_per_sequence"); offset=dissect_per_normally_small_nonnegative_whole_number(tvb, offset, pinfo, etr, hf_h245_num_sequence_extensions, &num_extensions); extension_mask=0; for(i=0;i<(int)num_extensions;i++){ - offset=dissect_per_boolean(tvb, offset, pinfo, etr, hf_h245_extension_present_bit, &extension_bit, NULL); + offset=dissect_per_boolean(tvb, offset, pinfo, etr, hf_h245_extension_present_bit, &extension_bit, &it); extension_mask=(extension_mask<<1)|extension_bit; + if(it){ + proto_item_append_text(it, " (%s %s present)", + index_get_extension_name(sequence, i), + extension_bit?"is":"is NOT" + ); + } + } /* find how many extensions we know about */ |