static void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_gop* gop) { proto_item *gog_item; proto_tree *gog_tree; proto_item *gog_time_item; proto_tree *gog_time_tree; proto_item *gog_gops_item; proto_tree *gog_gops_tree; mate_gop* gog_gops; proto_item *gog_gop_item; proto_tree *gog_gop_tree; mate_pdu* pdu; #ifdef _MATE_DEBUGGING proto_item* gog_key_item; proto_tree* gog_key_tree; guint i; #endif gog_item = proto_tree_add_uint(tree,gog->cfg->hfid,tvb,0,0,gog->id); gog_tree = proto_item_add_subtree(gog_item,gog->cfg->ett); gog_attrs_tree(gog_tree,tvb,gog); if (gog->cfg->show_times) { gog_time_item = proto_tree_add_text(gog_tree,tvb,0,0,"%s Times",gog->cfg->name); gog_time_tree = proto_item_add_subtree(gog_time_item, gog->cfg->ett_times); proto_tree_add_float(gog_time_tree, gog->cfg->hfid_start_time, tvb, 0, 0, gog->start_time); proto_tree_add_float(gog_time_tree, gog->cfg->hfid_last_time, tvb, 0, 0, gog->last_time - gog->start_time); } gog_gops_item = proto_tree_add_uint(gog_tree, gog->cfg->hfid_gog_num_of_gops, tvb, 0, 0, gog->num_of_gops); gog_gops_tree = proto_item_add_subtree(gog_gops_item, gog->cfg->ett_children); for (gog_gops = gog->gops; gog_gops; gog_gops = gog_gops->next) { if (gop != gog_gops) { if (gog->cfg->gop_tree_mode == GOP_FULL_TREE) { mate_gop_tree(gog_gops_tree, tvb, gog_gops); } else { gog_gop_item = proto_tree_add_uint(gog_gops_tree,gog_gops->cfg->hfid,tvb,0,0,gog_gops->id); if (gog->cfg->gop_tree_mode == GOP_BASIC_TREE) { gog_gop_tree = proto_item_add_subtree(gog_gop_item, gog->cfg->ett_gog_gop); proto_tree_add_text(gog_gop_tree, tvb,0,0, "Started at: %f", gog_gops->start_time); proto_tree_add_text(gog_gop_tree, tvb,0,0, "%s Duration: %f", gog_gops->cfg->name, gog_gops->last_time - gog_gops->start_time); if (gog_gops->released) proto_tree_add_text(gog_gop_tree, tvb,0,0, "%s has been released, Time: %f", gog_gops->cfg->name, gog_gops->release_time - gog_gops->start_time); proto_tree_add_text(gog_gop_tree, tvb,0,0, "Number of Pdus: %u",gog_gops->num_of_pdus); if (gop->pdus && gop->cfg->pdu_tree_mode != GOP_NO_TREE) { proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstart,tvb,0,0,gog_gops->pdus->frame); for (pdu = gog_gops->pdus->next ; pdu; pdu = pdu->next) { if (pdu->is_stop) { proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstop,tvb,0,0,pdu->frame); break; } } } } } } else { proto_tree_add_uint_format(gog_gops_tree,gop->cfg->hfid,tvb,0,0,gop->id,"current %s Gop: %d",gop->cfg->name,gop->id); } } }
static void mate_gog_tree(proto_tree* tree, packet_info *pinfo, tvbuff_t *tvb, mate_gog* gog, mate_gop* gop) { proto_item *gog_item; proto_tree *gog_tree; proto_tree *gog_time_tree; proto_item *gog_gops_item; proto_tree *gog_gops_tree; mate_gop* gog_gops; proto_item *gog_gop_item; proto_tree *gog_gop_tree; mate_pdu* pdu; gog_item = proto_tree_add_uint(tree,gog->cfg->hfid,tvb,0,0,gog->id); gog_tree = proto_item_add_subtree(gog_item,gog->cfg->ett); gog_attrs_tree(gog_tree,pinfo,tvb,gog); if (gog->cfg->show_times) { gog_time_tree = proto_tree_add_subtree_format(gog_tree,tvb,0,0,gog->cfg->ett_times,NULL,"%s Times",gog->cfg->name); proto_tree_add_float(gog_time_tree, gog->cfg->hfid_start_time, tvb, 0, 0, gog->start_time); proto_tree_add_float(gog_time_tree, gog->cfg->hfid_last_time, tvb, 0, 0, gog->last_time - gog->start_time); } gog_gops_item = proto_tree_add_uint(gog_tree, gog->cfg->hfid_gog_num_of_gops, tvb, 0, 0, gog->num_of_gops); gog_gops_tree = proto_item_add_subtree(gog_gops_item, gog->cfg->ett_children); for (gog_gops = gog->gops; gog_gops; gog_gops = gog_gops->next) { if (gop != gog_gops) { if (gog->cfg->gop_tree_mode == GOP_FULL_TREE) { mate_gop_tree(gog_gops_tree, pinfo, tvb, gog_gops); } else { gog_gop_item = proto_tree_add_uint(gog_gops_tree,gog_gops->cfg->hfid,tvb,0,0,gog_gops->id); if (gog->cfg->gop_tree_mode == GOP_BASIC_TREE) { gog_gop_tree = proto_item_add_subtree(gog_gop_item, gog->cfg->ett_gog_gop); proto_tree_add_float(gog_gop_tree, hf_mate_started_at, tvb,0,0,gog_gops->start_time); proto_tree_add_float_format(gog_gop_tree, hf_mate_duration, tvb,0,0, gog_gops->last_time - gog_gops->start_time, "%s Duration: %f", gog_gops->cfg->name, gog_gops->last_time - gog_gops->start_time); if (gog_gops->released) proto_tree_add_float_format(gog_gop_tree, hf_mate_released_time, tvb,0,0, gog_gops->release_time - gog_gops->start_time, "%s has been released, Time: %f", gog_gops->cfg->name, gog_gops->release_time - gog_gops->start_time); proto_tree_add_uint(gog_gop_tree, hf_mate_number_of_pdus, tvb,0,0, gog_gops->num_of_pdus); if (gop->pdus && gop->cfg->pdu_tree_mode != GOP_NO_TREE) { proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstart,tvb,0,0,gog_gops->pdus->frame); for (pdu = gog_gops->pdus->next ; pdu; pdu = pdu->next) { if (pdu->is_stop) { proto_tree_add_uint(gog_gop_tree,gog->cfg->hfid_gog_gopstop,tvb,0,0,pdu->frame); break; } } } } } } else { proto_tree_add_uint_format(gog_gops_tree,gop->cfg->hfid,tvb,0,0,gop->id,"current %s Gop: %d",gop->cfg->name,gop->id); } } }