forked from osmocom/wireshark
Add PNODE_FINFO. We've been using PITEM_FINFO on proto_node's. This works because proto_item is typedefed to proto_node. We shouldn't rely on this since this is an implementation detail.
svn path=/trunk/; revision=29354
This commit is contained in:
parent
d3174f0d03
commit
3512e485ca
|
@ -549,7 +549,7 @@ free_node_tree_data(tree_data_t *tree_data)
|
|||
static gboolean
|
||||
proto_tree_free_node(proto_node *node, gpointer data _U_)
|
||||
{
|
||||
field_info *finfo = PITEM_FINFO(node);
|
||||
field_info *finfo = PNODE_FINFO(node);
|
||||
#if 0
|
||||
proto_node *parent = node->parent;
|
||||
#endif
|
||||
|
@ -5063,7 +5063,7 @@ typedef struct {
|
|||
static gboolean
|
||||
find_finfo(proto_node *node, gpointer data)
|
||||
{
|
||||
field_info *fi = PITEM_FINFO(node);
|
||||
field_info *fi = PNODE_FINFO(node);
|
||||
if (fi && fi->hfinfo) {
|
||||
if (fi->hfinfo->id == ((ffdata_t*)data)->id) {
|
||||
g_ptr_array_add(((ffdata_t*)data)->array, fi);
|
||||
|
@ -5097,7 +5097,7 @@ proto_find_finfo(proto_tree *tree, int id)
|
|||
static gboolean
|
||||
every_finfo(proto_node *node, gpointer data)
|
||||
{
|
||||
field_info *fi = PITEM_FINFO(node);
|
||||
field_info *fi = PNODE_FINFO(node);
|
||||
if (fi && fi->hfinfo) {
|
||||
g_ptr_array_add(((ffdata_t*)data)->array, fi);
|
||||
}
|
||||
|
@ -5130,7 +5130,7 @@ typedef struct {
|
|||
static gboolean
|
||||
check_for_offset(proto_node *node, gpointer data)
|
||||
{
|
||||
field_info *fi = PITEM_FINFO(node);
|
||||
field_info *fi = PNODE_FINFO(node);
|
||||
offset_search_t *offsearch = data;
|
||||
|
||||
/* !fi == the top most container node which holds nothing */
|
||||
|
|
|
@ -345,8 +345,11 @@ extern gboolean proto_tree_traverse_post_order(proto_tree *tree,
|
|||
extern void proto_tree_children_foreach(proto_tree *tree,
|
||||
proto_tree_foreach_func func, gpointer data);
|
||||
|
||||
/** Retrieve the field_info from a proto_node */
|
||||
#define PNODE_FINFO(proto_node) ((proto_node)->finfo)
|
||||
|
||||
/** Retrieve the field_info from a proto_item */
|
||||
#define PITEM_FINFO(proto_item) ((proto_item)->finfo)
|
||||
#define PITEM_FINFO(proto_item) PNODE_FINFO(proto_item)
|
||||
|
||||
/** Retrieve the tree_data_t from a proto_tree */
|
||||
#define PTREE_DATA(proto_tree) ((proto_tree)->tree_data)
|
||||
|
|
2
file.c
2
file.c
|
@ -2967,7 +2967,7 @@ match_subtree_text(proto_node *node, gpointer data)
|
|||
const gchar *string = mdata->string;
|
||||
size_t string_len = mdata->string_len;
|
||||
capture_file *cf = mdata->cf;
|
||||
field_info *fi = PITEM_FINFO(node);
|
||||
field_info *fi = PNODE_FINFO(node);
|
||||
gchar label_str[ITEM_LABEL_LENGTH];
|
||||
gchar *label_ptr;
|
||||
size_t label_len;
|
||||
|
|
|
@ -3355,7 +3355,7 @@ static gboolean process_node(proto_node *ptree_node, header_field_info *hfinform
|
|||
header_field_info *hfssrc;
|
||||
ipv4_addr *ipv4;
|
||||
|
||||
finfo = PITEM_FINFO(ptree_node);
|
||||
finfo = PNODE_FINFO(ptree_node);
|
||||
|
||||
if (hfinformation==(finfo->hfinfo)) {
|
||||
hfssrc = proto_registrar_get_byname(proto_field);
|
||||
|
@ -3366,7 +3366,7 @@ static gboolean process_node(proto_node *ptree_node, header_field_info *hfinform
|
|||
}
|
||||
for(ptree_node=ptree_node->first_child; ptree_node!=NULL;
|
||||
ptree_node=ptree_node->next) {
|
||||
finfo=PITEM_FINFO(ptree_node);
|
||||
finfo=PNODE_FINFO(ptree_node);
|
||||
if (hfssrc==finfo->hfinfo) {
|
||||
if (hfinformation->type==FT_IPv4) {
|
||||
ipv4 = fvalue_get(&finfo->value);
|
||||
|
|
|
@ -1684,7 +1684,7 @@ proto_tree_draw_node(proto_node *node, gpointer data)
|
|||
struct proto_tree_draw_info info;
|
||||
struct proto_tree_draw_info *parent_info = (struct proto_tree_draw_info*) data;
|
||||
|
||||
field_info *fi = PITEM_FINFO(node);
|
||||
field_info *fi = PNODE_FINFO(node);
|
||||
gchar label_str[ITEM_LABEL_LENGTH];
|
||||
gchar *label_ptr;
|
||||
gboolean is_leaf, is_expanded;
|
||||
|
|
|
@ -3503,7 +3503,7 @@ static gboolean process_node(proto_node *ptree_node, header_field_info *hfinform
|
|||
header_field_info *hfssrc;
|
||||
ipv4_addr *ipv4;
|
||||
|
||||
finfo = PITEM_FINFO(ptree_node);
|
||||
finfo = PNODE_FINFO(ptree_node);
|
||||
|
||||
if (hfinformation==(finfo->hfinfo)) {
|
||||
hfssrc = proto_registrar_get_byname(proto_field);
|
||||
|
@ -3511,7 +3511,7 @@ static gboolean process_node(proto_node *ptree_node, header_field_info *hfinform
|
|||
return FALSE;
|
||||
for(ptree_node=ptree_node->first_child; ptree_node!=NULL;
|
||||
ptree_node=ptree_node->next) {
|
||||
finfo=PITEM_FINFO(ptree_node);
|
||||
finfo=PNODE_FINFO(ptree_node);
|
||||
if (hfssrc==finfo->hfinfo) {
|
||||
if (hfinformation->type==FT_IPv4) {
|
||||
ipv4 = fvalue_get(&finfo->value);
|
||||
|
|
6
print.c
6
print.c
|
@ -151,7 +151,7 @@ proto_tree_print(print_args_t *print_args, epan_dissect_t *edt,
|
|||
static
|
||||
void proto_tree_print_node(proto_node *node, gpointer data)
|
||||
{
|
||||
field_info *fi = PITEM_FINFO(node);
|
||||
field_info *fi = PNODE_FINFO(node);
|
||||
print_data *pdata = (print_data*) data;
|
||||
const guint8 *pd;
|
||||
gchar label_str[ITEM_LABEL_LENGTH];
|
||||
|
@ -255,7 +255,7 @@ proto_tree_write_pdml(epan_dissect_t *edt, FILE *fh)
|
|||
static void
|
||||
proto_tree_write_node_pdml(proto_node *node, gpointer data)
|
||||
{
|
||||
field_info *fi = PITEM_FINFO(node);
|
||||
field_info *fi = PNODE_FINFO(node);
|
||||
write_pdml_data *pdata = (write_pdml_data*) data;
|
||||
const gchar *label_ptr;
|
||||
gchar label_str[ITEM_LABEL_LENGTH];
|
||||
|
@ -1407,7 +1407,7 @@ static void proto_tree_get_node_field_values(proto_node *node, gpointer data)
|
|||
gpointer field_index;
|
||||
|
||||
call_data = data;
|
||||
fi = PITEM_FINFO(node);
|
||||
fi = PNODE_FINFO(node);
|
||||
|
||||
field_index = g_hash_table_lookup(call_data->fields->field_indicies, fi->hfinfo->abbrev);
|
||||
if(NULL != field_index) {
|
||||
|
|
|
@ -85,7 +85,7 @@ process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu
|
|||
proto_node *proto_sibling_node;
|
||||
GNode *stat_node;
|
||||
|
||||
finfo = PITEM_FINFO(ptree_node);
|
||||
finfo = PNODE_FINFO(ptree_node);
|
||||
g_assert(finfo);
|
||||
|
||||
/* If the field info isn't related to a protocol but to a field,
|
||||
|
|
|
@ -76,7 +76,7 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v
|
|||
{
|
||||
phs_t *rs=prs;
|
||||
phs_t *tmprs;
|
||||
proto_tree *tree;
|
||||
proto_node *node;
|
||||
field_info *fi;
|
||||
|
||||
if(!edt){
|
||||
|
@ -89,8 +89,8 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v
|
|||
return 0;
|
||||
}
|
||||
|
||||
for(tree=edt->tree->first_child;tree;tree=tree->next){
|
||||
fi=PITEM_FINFO(tree);
|
||||
for(node=edt->tree->first_child;node;node=node->next){
|
||||
fi=PNODE_FINFO(node);
|
||||
|
||||
/* first time we saw a protocol at this leaf */
|
||||
if(rs->protocol==-1){
|
||||
|
|
Loading…
Reference in New Issue