fields passed into proto_tree_add_bits_* should have bits==0

svn path=/trunk/; revision=25074
This commit is contained in:
Richard van der Hoff 2008-04-16 09:49:39 +00:00
parent f3a40604dc
commit bcfb45de67
2 changed files with 7 additions and 2 deletions

View File

@ -6111,6 +6111,11 @@ proto_tree_add_bits_ret_val(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
hf_field = proto_registrar_get_nth(hf_index);
if(hf_field -> bitmask != 0) {
REPORT_DISSECTOR_BUG(ep_strdup_printf("Incompatible use of proto_tree_add_bits_ret_val with field '%s' (%s) with bitmask != 0",
hf_field->abbrev, hf_field->name));
}
/* Byte align offset */
offset = bit_offset>>3;

View File

@ -1641,7 +1641,7 @@ proto_tree_add_bitmask(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_hdr,
/** Add bits to a proto_tree, using the text label registered to that item.
The item is extracted from the tvbuff handed to it.
@param tree the tree to append this item to
@param hfindex field index
@param hfindex field index. Fields for use with this function should have bitmask==0.
@param tvb the tv buffer of the current data
@param bit_offset start of data in tvb expressed in bits
@param no_of_bits length of data in tvb expressed in bits
@ -1653,7 +1653,7 @@ proto_tree_add_bits_item(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint bit
/** Add bits to a proto_tree, using the text label registered to that item.
The item is extracted from the tvbuff handed to it.
@param tree the tree to append this item to
@param hfindex field index
@param hfindex field index. Fields for use with this function should have bitmask==0.
@param tvb the tv buffer of the current data
@param bit_offset start of data in tvb expressed in bits
@param no_of_bits length of data in tvb expressed in bits