set_label:
- if (pi_value) proto_item_fill_label(pi_value->finfo, label);
+ if (pi_value) proto_item_fill_label(PITEM_FINFO(pi_value), label);
if (oid_info && oid_info->name) {
if (oid_left >= 1) {
}
static gboolean fvt_cache_cb(proto_node * node, gpointer data _U_) {
- field_info* finfo = node->finfo;
+ field_info* finfo = PNODE_FINFO(node);
fvt_cache_entry_t* e;
if (!finfo) return FALSE;
break;
}
- proto_item_fill_label(pi->finfo, label);
+ proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
return label;
}
break;
}
- proto_item_fill_label(pi->finfo, label);
+ proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
return label;
}
{
char* label = ep_alloc(ITEM_LABEL_LENGTH+1);
proto_item* pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length(tvb),FALSE);
- proto_item_fill_label(pi->finfo, label);
+ proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
return label;
}
gint length = tvb_length_remaining(tvb,0);
if (length == 4) {
pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length_remaining(tvb,0),FALSE);
- proto_item_fill_label(pi->finfo, label);
+ proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
}
else {
set_label:
- if (pi_value) proto_item_fill_label(pi_value->finfo, label);
+ if (pi_value) proto_item_fill_label(PITEM_FINFO(pi_value), label);
if (oid_info && oid_info->name) {
if (oid_left >= 1) {
PROTO_ITEM_SET_GENERATED(ti);
/* if we have a proto_item (not a faked item), set expert attributes to it */
- if(pi != NULL && pi->finfo != NULL) {
+ if(pi != NULL && PITEM_FINFO(pi) != NULL) {
ei->pitem = pi;
expert_set_item_flags(pi, group, severity);
}
will still have somewhere to attach to \
or else filtering will not work (they would be ignored since tree\
would be NULL). \
- DONT try to fake a node where PITEM_FINFO(pi) is NULL \
+ DONT try to fake a node where PTREE_FINFO(tree) is NULL \
since dissectors that want to do proto_item_set_len() or \
other operations that dereference this would crash. \
We dont fake FT_PROTOCOL either since these are cheap and \
some stuff (proto hier stat) assumes they always exist. \
*/ \
if(!(PTREE_DATA(tree)->visible)){ \
- if(PITEM_FINFO(tree)){ \
+ if(PTREE_FINFO(tree)){ \
register header_field_info *hfinfo; \
PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo); \
if((hfinfo->ref_count == HF_REF_TYPE_NONE) \
* Make sure "tree" is ready to have subtrees under it, by
* checking whether it's been given an ett_ value.
*
- * "tnode->finfo" may be null; that's the case for the root
+ * "PNODE_FINFO(tnode)" may be null; that's the case for the root
* node of the protocol tree. That node is not displayed,
* so it doesn't need an ett_ value to remember whether it
* was expanded.
*/
tnode = tree;
- tfi = tnode->finfo;
+ tfi = PNODE_FINFO(tnode);
if (tfi != NULL && (tfi->tree_type < 0 || tfi->tree_type >= num_tree_types)) {
REPORT_DISSECTOR_BUG(ep_strdup_printf("\"%s\" - \"%s\" tfi->tree_type: %u invalid (%s:%u)",
fi->hfinfo->name, fi->hfinfo->abbrev, tfi->tree_type, __FILE__, __LINE__));
PROTO_NODE_NEW(pnode);
pnode->parent = tnode;
- pnode->finfo = fi;
+ PNODE_FINFO(pnode) = fi;
pnode->tree_data = PTREE_DATA(tree);
if (tnode->last_child != NULL) {
gboolean
proto_item_set_expert_flags(proto_item *pi, int group, guint severity)
{
- if(pi == NULL || pi->finfo == NULL)
+ if(pi == NULL || PITEM_FINFO(pi) == NULL)
return FALSE;
/* only change things if severity is worse or at least equal than before */
- if(severity >= FI_GET_FLAG(pi->finfo, PI_SEVERITY_MASK)) {
- FI_REPLACE_FLAGS(pi->finfo, PI_GROUP_MASK, group);
- FI_REPLACE_FLAGS(pi->finfo, PI_SEVERITY_MASK, severity);
+ if(severity >= FI_GET_FLAG(PITEM_FINFO(pi), PI_SEVERITY_MASK)) {
+ FI_REPLACE_FLAGS(PITEM_FINFO(pi), PI_GROUP_MASK, group);
+ FI_REPLACE_FLAGS(PITEM_FINFO(pi), PI_SEVERITY_MASK, severity);
return TRUE;
}
/* Initialize the proto_node */
PROTO_NODE_NEW(pnode);
pnode->parent = NULL;
- pnode->finfo = NULL;
+ PNODE_FINFO(pnode) = NULL;
pnode->tree_data = g_new(tree_data_t, 1);
/* Don't initialize the tree_data_t. Wait until we know we need it */
if (tree == NULL)
return;
- fi = tree->finfo;
+ fi = PTREE_FINFO(tree);
start += TVB_RAW_OFFSET(tvb);
DISSECTOR_ASSERT(start >= 0);
DISSECTOR_ASSERT(length >= 0);
/** Retrieve the field_info from a proto_item */
#define PITEM_FINFO(proto_item) PNODE_FINFO(proto_item)
+/** Retrieve the field_info from a proto_tree */
+#define PTREE_FINFO(proto_tree) PNODE_FINFO(proto_tree)
+
/** Retrieve the tree_data_t from a proto_tree */
#define PTREE_DATA(proto_tree) ((proto_tree)->tree_data)
if (expert_data->pitem) {
char *filter;
- filter = proto_construct_match_selected_string(expert_data->pitem->finfo, NULL);
+ filter = proto_construct_match_selected_string(PITEM_FINFO(expert_data->pitem), NULL);
if (filter != NULL)
err->procedures[row].fvalue_value = g_strdup(filter);
}
/* display the TLV name and display the value in hex. Highlight type, length, and value. */
tlv_item = proto_tree_add_item(tree, hfindex, tvb, start, tlv_value_length, little_endian);
/* Correct the highlighting. */
- tlv_item->finfo->start -= tlv_val_offset;
- tlv_item->finfo->length += tlv_val_offset;
+ PITEM_FINFO(tlv_item)->start -= tlv_val_offset;
+ PITEM_FINFO(tlv_item)->length += tlv_val_offset;
/* add TLV subtree to contain the type, length, and value */
tlv_tree = proto_item_add_subtree(tlv_item, *ett_tlv[tlv_type]);
/* display the TLV type */
break;
}
/* Show "TLV value: " */
- tlv_item = proto_tree_add_text(tlv_tree, tvb, start, tlv_value_length, hex_fmt, tlv_item->finfo->hfinfo->name, tlv_value);
+ tlv_item = proto_tree_add_text(tlv_tree, tvb, start, tlv_value_length, hex_fmt, PITEM_FINFO(tlv_item)->hfinfo->name, tlv_value);
tlv_tree = proto_item_add_subtree(tlv_item, idx);
/* Return a pointer to the value level */
va_end(ap);
tlv_item = proto_tree_add_protocol_format(tree, hfindex, tvb, start, length, "%s", message);
/* Correct the highlighting. */
- tlv_item->finfo->start -= tlv_val_offset;
- tlv_item->finfo->length += tlv_val_offset;
+ PITEM_FINFO(tlv_item)->start -= tlv_val_offset;
+ PITEM_FINFO(tlv_item)->length += tlv_val_offset;
/* add TLV subtree to contain the type, length, and value */
tlv_tree = proto_item_add_subtree(tlv_item, *ett_tlv[tlv_type]);
/* display the TLV type */
dl_ie_count = ((first_24bits & WIMAX_HARQ_MAP_DL_IE_COUNT_MASK) >> WIMAX_HARQ_MAP_DL_IE_COUNT_SHIFT);
/* get the UL MAP appended */
ulmap_appended = (first_24bits & WIMAX_HARQ_UL_MAP_APPENDED_MASK);
- if (parent_item == NULL || parent_item->finfo == NULL)
+ if (parent_item == NULL || PITEM_FINFO(parent_item) == NULL)
{
parent_item = harq_map_item; /* Prevent crash */
}
* not a normal protocol in the top-level tree. It was instead
* added as a normal tree such as IPv6's Hop-by-hop Option Header and
* should be skipped when creating the protocol hierarchy display. */
- if(strlen(proto_sibling_node->finfo->hfinfo->name) == 0 && ptree_node->next)
+ if(strlen(PNODE_FINFO(proto_sibling_node)->hfinfo->name) == 0 && ptree_node->next)
proto_sibling_node = proto_sibling_node->next;
process_node(proto_sibling_node, stat_node, ps, pkt_len);