@param hfinfo header_field
@param free_block a code block to call to free resources if this returns
@return the header field matching 'hfinfo' */
-#define TRY_TO_FAKE_THIS_ITEM_OR_FREE(tree, hfindex, hfinfo, tvb, free_block) \
+#define TRY_TO_FAKE_THIS_ITEM_OR_FREE(tree, hfindex, hfinfo, free_block) \
/* If this item is not referenced we dont have to do much work \
at all but we should still return a node so that field items \
below this node (think proto_item_add_subtree()) will still \
} \
PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo); \
if (!(PTREE_DATA(tree)->visible)) { \
- if (PTREE_FINFO(tree) \
- && PTREE_FINFO(tree)->ds_tvb == tvb) { \
+ if (PTREE_FINFO(tree)) { \
if ((hfinfo->ref_type != HF_REF_TYPE_DIRECT) \
&& (hfinfo->type != FT_PROTOCOL || \
PTREE_DATA(tree)->fake_protocols)) { \
@param hfindex field index
@param hfinfo header_field
@return the header field matching 'hfinfo' */
-#define TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb) \
- TRY_TO_FAKE_THIS_ITEM_OR_FREE(tree, hfindex, hfinfo, tvb, ((void)0))
+#define TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo) \
+ TRY_TO_FAKE_THIS_ITEM_OR_FREE(tree, hfindex, hfinfo, ((void)0))
/** See inlined comments.
tree = ptvcursor_tree(ptvc);
- TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo, ptvcursor_tvbuff(ptvc));
+ TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo);
pi = proto_tree_add_text_node(tree, ptvcursor_tvbuff(ptvc),
ptvcursor_current_offset(ptvc), length);
va_list ap;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo);
pi = proto_tree_add_text_node(tree, tvb, start, length);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo);
pi = proto_tree_add_text_node(tree, tvb, start, length);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hf_text_only, hfinfo);
pi = proto_tree_add_text_node(tree, tvb, start, length);
}
/* Coast clear. Try and fake it */
- TRY_TO_FAKE_THIS_ITEM(ptvc->tree, hfindex, hfinfo, ptvcursor_tvbuff(ptvc));
+ TRY_TO_FAKE_THIS_ITEM(ptvc->tree, hfindex, hfinfo);
new_fi = new_field_info(ptvc->tree, hfinfo, ptvc->tvb, offset, item_length);
get_hfi_length(hfinfo, tvb, start, &length, &item_length);
test_length(hfinfo, tvb, start, item_length);
- TRY_TO_FAKE_THIS_ITEM(tree, hfinfo->id, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfinfo->id, hfinfo);
new_fi = new_field_info(tree, hfinfo, tvb, start, item_length);
if (err) *err = saved_err;
- TRY_TO_FAKE_THIS_ITEM_OR_FREE(tree, hfinfo->id, hfinfo, tvb,
+ TRY_TO_FAKE_THIS_ITEM_OR_FREE(tree, hfinfo->id, hfinfo,
{
if (created_bytes)
g_byte_array_free(created_bytes, TRUE);
retval->nsecs = time_stamp.nsecs;
}
- TRY_TO_FAKE_THIS_ITEM(tree, hfinfo->id, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfinfo->id, hfinfo);
new_fi = new_field_info(tree, hfinfo, tvb, start, length);
va_list ap;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_NONE);
va_list ap;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_PROTOCOL);
get_hfi_length(hfinfo, tvb, start, &length, &item_length);
test_length(hfinfo, tvb, start, item_length);
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_BYTES);
get_hfi_length(hfinfo, tvb, start, &length, &item_length);
test_length(hfinfo, tvb, start, item_length);
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
if (start_ptr)
pi = proto_tree_add_bytes(tree, hfindex, tvb, start, length,
get_hfi_length(hfinfo, tvb, start, &length, &item_length);
test_length(hfinfo, tvb, start, item_length);
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
if (start_ptr)
pi = proto_tree_add_bytes(tree, hfindex, tvb, start, length,
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_ABSOLUTE_TIME ||
hfinfo->type == FT_RELATIVE_TIME);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_IPXNET);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_IPv4);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_IPv6);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_GUID);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_OID);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ || hfinfo->type == FT_STRINGZPAD);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_AX25);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_ETHER);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_BOOLEAN);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_FLOAT);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_DOUBLE);
proto_item *pi = NULL;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
switch (hfinfo->type) {
case FT_UINT8:
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_UINT64);
proto_item *pi = NULL;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
switch (hfinfo->type) {
case FT_INT8:
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_INT64);
proto_item *pi;
header_field_info *hfinfo;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_EUI64);
* but only after doing a bunch more work (which we can, in the common
* case, shortcut here).
*/
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
return proto_tree_add_bits_ret_val(tree, hfindex, tvb, bit_offset, no_of_bits, NULL, encoding);
}
}
/* Coast clear. Try and fake it */
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field);
bf_str = decode_bits_in_field(bit_offset, no_of_bits, value);
}
/* Coast clear. Try and fake it */
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field);
/* initialise the format string */
bf_str = (char *)ep_alloc(256);
header_field_info *hf_field;
/* We do not have to return a value, try to fake it as soon as possible */
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field);
if (hf_field->bitmask != 0) {
REPORT_DISSECTOR_BUG(ep_strdup_printf(
gchar *dst;
header_field_info *hf_field;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field);
switch (hf_field->type) {
case FT_UINT8:
gchar *dst;
header_field_info *hf_field;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field);
DISSECTOR_ASSERT(hf_field->type == FT_FLOAT);
gchar *dst;
header_field_info *hf_field;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field);
switch (hf_field->type) {
case FT_INT8:
gchar *dst;
header_field_info *hf_field;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hf_field);
DISSECTOR_ASSERT(hf_field->type == FT_BOOLEAN);
gint byte_offset;
gchar *string;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_STRING);
gint byte_offset;
gchar *string;
- TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo, tvb);
+ TRY_TO_FAKE_THIS_ITEM(tree, hfindex, hfinfo);
DISSECTOR_ASSERT(hfinfo->type == FT_STRING);