diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-02 15:37:23 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-02 15:37:23 +0000 |
commit | d121a9be3b4838bae9ce7c2bfa8c8b34a86af1e5 (patch) | |
tree | b30245b6d4b617c1ffc5617a614e9d4fb4666f83 /epan/proto.c | |
parent | e9f605d310dcc0f11d88ee2ad1883c166f4bc1fe (diff) |
From Jakub Zawadzki:
Fix copy&paste error + add support for proto_tree_add_bits API
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4413
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32634 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/epan/proto.c b/epan/proto.c index 6d22b50150..0a5b6cc47b 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -6557,8 +6557,8 @@ proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, * Offset should be given in bits from the start of the tvb. */ -proto_item * -proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, +static proto_item * +_proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, guint64 *return_value, const gboolean little_endian) { @@ -6678,7 +6678,21 @@ proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, } proto_item * -proto_tree_add_bits_format_value(proto_tree *tree, const int hf_index, +proto_tree_add_bits_ret_val(proto_tree *tree, const int hf_index, tvbuff_t *tvb, + const gint bit_offset, const gint no_of_bits, + guint64 *return_value, const gboolean little_endian) +{ + proto_item *item; + + if ((item = _proto_tree_add_bits_ret_val(tree, hf_index, tvb, bit_offset, no_of_bits, return_value, little_endian))) { + FI_SET_FLAG(PNODE_FINFO(item), FI_BITS_OFFSET(bit_offset)); + FI_SET_FLAG(PNODE_FINFO(item), FI_BITS_SIZE(no_of_bits)); + } + return item; +} + +static proto_item * +_proto_tree_add_bits_format_value(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, void *value_ptr, gchar *value_str) @@ -6777,6 +6791,21 @@ proto_tree_add_bits_format_value(proto_tree *tree, const int hf_index, } } +proto_item * +proto_tree_add_bits_format_value(proto_tree *tree, const int hf_index, + tvbuff_t *tvb, const gint bit_offset, + const gint no_of_bits, void *value_ptr, + gchar *value_str) +{ + proto_item *item; + + if ((item = _proto_tree_add_bits_format_value(tree, hf_index, tvb, bit_offset, no_of_bits, value_ptr, value_str))) { + FI_SET_FLAG(PNODE_FINFO(item), FI_BITS_OFFSET(bit_offset)); + FI_SET_FLAG(PNODE_FINFO(item), FI_BITS_SIZE(no_of_bits)); + } + return item; +} + #define CREATE_VALUE_STRING(dst,format,ap) \ va_start(ap,format); \ dst = ep_strdup_vprintf(format, ap); \ |