diff options
author | Michael Mann <mmann78@netscape.net> | 2014-07-09 21:21:32 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-07-10 01:51:21 +0000 |
commit | e6c87fe6b13f43d0c74ea8516d83a38ea4317688 (patch) | |
tree | 27eb9cf5e28b7fdb4fd99477b64e1062b7102cf6 /plugins | |
parent | 9b182b7097e339501977f595903c2e837055fb1d (diff) |
convert to proto_tree_add_subtree[_format] for plugin dissectors
Change-Id: I13924c5a2f056688a42cdee25654d82c056b5f97
Reviewed-on: https://code.wireshark.org/review/2974
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins')
26 files changed, 469 insertions, 868 deletions
diff --git a/plugins/docsis/packet-bpkmattr.c b/plugins/docsis/packet-bpkmattr.c index 8347b3cb76..c7428bedee 100644 --- a/plugins/docsis/packet-bpkmattr.c +++ b/plugins/docsis/packet-bpkmattr.c @@ -145,8 +145,6 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) guint16 length; int pos = 0; gint total_len; - proto_item *cmid_it, *tekp_it, *scap_it; - proto_item *saqry_it, *dnld_it, *sadsc_it; proto_tree *cmid_tree, *tekp_tree, *scap_tree; proto_tree *saqry_tree, *dnld_tree, *sadsc_tree; tvbuff_t *cmid_tvb, *tekp_tvb, *scap_tvb; @@ -185,11 +183,9 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) length, ENC_NA); break; case BPKM_CM_ID: - cmid_it = - proto_tree_add_text (tree, tvb, pos, length, - "5 CM Identification"); cmid_tree = - proto_item_add_subtree (cmid_it, ett_docsis_bpkmattr_cmid); + proto_tree_add_subtree(tree, tvb, pos, length, + ett_docsis_bpkmattr_cmid, NULL, "5 CM Identification"); cmid_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (cmid_tvb, pinfo, cmid_tree); break; @@ -240,10 +236,8 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) THROW (ReportedBoundsError); break; case BPKM_TEK_PARAM: - tekp_it = - proto_tree_add_text (tree, tvb, pos, length, "13 TEK Parameters"); tekp_tree = - proto_item_add_subtree (tekp_it, ett_docsis_bpkmattr_tekp); + proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_bpkmattr_tekp, NULL, "13 TEK Parameters"); tekp_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (tekp_tvb, pinfo, tekp_tree); break; @@ -272,11 +266,9 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) length, ENC_NA); break; case BPKM_SEC_CAPABILITIES: - scap_it = - proto_tree_add_text (tree, tvb, pos, length, - "19 Security Capabilities"); scap_tree = - proto_item_add_subtree (scap_it, ett_docsis_bpkmattr_scap); + proto_tree_add_subtree(tree, tvb, pos, length, + ett_docsis_bpkmattr_scap, NULL, "19 Security Capabilities"); scap_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (scap_tvb, pinfo, scap_tree); break; @@ -299,10 +291,8 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) THROW (ReportedBoundsError); break; case BPKM_SA_DESCRIPTOR: - sadsc_it = - proto_tree_add_text (tree, tvb, pos, length, "23 SA Descriptor"); sadsc_tree = - proto_item_add_subtree (sadsc_it, ett_docsis_bpkmattr_sadsc); + proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_bpkmattr_sadsc, NULL, "23 SA Descriptor"); sadsc_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (sadsc_tvb, pinfo, sadsc_tree); break; @@ -314,10 +304,8 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) THROW (ReportedBoundsError); break; case BPKM_SA_QUERY: - saqry_it = - proto_tree_add_text (tree, tvb, pos, length, "25 SA Query"); saqry_tree = - proto_item_add_subtree (saqry_it, ett_docsis_bpkmattr_saqry); + proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_bpkmattr_saqry, NULL, "25 SA Query"); saqry_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (saqry_tvb, pinfo, saqry_tree); break; @@ -340,11 +328,9 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) length, ENC_NA); break; case BPKM_DNLD_PARAMS: - dnld_it = - proto_tree_add_text (tree, tvb, pos, length, - "28 Download Parameters"); dnld_tree = - proto_item_add_subtree (dnld_it, ett_docsis_bpkmattr_dnld); + proto_tree_add_subtree(tree, tvb, pos, length, + ett_docsis_bpkmattr_dnld, NULL, "28 Download Parameters"); dnld_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (dnld_tvb, pinfo, dnld_tree); break; diff --git a/plugins/docsis/packet-dccack.c b/plugins/docsis/packet-dccack.c index d7b9c56b43..e6d7eb7f9f 100644 --- a/plugins/docsis/packet-dccack.c +++ b/plugins/docsis/packet-dccack.c @@ -61,8 +61,7 @@ dissect_dccack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { dcc_item = proto_tree_add_protocol_format (tree, proto_docsis_dccack, tvb, 0, - tvb_length_remaining (tvb, 0), - "DCC-ACK Message"); + -1, "DCC-ACK Message"); dcc_tree = proto_item_add_subtree (dcc_item, ett_docsis_dccack); proto_tree_add_item (dcc_tree, hf_docsis_dccack_tran_id, tvb, 0, 2, ENC_BIG_ENDIAN); diff --git a/plugins/docsis/packet-dccreq.c b/plugins/docsis/packet-dccreq.c index eedbe0a575..dc842e0488 100644 --- a/plugins/docsis/packet-dccreq.c +++ b/plugins/docsis/packet-dccreq.c @@ -113,13 +113,12 @@ static void dissect_dccreq_ds_params (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcc_item; proto_tree *dcc_tree; int pos; pos = start; - dcc_item = proto_tree_add_text ( tree, tvb, start, len, "2 DCC-REQ Downstream Params Encodings (Length = %u)", len); - dcc_tree = proto_item_add_subtree ( dcc_item , ett_docsis_dccreq_ds_params); + dcc_tree = proto_tree_add_subtree_format( tree, tvb, start, len, ett_docsis_dccreq_ds_params, NULL, + "2 DCC-REQ Downstream Params Encodings (Length = %u)", len); while ( pos < ( start + len) ) { @@ -198,13 +197,11 @@ static void dissect_dccreq_sf_sub (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcc_item; proto_tree *dcc_tree; int pos; pos = start; - dcc_item = proto_tree_add_text ( tree, tvb, start, len, "7 DCC-REQ Service Flow Substitution Encodings (Length = %u)", len); - dcc_tree = proto_item_add_subtree ( dcc_item , ett_docsis_dccreq_sf_sub); + dcc_tree = proto_tree_add_subtree_format( tree, tvb, start, len, ett_docsis_dccreq_sf_sub, NULL, "7 DCC-REQ Service Flow Substitution Encodings (Length = %u)", len); while ( pos < ( start + len) ) { @@ -271,8 +268,7 @@ dissect_dccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { dcc_item = proto_tree_add_protocol_format (tree, proto_docsis_dccreq, tvb, 0, - tvb_length_remaining (tvb, 0), - "DCC-REQ Message"); + -1, "DCC-REQ Message"); dcc_tree = proto_item_add_subtree (dcc_item, ett_docsis_dccreq); proto_tree_add_item (dcc_tree, hf_docsis_dccreq_tran_id, tvb, 0, 2, ENC_BIG_ENDIAN); diff --git a/plugins/docsis/packet-dccrsp.c b/plugins/docsis/packet-dccrsp.c index c2d91f7a90..4af42ba9f5 100644 --- a/plugins/docsis/packet-dccrsp.c +++ b/plugins/docsis/packet-dccrsp.c @@ -59,13 +59,12 @@ static void dissect_dccrsp_cm_jump_time (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcc_item; proto_tree *dcc_tree; int pos; pos = start; - dcc_item = proto_tree_add_text ( tree, tvb, start, len, "2 DCC-RSP CM Time Jump Encodings (Length = %u)", len); - dcc_tree = proto_item_add_subtree ( dcc_item , ett_docsis_dccrsp_cm_jump_time); + dcc_tree = proto_tree_add_subtree_format( tree, tvb, start, len, ett_docsis_dccrsp_cm_jump_time, NULL, + "2 DCC-RSP CM Time Jump Encodings (Length = %u)", len); while ( pos < ( start + len) ) { @@ -117,8 +116,7 @@ dissect_dccrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { dcc_item = proto_tree_add_protocol_format (tree, proto_docsis_dccrsp, tvb, 0, - tvb_length_remaining (tvb, 0), - "DCC-RSP Message"); + -1, "DCC-RSP Message"); dcc_tree = proto_item_add_subtree (dcc_item, ett_docsis_dccrsp); proto_tree_add_item (dcc_tree, hf_docsis_dccrsp_tran_id, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item (dcc_tree, hf_docsis_dccrsp_conf_code, tvb, 2, 1, ENC_BIG_ENDIAN); diff --git a/plugins/docsis/packet-dcd.c b/plugins/docsis/packet-dcd.c index db72e0c51e..e4573e50f5 100644 --- a/plugins/docsis/packet-dcd.c +++ b/plugins/docsis/packet-dcd.c @@ -129,13 +129,12 @@ static void dissect_dcd_dsg_cfg (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcd_item; proto_tree *dcd_tree; int pos; pos = start; - dcd_item = proto_tree_add_text ( tree, tvb, start, len, "51 DCD DSG Config Encodings (Length = %u)", len); - dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_cfg); + dcd_tree = proto_tree_add_subtree_format( tree, tvb, start, len, + ett_docsis_dcd_cfg, NULL, "51 DCD DSG Config Encodings (Length = %u)", len); while ( pos < ( start + len) ) { @@ -212,13 +211,11 @@ static void dissect_dcd_down_classifier_ip (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcd_item; proto_tree *dcd_tree; int pos; pos = start; - dcd_item = proto_tree_add_text ( tree, tvb, start, len, "23.9 DCD_CFR_IP Encodings (Length = %u)", len); - dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_cfr_ip); + dcd_tree = proto_tree_add_subtree_format( tree, tvb, start, len, ett_docsis_dcd_cfr_ip, NULL, "23.9 DCD_CFR_IP Encodings (Length = %u)", len); while ( pos < ( start + len) ) { @@ -323,13 +320,11 @@ static void dissect_dcd_clid (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcd_item; proto_tree *dcd_tree; int pos; pos = start; - dcd_item = proto_tree_add_text ( tree, tvb, start, len, "50.4 DCD Rule ClientID Encodings (Length = %u)", len); - dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_clid); + dcd_tree = proto_tree_add_subtree_format( tree, tvb, start, len, ett_docsis_dcd_clid, NULL, "50.4 DCD Rule ClientID Encodings (Length = %u)", len); while ( pos < ( start + len) ) { @@ -389,13 +384,11 @@ static void dissect_dcd_dsg_rule (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcd_item; proto_tree *dcd_tree; int pos; pos = start; - dcd_item = proto_tree_add_text ( tree, tvb, start, len, "50 DCD DSG Rule Encodings (Length = %u)", len); - dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_rule); + dcd_tree = proto_tree_add_subtree_format( tree, tvb, start, len, ett_docsis_dcd_rule, NULL, "50 DCD DSG Rule Encodings (Length = %u)", len); while ( pos < ( start + len) ) { @@ -468,13 +461,11 @@ static void dissect_dcd_down_classifier (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *dcd_item; proto_tree *dcd_tree; int pos; pos = start; - dcd_item = proto_tree_add_text ( tree, tvb, start, len, "23 DCD_CFR Encodings (Length = %u)", len); - dcd_tree = proto_item_add_subtree ( dcd_item , ett_docsis_dcd_cfr); + dcd_tree = proto_tree_add_subtree_format( tree, tvb, start, len, ett_docsis_dcd_cfr, NULL, "23 DCD_CFR Encodings (Length = %u)", len); while ( pos < ( start + len) ) { diff --git a/plugins/docsis/packet-docsis.c b/plugins/docsis/packet-docsis.c index 4002571920..1d2cb23f15 100644 --- a/plugins/docsis/packet-docsis.c +++ b/plugins/docsis/packet-docsis.c @@ -188,7 +188,7 @@ static void dissect_ehdr (tvbuff_t * tvb, proto_tree * tree, gboolean isfrag) { proto_tree *ehdr_tree; - proto_item *it, *item; + proto_item *item; gint ehdrlen; int pos; guint8 type; @@ -200,8 +200,7 @@ dissect_ehdr (tvbuff_t * tvb, proto_tree * tree, gboolean isfrag) ehdrlen = tvb_get_guint8 (tvb, 1); pos = 4; - it = proto_tree_add_text (tree, tvb, pos, ehdrlen, "Extended Header"); - ehdr_tree = proto_item_add_subtree (it, ett_ehdr); + ehdr_tree = proto_tree_add_subtree(tree, tvb, pos, ehdrlen, ett_ehdr, NULL, "Extended Header"); while (pos < ehdrlen + 4) { type = (tvb_get_guint8 (tvb, pos) & 0xF0); @@ -313,18 +312,18 @@ dissect_ehdr (tvbuff_t * tvb, proto_tree * tree, gboolean isfrag) ENC_BIG_ENDIAN); break; case EH_DS_SERVICE: - proto_tree_add_item(ehdr_tree, hf_docsis_ehdr_ds_traffic_pri, tvb, pos+1, 1, FALSE); + proto_tree_add_item(ehdr_tree, hf_docsis_ehdr_ds_traffic_pri, tvb, pos+1, 1, ENC_BIG_ENDIAN); if (len == 3) { - proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_dsid, tvb, pos+1, 3, FALSE); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_dsid, tvb, pos+1, 3, ENC_BIG_ENDIAN); } if (len == 5) { - proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_seq_chg_cnt, tvb, pos+1, 1, FALSE); - proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_dsid, tvb, pos+1, 3, FALSE); - proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_pkt_seq_num, tvb, pos+4, 2, FALSE); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_seq_chg_cnt, tvb, pos+1, 1, ENC_BIG_ENDIAN); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_dsid, tvb, pos+1, 3, ENC_BIG_ENDIAN); + proto_tree_add_item (ehdr_tree, hf_docsis_ehdr_ds_pkt_seq_num, tvb, pos+4, 2, ENC_BIG_ENDIAN); } break; diff --git a/plugins/docsis/packet-mdd.c b/plugins/docsis/packet-mdd.c index e5d6e0ff10..764d84aff3 100644 --- a/plugins/docsis/packet-mdd.c +++ b/plugins/docsis/packet-mdd.c @@ -314,10 +314,8 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) guint8 subtype, sublength; int i; - proto_item *tlv_item; proto_tree *tlv_tree; - proto_item *tlv_sub_item; proto_tree *tlv_sub_tree; proto_item *text_item; @@ -342,8 +340,7 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { type = tvb_get_guint8 (tvb, pos); length = tvb_get_guint8 (tvb, pos + 1); - tlv_item = proto_tree_add_text (mdd_tree, tvb, pos, length + 2,"%s", val_to_str(type, mdd_tlv_vals, "Unknown TLV (%u)")); - tlv_tree = proto_item_add_subtree (tlv_item, ett_tlv); + tlv_tree = proto_tree_add_subtree(mdd_tree, tvb, pos, length + 2, ett_tlv, NULL, val_to_str(type, mdd_tlv_vals, "Unknown TLV (%u)")); switch(type) { @@ -360,8 +357,7 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_frequency, tvb, subpos + 2 , 4, ENC_BIG_ENDIAN); break; case DOWNSTREAM_ACTIVE_CHANNEL_LIST_MODULATION_ORDER_ANNEX: - tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 1, "Modulation Order/Annex"); - tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv); + tlv_sub_tree = proto_tree_add_subtree(tlv_tree, tvb, subpos + 2, 1, ett_sub_tlv, NULL, "Modulation Order/Annex"); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_downstream_active_channel_list_modulation_order, tvb, subpos + 2 , 1, ENC_BIG_ENDIAN); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_downstream_active_channel_list_annex, tvb, subpos + 2 , 1, ENC_BIG_ENDIAN); break; @@ -369,8 +365,7 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (tlv_tree, hf_docsis_mdd_downstream_active_channel_list_primary_capable, tvb, subpos + 2 , 1, ENC_BIG_ENDIAN); break; case DOWNSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK: - tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 2, "CM-STATUS Event Enable Bitmask"); - tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv); + tlv_sub_tree = proto_tree_add_subtree(tlv_tree, tvb, subpos + 2, 2, ett_sub_tlv, NULL, "CM-STATUS Event Enable Bitmask"); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_timeout, tvb, subpos + 2 , 2,ENC_BIG_ENDIAN); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_qam_fec_lock_failure, tvb, subpos + 2 , 2, ENC_BIG_ENDIAN); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_mdd_recovery, tvb, subpos + 2 , 2,ENC_BIG_ENDIAN); @@ -450,8 +445,7 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (tlv_tree, hf_docsis_mdd_upstream_active_channel_list_upstream_channel_id, tvb, subpos + 2 , 1, ENC_BIG_ENDIAN); break; case UPSTREAM_ACTIVE_CHANNEL_LIST_CM_STATUS_EVENT_ENABLE_BITMASK: - tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos + 2, 2, "CM-STATUS Event Enable Bitmask"); - tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv); + tlv_sub_tree = proto_tree_add_subtree(tlv_tree, tvb, subpos + 2, 2, ett_sub_tlv, NULL, "CM-STATUS Event Enable Bitmask"); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_t4_timeout, tvb, subpos + 2 , 2, ENC_BIG_ENDIAN); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_t3_retries_exceeded, tvb, subpos + 2 , 2, ENC_BIG_ENDIAN); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_bitmask_successful_ranging_after_t3_retries_exceeded, tvb, subpos + 2 , 2, ENC_BIG_ENDIAN); @@ -508,7 +502,7 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) sublength = tvb_get_guint8 (tvb, subpos + 1); switch(subtype) { case DSG_DA_TO_DSID_ASSOCIATION_DA: - proto_tree_add_item (tlv_tree, hf_docsis_mdd_dsg_da_to_dsid_association_da, tvb, subpos + 2, 6, ENC_BIG_ENDIAN); + proto_tree_add_item (tlv_tree, hf_docsis_mdd_dsg_da_to_dsid_association_da, tvb, subpos + 2, 6, ENC_NA); break; case DSG_DA_TO_DSID_ASSOCIATION_DSID: proto_tree_add_item (tlv_tree, hf_docsis_mdd_dsg_da_to_dsid_association_dsid, tvb, subpos + 2, 3, ENC_BIG_ENDIAN); @@ -519,8 +513,7 @@ dissect_mdd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) break; case CM_STATUS_EVENT_ENABLE_NON_CHANNEL_SPECIFIC_EVENTS: subpos = pos + 2; - tlv_sub_item = proto_tree_add_text (tlv_tree, tvb, subpos, 2, "CM-STATUS Event Enable Bitmask for Non-Channel-Specific Events"); - tlv_sub_tree = proto_item_add_subtree (tlv_sub_item, ett_sub_tlv); + tlv_sub_tree = proto_tree_add_subtree(tlv_tree, tvb, subpos, 2, ett_sub_tlv, NULL, "CM-STATUS Event Enable Bitmask for Non-Channel-Specific Events"); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_sequence_out_of_range, tvb, subpos, 2,ENC_BIG_ENDIAN); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_operating_on_battery_backup, tvb, subpos , 2,ENC_BIG_ENDIAN); proto_tree_add_item (tlv_sub_tree, hf_docsis_mdd_cm_status_event_enable_non_channel_specific_events_cm_returned_to_ac_power, tvb, subpos , 2,ENC_BIG_ENDIAN); diff --git a/plugins/docsis/packet-tlv-cmctrl.c b/plugins/docsis/packet-tlv-cmctrl.c index da682dec7c..1bba35c317 100644 --- a/plugins/docsis/packet-tlv-cmctrl.c +++ b/plugins/docsis/packet-tlv-cmctrl.c @@ -67,13 +67,11 @@ static void dissect_ds_event(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *event_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + event_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_cmctrl_tlv_ds_event, NULL, "Override Downstream Status Event Event Mask (Length = %u)", len); - event_tree = proto_item_add_subtree (it, ett_cmctrl_tlv_ds_event); while (pos < (start + len)) { @@ -112,13 +110,11 @@ static void dissect_us_event(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *event_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + event_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_cmctrl_tlv_us_event, NULL, "Override Upstream Status Enable Event Mask (Length = %u)", len); - event_tree = proto_item_add_subtree (it, ett_cmctrl_tlv_us_event); while (pos < (start + len)) { diff --git a/plugins/docsis/packet-tlv.c b/plugins/docsis/packet-tlv.c index e98f1ab511..8d586c4e06 100644 --- a/plugins/docsis/packet-tlv.c +++ b/plugins/docsis/packet-tlv.c @@ -645,13 +645,11 @@ dissect_phs_err (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *err_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + err_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_sflow_err, NULL, "5 Service Flow Error Encodings (Length = %u)", len); - err_tree = proto_item_add_subtree (it, ett_docsis_tlv_sflow_err); while (pos < (start + len)) { @@ -695,13 +693,11 @@ static void dissect_phs (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *phs_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + phs_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_phs, NULL, "26 PHS Encodings (Length = %u)", len); - phs_tree = proto_item_add_subtree (it, ett_docsis_tlv_phs); while (pos < (start + len)) { @@ -865,13 +861,11 @@ dissect_sflow_err (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *err_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + err_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_sflow_err, NULL, "5 Service Flow Error Encodings (Length = %u)", len); - err_tree = proto_item_add_subtree (it, ett_docsis_tlv_sflow_err); while (pos < (start + len)) { @@ -1088,20 +1082,18 @@ dissect_sflow (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len, guint8 direction) { guint8 type, length; - proto_item *it; proto_tree *sflow_tree; int pos = start; if (direction == 24) - it = - proto_tree_add_text (tree, tvb, start, len, + sflow_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_clsfr, NULL, "24 Upstream Service Flow (Length = %u)", len); else if (direction == 25) - it = - proto_tree_add_text (tree, tvb, start, len, + sflow_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_clsfr, NULL, "25 Downstream Service Flow (Length = %u)", len); else return; - sflow_tree = proto_item_add_subtree (it, ett_docsis_tlv_clsfr); while (pos < (start + len)) { @@ -1262,13 +1254,11 @@ dissect_dot1q_clsfr (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *dot1qclsfr_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + dot1qclsfr_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_cos, NULL, "11 801.1P/Q Classifiers (Length = %u)", len); - dot1qclsfr_tree = proto_item_add_subtree (it, ett_docsis_tlv_cos); while (pos < (start + len)) { @@ -1316,13 +1306,11 @@ dissect_eth_clsfr (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *ethclsfr_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + ethclsfr_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_clsfr_eth, NULL, "10 Ethernet Classifiers (Length = %u)", len); - ethclsfr_tree = proto_item_add_subtree (it, ett_docsis_tlv_clsfr_eth); while (pos < (start + len)) { @@ -1378,13 +1366,11 @@ dissect_clsfr_err (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *err_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + err_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_clsfr_err, NULL, "8 Classifier Error Encodings (Length = %u)", len); - err_tree = proto_item_add_subtree (it, ett_docsis_tlv_clsfr_err); while (pos < (start + len)) { @@ -1437,13 +1423,11 @@ dissect_ip_classifier (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *ipclsfr_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + ipclsfr_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_clsfr_ip, NULL, "9 IP Classifier (Length = %u)", len); - ipclsfr_tree = proto_item_add_subtree (it, ett_docsis_tlv_clsfr_ip); while (pos < (start + len)) { @@ -1580,22 +1564,20 @@ dissect_classifiers (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len, guint8 direction) { guint8 type, length; - proto_item *it; proto_tree *clsfr_tree; int pos = start; if (direction == 22) - it = - proto_tree_add_text (tree, tvb, start, len, + clsfr_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_clsfr, NULL, "22 Upstream Packet Classifier (Length = %u)", len); else if (direction == 23) - it = - proto_tree_add_text (tree, tvb, start, len, + clsfr_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_clsfr, NULL, "23 Downstream Packet Classifier (Length = %u)", len); else return; - clsfr_tree = proto_item_add_subtree (it, ett_docsis_tlv_clsfr); while (pos < (start + len)) { @@ -1710,13 +1692,11 @@ dissect_doc10cos (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *doc10cos_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + doc10cos_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_cos, NULL, "1 Docsis 1.0 Class of Service (Length = %u)", len); - doc10cos_tree = proto_item_add_subtree (it, ett_docsis_tlv_cos); while (pos < (start + len)) { @@ -1757,15 +1737,13 @@ dissect_modemcap (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *mcap_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + mcap_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_mcap, NULL, "5 Modem Capabilities Type (Length = %u)", len); - mcap_tree = proto_item_add_subtree (it, ett_docsis_tlv_mcap); while (pos < (start + len)) { type = tvb_get_guint8 (tvb, pos++); @@ -2222,14 +2200,12 @@ static void dissect_cos (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *cos_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + cos_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_cos, NULL, "4 Class of Service Type (Length = %u)", len); - cos_tree = proto_item_add_subtree (it, ett_docsis_tlv_cos); while (pos < (start + len)) { @@ -2380,13 +2356,11 @@ dissect_ds_ch_list_single (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *single_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + single_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_ds_ch_list_single, NULL, "1 Single Downstream Channel (Length = %u)", len); - single_tree = proto_item_add_subtree (it, ett_docsis_tlv_ds_ch_list_single); while (pos < (start + len)) { @@ -2426,13 +2400,11 @@ dissect_ds_ch_list_range (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *range_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + range_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_ds_ch_list_range, NULL, "2 Downstream Frequency Range (Length = %u)", len); - range_tree = proto_item_add_subtree (it, ett_docsis_tlv_ds_ch_list_range); while (pos < (start + len)) { @@ -2494,13 +2466,11 @@ dissect_dut_filter (tvbuff_t * tvb, proto_tree * tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *dut_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + dut_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_dut_filter, NULL, "Downstream Unencrypted Traffic (Length = %u)", len); - dut_tree = proto_item_add_subtree (it, ett_docsis_tlv_dut_filter); while (pos < (start + len)) { @@ -2532,13 +2502,11 @@ static void dissect_ds_ch_list(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *dschlst_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + dschlst_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_ds_ch_list, NULL, "41 Downstream Channel List (Length = %u)", len); - dschlst_tree = proto_item_add_subtree (it, ett_docsis_tlv_ds_ch_list); while (pos < (start + len)) { @@ -2573,13 +2541,11 @@ static void dissect_tcc_err(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *tccerr_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + tccerr_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_tcc_err, NULL, "TCC Error Encodings (Length = %u)", len); - tccerr_tree = proto_item_add_subtree (it, ett_docsis_tlv_tcc_err); while (pos < (start + len)) { @@ -2618,13 +2584,11 @@ static void dissect_tcc_rng_parms(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *rngparm_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + rngparm_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_tcc_rng_parms, NULL, "Ranging Parameters (Length = %u)", len); - rngparm_tree = proto_item_add_subtree (it, ett_docsis_tlv_tcc_rng_parms); while (pos < (start + len)) { @@ -2701,13 +2665,11 @@ static void dissect_sid_cl_so_crit(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *crit_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + crit_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_sid_cl_so, NULL, "SID Cluster Switchover Criteria (Length = %u)", len); - crit_tree = proto_item_add_subtree (it, ett_docsis_tlv_sid_cl_so); while (pos < (start + len)) { @@ -2772,13 +2734,11 @@ static void dissect_sid_cl_enc_map(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *map_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + map_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_sid_cl_enc_map, NULL, "SID-to-Channel Mapping (Length = %u)", len); - map_tree = proto_item_add_subtree (it, ett_docsis_tlv_sid_cl_enc_map); while (pos < (start + len)) { @@ -2831,13 +2791,11 @@ static void dissect_sid_cl_enc(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *enc_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + enc_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_sid_cl_enc, NULL, "SID Cluster Encoding (Length = %u)", len); - enc_tree = proto_item_add_subtree (it, ett_docsis_tlv_sid_cl_enc); while (pos < (start + len)) { @@ -2872,13 +2830,11 @@ static void dissect_sid_cl(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *sid_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + sid_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_sid_cl, NULL, "47 Service Flow SID Cluster Assignments (Length = %u)", len); - sid_tree = proto_item_add_subtree (it, ett_docsis_tlv_sid_cl); while (pos < (start + len)) { @@ -2914,15 +2870,13 @@ dissect_tcc(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *tcc_tree; int pos = start; tvbuff_t *ucd_tvb; - it = - proto_tree_add_text (tree, tvb, start, len, + tcc_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_tcc, NULL, "46 Transmit Channel Configuration (Length = %u)", len); - tcc_tree = proto_item_add_subtree (it, ett_docsis_tlv_tcc); while (pos < (start + len)) { @@ -3033,13 +2987,11 @@ static void dissect_ch_bl_rng(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *chblrng_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + chblrng_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcp_ch_bl_rng, NULL, "Receive Module Channel Block Range (Length = %u)", len); - chblrng_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcp_ch_bl_rng); while (pos < (start + len)) { @@ -3080,13 +3032,11 @@ static void dissect_rcp_rcv_mod(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *rcvmod_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + rcvmod_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcp_rcv_mod_enc, NULL, "Receive Module Capability (Length = %u)", len); - rcvmod_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcp_rcv_mod_enc); while (pos < (start + len)) { @@ -3114,7 +3064,7 @@ dissect_rcp_rcv_mod(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { proto_tree_add_item (rcvmod_tree, hf_docsis_rcv_mod_enc_ctr_freq_asgn, tvb, pos, - length, FALSE); + length, ENC_BIG_ENDIAN); } else { @@ -3145,13 +3095,11 @@ static void dissect_rcp_rcv_ch(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *rcvch_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + rcvch_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcp_rcv_ch, NULL, "Receive Channels (Length = %u)", len); - rcvch_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcp_rcv_ch); while (pos < (start + len)) { @@ -3211,15 +3159,13 @@ dissect_rcp(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *rcp_tree; int pos = start; tvbuff_t *vsif_tvb; - it = - proto_tree_add_text (tree, tvb, start, len, + rcp_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcp, NULL, "48 Receive Channel Profile (Length = %u)", len); - rcp_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcp); while (pos < (start + len)) { @@ -3282,13 +3228,11 @@ static void dissect_rcc_rcv_mod(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *rcvmod_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + rcvmod_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcc_rcv_mod_enc, NULL, "Receive Module Assignment (Length = %u)", len); - rcvmod_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcc_rcv_mod_enc); while (pos < (start + len)) { @@ -3334,13 +3278,11 @@ static void dissect_rcc_rcv_ch(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *rcvch_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + rcvch_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcc_rcv_ch, NULL, "Receive Channels (Length = %u)", len); - rcvch_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcc_rcv_ch); while (pos < (start + len)) { @@ -3398,13 +3340,11 @@ static void dissect_rcc_err(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *err_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + err_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcc_rcv_ch, NULL, "RCC Error Encodings (Length = %u)", len); - err_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcc_rcv_ch); while (pos < (start + len)) { @@ -3475,15 +3415,13 @@ dissect_rcc(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *rcc_tree; int pos = start; tvbuff_t *vsif_tvb; - it = - proto_tree_add_text (tree, tvb, start, len, + rcc_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_rcc, NULL, "49 Receive Channel Configuration (Length = %u)", len); - rcc_tree = proto_item_add_subtree (it, ett_docsis_tlv_rcc); while (pos < (start + len)) { @@ -3525,13 +3463,11 @@ static void dissect_dsid_ds_reseq(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *dsid_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + dsid_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_dsid_ds_reseq, NULL, "Resequencing DSID (Length = %u)", len); - dsid_tree = proto_item_add_subtree (it, ett_docsis_tlv_dsid_ds_reseq); while (pos < (start + len)) { @@ -3601,13 +3537,11 @@ static void dissect_dsid_mc_addr(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *dsid_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + dsid_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_dsid_mc_addr, NULL, "Client MAC Address Encodings (Length = %u)", len); - dsid_tree = proto_item_add_subtree (it, ett_docsis_tlv_dsid_mc_addr); while (pos < (start + len)) { @@ -3648,13 +3582,11 @@ static void dissect_dsid_mc(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *dsid_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + dsid_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_dsid_mc, NULL, "Multicast Encodings (Length = %u)", len); - dsid_tree = proto_item_add_subtree (it, ett_docsis_tlv_dsid_mc); while (pos < (start + len)) { @@ -3687,13 +3619,11 @@ static void dissect_dsid(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *dsid_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + dsid_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_dsid, NULL, "50 DSID Encodings (Length = %u)", len); - dsid_tree = proto_item_add_subtree (it, ett_docsis_tlv_dsid); while (pos < (start + len)) { @@ -3740,13 +3670,11 @@ static void dissect_sec_assoc(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *sec_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + sec_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_dsid, NULL, "51 Security Association Encodings (Length = %u)", len); - sec_tree = proto_item_add_subtree (it, ett_docsis_tlv_dsid); while (pos < (start + len)) { @@ -3787,13 +3715,11 @@ static void dissect_ch_asgn(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *asgn_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + asgn_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_tlv_ch_asgn, NULL, "56 Channel Assignment Configuration Settings (Length = %u)", len); - asgn_tree = proto_item_add_subtree (it, ett_docsis_tlv_ch_asgn); while (pos < (start + len)) { @@ -3834,13 +3760,11 @@ static void dissect_cmts_mc_sess_enc(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len) { guint8 type, length; - proto_item *it; proto_tree *mc_tree; int pos = start; - it = - proto_tree_add_text (tree, tvb, start, len, + mc_tree = + proto_tree_add_subtree_format(tree, tvb, start, len, ett_docsis_cmts_mc_sess_enc, NULL, "64 CMTS Static Multicast Session Encoding (Length = %u)", len); - mc_tree = proto_item_add_subtree (it, ett_docsis_cmts_mc_sess_enc); while (pos < (start + len)) { diff --git a/plugins/docsis/packet-type29ucd.c b/plugins/docsis/packet-type29ucd.c index e4f48776fe..922af953b5 100644 --- a/plugins/docsis/packet-type29ucd.c +++ b/plugins/docsis/packet-type29ucd.c @@ -196,7 +196,6 @@ dissect_type29ucd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) guint8 type, length; guint8 tlvlen, tlvtype; proto_tree *burst_descr_tree; - proto_item *it; proto_tree *type29ucd_tree; proto_item *type29ucd_item; guint16 len; @@ -408,11 +407,10 @@ dissect_type29ucd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) break; /* DOCSIS 1.1 BURST DESCRIPTOR */ case type29ucd_BURST_DESCR: - it = - proto_tree_add_text (type29ucd_tree, tvb, pos, length, - "4 Burst Descriptor (Length = %u)", + burst_descr_tree = + proto_tree_add_subtree_format(type29ucd_tree, tvb, pos, length, + ett_burst_descr, NULL, "4 Burst Descriptor (Length = %u)", length); - burst_descr_tree = proto_item_add_subtree (it, ett_burst_descr); proto_tree_add_item (burst_descr_tree, hf_docsis_type29ucd_iuc, tvb, pos++, 1, ENC_BIG_ENDIAN); endtlvpos = pos + length - 1; @@ -560,11 +558,10 @@ dissect_type29ucd (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) break; /* DOCSIS 2.0 Upstream Channel Descriptor */ case type29ucd_BURST_DESCR5: - it = - proto_tree_add_text (type29ucd_tree, tvb, pos, length, - "5 Burst Descriptor (Length = %u)", + burst_descr_tree = + proto_tree_add_subtree_format(type29ucd_tree, tvb, pos, length, + ett_burst_descr, NULL, "5 Burst Descriptor (Length = %u)", length); - burst_descr_tree = proto_item_add_subtree (it, ett_burst_descr); proto_tree_add_item (burst_descr_tree, hf_docsis_type29ucd_iuc, tvb, pos++, 1, ENC_BIG_ENDIAN); endtlvpos = pos + length - 1; diff --git a/plugins/docsis/packet-ucd.c b/plugins/docsis/packet-ucd.c index 62d0812c5f..a70d103a6a 100644 --- a/plugins/docsis/packet-ucd.c +++ b/plugins/docsis/packet-ucd.c @@ -199,11 +199,10 @@ static void while (pos < len) { type = tvb_get_guint8 (tvb, pos); - tlv_item = proto_tree_add_text (ucd_tree, tvb, pos, -1, - "%s", + tlv_tree = proto_tree_add_subtree(ucd_tree, tvb, pos, -1, + ett_tlv, &tlv_item, val_to_str(type, channel_tlv_vals, "Unknown TLV (%u)")); - tlv_tree = proto_item_add_subtree (tlv_item, ett_tlv); proto_tree_add_uint (tlv_tree, hf_docsis_ucd_type, tvb, pos, 1, type); pos++; diff --git a/plugins/docsis/packet-vendor.c b/plugins/docsis/packet-vendor.c index 72a42d1dba..6794e4207e 100644 --- a/plugins/docsis/packet-vendor.c +++ b/plugins/docsis/packet-vendor.c @@ -148,7 +148,6 @@ dissect_cisco (tvbuff_t * tvb, proto_tree * tree, gint vsif_len) /* Start at pos = 5, since tvb includes the Vendor ID field */ int pos = 5; guint8 type, length; - proto_item *ipprec_it; proto_tree *ipprec_tree; int templen; @@ -164,10 +163,8 @@ dissect_cisco (tvbuff_t * tvb, proto_tree * tree, gint vsif_len) pos, length, ENC_BIG_ENDIAN); break; case IP_PREC: - ipprec_it = - proto_tree_add_text (tree, tvb, pos, length, "IP Precedence"); ipprec_tree = - proto_item_add_subtree (ipprec_it, ett_docsis_vsif_ipprec); + proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_vsif_ipprec, NULL, "IP Precedence"); /* Handle Sub-TLVs in IP Precedence */ templen = pos + length; while (pos < templen) diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index 24e18cdf1e..2e123dbe40 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -1315,8 +1315,7 @@ static void dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree * ecat_mailbox_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox); /* Create a mailbox header subtree */ - anItem = proto_tree_add_text(ecat_mailbox_tree, tvb, offset, ETHERCAT_MBOX_HEADER_LEN, "Header"); - ecat_mailbox_header_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_header); + ecat_mailbox_header_tree = proto_tree_add_subtree(ecat_mailbox_tree, tvb, offset, ETHERCAT_MBOX_HEADER_LEN, ett_ecat_mailbox_header, NULL, "Header"); /* Add length information to the mailbox header */ proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxlength, tvb, offset, sizeof(hdr.Length), ENC_LITTLE_ENDIAN); diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c index db945f3781..c201c68ec3 100644 --- a/plugins/ethercat/packet-ethercat-datagram.c +++ b/plugins/ethercat/packet-ethercat-datagram.c @@ -542,12 +542,10 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree { /* Create the sub tree for the current datagram */ EcSubFormatter(tvb, suboffset, szText, nMax); - aitem = proto_tree_add_text(ecat_datagrams_tree, tvb, suboffset, subsize, "%s", szText); - ecat_datagram_tree = proto_item_add_subtree(aitem, ett_ecat_datagram_subtree); + ecat_datagram_tree = proto_tree_add_subtree(ecat_datagrams_tree, tvb, suboffset, subsize, ett_ecat_datagram_subtree, NULL, szText); /* Create a subtree placeholder for the Header */ - aitem = proto_tree_add_text(ecat_datagram_tree, tvb, offset, EcParserHDR_Len, "Header"); - ecat_header_tree = proto_item_add_subtree(aitem, ett_ecat_header); + ecat_header_tree = proto_tree_add_subtree(ecat_datagram_tree, tvb, offset, EcParserHDR_Len, ett_ecat_header, NULL, "Header"); EcCmdFormatter(ecHdr.cmd, szText, nMax); aitem = proto_tree_add_item(ecat_header_tree, hf_ecat_cmd, tvb, suboffset, sizeof(ecHdr.cmd), ENC_LITTLE_ENDIAN); @@ -601,10 +599,9 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Add information about the length field (11 bit length, 3 bits reserved, 1 bit circulating frame and 1 bit more in a sub tree */ - aitem = proto_tree_add_text(ecat_header_tree, tvb, suboffset, sizeof(ecHdr.len), - "Length : %d (0x%x) - %s - %s", + length_sub_tree = proto_tree_add_subtree_format(ecat_header_tree, tvb, suboffset, sizeof(ecHdr.len), + ett_ecat_length, NULL, "Length : %d (0x%x) - %s - %s", len, len, ecHdr.len & 0x4000 ? "Roundtrip" : "No Roundtrip", ecHdr.len & 0x8000 ? "More Follows..." : "Last Sub Command"); - length_sub_tree = proto_item_add_subtree(aitem, ett_ecat_length); proto_tree_add_item(length_sub_tree, hf_ecat_length_len, tvb, suboffset, sizeof(ecHdr.len), ENC_LITTLE_ENDIAN); proto_tree_add_item(length_sub_tree, hf_ecat_length_r, tvb, suboffset, sizeof(ecHdr.len), ENC_LITTLE_ENDIAN); diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c index be0df39ffd..e0a5d54432 100644 --- a/plugins/gryphon/packet-gryphon.c +++ b/plugins/gryphon/packet-gryphon.c @@ -780,7 +780,7 @@ dissect_gryphon_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *gryphon_tree; proto_item *ti; proto_tree *header_tree, *body_tree, *local_tree; - proto_item *header_item, *body_item, *local_item; + proto_item *local_item; int msgend; int msglen, msgpad; unsigned int src, dest, i, frmtyp; @@ -827,8 +827,7 @@ dissect_gryphon_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return; } - header_item = proto_tree_add_text(gryphon_tree, tvb, offset, MSG_HDR_SZ, "Header"); - header_tree = proto_item_add_subtree(header_item, ett_gryphon_header); + header_tree = proto_tree_add_subtree(gryphon_tree, tvb, offset, MSG_HDR_SZ, ett_gryphon_header, NULL, "Header"); proto_tree_add_item(header_tree, hf_gryphon_src, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(header_tree, hf_gryphon_srcchan, tvb, offset+1, 1, ENC_BIG_ENDIAN); @@ -850,9 +849,8 @@ dissect_gryphon_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, msgpad = 3 - (msglen + 3) % 4; msgend = offset + msglen + msgpad + MSG_HDR_SZ; - body_item = proto_tree_add_text(gryphon_tree, tvb, offset + MSG_HDR_SZ, - msglen + msgpad, "Body"); - body_tree = proto_item_add_subtree(body_item, ett_gryphon_body); + body_tree = proto_tree_add_subtree(gryphon_tree, tvb, offset + MSG_HDR_SZ, + msglen + msgpad, ett_gryphon_body, NULL, "Body"); offset += MSG_HDR_SZ; switch (frmtyp) { @@ -893,7 +891,6 @@ decode_command(tvbuff_t *tvb, int offset, int dst, proto_tree *pt) int cmd, msglen; unsigned int i; proto_tree *ft; - proto_item *ti; proto_item *hi; msglen = tvb_reported_length_remaining(tvb, offset); @@ -922,9 +919,8 @@ decode_command(tvbuff_t *tvb, int offset, int dst, proto_tree *pt) msglen -= 4; if (cmds[i].cmd_fnct && msglen > 0) { - ti = proto_tree_add_text(pt, tvb, offset, -1, "Data: (%d byte%s)", - msglen, msglen == 1 ? "" : "s"); - ft = proto_item_add_subtree(ti, ett_gryphon_command_data); + ft = proto_tree_add_subtree_format(pt, tvb, offset, -1, ett_gryphon_command_data, NULL, + "Data: (%d byte%s)", msglen, msglen == 1 ? "" : "s"); offset = (*(cmds[i].cmd_fnct)) (tvb, offset, ft); } return offset; @@ -936,7 +932,6 @@ decode_response(tvbuff_t *tvb, int offset, int src, proto_tree *pt) int cmd, msglen; unsigned int i; proto_tree *ft; - proto_item *ti; msglen = tvb_reported_length_remaining(tvb, offset); cmd = tvb_get_guint8(tvb, offset); @@ -965,9 +960,8 @@ decode_response(tvbuff_t *tvb, int offset, int src, proto_tree *pt) msglen -= 4; if (cmds[i].rsp_fnct && msglen > 0) { - ti = proto_tree_add_text(pt, tvb, offset, msglen, "Data: (%d byte%s)", - msglen, msglen == 1 ? "" : "s"); - ft = proto_item_add_subtree(ti, ett_gryphon_response_data); + ft = proto_tree_add_subtree_format(pt, tvb, offset, msglen, ett_gryphon_response_data, NULL, + "Data: (%d byte%s)", msglen, msglen == 1 ? "" : "s"); offset = (*(cmds[i].rsp_fnct)) (tvb, offset, ft); } return offset; @@ -976,7 +970,7 @@ decode_response(tvbuff_t *tvb, int offset, int src, proto_tree *pt) static int decode_data(tvbuff_t *tvb, int offset, proto_tree *pt) { - proto_item *item, *item1; + proto_item *item1; proto_tree *tree, *tree1; int hdrsize, datasize, extrasize, /* hdrbits, */ msgsize, padding, mode; nstime_t timestamp; @@ -988,8 +982,7 @@ decode_data(tvbuff_t *tvb, int offset, proto_tree *pt) padding = 3 - (hdrsize + datasize + extrasize + 3) % 4; msgsize = hdrsize + datasize + extrasize + padding + 16; - item = proto_tree_add_text(pt, tvb, offset, 16, "Message header"); - tree = proto_item_add_subtree (item, ett_gryphon_data_header); + tree = proto_tree_add_subtree(pt, tvb, offset, 16, ett_gryphon_data_header, NULL, "Message header"); proto_tree_add_item(tree, hf_gryphon_data_header_length, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gryphon_data_data_length, tvb, offset+2, 2, ENC_BIG_ENDIAN); @@ -1017,8 +1010,7 @@ decode_data(tvbuff_t *tvb, int offset, proto_tree *pt) proto_tree_add_item(tree, hf_gryphon_reserved3, tvb, offset+13, 3, ENC_BIG_ENDIAN); offset += 16; - item = proto_tree_add_text(pt, tvb, offset, msgsize-16-padding, "Message Body"); - tree = proto_item_add_subtree (item, ett_gryphon_data_body); + tree = proto_tree_add_subtree(pt, tvb, offset, msgsize-16-padding, ett_gryphon_data_body, NULL, "Message Body"); if (hdrsize) { proto_tree_add_item(tree, hf_gryphon_data_header_data, tvb, offset, hdrsize, ENC_NA); offset += hdrsize; @@ -1177,26 +1169,23 @@ cmd_ioctl(tvbuff_t *tvb, int offset, proto_tree *pt) static int cmd_addfilt(tvbuff_t *tvb, int offset, proto_tree *pt) { - proto_item *item; proto_tree *tree; int blocks, i, length; - item = proto_tree_add_text(pt, tvb, offset, 1, "Flags"); - tree = proto_item_add_subtree (item, ett_gryphon_flags); + tree = proto_tree_add_subtree(pt, tvb, offset, 1, ett_gryphon_flags, NULL, "Flags"); proto_tree_add_item(tree, hf_gryphon_addfilt_pass, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gryphon_addfilt_active, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; blocks = tvb_get_guint8(tvb, offset); proto_tree_add_item(pt, hf_gryphon_addfilt_blocks, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(pt, hf_gryphon_reserved_bytes, tvb, offset+1, 6, ENC_BIG_ENDIAN); + proto_tree_add_item(pt, hf_gryphon_reserved_bytes, tvb, offset+1, 6, ENC_NA); offset += 7; for (i = 1; i <= blocks; i++) { length = tvb_get_ntohs(tvb, offset+2) * 2 + 8; length += 3 - (length + 3) % 4; - item = proto_tree_add_text(pt, tvb, offset, length, "Filter block %d", i); - tree = proto_item_add_subtree (item, ett_gryphon_cmd_filter_block); + tree = proto_tree_add_subtree_format(pt, tvb, offset, length, ett_gryphon_cmd_filter_block, NULL, "Filter block %d", i); offset = filter_block(tvb, offset, tree); } return offset; @@ -1271,13 +1260,11 @@ resp_events(tvbuff_t *tvb, int offset, proto_tree *pt) int msglen; unsigned int i; proto_tree *tree; - proto_item *item; msglen = tvb_reported_length_remaining(tvb, offset); i = 1; while (msglen != 0) { - item = proto_tree_add_text(pt, tvb, offset, 20, "Event %d:", i); - tree = proto_item_add_subtree (item, ett_gryphon_cmd_events_data); + tree = proto_tree_add_subtree_format(pt, tvb, offset, 20, ett_gryphon_cmd_events_data, NULL, "Event %d:", i); proto_tree_add_item(tree, hf_gryphon_event_id, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gryphon_event_name, tvb, offset+1, 19, ENC_NA|ENC_ASCII); offset += 20; @@ -1346,7 +1333,6 @@ cmd_optimize(tvbuff_t *tvb, int offset, proto_tree *pt) static int resp_config(tvbuff_t *tvb, int offset, proto_tree *pt) { - proto_item *ti, *item; proto_tree *ft, *tree; int devices; int i; @@ -1369,8 +1355,7 @@ resp_config(tvbuff_t *tvb, int offset, proto_tree *pt) offset += 16; for (i = 1; i <= devices; i++) { - ti = proto_tree_add_text(pt, tvb, offset, 80, "Channel %d:", i); - ft = proto_item_add_subtree(ti, ett_gryphon_cmd_config_device); + ft = proto_tree_add_subtree_format(pt, tvb, offset, 80, ett_gryphon_cmd_config_device, NULL, "Channel %d:", i); proto_tree_add_item(ft, hf_gryphon_config_driver_name, tvb, offset, 20, ENC_NA|ENC_ASCII); offset += 20; @@ -1383,8 +1368,7 @@ resp_config(tvbuff_t *tvb, int offset, proto_tree *pt) x = tvb_get_ntohl (tvb, offset); if (x) { - item = proto_tree_add_text(ft, tvb, offset, 4, "Valid Header lengths"); - tree = proto_item_add_subtree (item, ett_gryphon_valid_headers); + tree = proto_tree_add_subtree(ft, tvb, offset, 4, ett_gryphon_valid_headers, NULL, "Valid Header lengths"); for (j = 0; ; j++) { if (x & 1) { proto_tree_add_text(tree, tvb, offset, 4, "%d byte%s", j, @@ -1455,8 +1439,7 @@ cmd_sched(tvbuff_t *tvb, int offset, proto_tree *pt) length = 16 + tvb_get_guint8(tvb, offset+16) + tvb_get_ntohs(tvb, offset+18) + tvb_get_guint8(tvb, offset+20) + 16; length += 3 - (length + 3) % 4; - item = proto_tree_add_text(pt, tvb, offset, length, "Message %d", i); - tree = proto_item_add_subtree (item, ett_gryphon_cmd_sched_data); + tree = proto_tree_add_subtree_format(pt, tvb, offset, length, ett_gryphon_cmd_sched_data, NULL, "Message %d", i); proto_tree_add_item(tree, hf_gryphon_sched_sleep, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; msglen -= 4; @@ -1485,8 +1468,7 @@ cmd_sched(tvbuff_t *tvb, int offset, proto_tree *pt) offset += 4; msglen -= 4; - item1 = proto_tree_add_text(tree, tvb, offset, length, "Message"); - tree1 = proto_item_add_subtree (item1, ett_gryphon_cmd_sched_cmd); + tree1 = proto_tree_add_subtree(tree, tvb, offset, length, ett_gryphon_cmd_sched_cmd, NULL, "Message"); save_offset = offset; offset = decode_data(tvb, offset, tree1); msglen -= offset - save_offset; @@ -1629,15 +1611,13 @@ cmd_addresp(tvbuff_t *tvb, int offset, proto_tree *pt) for (i = 1; i <= blocks; i++) { length = tvb_get_ntohs(tvb, offset+2) * 2 + 8; length += 3 - (length + 3) % 4; - item = proto_tree_add_text(pt, tvb, offset, length, "Filter block %d", i); - tree = proto_item_add_subtree (item, ett_gryphon_cmd_filter_block); + tree = proto_tree_add_subtree_format(pt, tvb, offset, length, ett_gryphon_cmd_filter_block, NULL, "Filter block %d", i); offset = filter_block(tvb, offset, tree); } for (i = 1; i <= responses; i++) { msglen = tvb_get_ntohs(tvb, offset+4) + 8; length = msglen + 3 - (msglen + 3) % 4; - item = proto_tree_add_text(pt, tvb, offset, length, "Response block %d", i); - tree = proto_item_add_subtree (item, ett_gryphon_cmd_response_block); + tree = proto_tree_add_subtree_format(pt, tvb, offset, length, ett_gryphon_cmd_response_block, NULL, "Response block %d", i); next_tvb = tvb_new_subset_length(tvb, offset, msglen); dissect_gryphon_message(next_tvb, NULL, tree, TRUE); offset += length; @@ -1775,7 +1755,6 @@ cmd_list(tvbuff_t *tvb, int offset, proto_tree *pt) static int resp_list(tvbuff_t *tvb, int offset, proto_tree *pt) { - proto_item *item; proto_tree *tree; unsigned int i, count; @@ -1788,8 +1767,7 @@ resp_list(tvbuff_t *tvb, int offset, proto_tree *pt) offset += 2; for (i = 1; i <= count; i++) { - item = proto_tree_add_text(pt, tvb, offset, 112, "Program %u", i); - tree = proto_item_add_subtree (item, ett_gryphon_pgm_list); + tree = proto_tree_add_subtree_format(pt, tvb, offset, 112, ett_gryphon_pgm_list, NULL, "Program %u", i); proto_tree_add_item(tree, hf_gryphon_list_name, tvb, offset, 32, ENC_NA|ENC_ASCII); offset += 32; @@ -1870,7 +1848,6 @@ static int cmd_options(tvbuff_t *tvb, int offset, proto_tree *pt) { int msglen; - proto_item *item; proto_tree *tree; unsigned int i, size, padding, option, option_length, option_value; const char *string, *string1; @@ -1885,8 +1862,7 @@ cmd_options(tvbuff_t *tvb, int offset, proto_tree *pt) option_length = tvb_get_guint8(tvb, offset+1); size = option_length + 2; padding = 3 - ((size + 3) %4); - item = proto_tree_add_text(pt, tvb, offset, size + padding, "Option number %u", i); - tree = proto_item_add_subtree (item, ett_gryphon_pgm_options); + tree = proto_tree_add_subtree_format(pt, tvb, offset, size + padding, ett_gryphon_pgm_options, NULL, "Option number %u", i); option = tvb_get_guint8(tvb, offset); switch (option_length) { case 1: @@ -2020,8 +1996,7 @@ cmd_usdt(tvbuff_t *tvb, int offset, proto_tree *pt) bytes = tvb_reported_length_remaining (tvb, offset); if (bytes <= 0) break; - localItem = proto_tree_add_text(pt, tvb, offset, 16, "%s block of USDT/UUDT IDs", i==0?"First":"Second"); - localTree = proto_item_add_subtree (localItem, ett_gryphon_usdt_data); + localTree = proto_tree_add_subtree_format(pt, tvb, offset, 16, ett_gryphon_usdt_data, NULL, "%s block of USDT/UUDT IDs", i==0?"First":"Second"); size = tvb_get_ntohl (tvb, offset); localItem = proto_tree_add_item(localTree, hf_gryphon_usdt_block_size, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -2054,15 +2029,13 @@ cmd_usdt(tvbuff_t *tvb, int offset, proto_tree *pt) static int cmd_bits_in (tvbuff_t *tvb, int offset, proto_tree *pt) { - proto_item *item; proto_tree *tree; int msglen, value; msglen = tvb_reported_length_remaining(tvb, offset); value = tvb_get_guint8(tvb, offset); if (value) { - item = proto_tree_add_text(pt, tvb, offset, 1, "Digital values set"); - tree = proto_item_add_subtree (item, ett_gryphon_digital_data); + tree = proto_tree_add_subtree(pt, tvb, offset, 1, ett_gryphon_digital_data, NULL, "Digital values set"); proto_tree_add_item(tree, hf_gryphon_bits_in_input1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gryphon_bits_in_input2, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2080,15 +2053,13 @@ cmd_bits_in (tvbuff_t *tvb, int offset, proto_tree *pt) static int cmd_bits_out (tvbuff_t *tvb, int offset, proto_tree *pt) { - proto_item *item; proto_tree *tree; int msglen, value; msglen = tvb_reported_length_remaining(tvb, offset); value = tvb_get_guint8(tvb, offset); if (value) { - item = proto_tree_add_text(pt, tvb, offset, 1, "Digital values set"); - tree = proto_item_add_subtree (item, ett_gryphon_digital_data); + tree = proto_tree_add_subtree(pt, tvb, offset, 1, ett_gryphon_digital_data, NULL, "Digital values set"); proto_tree_add_item(tree, hf_gryphon_bits_out_output1, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gryphon_bits_out_output2, tvb, offset, 1, ENC_BIG_ENDIAN); diff --git a/plugins/mate/packet-mate.c b/plugins/mate/packet-mate.c index f4a70f5f44..ddefb85874 100644 --- a/plugins/mate/packet-mate.c +++ b/plugins/mate/packet-mate.c @@ -45,12 +45,10 @@ static proto_item *mate_i = NULL; static void pdu_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_pdu* pdu) { AVPN* c; - proto_item *avpl_i; proto_tree *avpl_t; int* hfi_p; - avpl_i = proto_tree_add_text(tree,tvb,0,0,"%s Attributes",pdu->cfg->name); - avpl_t = proto_item_add_subtree(avpl_i, pdu->cfg->ett_attr); + avpl_t = proto_tree_add_subtree_format(tree,tvb,0,0,pdu->cfg->ett_attr,NULL,"%s Attributes",pdu->cfg->name); for ( c = pdu->avpl->null.next; c->avp; c = c->next) { hfi_p = (int *)g_hash_table_lookup(pdu->cfg->my_hfids,(char*)c->avp->n); @@ -66,12 +64,10 @@ static void pdu_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_pdu* pdu) { static void gop_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) { AVPN* c; - proto_item *avpl_i; proto_tree *avpl_t; int* hfi_p; - avpl_i = proto_tree_add_text(tree,tvb,0,0,"%s Attributes",gop->cfg->name); - avpl_t = proto_item_add_subtree(avpl_i, gop->cfg->ett_attr); + avpl_t = proto_tree_add_subtree_format(tree,tvb,0,0,gop->cfg->ett_attr,NULL,"%s Attributes",gop->cfg->name); for ( c = gop->avpl->null.next; c->avp; c = c->next) { hfi_p = (int *)g_hash_table_lookup(gop->cfg->my_hfids,(char*)c->avp->n); @@ -87,12 +83,10 @@ static void gop_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) { static void gog_attrs_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog) { AVPN* c; - proto_item *avpl_i; proto_tree *avpl_t; int* hfi_p; - avpl_i = proto_tree_add_text(tree,tvb,0,0,"%s Attributes",gog->cfg->name); - avpl_t = proto_item_add_subtree(avpl_i, gog->cfg->ett_attr); + avpl_t = proto_tree_add_subtree_format(tree,tvb,0,0,gog->cfg->ett_attr,NULL,"%s Attributes",gog->cfg->name); for ( c = gog->avpl->null.next; c->avp; c = c->next) { hfi_p = (int *)g_hash_table_lookup(gog->cfg->my_hfids,(char*)c->avp->n); @@ -111,7 +105,6 @@ static void mate_gop_tree(proto_tree* pdu_tree, tvbuff_t *tvb, mate_gop* gop); 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; @@ -126,8 +119,7 @@ static void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_g 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); + 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); @@ -183,7 +175,6 @@ static void mate_gog_tree(proto_tree* tree, tvbuff_t *tvb, mate_gog* gog, mate_g static void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) { proto_item *gop_item; proto_tree *gop_time_tree; - proto_item *gop_time_item; proto_tree *gop_tree; proto_item *gop_pdu_item; proto_tree *gop_pdu_tree; @@ -202,8 +193,7 @@ static void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) { gop_attrs_tree(gop_tree,tvb,gop); if (gop->cfg->show_times) { - gop_time_item = proto_tree_add_text(gop_tree,tvb,0,0,"%s Times",gop->cfg->name); - gop_time_tree = proto_item_add_subtree(gop_time_item, gop->cfg->ett_times); + gop_time_tree = proto_tree_add_subtree_format(gop_tree,tvb,0,0,gop->cfg->ett_times,NULL,"%s Times",gop->cfg->name); proto_tree_add_float(gop_time_tree, gop->cfg->hfid_start_time, tvb, 0, 0, gop->start_time); diff --git a/plugins/opcua/opcua_simpletypes.c b/plugins/opcua/opcua_simpletypes.c index d74dc31541..2c70a3a3af 100644 --- a/plugins/opcua/opcua_simpletypes.c +++ b/plugins/opcua/opcua_simpletypes.c @@ -589,8 +589,7 @@ void parseLocalizedText(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const ch proto_item *ti; proto_item *ti_inner; - ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: LocalizedText", szFieldName); - subtree = proto_item_add_subtree(ti, ett_opcua_localizedtext); + subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_localizedtext, &ti, "%s: LocalizedText", szFieldName); /* parse encoding mask */ EncodingMask = tvb_get_guint8(tvb, iOffset); @@ -693,8 +692,7 @@ void parseDiagnosticInfo(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const c proto_item *ti; proto_item *ti_inner; - ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: DiagnosticInfo", szFieldName); - subtree = proto_item_add_subtree(ti, ett_opcua_diagnosticinfo); + subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_diagnosticinfo, &ti, "%s: DiagnosticInfo", szFieldName); /* parse encoding mask */ EncodingMask = tvb_get_guint8(tvb, iOffset); @@ -739,8 +737,9 @@ void parseDiagnosticInfo(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const c void parseQualifiedName(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: QualifiedName", szFieldName); - proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_qualifiedname); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, + ett_opcua_qualifiedname, &ti, "%s: QualifiedName", szFieldName); parseUInt16(subtree, tvb, pOffset, hf_opcua_qualifiedname_id); parseString(subtree, tvb, pOffset, hf_opcua_qualifiedname_name); @@ -750,8 +749,9 @@ void parseQualifiedName(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const ch void parseDataValue(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: DataValue", szFieldName); - proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_datavalue); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, + ett_opcua_datavalue, &ti, "%s: DataValue", szFieldName); proto_tree *mask_tree; gint iOffset = *pOffset; guint8 EncodingMask; @@ -799,8 +799,9 @@ void parseDataValue(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char * void parseVariant(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: Variant", szFieldName); - proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_variant); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, + ett_opcua_variant, &ti, "%s: Variant", szFieldName); gint iOffset = *pOffset; guint8 EncodingMask; gint32 ArrayDimensions = 0; @@ -844,8 +845,9 @@ void parseVariant(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *sz if (EncodingMask & VARIANT_ARRAYDIMENSIONS) { - proto_item *ti_2 = proto_tree_add_text(subtree, tvb, iOffset, -1, "ArrayDimensions"); - proto_tree *subtree_2 = proto_item_add_subtree(ti_2, ett_opcua_variant_arraydims); + proto_item *ti_2; + proto_tree *subtree_2 = proto_tree_add_subtree(subtree, tvb, iOffset, -1, + ett_opcua_variant_arraydims, &ti_2, "ArrayDimensions"); int i; /* read array length */ @@ -912,8 +914,8 @@ void parseVariant(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *sz */ void parseArraySimple(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName, const char *szTypeName, int hfIndex, fctSimpleTypeParser pParserFunction, const gint idx) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: Array of %s", szFieldName, szTypeName); - proto_tree *subtree = proto_item_add_subtree(ti, idx); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, idx, &ti, "%s: Array of %s", szFieldName, szTypeName); int i; gint32 iLen; @@ -947,8 +949,8 @@ void parseArraySimple(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char */ void parseArrayEnum(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName, const char *szTypeName, fctEnumParser pParserFunction, const gint idx) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: Array of %s", szFieldName, szTypeName); - proto_tree *subtree = proto_item_add_subtree(ti, idx); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, idx, &ti, "%s: Array of %s", szFieldName, szTypeName); int i; gint32 iLen; @@ -978,8 +980,8 @@ void parseArrayEnum(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char * */ void parseArrayComplex(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName, const char *szTypeName, fctComplexTypeParser pParserFunction, const gint idx) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: Array of %s", szFieldName, szTypeName); - proto_tree *subtree = proto_item_add_subtree(ti, idx); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, idx, &ti, "%s: Array of %s", szFieldName, szTypeName); int i; gint32 iLen; @@ -1007,8 +1009,8 @@ void parseArrayComplex(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const cha void parseNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: NodeId", szFieldName); - proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_nodeid); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_nodeid, &ti, "%s: NodeId", szFieldName); gint iOffset = *pOffset; guint8 EncodingMask; @@ -1066,8 +1068,7 @@ void parseExtensionObject(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const proto_item *ti_inner; /* add extension object subtree */ - ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: ExtensionObject", szFieldName); - extobj_tree = proto_item_add_subtree(ti, ett_opcua_extensionobject); + extobj_tree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_extensionobject, &ti, "%s: ExtensionObject", szFieldName); /* add nodeid subtree */ TypeId = getExtensionObjectType(tvb, &iOffset); @@ -1092,8 +1093,9 @@ void parseExtensionObject(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const void parseExpandedNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName) { - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s: ExpandedNodeId", szFieldName); - proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_expandednodeid); + proto_item *ti; + proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, + ett_opcua_expandednodeid, &ti, "%s: ExpandedNodeId", szFieldName); gint iOffset = *pOffset; guint8 EncodingMask; diff --git a/plugins/opcua/opcua_transport_layer.c b/plugins/opcua/opcua_transport_layer.c index daecc02a07..8c8a080551 100644 --- a/plugins/opcua/opcua_transport_layer.c +++ b/plugins/opcua/opcua_transport_layer.c @@ -186,12 +186,10 @@ int parseService(proto_tree *tree, tvbuff_t *tvb, gint *pOffset) * THIS WILL CHAHNGE IN THE FUTURE. */ /* add encodeable object subtree */ - ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "OpcUa Service : Encodeable Object"); - encobj_tree = proto_item_add_subtree(ti, ett_opcua_extensionobject); + encobj_tree = proto_tree_add_subtree(tree, tvb, *pOffset, -1, ett_opcua_extensionobject, &ti, "OpcUa Service : Encodeable Object"); /* add nodeid subtree */ - ti_inner = proto_tree_add_text(encobj_tree, tvb, *pOffset, -1, "TypeId : ExpandedNodeId"); - nodeid_tree = proto_item_add_subtree(ti_inner, ett_opcua_nodeid); + nodeid_tree = proto_tree_add_subtree(encobj_tree, tvb, *pOffset, -1, ett_opcua_nodeid, &ti_inner, "TypeId : ExpandedNodeId"); ServiceId = parseServiceNodeId(nodeid_tree, tvb, pOffset); proto_item_set_end(ti_inner, tvb, *pOffset); @@ -220,12 +218,10 @@ int parseOpenSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset) proto_tree_add_item(tree, hf_opcua_transport_rqid, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4; /* add encodeable object subtree */ - ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "Message : Encodeable Object"); - encobj_tree = proto_item_add_subtree(ti, ett_opcua_extensionobject); + encobj_tree = proto_tree_add_subtree(tree, tvb, *pOffset, -1, ett_opcua_extensionobject, &ti, "Message : Encodeable Object"); /* add nodeid subtree */ - ti_inner = proto_tree_add_text(encobj_tree, tvb, *pOffset, -1, "TypeId : ExpandedNodeId"); - nodeid_tree = proto_item_add_subtree(ti_inner, ett_opcua_nodeid); + nodeid_tree = proto_tree_add_subtree(encobj_tree, tvb, *pOffset, -1, ett_opcua_nodeid, &ti_inner, "TypeId : ExpandedNodeId"); ServiceId = parseServiceNodeId(nodeid_tree, tvb, pOffset); proto_item_set_end(ti_inner, tvb, *pOffset); @@ -251,12 +247,10 @@ int parseCloseSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset) parseSecurityLayer(tree, tvb, pOffset); /* add encodeable object subtree */ - ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "Message : Encodeable Object"); - encobj_tree = proto_item_add_subtree(ti, ett_opcua_extensionobject); + encobj_tree = proto_tree_add_subtree(tree, tvb, *pOffset, -1, ett_opcua_extensionobject, &ti, "Message : Encodeable Object"); /* add nodeid subtree */ - ti_inner = proto_tree_add_text(encobj_tree, tvb, *pOffset, -1, "TypeId : ExpandedNodeId"); - nodeid_tree = proto_item_add_subtree(ti_inner, ett_opcua_nodeid); + nodeid_tree = proto_tree_add_subtree(encobj_tree, tvb, *pOffset, -1, ett_opcua_nodeid, &ti_inner, "TypeId : ExpandedNodeId"); ServiceId = parseServiceNodeId(nodeid_tree, tvb, pOffset); proto_item_set_end(ti_inner, tvb, *pOffset); diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index 40979b0ad0..884a87fcfc 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -2665,13 +2665,12 @@ pnio_ar_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pnio_ar_t *ar) proto_item *sub_item; proto_tree *sub_tree; - sub_item = proto_tree_add_text(tree, tvb, 0, 0, + sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_pn_io_ar_info, &sub_item, "ARUUID:%s ContrMAC:%s ContrAlRef:0x%x DevMAC:%s DevAlRef:0x%x InCR:0x%x OutCR=0x%x", guid_to_ep_str((const e_guid_t*) &ar->aruuid), ether_to_str((const guint8 *)ar->controllermac), ar->controlleralarmref, ether_to_str((const guint8 *)ar->devicemac), ar->devicealarmref, ar->inputframeid, ar->outputframeid); - sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_ar_info); PROTO_ITEM_SET_GENERATED(sub_item); item = proto_tree_add_guid(sub_tree, hf_pn_io_ar_uuid, tvb, 0, 0, (e_guid_t *) &ar->aruuid); diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c index 3739df18c2..5faa64da1d 100644 --- a/plugins/profinet/packet-dcom-cba-acco.c +++ b/plugins/profinet/packet-dcom-cba-acco.c @@ -632,13 +632,12 @@ cba_frame_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba_fram proto_item *sub_item; proto_tree *sub_tree; - sub_item = proto_tree_add_text(tree, tvb, 0, 0, + sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_cba_frame_info, &sub_item, "Cons:\"%s\" CCRID:0x%x Prov:\"%s\" PCRID:0x%x QoS:%s/%ums Len:%u", frame->consparent ? frame->consparent->name : "", frame->conscrid, frame->provparent ? frame->provparent->name : "", frame->provcrid, val_to_str(frame->qostype, cba_qos_type_short_vals, "%u"), frame->qosvalue, frame->length); - sub_tree = proto_item_add_subtree(sub_item, ett_cba_frame_info); PROTO_ITEM_SET_GENERATED(sub_item); item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_type, tvb, 0, 0, frame->qostype); @@ -855,14 +854,15 @@ cba_connection_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba proto_tree *sub_tree; if (conn->qostype != 0x30) { - sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x QoS:%s/%ums", + sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_cba_conn_info, &sub_item, + "ProvItem:\"%s\" PID:0x%x CID:0x%x QoS:%s/%ums", conn->provitem, conn->provid, conn->consid, val_to_str(conn->qostype, cba_qos_type_short_vals, "%u"), conn->qosvalue); } else { - sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x Len:%u", + sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_cba_conn_info, &sub_item, + "ProvItem:\"%s\" PID:0x%x CID:0x%x Len:%u", conn->provitem, conn->provid, conn->consid, conn->length); } - sub_tree = proto_item_add_subtree(sub_item, ett_cba_conn_info); PROTO_ITEM_SET_GENERATED(sub_item); item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_provider_item, tvb, 0, 0 /* len */, conn->provitem); diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c index c4c1272858..a40723cb49 100644 --- a/plugins/unistim/packet-unistim.c +++ b/plugins/unistim/packet-unistim.c @@ -186,7 +186,6 @@ static int dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree,void *data _U_){ gint offset=0; proto_item *ti= NULL; - proto_item *ti1= NULL; proto_tree *overall_unistim_tree = NULL; proto_tree *rudpm_tree=NULL; gint size; @@ -219,8 +218,7 @@ dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree,void *data _U_ col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree,proto_unistim,tvb,offset,-1,ENC_NA); overall_unistim_tree = proto_item_add_subtree(ti,ett_unistim); - ti1=proto_tree_add_text(overall_unistim_tree,tvb,offset,5,"Reliable UDP"); - rudpm_tree=proto_item_add_subtree(ti1,ett_unistim); + rudpm_tree=proto_tree_add_subtree(overall_unistim_tree,tvb,offset,5,ett_unistim,NULL,"Reliable UDP"); proto_tree_add_item(rudpm_tree,hf_unistim_seq_nu,tvb,offset,4,ENC_BIG_ENDIAN); @@ -334,12 +332,9 @@ dissect_uftp_message(proto_tree *unistim_tree,packet_info *pinfo _U_,tvbuff_t *t guint command; guint str_len; guint dat_len; - proto_item *ti; proto_tree *msg_tree; - ti = proto_tree_add_text(unistim_tree,tvb,offset,-1,"UFTP CMD"); - - msg_tree = proto_item_add_subtree(ti,ett_unistim); + msg_tree = proto_tree_add_subtree(unistim_tree,tvb,offset,-1,ett_unistim,NULL,"UFTP CMD"); command=tvb_get_guint8(tvb,offset); @@ -404,9 +399,7 @@ dissect_unistim_message(proto_tree *unistim_tree,packet_info *pinfo,tvbuff_t *tv proto_item *ti; proto_tree *msg_tree; - ti = proto_tree_add_text(unistim_tree,tvb,offset,-1,"Unistim CMD"); - - msg_tree = proto_item_add_subtree(ti,ett_unistim); + msg_tree = proto_tree_add_subtree(unistim_tree,tvb,offset,-1,ett_unistim,&ti,"Unistim CMD"); addr=tvb_get_guint8(tvb,offset); @@ -688,8 +681,6 @@ dissect_broadcast_switch(proto_tree *msg_tree, tvbuff_t *tvb,gint offset, guint msg_len){ guint bcast_cmd; guint year,month,day,hour,minute,second; - proto_item *date_label; - proto_item *time_label; proto_tree *date_tree; proto_tree *time_tree; bcast_cmd=tvb_get_guint8(tvb,offset); @@ -717,9 +708,8 @@ dissect_broadcast_switch(proto_tree *msg_tree, hour=tvb_get_guint8(tvb,offset+3); minute=tvb_get_guint8(tvb,offset+4); second=tvb_get_guint8(tvb,offset+5); - date_label=proto_tree_add_text(msg_tree,tvb,offset,3, + date_tree=proto_tree_add_subtree_format(msg_tree,tvb,offset,3,ett_unistim,NULL, "Date %i/%i/%i",month,day,year%100); - date_tree=proto_item_add_subtree(date_label,ett_unistim); proto_tree_add_item(date_tree,hf_broadcast_year,tvb,offset,1,ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(date_tree,hf_broadcast_month,tvb,offset,1,ENC_BIG_ENDIAN); @@ -727,9 +717,8 @@ dissect_broadcast_switch(proto_tree *msg_tree, proto_tree_add_item(date_tree,hf_broadcast_day,tvb,offset,1,ENC_BIG_ENDIAN); offset+=1; - time_label=proto_tree_add_text(msg_tree,tvb,offset,3, + time_tree=proto_tree_add_subtree_format(msg_tree,tvb,offset,3,ett_unistim,NULL, "Time %i:%i:%i",hour,minute,second); - time_tree=proto_item_add_subtree(time_label,ett_unistim); proto_tree_add_item(time_tree,hf_broadcast_hour,tvb,offset,1,ENC_BIG_ENDIAN); offset+=1; proto_tree_add_item(time_tree,hf_broadcast_minute,tvb,offset,1,ENC_BIG_ENDIAN); @@ -780,7 +769,6 @@ dissect_display_switch(proto_tree *msg_tree, guint address_byte; guint movement_byte; proto_tree *address_tree; - proto_item *tmp_ti; display_cmd=tvb_get_guint8(tvb,offset); proto_tree_add_item(msg_tree,hf_display_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN); offset+=1;msg_len-=1; @@ -1025,9 +1013,7 @@ dissect_display_switch(proto_tree *msg_tree, break; case 0x19: /*address|yes control|no tag|no*/ - tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address"); - - address_tree=proto_item_add_subtree(tmp_ti,ett_unistim); + address_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Address"); address_byte=tvb_get_guint8(tvb,offset); proto_tree_add_item(address_tree,hf_basic_bit_field, tvb,offset,1,ENC_BIG_ENDIAN); @@ -1099,8 +1085,7 @@ dissect_display_switch(proto_tree *msg_tree, break; case 0x1b: /*address|yes control|yes tag|no*/ - tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address Data"); - address_tree=proto_item_add_subtree(tmp_ti,ett_unistim); + address_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Address Data"); address_byte=tvb_get_guint8(tvb,offset); proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN); proto_tree_add_item(address_tree, @@ -1166,8 +1151,7 @@ dissect_display_switch(proto_tree *msg_tree, break; case 0x1d: /*address|yes control|no tag|yes*/ - tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address Data"); - address_tree=proto_item_add_subtree(tmp_ti,ett_unistim); + address_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Address Data"); address_byte=tvb_get_guint8(tvb,offset); proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN); proto_tree_add_item(address_tree,hf_display_write_address_numeric,tvb, @@ -1230,8 +1214,7 @@ dissect_display_switch(proto_tree *msg_tree, break; case 0x1f: /*address|yes control|yes tag|yes*/ - tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address"); - address_tree=proto_item_add_subtree(tmp_ti,ett_unistim); + address_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Address"); address_byte=tvb_get_guint8(tvb,offset); proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN); proto_tree_add_item(address_tree,hf_display_write_address_numeric, @@ -1949,7 +1932,6 @@ dissect_network_phone(proto_tree *msg_tree, tvbuff_t *tvb,gint offset, guint msg_len){ guint network_cmd; proto_tree *server_tree; - proto_item *server; guint i; network_cmd=tvb_get_guint8(tvb,offset); proto_tree_add_item(msg_tree,hf_network_phone_cmd,tvb,offset,1,ENC_BIG_ENDIAN); @@ -2017,9 +1999,8 @@ dissect_network_phone(proto_tree *msg_tree, if(port_num<1064) break; */ - server=proto_tree_add_text(msg_tree,tvb,offset,9, - "Server (S%d) Server ID: %X",i,i-1); - server_tree=proto_item_add_subtree(server,ett_unistim); + server_tree=proto_tree_add_subtree_format(msg_tree,tvb,offset,9, + ett_unistim,NULL,"Server (S%d) Server ID: %X",i,i-1); proto_tree_add_item(server_tree, hf_net_phone_server_port, tvb,offset,2,ENC_BIG_ENDIAN); @@ -2061,7 +2042,6 @@ static gint dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo, tvbuff_t *tvb,gint offset,guint msg_len){ proto_tree *param_tree; - proto_item *param; guint audio_cmd; guint apb_op_code; guint apb_data_len; @@ -2398,8 +2378,7 @@ dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo, proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,ENC_BIG_ENDIAN), offset+=1;msg_len-=1; while(msg_len>0){ - param=proto_tree_add_text(msg_tree,tvb,offset,0,"Param"); - param_tree=proto_item_add_subtree(param,ett_unistim); + param_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Param"); vocoder_param=tvb_get_guint8(tvb,offset); proto_tree_add_item(param_tree,hf_basic_bit_field, tvb,offset,1,ENC_BIG_ENDIAN); diff --git a/plugins/wimax/msg_dlmap.c b/plugins/wimax/msg_dlmap.c index 455e419cd7..b4176f79db 100644 --- a/plugins/wimax/msg_dlmap.c +++ b/plugins/wimax/msg_dlmap.c @@ -319,8 +319,7 @@ gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint leng else if (RCID_Type_lcl == 3) length = 4; } - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, length), "RCID_IE"); - tree = proto_item_add_subtree(ti, ett_286j); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, length), ett_286j, &ti, "RCID_IE"); if (RCID_Type_lcl == 0) { XBIT(cid, 16, "CID"); @@ -360,16 +359,14 @@ static gint Dedicated_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, /* offset of IE in nibbles, length is variable */ gint nib; gint nibble; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint len; nib = offset; length = NIB_NIBBLE(nib, bufptr); /* length in nibbles */ - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length+1), "Dedicated_DL_Control_IE"); - tree = proto_item_add_subtree(ti, ett_286i); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(nib, length+1), ett_286i, NULL, "Dedicated_DL_Control_IE"); proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Length: %d", length); nib++; @@ -399,16 +396,14 @@ static gint Dedicated_MIMO_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bu /* offset of IE in bits, length is variable */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint mci, cqi, cmi, matrix = 0, pad, CQICH_num, mimo_mode; gint j; bit = offset; /* 8.4.5.3.21 table 286t */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "Dedicated MIMO DL Control IE"); - tree = proto_item_add_subtree(ti, ett_286t); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286t, NULL, "Dedicated MIMO DL Control IE"); XBIT(length, 5, "Length (nibbles)"); XBIT(mci, 1, "Control Header (MIMO Control Info)"); @@ -473,16 +468,14 @@ static gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp /* offset of IE in nibbles, length is variable */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint nsub, ddci, dur, sbi, res, diuc, rci, ind, per, ofs; gint j; bit = NIB_TO_BIT(offset); /* 8.4.5.3.21 table 286m */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, length), "DL_HARQ_Chase_sub_burst_IE"); - tree = proto_item_add_subtree(ti, ett_286m); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, length), ett_286m, NULL, "DL_HARQ_Chase_sub_burst_IE"); XBIT(nsub, 4, "N sub burst[ISI]"); XBIT(data, 4, "N ACK channel"); @@ -528,8 +521,7 @@ static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *buf /* offset of IE in nibbles, length is variable */ gint bit; guint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; proto_item *generic_item = NULL; gint nsub, ddci, dur, ind, per, ofs; gint j; @@ -538,8 +530,7 @@ static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *buf bit = NIB_TO_BIT(offset); /* 8.4.5.3.21 table 286n */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 4), "DL HARQ IR CTC sub-burst IE"); - tree = proto_item_add_subtree(ti, ett_286n); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 4), ett_286n, NULL, "DL HARQ IR CTC sub-burst IE"); XBIT(nsub, 4, "N sub burst[ISI]"); XBIT(data, 4, "N ACK channel"); @@ -593,8 +584,7 @@ static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp /* offset of IE in nibbles, length is variable */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; proto_item *generic_item = NULL; gint nsub, sbdi, ddci, dur, ind, per, ofs; gint j; @@ -603,8 +593,7 @@ static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp bit = NIB_TO_BIT(offset); /* 8.4.5.3.21 table 286o */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 4), "DL HARQ IR CC sub-burst IE"); - tree = proto_item_add_subtree(ti, ett_286o); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 4), ett_286o, NULL, "DL HARQ IR CC sub-burst IE"); XBIT(nsub, 4, "N sub burst[ISI]"); XBIT(data, 4, "N ACK channel"); @@ -666,8 +655,7 @@ static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 /* offset of IE in nibbles, length is variable */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; proto_item *generic_item = NULL; gint nsub, mui, dci, akd; gint i, j; @@ -676,8 +664,7 @@ static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 bit = NIB_TO_BIT(offset); /* 8.4.5.3.21 table 286p */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "MIMO DL Chase HARQ sub-burst IE"); - tree = proto_item_add_subtree(ti, ett_286p); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286p, NULL, "MIMO DL Chase HARQ sub-burst IE"); XBIT(nsub, 4, "N sub burst[ISI]"); XBIT(data, 6, "N ACK channel"); @@ -735,8 +722,7 @@ static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bu /* offset of IE in nibbles, length is variable */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; proto_item *generic_item = NULL; gint nsub, mui, dci, akd; gint i, j; @@ -745,8 +731,7 @@ static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bu bit = NIB_TO_BIT(offset); /* 8.4.5.3.21 table 286q */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 4), "MIMO DL IR HARQ sub-burst IE"); - tree = proto_item_add_subtree(ti, ett_286q); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 4), ett_286q, NULL, "MIMO DL IR HARQ sub-burst IE"); XBIT(nsub, 4, "N sub burst[ISI]"); XBIT(data, 6, "N ACK channel"); @@ -798,8 +783,7 @@ static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const gui /* offset of IE in nibbles, length is variable */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; proto_item *generic_item = NULL; gint nsub, mui, dci, akd; gint i, j; @@ -808,8 +792,7 @@ static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const gui bit = NIB_TO_BIT(offset); /* 8.4.5.3.21 table 286r */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "MIMO DL IR HARQ for CC sub-burst IE"); - tree = proto_item_add_subtree(ti, ett_286r); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286r, NULL, "MIMO DL IR HARQ for CC sub-burst IE"); XBIT(nsub, 4, "N sub burst[ISI]"); XBIT(data, 6, "N ACK channel"); @@ -862,8 +845,7 @@ static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *b /* offset of IE in nibbles, length is variable */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; proto_item *generic_item = NULL; gint nsub, sbi, txc, akd, dmci; gint j; @@ -872,8 +854,7 @@ static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *b bit = NIB_TO_BIT(offset); /* 8.4.5.3.21 table 286s */ - ti = proto_tree_add_text(diuc_tree, tvb, BITHI(bit, 1), "MIMO DL STC HARQ sub-burst IE"); - tree = proto_item_add_subtree(ti, ett_286s); + tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286s, NULL, "MIMO DL STC HARQ sub-burst IE"); XBIT(nsub, 4, "N sub burst[ISI]"); XBIT(data, 6, "N ACK channel"); @@ -930,14 +911,12 @@ static gint MBS_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint mde, dci, s3i; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MBS_MAP_IE"); - tree = proto_item_add_subtree(ti, ett_286a); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286a, NULL, "MBS_MAP_IE"); XBIT(data, 4, "Extended-2 DIUC"); XBIT(data, 8, "Length"); @@ -989,13 +968,11 @@ static gint HO_Anchor_Active_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufp /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HO_Anchor_Active_DL_MAP_IE"); - tree = proto_item_add_subtree(ti, ett_286c); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286c, NULL, "HO_Anchor_Active_DL_MAP_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1010,13 +987,11 @@ static gint HO_Active_Anchor_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufp /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HO_Active_Anchor_DL_MAP_IE"); - tree = proto_item_add_subtree(ti, ett_286d); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286d, NULL, "HO_Active_Anchor_DL_MAP_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1031,13 +1006,11 @@ static gint HO_CID_Translation_MAP_IE(proto_tree *diuc_tree, const guint8 *bufpt /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "CID_Translation_MAP_IE"); - tree = proto_item_add_subtree(ti, ett_286e); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286e, NULL, "CID_Translation_MAP_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1052,13 +1025,11 @@ static gint MIMO_in_another_BS_IE(proto_tree *diuc_tree, const guint8 *bufptr, g /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_in_another_BS_IE"); - tree = proto_item_add_subtree(ti, ett_286f); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286f, NULL, "MIMO_in_another_BS_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1073,13 +1044,11 @@ static gint Macro_MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, /* offset of tlv in nibbles, length of tlv in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Macro_MIMO_DL_Basic_IE"); - tree = proto_item_add_subtree(ti, ett_286g); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286g, NULL, "Macro_MIMO_DL_Basic_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1094,13 +1063,11 @@ static gint Skip_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gi /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Skip_IE"); - tree = proto_item_add_subtree(ti, ett_286k); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286k, NULL, "Skip_IE"); XBIT(data, 4, "Extended-2 DIUC"); XBIT(data, 8, "Length"); @@ -1118,14 +1085,12 @@ static gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint len, lastbit, rui, mode, sub_len, pad; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HARQ_DL_MAP_IE"); - tree = proto_item_add_subtree(ti, ett_286l); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286l, NULL, "HARQ_DL_MAP_IE"); XBIT(data, 4, "Extended-2 DIUC"); XBIT(len, 8, "Length"); @@ -1200,13 +1165,11 @@ static gint HARQ_ACK_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset /* offset of TLV in nibbles, length of TLV in nibbles */ gint data; gint nib; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HARQ_ACK_IE"); - tree = proto_item_add_subtree(ti, ett_286u); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286u, NULL, "HARQ_ACK_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1223,15 +1186,13 @@ static gint Enhanced_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint numass, n_cid; gint i, n; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Enhanced_DL-MAP_IE"); - tree = proto_item_add_subtree(ti, ett_286v); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286v, NULL, "Enhanced_DL-MAP_IE"); XBIT(data, 4, "Extended-2 DIUC"); XBIT(data, 8, "Length"); @@ -1260,13 +1221,11 @@ static gint Closed_loop_MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "CL_MIMO_DL_Enhanced_IE"); - tree = proto_item_add_subtree(ti, ett_286w); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286w, NULL, "CL_MIMO_DL_Enhanced_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1281,8 +1240,7 @@ static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint num_region, num_users, pilot_pattern, encoding_mode, ackch_alloc, cqich_alloc; gint aas_preamble = 1; gint zone_permut = 0; /* TODO */ @@ -1290,8 +1248,7 @@ static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "AAS_SDMA_DL_IE"); - tree = proto_item_add_subtree(ti, ett_286y); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286y, NULL, "AAS_SDMA_DL_IE"); XBIT(data, 4, "Extended-2 DIUC"); XBIT(data, 8, "Length"); @@ -1397,13 +1354,11 @@ static gint Channel_Measurement_IE(proto_tree *diuc_tree, const guint8 *bufptr, /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Channel_Measurement_IE"); - tree = proto_item_add_subtree(ti, ett_280); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_280, NULL, "Channel_Measurement_IE"); XNIB(data, 1, "Extended DIUC"); XNIB(data, 1, "Length"); @@ -1425,13 +1380,11 @@ static gint STC_Zone_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset * used in 8.4.5.3.21.1 Dedicated MIMO Control IE 286t */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "STC_Zone_IE"); - tree = proto_item_add_subtree(ti, ett_279); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_279, NULL, "STC_Zone_IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1460,13 +1413,11 @@ static gint AAS_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "AAS_DL_IE"); - tree = proto_item_add_subtree(ti, ett_278); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_278, NULL, "AAS_DL_IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1490,13 +1441,11 @@ static gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, const guint8 * /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Data location in another BS IE"); - tree = proto_item_add_subtree(ti, ett_281); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_281, NULL, "Data location in another BS IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1525,16 +1474,13 @@ static gint CID_Switch_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offs /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; INC_CID = INC_CID ? 0 : 1; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "CID_Switch_IE"); - proto_item_append_text(ti, " (INC_CID = %d)",INC_CID); - tree = proto_item_add_subtree(ti, ett_282); + tree = proto_tree_add_subtree_format(diuc_tree, tvb, NIBHI(offset, length), ett_282, NULL, "CID_Switch_IE (INC_CID = %d)", INC_CID); XNIB(data, 1, "Extended DIUC"); XNIB(data, 1, "Length"); @@ -1549,13 +1495,11 @@ static gint MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint o /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_DL_Basic_IE"); - tree = proto_item_add_subtree(ti, ett_283); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_283, NULL, "MIMO_DL_Basic_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1570,13 +1514,11 @@ static gint MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 *bufptr, gin /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_DL_Enhanced_IE"); - tree = proto_item_add_subtree(ti, ett_284); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_284, NULL, "MIMO_DL_Enhanced_IE"); XNIB(data, 1, "Extended-2 DIUC"); XNIB(data, 2, "Length"); @@ -1591,14 +1533,12 @@ static gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gin /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint length_in_bits, rep, map, diuc, slots, idle, sleep, mask_len; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HARQ_Map_Pointer_IE"); - tree = proto_item_add_subtree(ti, ett_285); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_285, NULL, "HARQ_Map_Pointer_IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1642,14 +1582,12 @@ static gint PHYMOD_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offse /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint pmt; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "PHYMOD_DL_IE"); - tree = proto_item_add_subtree(ti, ett_286); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286, NULL, "PHYMOD_DL_IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1673,14 +1611,12 @@ static gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, const guint8 *bu /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint skip; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Broadcast Control Pointer IE"); - tree = proto_item_add_subtree(ti, ett_286x); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286x, NULL, "Broadcast Control Pointer IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1701,13 +1637,11 @@ static gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "DL_PUSC_Burst_Allocation_in_Other_Segment_IE"); - tree = proto_item_add_subtree(ti, ett_286b); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286b, NULL, "DL_PUSC_Burst_Allocation_in_Other_Segment_IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1737,13 +1671,11 @@ static gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "PUSC_ASCA_Alloc_IE"); - tree = proto_item_add_subtree(ti, ett_286z); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286z, NULL, "PUSC_ASCA_Alloc_IE"); XBIT(data, 4, "Extended DIUC"); XBIT(data, 4, "Length"); @@ -1767,14 +1699,12 @@ static gint UL_interference_and_noise_level_IE(proto_tree *diuc_tree, const guin /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint bitmap; nib = offset; - ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "UL_interference_and_noise_level_IE"); - tree = proto_item_add_subtree(ti, ett_286h); + tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286h, NULL, "UL_interference_and_noise_level_IE"); XNIB(data, 1, "Extended DIUC"); XNIB(data, 1, "Length"); @@ -2079,8 +2009,7 @@ static void dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo /* PHY Synchronization Field 8.4.5.1 */ { - ti = proto_tree_add_text(dlmap_tree, tvb, offset, 4, "Phy Synchronization Field"); - phy_tree = proto_item_add_subtree(ti, ett_275_phy); + phy_tree = proto_tree_add_subtree(dlmap_tree, tvb, offset, 4, ett_275_phy, NULL, "Phy Synchronization Field"); proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_ms, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_per_sec, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2097,8 +2026,7 @@ static void dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo /* DL-MAP IEs */ length = tvb_len - offset; /* remaining length in bytes */ - ti = proto_tree_add_text(dlmap_tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length); - ie_tree = proto_item_add_subtree(ti, ett_dlmap_ie); + ie_tree = proto_tree_add_subtree_format(dlmap_tree, tvb, offset, length, ett_dlmap_ie, NULL, "DL-MAP IEs (%d bytes)", length); /* length = BYTE_TO_NIB(length); */ /* convert length to nibbles */ @@ -2157,8 +2085,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre proto_tree_add_item(tree, hf_dlmapc_len, tvb, offset, 2, ENC_BIG_ENDIAN); /* PHY Synchronization Field 8.4.5.1 */ { - ti_phy = proto_tree_add_text(tree, tvb, offset+2, 4, "Phy Synchronization Field"); - phy_tree = proto_item_add_subtree(ti_phy, ett_275_phy); + phy_tree = proto_tree_add_subtree(tree, tvb, offset+2, 4, ett_275_phy, &ti_phy, "Phy Synchronization Field"); proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_ms, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_per_sec, tvb, offset+2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(phy_tree, hf_dlmap_phy_fnum, tvb, offset+3, 3, ENC_BIG_ENDIAN); @@ -2175,8 +2102,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre /* DL-MAP IEs */ length -= 15; /* remaining length in bytes (11 bytes above + CRC at end) */ if (dl_ie_count) { - ti_dlmap_ies = proto_tree_add_text(tree, tvb, offset, length, "DL-MAP IEs (%d bytes)", length); - ie_tree = proto_item_add_subtree(ti_dlmap_ies, ett_dlmap_ie); + ie_tree = proto_tree_add_subtree_format(tree, tvb, offset, length, ett_dlmap_ie, &ti_dlmap_ies, "DL-MAP IEs (%d bytes)", length); /* length = BYTE_TO_NIB(mac_len - (int)sizeof(mac_crc) - 1); */ /* convert length to nibbles */ @@ -2238,7 +2164,6 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* decode a SUB-DL-UL-MAP message 6.3.2.3.60 and return the length in bytes */ /* first three bits are 0x7, which following a compressed DL map indicates this message */ guint offset = 0; - proto_item *ti = NULL; proto_tree *tree = NULL; proto_tree *ie_tree = NULL; proto_item *generic_item = NULL; @@ -2254,8 +2179,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre sub_dl_ul_map = 1; /* set flag */ - ti = proto_tree_add_text(base_tree, tvb, NIBHI(nib,lennib-nib), "SUB-DL-UL-MAP"); - tree = proto_item_add_subtree(ti, ett_109x); + tree = proto_tree_add_subtree(base_tree, tvb, NIBHI(nib,lennib-nib), ett_109x, NULL, "SUB-DL-UL-MAP"); data = NIB_WORD(nib,bufptr); proto_tree_add_uint(tree, hf_109x_cmi, tvb, NIBHI(nib,4), data); @@ -2279,8 +2203,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre nib += 2; /* DL-MAP IEs */ - ti = proto_tree_add_text(tree, tvb, NIBHI(nib,1), "DL-MAP IEs"); - ie_tree = proto_item_add_subtree(ti, ett_109x_dl); + ie_tree = proto_tree_add_subtree(tree, tvb, NIBHI(nib,1), ett_109x_dl, NULL, "DL-MAP IEs"); for (i = 0; i < numie; i++) { nib += dissect_dlmap_ie(ie_tree, bufptr, nib, lennib - nib, tvb); } @@ -2294,8 +2217,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre nib += 2; /* UL-MAP IEs */ - ti = proto_tree_add_text(tree, tvb, NIBHI(nib,lennib-nib), "UL-MAP IEs"); - ie_tree = proto_item_add_subtree(ti, ett_109x_ul); + ie_tree = proto_tree_add_subtree(tree, tvb, NIBHI(nib,lennib-nib), ett_109x_ul, NULL, "UL-MAP IEs"); for ( ; nib < lennib - 1; ) { nib += dissect_ulmap_ie(ie_tree, bufptr, nib, lennib - nib, tvb); } diff --git a/plugins/wimax/msg_ulmap.c b/plugins/wimax/msg_ulmap.c index 248655aee8..a177424f62 100644 --- a/plugins/wimax/msg_ulmap.c +++ b/plugins/wimax/msg_ulmap.c @@ -275,14 +275,12 @@ static gint Dedicated_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint sdma; bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_UL_Control_IE"); - tree = proto_item_add_subtree(ti, ett_302r); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302r, NULL, "Dedicated_UL_Control_IE"); XBIT(data, 4, "Length"); XBIT(sdma, 4, "Control Header"); @@ -299,13 +297,11 @@ static gint Dedicated_MIMO_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bu /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_MIMO_UL_Control_IE"); - tree = proto_item_add_subtree(ti, ett_302s); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302s, NULL, "Dedicated_MIMO_UL_Control_IE"); XBIT(data, 2, "Matrix"); XBIT(N_layer, 2, "N_layer"); @@ -321,16 +317,14 @@ static gint UL_HARQ_Chase_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufp /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; /*proto_item *generic_item = NULL;*/ gint duci; /*guint16 calculated_crc;*/ bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, BITHI(offset,length), "UL_HARQ_Chase_Sub_Burst_IE"); - tree = proto_item_add_subtree(ti, ett_302k); + tree = proto_tree_add_subtree(uiuc_tree, tvb, BITHI(offset,length), ett_302k, NULL, "UL_HARQ_Chase_Sub_Burst_IE"); bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); XBIT(duci, 1, "Dedicated UL Control Indicator"); @@ -370,16 +364,14 @@ static gint UL_HARQ_IR_CTC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *buf /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; /*proto_item *generic_item = NULL;*/ gint duci; /*guint16 calculated_crc;*/ bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_HARQ_IR_CTC_Sub_Burst_IE"); - tree = proto_item_add_subtree(ti, ett_302l); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302l, NULL, "UL_HARQ_IR_CTC_Sub_Burst_IE"); bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); XBIT(duci, 1, "Dedicated UL Control Indicator"); @@ -419,16 +411,14 @@ static gint UL_HARQ_IR_CC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufp /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; /*proto_item *generic_item = NULL;*/ gint duci; /*guint16 calculated_crc;*/ bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_HARQ_IR_CC_Sub_Burst_IE"); - tree = proto_item_add_subtree(ti, ett_302m); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302m, NULL, "UL_HARQ_IR_CC_Sub_Burst_IE"); bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); XBIT(duci, 1, "Dedicated UL Control Indicator"); @@ -469,16 +459,14 @@ static gint MIMO_UL_Chase_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; /*proto_item *generic_item = NULL;*/ gint muin,dmci,ackd,i; /*guint16 calculated_crc;*/ bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Chase_HARQ_Sub_Burst_IE"); - tree = proto_item_add_subtree(ti, ett_302n); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302n, NULL, "MIMO_UL_Chase_HARQ_Sub_Burst_IE"); XBIT(muin, 1, "MU indicator"); XBIT(dmci, 1, "Dedicated MIMO ULControl Indicator"); @@ -529,16 +517,14 @@ static gint MIMO_UL_IR_HARQ__Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *b /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; /*proto_item *generic_item = NULL;*/ gint muin,dmci,ackd,i; /*guint16 calculated_crc;*/ bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_IR_HARQ__Sub_Burst_IE"); - tree = proto_item_add_subtree(ti, ett_302o); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302o, NULL, "MIMO_UL_IR_HARQ__Sub_Burst_IE"); XBIT(muin, 1, "MU indicator"); XBIT(dmci, 1, "Dedicated MIMO UL Control Indicator"); @@ -589,16 +575,14 @@ static gint MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE(proto_tree *uiuc_tree, const gu /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; /*proto_item *generic_item = NULL;*/ gint muin,dmci,ackd,i; /*guint16 calculated_crc;*/ bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE"); - tree = proto_item_add_subtree(ti, ett_302p); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302p, NULL, "MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE"); XBIT(muin, 1, "MU indicator"); XBIT(dmci, 1, "Dedicated MIMO UL Control Indicator"); @@ -650,16 +634,14 @@ static gint MIMO_UL_STC_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *b /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; /*proto_item *generic_item = NULL;*/ gint ackd,txct,sboi; /*guint16 calculated_crc;*/ bit = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_STC_HARQ_Sub_Burst_IE"); - tree = proto_item_add_subtree(ti, ett_302q); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302q, NULL, "MIMO_UL_STC_HARQ_Sub_Burst_IE"); XBIT(txct, 2, "Tx count"); XBIT(data, 10, "Duration"); @@ -709,13 +691,11 @@ static gint Power_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint o /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; nib = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Power_Control_IE"); - tree = proto_item_add_subtree(ti, ett_292); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_292, NULL, "Power_Control_IE"); XNIB(data, 1, "Extended UIUC"); XNIB(data, 1, "Length"); @@ -732,15 +712,13 @@ static gint Mini_Subchannel_allocation_IE(proto_tree *uiuc_tree, const guint8 *b /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint j, M; const gint m_table[4] = { 2, 2, 3, 6 }; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Mini_subchannel_allocation_IE"); - tree = proto_item_add_subtree(ti, ett_295); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_295, NULL, "Mini_subchannel_allocation_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -773,13 +751,11 @@ static gint AAS_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "AAS_UL_IE"); - tree = proto_item_add_subtree(ti, ett_293); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_293, NULL, "AAS_UL_IE"); XBIT(data, 4, "Extended UIUC"); XBIT(data, 4, "Length"); @@ -802,14 +778,12 @@ static gint CQICH_Alloc_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint off gint bit; gint data; gint target; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint rci, rtype, ftype, zperm, mgi, api, pad; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "CQICH_Alloc_IE"); - tree = proto_item_add_subtree(ti, ett_300); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_300, NULL, "CQICH_Alloc_IE"); XBIT(data, 4, "Extended UIUC"); XBIT(data, 4, "Length"); @@ -873,13 +847,11 @@ static gint UL_Zone_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Zone_IE"); - tree = proto_item_add_subtree(ti, ett_294); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_294, NULL, "UL_Zone_IE"); XBIT(data, 4, "Extended UIUC"); XBIT(data, 4, "Length"); @@ -901,14 +873,12 @@ static gint PHYMOD_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offse /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint pmt; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "PHYMOD_UL_IE"); - tree = proto_item_add_subtree(ti, ett_302); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302, NULL, "PHYMOD_UL_IE"); XBIT(data, 4, "Extended UIUC"); XBIT(data, 4, "Length"); @@ -931,13 +901,11 @@ static gint MIMO_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; nib = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Basic_IE"); - tree = proto_item_add_subtree(ti, ett_299); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_299, NULL, "MIMO_UL_Basic_IE"); XNIB(data, 1, "Extended UIUC"); XNIB(data, 1, "Length"); @@ -952,13 +920,11 @@ static gint ULMAP_Fast_Tracking_IE(proto_tree *uiuc_tree, const guint8 *bufptr, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Fast_Tracking_IE"); - tree = proto_item_add_subtree(ti, ett_302h); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302h, NULL, "Fast_Tracking_IE"); length = NIB_TO_BIT(length); @@ -982,13 +948,11 @@ static gint UL_PUSC_Burst_Allocation_in_other_segment_IE(proto_tree *uiuc_tree, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_PUSC_Burst_Allocation_in_Other_Segment_IE"); - tree = proto_item_add_subtree(ti, ett_302c); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302c, NULL, "UL_PUSC_Burst_Allocation_in_Other_Segment_IE"); XBIT(data, 4, "Extended UIUC"); XBIT(data, 4, "Length"); @@ -1011,14 +975,12 @@ static gint Fast_Ranging_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint of /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint hidi; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Fast_Ranging_IE"); - tree = proto_item_add_subtree(ti, ett_302g); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302g, NULL, "Fast_Ranging_IE"); XBIT(data, 4, "Extended UIUC"); XBIT(data, 4, "Length"); @@ -1046,13 +1008,11 @@ static gint UL_Allocation_Start_IE(proto_tree *uiuc_tree, const guint8 *bufptr, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Allocation_start_IE"); - tree = proto_item_add_subtree(ti, ett_302a); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302a, NULL, "UL_Allocation_start_IE"); XBIT(data, 4, "Extended UIUC"); XBIT(data, 4, "Length"); @@ -1076,15 +1036,13 @@ static gint CQICH_Enhanced_Allocation_IE(proto_tree *uiuc_tree, const guint8 *bu /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint i, cnum, bapm; guint pad; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "CQICH_Enhanced_Alloc_IE"); - tree = proto_item_add_subtree(ti, ett_302b); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302b, NULL, "CQICH_Enhanced_Alloc_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -1129,13 +1087,11 @@ static gint HO_Anchor_Active_UL_MAP_IE(proto_tree *uiuc_tree, const guint8 *bufp /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; nib = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HO_Anchor_Active_UL_MAP_IE"); - tree = proto_item_add_subtree(ti, ett_302d); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302d, NULL, "HO_Anchor_Active_UL_MAP_IE"); XNIB(data, 1, "Extended-2 UIUC"); XNIB(data, 2, "Length"); @@ -1150,13 +1106,11 @@ static gint HO_Active_Anchor_UL_MAP_IE(proto_tree *uiuc_tree, const guint8 *bufp /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; nib = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HO_Active_Anchor_UL_MAP_IE"); - tree = proto_item_add_subtree(ti, ett_302e); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302e, NULL, "HO_Active_Anchor_UL_MAP_IE"); XNIB(data, 1, "Extended-2 UIUC"); XNIB(data, 2, "Length"); @@ -1171,15 +1125,13 @@ static gint Anchor_BS_switch_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gin /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint nbss, acod, cqai, pad; gint i; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Anchor_BS_switch_IE"); - tree = proto_item_add_subtree(ti, ett_302i); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302i, NULL, "Anchor_BS_switch_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -1232,15 +1184,13 @@ static gint UL_sounding_command_IE(proto_tree *uiuc_tree, const guint8 *bufptr, /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint stype, ssrf, srlf, iafb, pad, sept, nssym, ncid, amod; gint i, j; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_Sounding_Command_IE"); - tree = proto_item_add_subtree(ti, ett_315d); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_315d, NULL, "UL_Sounding_Command_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -1338,13 +1288,11 @@ static gint MIMO_UL_Enhanced_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gin /* offset of TLV in nibbles, length of TLV in nibbles */ gint nib; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; nib = offset; - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "MIMO_UL_Enhanced_IE"); - tree = proto_item_add_subtree(ti, ett_302f); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302f, NULL, "MIMO_UL_Enhanced_IE"); XNIB(data, 1, "Extended-2 UIUC"); XNIB(data, 2, "Length"); @@ -1359,8 +1307,7 @@ static gint HARQ_ULMAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offs /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint bitlength; gint lastbit; gint pad, mode, alsi, nsub; @@ -1369,8 +1316,7 @@ static gint HARQ_ULMAP_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offs bit = NIB_TO_BIT(offset); bitlength = NIB_TO_BIT(length); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HARQ_ULMAP_IE"); - tree = proto_item_add_subtree(ti, ett_302j); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302j, NULL, "HARQ_ULMAP_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -1422,13 +1368,11 @@ static gint HARQ_ACKCH_Region_Allocation_IE(proto_tree *uiuc_tree, const guint8 /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "HARQ_ACKCH_Region_IE"); - tree = proto_item_add_subtree(ti, ett_302t); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302t, NULL, "HARQ_ACKCH_Region_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -1447,16 +1391,14 @@ static gint AAS_SDMA_UL_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint off /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint nreg, pad, user, encm, ppmd, padj; gint aasp = 0; /* TODO AAS UL preamble used */ gint ii, jj; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "AAS_SDMA_UL_IE"); - tree = proto_item_add_subtree(ti, ett_302u); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302u, NULL, "AAS_SDMA_UL_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -1531,15 +1473,13 @@ static gint Feedback_Polling_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gin /* offset of TLV in nibbles, length of TLV in nibbles */ gint bit; gint data; - proto_item *ti = NULL; - proto_item *tree = NULL; + proto_item *tree; gint nalloc, dula, pad, adur; gint i; bit = NIB_TO_BIT(offset); - ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Feedback_Polling_IE"); - tree = proto_item_add_subtree(ti, ett_302v); + tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302v, NULL, "Feedback_Polling_IE"); XBIT(data, 4, "Extended-2 UIUC"); XBIT(data, 8, "Length"); @@ -1582,8 +1522,8 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g * length of the IE in nibbles * offset = start of IE (nibbles) * length = total length of bufptr (nibbles) */ - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_item *ti; + proto_tree *tree; gint nibble; gint uiuc, ext_uiuc, ext2_uiuc, len, aas_or_amc; guint cid; @@ -1599,8 +1539,7 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g if (uiuc == 0) { /* 8.4.5.4.9 FAST-FEEDBACK channel */ - ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+8), "FAST FEEDBACK Allocation IE"); - tree = proto_item_add_subtree(ti, ett_ulmap_ffb); + tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble, 5+8), ett_ulmap_ffb, NULL, "FAST FEEDBACK Allocation IE"); proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid); nibble += 4; @@ -1621,8 +1560,7 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g ext2_uiuc = NIB_NIBBLE(5+nibble, bufptr); len = NIB_BYTE(5+nibble+1, bufptr); - ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+3+len*2), "UIUC: %d (Extended-2 IE)", uiuc); - tree = proto_item_add_subtree(ti, ett_290b); + tree = proto_tree_add_subtree_format(ie_tree, tvb, NIBHI(nibble, 5+3+len*2), ett_290b, NULL, "UIUC: %d (Extended-2 IE)", uiuc); proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid); nibble += 4; @@ -1691,8 +1629,7 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g else if (uiuc == 12) { /* 8.4.5.4 [2] CDMA bandwidth request, CDMA ranging */ - ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+8), "CDMA Bandwidth/Ranging Request IE"); - tree = proto_item_add_subtree(ti, ett_287_1); + tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble, 5+8), ett_287_1, NULL, "CDMA Bandwidth/Ranging Request IE"); proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid); nibble += 4; @@ -1711,8 +1648,7 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g else if (uiuc == 13) { /* 8.4.5.4.2 [2] PAPR reduction allocation, safety zone - table 289 */ - ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble,5+8), "PAPR/Safety/Sounding Zone IE"); - tree = proto_item_add_subtree(ti, ett_289); + tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble,5+8), ett_289, NULL, "PAPR/Safety/Sounding Zone IE"); proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid); @@ -1733,8 +1669,7 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g else if (uiuc == 14) { /* 8.4.5.4.3 [2] CDMA allocation IE */ - ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble,5+10), "CDMA allocation IE"); - tree = proto_item_add_subtree(ti, ett_290); + tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble,5+10), ett_290, &ti, "CDMA allocation IE"); proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid); nibble += 4; @@ -1770,8 +1705,7 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g ext_uiuc = NIB_NIBBLE(5+nibble, bufptr); len = NIB_NIBBLE(5+nibble+1, bufptr); - ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+2+len*2), "UIUC: %d (Extended IE)", uiuc); - tree = proto_item_add_subtree(ti, ett_291); + tree = proto_tree_add_subtree_format(ie_tree, tvb, NIBHI(nibble, 5+2+len*2), ett_291, NULL, "UIUC: %d (Extended IE)", uiuc); proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble,4), cid); nibble += 4; @@ -1847,8 +1781,7 @@ gint dissect_ulmap_ie( proto_tree *ie_tree, const guint8 *bufptr, gint offset, g if (aas_or_amc) len += 3; - ti = proto_tree_add_text(ie_tree, tvb, NIBHI(nibble, 5+len), "Data Grant Burst Profile"); - tree = proto_item_add_subtree(ti, ett_287_2); + tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble, 5+len), ett_287_2, NULL, "Data Grant Burst Profile"); proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid); nibble += 4; @@ -1902,8 +1835,7 @@ static void dissect_mac_mgmt_msg_ulmap_decoder(tvbuff_t *tvb, packet_info *pinfo /* UL-MAP IEs */ length = tvb_len - offset; /* remaining length in bytes */ - ti = proto_tree_add_text(ulmap_tree, tvb, offset, length, "UL-MAP IEs (%u bytes)", length); - ie_tree = proto_item_add_subtree(ti, ett_ulmap_ie); + ie_tree = proto_tree_add_subtree_format(ulmap_tree, tvb, offset, length, ett_ulmap_ie, NULL, "UL-MAP IEs (%u bytes)", length); /* length = BYTE_TO_NIB(length); */ /* convert length to nibbles */ nib = BYTE_TO_NIB(offset); @@ -1945,8 +1877,7 @@ gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offse proto_tree_add_uint(tree, hf_ulmap_ofdma_sym, tvb, NIBHI(nib,2), data); /* added 2005 */ nib += 2; - ti = proto_tree_add_text(tree, tvb, NIBHI(nib,length-nib), "UL-MAP IEs (%u bytes)", NIB_ADDR(length-nib)); - ie_tree = proto_item_add_subtree(ti, ett_306_ul); + ie_tree = proto_tree_add_subtree_format(tree, tvb, NIBHI(nib,length-nib), ett_306_ul, NULL, "UL-MAP IEs (%u bytes)", NIB_ADDR(length-nib)); while (nib < length-1) { nib += dissect_ulmap_ie(ie_tree, bufptr, nib, length-nib, tvb); } @@ -1970,14 +1901,12 @@ gint wimax_decode_ulmap_reduced_aas(proto_tree *base_tree, const guint8 *bufptr, * return length in bits */ gint bit; guint data; - proto_item *ti = NULL; - proto_tree *tree = NULL; + proto_tree *tree; gint azci, azpi, umii, phmi, powi, fbck; bit = offset; - ti = proto_tree_add_text(base_tree, tvb, BITHI(bit,length), "Reduced_AAS_Private_UL_MAP"); - tree = proto_item_add_subtree(ti, ett_308b); + tree = proto_tree_add_subtree(base_tree, tvb, BITHI(bit,length), ett_308b, NULL, "Reduced_AAS_Private_UL_MAP"); /* Decode and display the Reduced AAS private UL-MAP */ XBIT(azci, 1, "AAS zone configuration included"); diff --git a/plugins/wimax/packet-wmx.c b/plugins/wimax/packet-wmx.c index ef0ef4573e..fdbf2aa75d 100644 --- a/plugins/wimax/packet-wmx.c +++ b/plugins/wimax/packet-wmx.c @@ -99,8 +99,7 @@ proto_item *add_tlv_subtree(tlv_info_t *self, proto_tree *tree, int hfindex, tvb hf = proto_registrar_get_nth(hfindex); - tlv_item = proto_tree_add_text(tree, tvb, start, tlv_value_length+tlv_val_offset, "%s", hf->name); - tlv_tree = proto_item_add_subtree(tlv_item, ett_tlv[tlv_type]); + tlv_tree = proto_tree_add_subtree(tree, tvb, start, tlv_value_length+tlv_val_offset, ett_tlv[tlv_type], NULL, hf->name); proto_tree_add_uint(tlv_tree, hf_tlv_type, tvb, start, 1, tlv_type); if (size_of_tlv_length_field > 0) /* It is */ @@ -137,7 +136,6 @@ proto_tree *add_tlv_subtree_no_item(tlv_info_t *self, proto_tree *tree, int hfin { header_field_info *hf; proto_tree *tlv_tree; - proto_item *tlv_item; gint tlv_value_length, tlv_val_offset; guint8 size_of_tlv_length_field; guint8 tlv_type; @@ -154,8 +152,7 @@ proto_tree *add_tlv_subtree_no_item(tlv_info_t *self, proto_tree *tree, int hfin hf = proto_registrar_get_nth(hfindex); - tlv_item = proto_tree_add_text(tree, tvb, start, tlv_value_length+tlv_val_offset, "%s", hf->name); - tlv_tree = proto_item_add_subtree(tlv_item, ett_tlv[tlv_type]); + tlv_tree = proto_tree_add_subtree(tree, tvb, start, tlv_value_length+tlv_val_offset, ett_tlv[tlv_type], NULL, hf->name); proto_tree_add_uint(tlv_tree, hf_tlv_type, tvb, start, 1, tlv_type); if (size_of_tlv_length_field > 0) /* It is */ @@ -250,8 +247,7 @@ proto_tree *add_protocol_subtree(tlv_info_t *self, gint idx, proto_tree *tree, i break; } /* Show "TLV value: " */ - tlv_item = proto_tree_add_text(tlv_tree, tvb, start+tlv_val_offset, tlv_value_length, hex_fmt, label, tlv_value); - tlv_tree = proto_item_add_subtree(tlv_item, idx); + tlv_tree = proto_tree_add_subtree_format(tlv_tree, tvb, start+tlv_val_offset, tlv_value_length, idx, NULL, hex_fmt, label, tlv_value); /* Return a pointer to the value level */ return tlv_tree; diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c index 019ef86a4d..dc48a905d3 100644 --- a/plugins/wimaxasncp/packet-wimaxasncp.c +++ b/plugins/wimaxasncp/packet-wimaxasncp.c @@ -1324,12 +1324,9 @@ static void wimaxasncp_dissect_tlv_value( proto_item *item; const guint max_protocols_in_tlv_item = 8; /* arbitrary */ - item = proto_tree_add_text( + protocol_list_tree = proto_tree_add_subtree( tree, tvb, offset, length, - "Value"); - - protocol_list_tree = proto_item_add_subtree( - item, ett_wimaxasncp_tlv_protocol_list); + ett_wimaxasncp_tlv_protocol_list, NULL, "Value"); /* hidden item for filtering */ item = proto_tree_add_item( @@ -1384,12 +1381,9 @@ static void wimaxasncp_dissect_tlv_value( proto_item *item; const guint max_port_ranges_in_tlv_item = 3; /* arbitrary */ - item = proto_tree_add_text( + port_range_list_tree = proto_tree_add_subtree( tree, tvb, offset, length, - "Value"); - - port_range_list_tree = proto_item_add_subtree( - item, ett_wimaxasncp_tlv_port_range_list); + ett_wimaxasncp_tlv_port_range_list, NULL, "Value"); /* hidden item for filtering */ item = proto_tree_add_item( @@ -1469,12 +1463,9 @@ static void wimaxasncp_dissect_tlv_value( proto_tree *ip_address_mask_list_tree; proto_item *item; - item = proto_tree_add_text( + ip_address_mask_list_tree = proto_tree_add_subtree( tree, tvb, offset, length, - "Value"); - - ip_address_mask_list_tree = proto_item_add_subtree( - item, ett_wimaxasncp_tlv_ip_address_mask_list); + ett_wimaxasncp_tlv_ip_address_mask_list, NULL, "Value"); /* hidden item for filtering */ item = proto_tree_add_item( @@ -1496,12 +1487,9 @@ static void wimaxasncp_dissect_tlv_value( struct e_in6_addr ip; const gchar *s; - item = proto_tree_add_text( + ip_address_mask_tree = proto_tree_add_subtree( ip_address_mask_list_tree, tvb, offset, 32, - "IPv6 Address and Mask"); - - ip_address_mask_tree = proto_item_add_subtree( - item, ett_wimaxasncp_tlv_ip_address_mask); + ett_wimaxasncp_tlv_ip_address_mask, NULL, "IPv6 Address and Mask"); /* -------------------------------------------------------- * address @@ -1559,12 +1547,9 @@ static void wimaxasncp_dissect_tlv_value( guint32 ip; const gchar *s; - item = proto_tree_add_text( + ip_address_mask_tree = proto_tree_add_subtree( ip_address_mask_list_tree, tvb, offset, 8, - "IPv4 Address and Mask"); - - ip_address_mask_tree = proto_item_add_subtree( - item, ett_wimaxasncp_tlv_ip_address_mask); + ett_wimaxasncp_tlv_ip_address_mask, NULL, "IPv4 Address and Mask"); /* -------------------------------------------------------- * address @@ -1711,12 +1696,9 @@ static void wimaxasncp_dissect_tlv_value( guint32 vendorId; const gchar *vendorName; - item = proto_tree_add_text( + vsif_tree = proto_tree_add_subtree( tree, tvb, offset, length, - "Value"); - - vsif_tree = proto_item_add_subtree( - item, ett_wimaxasncp_tlv_vendor_specific_information_field); + ett_wimaxasncp_tlv_vendor_specific_information_field, NULL, "Value"); /* hidden item for filtering */ item = proto_tree_add_item( diff --git a/plugins/wimaxmacphy/packet-wimaxmacphy.c b/plugins/wimaxmacphy/packet-wimaxmacphy.c index 7c35cf4b9e..e5225be735 100644 --- a/plugins/wimaxmacphy/packet-wimaxmacphy.c +++ b/plugins/wimaxmacphy/packet-wimaxmacphy.c @@ -1012,7 +1012,6 @@ static gint dissect_wimaxmacphy_dl_sub_burst_descriptor(tvbuff_t *tvb, guint off { guint start_offset = offset; guint8 sub_burst_type; - proto_item *item; proto_tree *subtree; sub_burst_type = tvb_get_guint8(tvb, offset); @@ -1031,10 +1030,10 @@ static gint dissect_wimaxmacphy_dl_sub_burst_descriptor(tvbuff_t *tvb, guint off proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_number_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_NA); offset += 2; - proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved2, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_modulation_fec_code_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1060,8 +1059,7 @@ static gint dissect_wimaxmacphy_dl_sub_burst_descriptor(tvbuff_t *tvb, guint off { case 0x61: /* HARQ chase combining */ - item = proto_tree_add_text(tree, tvb, offset, 4, "HARQ Chase Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_sub_burst_harq_chase); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_sub_burst_harq_chase, NULL, "HARQ Chase Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1072,14 +1070,13 @@ static gint dissect_wimaxmacphy_dl_sub_burst_descriptor(tvbuff_t *tvb, guint off proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_flush_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_reserved, tvb, offset, 1, ENC_NA); offset += 1; break; case 0x64: /* MIMO chase combining */ - item = proto_tree_add_text(tree, tvb, offset, 4, "MIMO Chase Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_sub_burst_mimo_chase); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_sub_burst_mimo_chase, NULL, "MIMO Chase Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_mimo_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1106,7 +1103,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset { guint start_offset = offset; guint8 burst_type, burst_type_extension, sub_burst_descriptor_count, sub_burst; - proto_item *item, *opt_item; + proto_item *item; proto_tree *subtree, *opt_tree; burst_type = tvb_get_guint8(tvb, offset); @@ -1143,20 +1140,18 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset { case 0x40: /* map */ - item = proto_tree_add_text(tree, tvb, offset, 4, "MAP Data Burst Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_burst_map); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_map, NULL, "MAP Data Burst Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_map_number_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_map_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_map_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case 0x41: /* normal */ - item = proto_tree_add_text(tree, tvb, offset, 4, "Normal Data Burst Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_burst_normal); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_normal, NULL, "Normal Data Burst Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_normal_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1172,8 +1167,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset { case 0x01: /* AAS v1 */ - opt_item = proto_tree_add_text(tree, tvb, offset, 4, "Optional AAS Specific"); - opt_tree = proto_item_add_subtree(opt_item, ett_wimaxmacphy_dl_burst_opt_aas); + opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_opt_aas, NULL, "Optional AAS Specific"); proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_modifier_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1181,7 +1175,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_shift_index, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_reserved, tvb, offset, 2, ENC_NA); offset += 2; /* ??? Algorithm specific Information (per Burst Type extension) */ @@ -1189,8 +1183,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset case 0x02: /* MIMO v1 */ - opt_item = proto_tree_add_text(tree, tvb, offset, 4, "Optional MIMO Specific"); - opt_tree = proto_item_add_subtree(opt_item, ett_wimaxmacphy_dl_burst_opt_mimo); + opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_opt_mimo, NULL, "Optional MIMO Specific"); proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_mimo_matrix_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1198,7 +1191,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_mimo_layer_index, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(opt_tree, hf_wimaxmacphy_dl_burst_opt_mimo_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(opt_tree, hf_wimaxmacphy_dl_burst_opt_mimo_reserved, tvb, offset, 2, ENC_NA); offset += 2; @@ -1214,8 +1207,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset case 0x43: /* PAPR */ - item = proto_tree_add_text(tree, tvb, offset, 4, "PAPR Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_burst_papr); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_papr, NULL, "PAPR Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1223,7 +1215,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; @@ -1237,7 +1229,7 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(tree, hf_wimaxmacphy_number_of_sub_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_padding, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_padding, tvb, offset, 3, ENC_NA); offset += 3; /* sub-burst descriptors */ @@ -1246,8 +1238,8 @@ static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree *sub_burst_descriptor_tree; guint sub_burst_descriptor_length; - item = proto_tree_add_text(tree, tvb, offset, 1, "Sub-Burst Descriptor %u", sub_burst); - sub_burst_descriptor_tree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_sub_burst_descriptor); + sub_burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, + ett_wimaxmacphy_dl_sub_burst_descriptor, &item, "Sub-Burst Descriptor %u", sub_burst); sub_burst_descriptor_length = dissect_wimaxmacphy_dl_sub_burst_descriptor(tvb, offset, pinfo, sub_burst_descriptor_tree); @@ -1294,7 +1286,7 @@ static guint dissect_wimaxmacphy_dl_zone_descriptor(tvbuff_t *tvb, guint offset, proto_tree_add_item(tree, hf_wimaxmacphy_zone_dedicated_pilots, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_zone_reserved, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_zone_reserved, tvb, offset, 3, ENC_NA); offset += 3; /* zone-specific parts */ @@ -1302,8 +1294,7 @@ static guint dissect_wimaxmacphy_dl_zone_descriptor(tvbuff_t *tvb, guint offset, { case 0x21: /* STC */ - item = proto_tree_add_text(tree, tvb, offset, 4, "STC Zone Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_zone_stc); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_zone_stc, NULL, "STC Zone Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_zone_stc_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1320,8 +1311,7 @@ static guint dissect_wimaxmacphy_dl_zone_descriptor(tvbuff_t *tvb, guint offset, case 0x22: /* AAS */ - item = proto_tree_add_text(tree, tvb, offset, 4, "AAS Zone Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_zone_aas); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_zone_aas, NULL, "AAS Zone Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_zone_preamble_configuration, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1329,7 +1319,7 @@ static guint dissect_wimaxmacphy_dl_zone_descriptor(tvbuff_t *tvb, guint offset, proto_tree_add_item(subtree, hf_wimaxmacphy_zone_sdma_supported_indication, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_dl_zone_aas_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_dl_zone_aas_reserved, tvb, offset, 2, ENC_NA); offset += 2; /* ??? Algorithm Specific Information (per Zone Type) */ @@ -1345,7 +1335,7 @@ static guint dissect_wimaxmacphy_dl_zone_descriptor(tvbuff_t *tvb, guint offset, proto_tree_add_item(tree, hf_wimaxmacphy_number_of_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_burst_padding, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_burst_padding, tvb, offset, 3, ENC_NA); offset += 3; /* burst descriptors */ @@ -1355,8 +1345,8 @@ static guint dissect_wimaxmacphy_dl_zone_descriptor(tvbuff_t *tvb, guint offset, guint burst_descriptor_length; /* note: we'll adjust the length later */ - item = proto_tree_add_text(tree, tvb, offset, 1, "Burst Descriptor %u", burst); - burst_descriptor_tree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_burst_descriptor); + burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, + ett_wimaxmacphy_dl_burst_descriptor, &item, "Burst Descriptor %u", burst); burst_descriptor_length = dissect_wimaxmacphy_dl_burst_descriptor( tvb, offset, pinfo, burst_descriptor_tree); @@ -1405,8 +1395,7 @@ static guint dissect_wimaxmacphy_dl_subframe_descriptor(tvbuff_t *tvb, guint off proto_tree *zone_descriptor_tree; guint zone_descriptor_length; - item = proto_tree_add_text(tree, tvb, offset, 1, "Zone Descriptor %u", zone); - zone_descriptor_tree = proto_item_add_subtree(item, ett_wimaxmacphy_dl_zone_descriptor); + zone_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_dl_zone_descriptor, &item, "Zone Descriptor %u", zone); zone_descriptor_length = dissect_wimaxmacphy_dl_zone_descriptor( tvb, offset, pinfo, zone_descriptor_tree); @@ -1426,8 +1415,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_sub_allocation_specific_part(tvbuff proto_item *item, *opt_item; proto_tree *subtree, *opt_tree; - item = proto_tree_add_text(tree, tvb, offset, 1, "Sub-Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_sub_burst_sub_allocation_specific); + subtree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_wimaxmacphy_ul_sub_burst_sub_allocation_specific, &item, "Sub-Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1447,7 +1435,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_sub_allocation_specific_part(tvbuff proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_modulation_fec_code_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_NA); offset += 2; /* HARQ chase and MIMO chase specific parts */ @@ -1455,8 +1443,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_sub_allocation_specific_part(tvbuff { case 0x61: /* HARQ chase combining */ - opt_item = proto_tree_add_text(tree, tvb, offset, 4, "HARQ Chase Specific"); - opt_tree = proto_item_add_subtree(opt_item, ett_wimaxmacphy_ul_sub_burst_harq_chase); + opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_harq_chase, &opt_item, "HARQ Chase Specific"); proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1467,14 +1454,13 @@ static gint dissect_wimaxmacphy_ul_sub_burst_sub_allocation_specific_part(tvbuff proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_flush_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_reserved, tvb, offset, 1, ENC_NA); offset += 1; break; case 0x64: /* MIMO chase combining */ - opt_item = proto_tree_add_text(tree, tvb, offset, 4, "MIMO Chase Specific"); - opt_tree = proto_item_add_subtree(opt_item, ett_wimaxmacphy_ul_sub_burst_mimo_chase); + opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_mimo_chase, NULL, "MIMO Chase Specific"); proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_mimo_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1502,7 +1488,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_sub_allocation_specific_part(tvbuff static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree) { guint8 sub_burst_type; - proto_item *item, *feedback_item; + proto_item *feedback_item; proto_tree *subtree, *feedback_tree; guint start_offset = offset; @@ -1519,7 +1505,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint off proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_NA); offset += 2; /* sub-burst-specific parts */ @@ -1527,8 +1513,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint off { case 0x68: /* mini-subchannel */ - item = proto_tree_add_text(tree, tvb, offset, 4, "Mini-Subchannel Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_sub_burst_mini_subchannel); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_mini_subchannel, NULL, "Mini-Subchannel Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_ctype, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1536,14 +1521,13 @@ static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint off proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_mini_subchannel_index, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_mini_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_mini_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case 0x69: /* fast feedback */ - item = proto_tree_add_text(tree, tvb, offset, 4, "Fast Feedback Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_sub_burst_fast_feedback); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_fast_feedback, NULL, "Fast Feedback Allocation Specific"); feedback_item = proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding, tvb, offset, 1, ENC_BIG_ENDIAN); feedback_tree = proto_item_add_subtree(feedback_item, ett_wimaxmacphy_ul_feedback_type_coding); @@ -1569,8 +1553,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint off case 0x6a: /* HARQ ACK */ - item = proto_tree_add_text(tree, tvb, offset, 4, "HARQ ACK Subchannel Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_sub_burst_harq_ack); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_harq_ack, NULL, "HARQ ACK Subchannel Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_harq_ack_acid, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_harq_ack_reserved, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1579,8 +1562,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint off case 0x6b: /* sounding signal */ - item = proto_tree_add_text(tree, tvb, offset, 11, "Sounding Signal Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_sub_burst_sounding_signal); + subtree = proto_tree_add_subtree(tree, tvb, offset, 11, ett_wimaxmacphy_ul_sub_burst_sounding_signal, NULL, "Sounding Signal Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_symbol_index, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1609,7 +1591,7 @@ static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint off proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_decimation_offset, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_reserved, tvb, offset, 1, ENC_NA); offset += 1; break; @@ -1626,7 +1608,7 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset { guint8 burst_type, burst_type_extension; guint8 sub_burst_descriptor_count, sub_burst; - proto_item *item, *opt_item, *pilot_patterns_item; + proto_item *item, *pilot_patterns_item; proto_tree *subtree, *opt_tree, *pilot_patterns_tree; guint start_offset = offset; @@ -1653,7 +1635,7 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(tree, hf_wimaxmacphy_burst_subchannel_offset, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_burst_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_burst_reserved, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_burst_repetition_coding_indication, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1670,8 +1652,7 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset { case 0x40: /* HARQ ACK channel */ - item = proto_tree_add_text(tree, tvb, offset, 4, "HARQ ACK Channel Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_harq_ack); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_harq_ack, NULL, "HARQ ACK Channel Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_harq_ack_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1679,14 +1660,13 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_harq_ack_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_harq_ack_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_harq_ack_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case 0x41: /* fast feedback channel */ - item = proto_tree_add_text(tree, tvb, offset, 4, "Fast Feedback Channel Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_fast_feedback); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_fast_feedback, NULL, "Fast Feedback Channel Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_fast_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1694,14 +1674,13 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_fast_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_fast_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_fast_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case 0x42: /* initial ranging/handover ranging */ - item = proto_tree_add_text(tree, tvb, offset, 8, "Initial Ranging/Handover Ranging Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_initial_ranging); + subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_ul_burst_initial_ranging, NULL, "Initial Ranging/Handover Ranging Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1712,20 +1691,19 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_ranging_method, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_reserved1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_zone_xid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_reserved2, tvb, offset, 2, ENC_NA); offset += 2; break; case 0x43: /* periodic ranging/bandwidth request */ - item = proto_tree_add_text(tree, tvb, offset, 8, "Periodic Ranging/Bandwidth Request Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_periodic_ranging); + subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_ul_burst_periodic_ranging, NULL, "Periodic Ranging/Bandwidth Request Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1736,20 +1714,19 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_ranging_method, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_reserved1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_zone_xid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_reserved2, tvb, offset, 2, ENC_NA); offset += 2; break; case 0x44: /* PAPR/safety zone */ - item = proto_tree_add_text(tree, tvb, offset, 4, "PAPR/Safety Zone Channel Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_papr_safety_zone); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_papr_safety_zone, NULL, "PAPR/Safety Zone Channel Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1760,14 +1737,13 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_papr_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_reserved, tvb, offset, 1, ENC_NA); offset += 1; break; case 0x45: /* sounding zone */ - item = proto_tree_add_text(tree, tvb, offset, 8, "Sounding Zone Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_sounding_zone); + subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_ul_burst_sounding_zone, NULL, "Sounding Zone Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1790,14 +1766,13 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_decimation_offset_rand, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_reserved, tvb, offset, 1, ENC_NA); offset += 1; break; case 0x46: /* noise floor calculation */ - item = proto_tree_add_text(tree, tvb, offset, 4, "Noise Floor Calculation Allocation Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_noise_floor); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_noise_floor, NULL, "Noise Floor Calculation Allocation Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_noise_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1805,19 +1780,18 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_noise_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_noise_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_noise_reserved, tvb, offset, 2, ENC_NA); offset += 2; break; case 0x47: /* normal data */ - item = proto_tree_add_text(tree, tvb, offset, 4, "Normal Data Burst Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_normal_data); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_normal_data, NULL, "Normal Data Burst Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_normal_number_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_normal_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_normal_reserved, tvb, offset, 2, ENC_NA); offset += 2; /* extensions */ @@ -1825,13 +1799,12 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset { case 0x01: /* AAS v1 */ - opt_item = proto_tree_add_text(tree, tvb, offset, 4, "Optional AAS Specific"); - opt_tree = proto_item_add_subtree(opt_item, ett_wimaxmacphy_ul_burst_opt_aas); + opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_opt_aas, NULL, "Optional AAS Specific"); proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_modifier_type, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_shift_index, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1842,8 +1815,7 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset case 0x02: /* MIMO v1 */ - opt_item = proto_tree_add_text(tree, tvb, offset, 4, "Optional MIMO Specific"); - opt_tree = proto_item_add_subtree(opt_item, ett_wimaxmacphy_ul_burst_opt_mimo); + opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_opt_mimo, NULL, "Optional MIMO Specific"); proto_tree_add_item(opt_tree, hf_wimaxmacphy_ul_burst_opt_mimo_matrix_indicator, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1884,7 +1856,7 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree_add_item(tree, hf_wimaxmacphy_number_of_sub_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_padding, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_padding, tvb, offset, 3, ENC_NA); offset += 3; /* sub-burst descriptors */ @@ -1893,8 +1865,7 @@ static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset proto_tree *sub_burst_descriptor_tree; guint sub_burst_descriptor_length; - item = proto_tree_add_text(tree, tvb, offset, 1, "Sub-Burst Descriptor %u", sub_burst); - sub_burst_descriptor_tree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_sub_burst_descriptor); + sub_burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_ul_sub_burst_descriptor, &item, "Sub-Burst Descriptor %u", sub_burst); sub_burst_descriptor_length = dissect_wimaxmacphy_ul_sub_burst_descriptor(tvb, offset, pinfo, sub_burst_descriptor_tree); @@ -1946,8 +1917,7 @@ static guint dissect_wimaxmacphy_ul_zone_descriptor(tvbuff_t *tvb, guint offset, { proto_tree *subtree; - item = proto_tree_add_text(tree, tvb, offset, 4, "AAS Zone Specific"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_zone_aas); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_zone_aas, NULL, "AAS Zone Specific"); proto_tree_add_item(subtree, hf_wimaxmacphy_zone_preamble_configuration, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -1958,7 +1928,7 @@ static guint dissect_wimaxmacphy_ul_zone_descriptor(tvbuff_t *tvb, guint offset, proto_tree_add_item(subtree, hf_wimaxmacphy_zone_sdma_supported_indication, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_ul_zone_aas_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_ul_zone_aas_reserved, tvb, offset, 1, ENC_NA); offset += 1; /* ??? Algorithm Specific Information (per Zone Type) */ @@ -1974,7 +1944,7 @@ static guint dissect_wimaxmacphy_ul_zone_descriptor(tvbuff_t *tvb, guint offset, proto_tree_add_item(tree, hf_wimaxmacphy_number_of_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_burst_padding, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_burst_padding, tvb, offset, 3, ENC_NA); offset += 3; /* burst descriptors */ @@ -1983,8 +1953,7 @@ static guint dissect_wimaxmacphy_ul_zone_descriptor(tvbuff_t *tvb, guint offset, proto_tree *burst_descriptor_tree; guint burst_descriptor_length; - item = proto_tree_add_text(tree, tvb, offset, 1, "Burst Descriptor %u", burst); - burst_descriptor_tree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_burst_descriptor); + burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_ul_burst_descriptor, &item, "Burst Descriptor %u", burst); burst_descriptor_length = dissect_wimaxmacphy_ul_burst_descriptor( tvb, offset, pinfo, burst_descriptor_tree); @@ -2008,7 +1977,7 @@ static guint dissect_wimaxmacphy_ul_subframe_descriptor(tvbuff_t *tvb, guint off proto_tree_add_item(tree, hf_wimaxmacphy_subframe_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_subframe_downlink_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_subframe_downlink_reserved1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_subframe_phy_sap_version_number, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2021,7 +1990,7 @@ static guint dissect_wimaxmacphy_ul_subframe_descriptor(tvbuff_t *tvb, guint off proto_tree_add_item(tree, hf_wimaxmacphy_number_of_zone_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_zone_padding, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_zone_padding, tvb, offset, 3, ENC_NA); offset += 3; /* ----------------------------------------------------------------------- @@ -2035,8 +2004,7 @@ static guint dissect_wimaxmacphy_ul_subframe_descriptor(tvbuff_t *tvb, guint off proto_tree *zone_descriptor_tree; guint zone_descriptor_length; - item = proto_tree_add_text(tree, tvb, offset, 1, "Zone Descriptor %u", zone); - zone_descriptor_tree = proto_item_add_subtree(item, ett_wimaxmacphy_ul_zone_descriptor); + zone_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_ul_zone_descriptor, &item, "Zone Descriptor %u", zone); zone_descriptor_length = dissect_wimaxmacphy_ul_zone_descriptor( tvb, offset, pinfo, zone_descriptor_tree); @@ -2073,7 +2041,7 @@ static guint dissect_wimaxmacphy_phy_txstart_confirmation(tvbuff_t *tvb, guint o proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_wimaxmacphy_prim_next_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN); /* offset += 1; */ @@ -2089,7 +2057,7 @@ static guint dissect_wimaxmacphy_phy_txstart_indication(tvbuff_t *tvb, guint off proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_lsn, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_prim_initial_frame_number, tvb, offset, 3, ENC_BIG_ENDIAN); @@ -2120,13 +2088,13 @@ static guint dissect_wimaxmacphy_phy_txsdu_confirmation(tvbuff_t *tvb, guint off proto_tree_add_item(tree, hf_wimaxmacphy_prim_dl_sub_burst_burst_number, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved5, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved5, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_wimaxmacphy_prim_next_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN); /* offset += 1; */ @@ -2149,7 +2117,7 @@ static guint dissect_wimaxmacphy_phy_txend_indication(tvbuff_t *tvb, guint offse proto_tree_add_item(tree, hf_wimaxmacphy_prim_number_of_consecutive_frames_with_aas, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved5, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved5, tvb, offset, 2, ENC_NA); /* offset += 2; */ return 6; @@ -2181,7 +2149,7 @@ static guint dissect_wimaxmacphy_phy_rxstart_confirmation(tvbuff_t *tvb, guint o proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_wimaxmacphy_prim_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN); /* offset += 1; */ @@ -2193,7 +2161,7 @@ static guint dissect_wimaxmacphy_phy_rxstart_indication(tvbuff_t *tvb, guint off proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_lsn, tvb, offset, 1, ENC_BIG_ENDIAN); /* offset += 1; */ @@ -2203,7 +2171,7 @@ static guint dissect_wimaxmacphy_phy_rxstart_indication(tvbuff_t *tvb, guint off static guint dissect_wimaxmacphy_phy_rxsdu_indication(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree) { guint8 indication_type; - proto_item *item, *feedback_item; + proto_item *feedback_item; proto_tree *subtree, *feedback_tree; guint length, start_offset = offset; @@ -2220,7 +2188,7 @@ static guint dissect_wimaxmacphy_phy_rxsdu_indication(tvbuff_t *tvb, guint offse proto_tree_add_item(tree, hf_wimaxmacphy_prim_cinr, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_prim_power_offset, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2256,26 +2224,24 @@ static guint dissect_wimaxmacphy_phy_rxsdu_indication(tvbuff_t *tvb, guint offse } case 1: /* HARQ ACK */ { - item = proto_tree_add_text(tree, tvb, offset, 4, "HARQ ACK channel data format"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_prim_harq_ack); + subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_prim_harq_ack, NULL, "HARQ ACK channel data format"); proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_issid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_acid, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_reserved1, tvb, offset, 1, ENC_NA); proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_ack_valid, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_reserved2, tvb, offset, 1, ENC_NA); offset += 1; break; } case 2: /* fast feedback */ { - item = proto_tree_add_text(tree, tvb, offset, 8, "Fast Feedback channel data format"); - subtree = proto_item_add_subtree(item, ett_wimaxmacphy_prim_harq_ack); + subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_prim_harq_ack, NULL, "Fast Feedback channel data format"); proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_issid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -2297,7 +2263,7 @@ static guint dissect_wimaxmacphy_phy_rxsdu_indication(tvbuff_t *tvb, guint offse proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_feedback_valid, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_feedback_sub_type, tvb, offset, 2, ENC_BIG_ENDIAN); - proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_reserved, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_feedback_value, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2325,7 +2291,7 @@ static guint dissect_wimaxmacphy_phy_rxend_indication(tvbuff_t *tvb, guint offse proto_tree_add_item(tree, hf_wimaxmacphy_prim_number_of_affected_ss, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_NA); offset += 1; do @@ -2352,7 +2318,7 @@ static guint dissect_wimaxmacphy_phy_rxcdma_indication(tvbuff_t *tvb, guint offs proto_tree_add_item(tree, hf_wimaxmacphy_prim_cdma_symbol, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_prim_cdma_subchannel, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2364,14 +2330,14 @@ static guint dissect_wimaxmacphy_phy_rxcdma_indication(tvbuff_t *tvb, guint offs proto_tree_add_item(tree, hf_wimaxmacphy_prim_cinr, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved3, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved3, tvb, offset, 1, ENC_NA); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_prim_power_offset, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_msn, tvb, offset, 2, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved4, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved4, tvb, offset, 2, ENC_NA); offset += 2; proto_tree_add_item(tree, hf_wimaxmacphy_prim_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN); |