diff options
author | Michael Mann <mmann78@netscape.net> | 2014-06-20 21:35:40 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-06-22 21:08:21 +0000 |
commit | 9356d5c689fa911b0b13d4b2a0cd6e9208d60f6d (patch) | |
tree | f3265efe4137c8a09995b448bf0c4bcdecf4e5a9 /epan | |
parent | 2c0214efff7b3421355e42ee7f3075c2f3181d3e (diff) |
convert to proto_tree_add_subtree[_format] for ASN.1 dissectors
Change-Id: I753ca95e2e1b38bad2c09955317e648c525e40ef
Reviewed-on: https://code.wireshark.org/review/2509
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
26 files changed, 401 insertions, 556 deletions
diff --git a/epan/dissectors/packet-ansi_tcap.c b/epan/dissectors/packet-ansi_tcap.c index 42f74903d0..b850febaec 100644 --- a/epan/dissectors/packet-ansi_tcap.c +++ b/epan/dissectors/packet-ansi_tcap.c @@ -1432,9 +1432,8 @@ dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) #if 0 /* Skip this part for now it will be rewritten */ if (g_ansi_tcap_HandleSRT && !tcap_subdissector_used ) { if (gtcap_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_ansi_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_ansi_tcap_stat); } p_tcap_context=tcapsrt_call_matching(tvb, pinfo, stat_tree, gp_tcapsrt_info); ansi_tcap_private.context=p_tcap_context; @@ -1734,7 +1733,7 @@ proto_register_ansi_tcap(void) NULL, HFILL }}, /*--- End of included file: packet-ansi_tcap-hfarr.c ---*/ -#line 494 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" +#line 493 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" }; /* Setup protocol subtree array */ @@ -1772,7 +1771,7 @@ proto_register_ansi_tcap(void) &ett_ansi_tcap_T_paramSet, /*--- End of included file: packet-ansi_tcap-ettarr.c ---*/ -#line 505 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" +#line 504 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" }; static const enum_val_t ansi_tcap_response_matching_type_values[] = { diff --git a/epan/dissectors/packet-atn-cm.c b/epan/dissectors/packet-atn-cm.c index d7fd33dd6c..8d963de23b 100644 --- a/epan/dissectors/packet-atn-cm.c +++ b/epan/dissectors/packet-atn-cm.c @@ -642,19 +642,10 @@ dissect_atn_cm( void *data _U_) { int type; - proto_item *ti; proto_tree *sub_tree; - ti = proto_tree_add_text( - tree, - tvb, - 0, - tvb_reported_length_remaining(tvb, 0) , - ATN_CM_PROTO); - - sub_tree = proto_item_add_subtree( - ti, - ett_atn_cm); + sub_tree = proto_tree_add_subtree( + tree, tvb, 0, -1, ett_atn_cm, NULL, ATN_CM_PROTO); /* ti = proto_tree_add_item(tree, proto_atn_cm, tvb, 0, 0 , ENC_NA); */ /* sub_tree = proto_item_add_subtree(ti, ett_atn_cm_pdu); */ @@ -940,7 +931,7 @@ void proto_register_atn_cm (void) "Timeminutes", HFILL }}, /*--- End of included file: packet-atn-cm-hfarr.c ---*/ -#line 212 "../../asn1/atn-cm/packet-atn-cm-template.c" +#line 203 "../../asn1/atn-cm/packet-atn-cm-template.c" }; static gint *ett[] = { @@ -963,7 +954,7 @@ void proto_register_atn_cm (void) &ett_atn_cm_Time, /*--- End of included file: packet-atn-cm-ettarr.c ---*/ -#line 215 "../../asn1/atn-cm/packet-atn-cm-template.c" +#line 206 "../../asn1/atn-cm/packet-atn-cm-template.c" &ett_atn_cm }; diff --git a/epan/dissectors/packet-atn-cpdlc.c b/epan/dissectors/packet-atn-cpdlc.c index e21ffa70c0..3ed86fea18 100644 --- a/epan/dissectors/packet-atn-cpdlc.c +++ b/epan/dissectors/packet-atn-cpdlc.c @@ -5359,17 +5359,10 @@ dissect_atn_cpdlc( if(!atn_cv){ /* atn conversation not found */ return 0; } - ti = proto_tree_add_text( - tree, - tvb, - 0, - tvb_reported_length_remaining(tvb, 0) , + atn_cpdlc_tree = proto_tree_add_subtree( + tree, tvb, 0, -1, ett_atn_cpdlc, NULL, ATN_CPDLC_PROTO ); - atn_cpdlc_tree = proto_item_add_subtree( - ti, - ett_atn_cpdlc); - switch(atn_cv->ae_qualifier){ case pmcpdlc: if( check_heur_msg_type(pinfo) == um ) { @@ -7918,7 +7911,7 @@ void proto_register_atn_cpdlc (void) NULL, HFILL }}, /*--- End of included file: packet-atn-cpdlc-hfarr.c ---*/ -#line 316 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" +#line 309 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" }; static gint *ett[] = { @@ -8069,7 +8062,7 @@ void proto_register_atn_cpdlc (void) &ett_atn_cpdlc_WindSpeed, /*--- End of included file: packet-atn-cpdlc-ettarr.c ---*/ -#line 320 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" +#line 313 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" &ett_atn_cpdlc }; diff --git a/epan/dissectors/packet-atn-ulcs.c b/epan/dissectors/packet-atn-ulcs.c index 6260b1f931..5b2673db8b 100644 --- a/epan/dissectors/packet-atn-ulcs.c +++ b/epan/dissectors/packet-atn-ulcs.c @@ -402,13 +402,9 @@ dissect_atn_ulcs_T_pdv_list_presentation_data_values_arbitrary(tvbuff_t *tvb _U_ /* call appropiate dissector for bitstring data */ switch(ulcs_context_value){ case 1: /* ACSE PDU*/ - ti = proto_tree_add_text( - root_tree, - tvb, - offset, - 0, - ATN_ACSE_PROTO ); - atn_ulcs_tree = proto_item_add_subtree(ti, ett_atn_acse); + atn_ulcs_tree = proto_tree_add_subtree( + root_tree, tvb, offset, 0, + ett_atn_acse, NULL, ATN_ACSE_PROTO ); dissect_ACSE_apdu_PDU( tvb_new_subset_remaining(tvb_usr, 0), @@ -2018,16 +2014,9 @@ dissect_atn_ulcs( value_ses_pres = tvb_get_ntohs(tvb, offset); /* SPDU: dissect session layer */ - ti = proto_tree_add_text( - tree, - tvb, - offset, - 0, - ATN_SES_PROTO ); - - atn_ulcs_tree = proto_item_add_subtree( - ti, - ett_atn_ses); + atn_ulcs_tree = proto_tree_add_subtree( + tree, tvb, offset, 0, + ett_atn_ses, NULL, ATN_SES_PROTO ); /* get SPDU (1 octet) */ value_ses = tvb_get_guint8(tvb, offset); @@ -2077,14 +2066,9 @@ dissect_atn_ulcs( offset++; /* PPDU: dissect presentation layer */ - ti = proto_tree_add_text( - tree, - tvb, - offset, - 0, - ATN_PRES_PROTO ); - - atn_ulcs_tree = proto_item_add_subtree(ti, ett_atn_pres); + atn_ulcs_tree = proto_tree_add_subtree( + tree, tvb, offset, 0, + ett_atn_pres, NULL, ATN_PRES_PROTO ); value_pres = tvb_get_guint8(tvb, offset); @@ -2120,16 +2104,9 @@ dissect_atn_ulcs( offset++; /* ACSE PDU: dissect application layer */ - ti = proto_tree_add_text( - tree, - tvb, - offset, - 0, - ATN_ACSE_PROTO ); - - atn_ulcs_tree = proto_item_add_subtree( - ti, - ett_atn_acse); + atn_ulcs_tree = proto_tree_add_subtree( + tree, tvb, offset, 0, + ett_atn_acse, NULL, ATN_ACSE_PROTO ); dissect_ACSE_apdu_PDU( tvb_new_subset_remaining(tvb, offset), @@ -2506,7 +2483,7 @@ void proto_register_atn_ulcs (void) NULL, HFILL }}, /*--- End of included file: packet-atn-ulcs-hfarr.c ---*/ -#line 815 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" +#line 796 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" {&hf_atn_ses_type, { "SPDU Type", "atn-ulcs.ses.type", @@ -2586,7 +2563,7 @@ void proto_register_atn_ulcs (void) &ett_atn_ulcs_AttributeTypeAndValue, /*--- End of included file: packet-atn-ulcs-ettarr.c ---*/ -#line 865 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" +#line 846 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" &ett_atn_ses, &ett_atn_pres, &ett_atn_acse, diff --git a/epan/dissectors/packet-camel.c b/epan/dissectors/packet-camel.c index 5e82062d11..c9ffc07219 100644 --- a/epan/dissectors/packet-camel.c +++ b/epan/dissectors/packet-camel.c @@ -7949,7 +7949,7 @@ dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn static int dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item, *stat_item; + proto_item *item; proto_tree *tree = NULL, *stat_tree = NULL; struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; @@ -7974,8 +7974,7 @@ dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi if (gcamel_HandleSRT && gp_camelsrt_info->tcap_context ) { if (gcamel_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); - stat_tree = proto_item_add_subtree(stat_item, ett_camel_stat); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_camel_stat, NULL, "Stat"); } camelsrt_call_matching(tvb, pinfo, stat_tree, gp_camelsrt_info); tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); @@ -7987,7 +7986,7 @@ dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi static int dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item, *stat_item; + proto_item *item; proto_tree *tree = NULL, *stat_tree = NULL; struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; @@ -8012,8 +8011,7 @@ dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi if (gcamel_HandleSRT && gp_camelsrt_info->tcap_context ) { if (gcamel_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); - stat_tree = proto_item_add_subtree(stat_item, ett_camel_stat); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_camel_stat, NULL, "Stat"); } camelsrt_call_matching(tvb, pinfo, stat_tree, gp_camelsrt_info); tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); @@ -8025,7 +8023,7 @@ dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi static int dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data) { - proto_item *item, *stat_item; + proto_item *item; proto_tree *tree, *stat_tree = NULL; struct tcap_private_t * p_private_tcap = (struct tcap_private_t*)data; asn1_ctx_t asn1_ctx; @@ -8049,8 +8047,7 @@ dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* if (gcamel_HandleSRT && gp_camelsrt_info->tcap_context ) { if (gcamel_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); - stat_tree = proto_item_add_subtree(stat_item, ett_camel_stat); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_camel_stat, NULL, "Stat"); } camelsrt_call_matching(tvb, pinfo, stat_tree, gp_camelsrt_info); tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info); @@ -8105,7 +8102,7 @@ void proto_reg_handoff_camel(void) { /*--- End of included file: packet-camel-dis-tab.c ---*/ -#line 1224 "../../asn1/camel/packet-camel-template.c" +#line 1221 "../../asn1/camel/packet-camel-template.c" } else { range_foreach(ssn_range, range_delete_callback); g_free(ssn_range); @@ -10219,7 +10216,7 @@ void proto_register_camel(void) { "InvokeId_present", HFILL }}, /*--- End of included file: packet-camel-hfarr.c ---*/ -#line 1397 "../../asn1/camel/packet-camel-template.c" +#line 1394 "../../asn1/camel/packet-camel-template.c" }; /* List of subtrees */ @@ -10434,7 +10431,7 @@ void proto_register_camel(void) { &ett_camel_InvokeId, /*--- End of included file: packet-camel-ettarr.c ---*/ -#line 1413 "../../asn1/camel/packet-camel-template.c" +#line 1410 "../../asn1/camel/packet-camel-template.c" }; static ei_register_info ei[] = { diff --git a/epan/dissectors/packet-charging_ase.c b/epan/dissectors/packet-charging_ase.c index e78ea1d187..f3418a4e94 100644 --- a/epan/dissectors/packet-charging_ase.c +++ b/epan/dissectors/packet-charging_ase.c @@ -847,7 +847,7 @@ dissect_charging_ase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *it; proto_tree *tr; - it=proto_tree_add_protocol_format(tree, proto_charging_ase, tvb, 0, tvb_captured_length(tvb), "Charging ASE"); + it=proto_tree_add_protocol_format(tree, proto_charging_ase, tvb, 0, -1, "Charging ASE"); tr=proto_item_add_subtree(it, ett_charging_ase); if(tvb_reported_length(tvb)>0) diff --git a/epan/dissectors/packet-cmp.c b/epan/dissectors/packet-cmp.c index 5ef6751b1f..4f89bdc1d2 100644 --- a/epan/dissectors/packet-cmp.c +++ b/epan/dissectors/packet-cmp.c @@ -1515,8 +1515,7 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa proto_tree_add_item(tree, hf_cmp_tcptrans_type, tvb, offset++, 1, ENC_BIG_ENDIAN); } else { /* post RFC2510 TCP transport - the former "type" field is now "version" */ - ti = proto_tree_add_text(tree, tvb, offset, 7, "TCP transport"); - tcptrans_tree = proto_item_add_subtree(ti, ett_cmp); + tcptrans_tree = proto_tree_add_subtree(tree, tvb, offset, 7, ett_cmp, NULL, "TCP transport"); pdu_type=tvb_get_guint8(tvb, 6); proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; @@ -2337,7 +2336,7 @@ void proto_register_cmp(void) { NULL, HFILL }}, /*--- End of included file: packet-cmp-hfarr.c ---*/ -#line 326 "../../asn1/cmp/packet-cmp-template.c" +#line 325 "../../asn1/cmp/packet-cmp-template.c" }; /* List of subtrees */ @@ -2395,7 +2394,7 @@ void proto_register_cmp(void) { &ett_cmp_PollRepContent_item, /*--- End of included file: packet-cmp-ettarr.c ---*/ -#line 332 "../../asn1/cmp/packet-cmp-template.c" +#line 331 "../../asn1/cmp/packet-cmp-template.c" }; module_t *cmp_module; @@ -2489,7 +2488,7 @@ void proto_reg_handoff_cmp(void) { /*--- End of included file: packet-cmp-dis-tab.c ---*/ -#line 404 "../../asn1/cmp/packet-cmp-template.c" +#line 403 "../../asn1/cmp/packet-cmp-template.c" inited = TRUE; } diff --git a/epan/dissectors/packet-dop.c b/epan/dissectors/packet-dop.c index 2aa0fb5ed9..def700ece0 100644 --- a/epan/dissectors/packet-dop.c +++ b/epan/dissectors/packet-dop.c @@ -2029,13 +2029,12 @@ call_dop_oid_callback(const char *base_string, tvbuff_t *tvb, int offset, packet if (dissector_try_string(dop_dissector_table, binding_param, tvb, pinfo, tree, data)) { offset = tvb_reported_length (tvb); } else { - proto_item *item=NULL; - proto_tree *next_tree=NULL; + proto_item *item; + proto_tree *next_tree; + + next_tree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_dop_unknown, &item, + "Dissector for parameter %s OID:%s not implemented. Contact Wireshark developers if you want this supported", base_string, binding_type ? binding_type : "<empty>"); - item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), "Dissector for parameter %s OID:%s not implemented. Contact Wireshark developers if you want this supported", base_string, binding_type ? binding_type : "<empty>"); - if (item) { - next_tree = proto_item_add_subtree(item, ett_dop_unknown); - } offset = dissect_unknown_ber(pinfo, tvb, offset, next_tree); expert_add_info(pinfo, item, &ei_dop_unknown_binding_parameter); } @@ -2933,7 +2932,7 @@ void proto_register_dop(void) { NULL, HFILL }}, /*--- End of included file: packet-dop-hfarr.c ---*/ -#line 240 "../../asn1/dop/packet-dop-template.c" +#line 239 "../../asn1/dop/packet-dop-template.c" }; /* List of subtrees */ @@ -3012,7 +3011,7 @@ void proto_register_dop(void) { &ett_dop_GrantsAndDenials, /*--- End of included file: packet-dop-ettarr.c ---*/ -#line 247 "../../asn1/dop/packet-dop-template.c" +#line 246 "../../asn1/dop/packet-dop-template.c" }; static ei_register_info ei[] = { @@ -3075,7 +3074,7 @@ void proto_reg_handoff_dop(void) { /*--- End of included file: packet-dop-dis-tab.c ---*/ -#line 287 "../../asn1/dop/packet-dop-template.c" +#line 286 "../../asn1/dop/packet-dop-template.c" /* APPLICATION CONTEXT */ oid_add_from_string("id-ac-directory-operational-binding-management","2.5.3.3"); diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c index 21502e1fc4..e1d2d7009b 100644 --- a/epan/dissectors/packet-gsm_map.c +++ b/epan/dissectors/packet-gsm_map.c @@ -21670,67 +21670,51 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, /* Private extension container for PLMN Data */ static void dissect_gsm_mapext_PlmnContainer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "MAP Ext. Plmn Container"); - tree = proto_item_add_subtree(item, ett_gsm_old_PlmnContainer_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_gsm_old_PlmnContainer_U, NULL, "MAP Ext. Plmn Container"); + dissect_gsm_old_PlmnContainer(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_SriResExtension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_SriResExtension_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_SriResExtension_U, NULL, "Nokia Extension"); dissect_NokiaMAP_Extensions_SriResExtension(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_CanLocArgExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_CanLocArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_CanLocArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_CanLocArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_ATMargExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_ATMargExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_ATMargExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_ATMargExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_DTMargExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_DTMargExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_DTMargExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_DTMargExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } @@ -21742,15 +21726,12 @@ static void dissect_NokiaMAP_ext_NumberPorted(tvbuff_t *tvb, packet_info *pinfo, } static void dissect_NokiaMAP_ext_ATMresExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_ATMresExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_ATMresExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_ATMresExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } @@ -21762,106 +21743,82 @@ static void dissect_NokiaMAP_ext_AbsentSubscriberExt(tvbuff_t *tvb, packet_info } static void dissect_NokiaMAP_ext_SriForSMArgExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_SriForSMArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_SriForSMArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_SriForSMArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_ReportSMDelStatArgExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_ReportSMDelStatArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_ReportSMDelStatArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_ReportSMDelStatArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_UdlArgExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_UdlArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_UdlArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_UdlArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_RoamNotAllowedExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_RoamNotAllowedExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_RoamNotAllowedExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_RoamNotAllowedExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_MO_ForwardSM_ArgExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_MO_ForwardSM_ArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_MO_ForwardSM_ArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_MO_ForwardSM_ArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_ErrOlcmInfoTableExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_ErrOlcmInfoTableExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_ErrOlcmInfoTableExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_ErrOlcmInfoTableExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_RoutingCategoryExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_RoutingCategoryExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_RoutingCategoryExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_RoutingCategoryExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_AnyTimeModArgExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_AnyTimeModArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_AnyTimeModArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_AnyTimeModArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } @@ -21893,94 +21850,73 @@ static void dissect_NokiaMAP_ext_AllowedServiceData(tvbuff_t *tvb, packet_info * } static void dissect_NokiaMAP_ext_SriExtension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_SriExtension_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_SriExtension_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_SriExtension(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ExtraSignalInfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_ExtraSignalInfo_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_ExtraSignalInfo_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_ExtraSignalInfo(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_SS_DataExtension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_SS_DataExtension_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_SS_DataExtension_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_SS_DataExtension(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_HOExtension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_HO_Ext_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_HO_Ext_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_HO_Ext(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_UlResExtension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_UlResExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_UlResExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_UlResExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_IsdArgExtension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_IsdArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_IsdArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_IsdArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } static void dissect_NokiaMAP_ext_DsdArgExt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); /* create display subtree for the protocol */ - if(parent_tree){ - item = proto_tree_add_text(parent_tree, tvb, 0, -1, "Nokia Extension"); - tree = proto_item_add_subtree(item, ett_NokiaMAP_Extensions_DsdArgExt_U); - } + tree = proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_NokiaMAP_Extensions_DsdArgExt_U, NULL, "Nokia Extension"); + dissect_NokiaMAP_Extensions_DsdArgExt(FALSE, tvb, 0, &asn1_ctx, tree, -1); } @@ -29543,7 +29479,7 @@ void proto_register_gsm_map(void) { NULL, HFILL }}, /*--- End of included file: packet-gsm_map-hfarr.c ---*/ -#line 2957 "../../asn1/gsm_map/packet-gsm_map-template.c" +#line 2893 "../../asn1/gsm_map/packet-gsm_map-template.c" }; /* List of subtrees */ @@ -30251,7 +30187,7 @@ void proto_register_gsm_map(void) { &ett_NokiaMAP_Extensions_AllowedServiceData, /*--- End of included file: packet-gsm_map-ettarr.c ---*/ -#line 2988 "../../asn1/gsm_map/packet-gsm_map-template.c" +#line 2924 "../../asn1/gsm_map/packet-gsm_map-template.c" }; static ei_register_info ei[] = { @@ -30353,7 +30289,7 @@ void proto_register_gsm_map(void) { /*--- End of included file: packet-gsm_map-dis-tab.c ---*/ -#line 3024 "../../asn1/gsm_map/packet-gsm_map-template.c" +#line 2960 "../../asn1/gsm_map/packet-gsm_map-template.c" oid_add_from_string("ericsson-gsm-Map-Ext","1.2.826.0.1249.58.1.0" ); oid_add_from_string("accessTypeNotAllowed-id","1.3.12.2.1107.3.66.1.2"); /*oid_add_from_string("map-ac networkLocUp(1) version3(3)","0.4.0.0.1.0.1.3" ); diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c index ac973118e1..12076b34e2 100644 --- a/epan/dissectors/packet-h225.c +++ b/epan/dissectors/packet-h225.c @@ -7539,7 +7539,7 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree * col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); col_clear(pinfo->cinfo, COL_INFO); - it=proto_tree_add_protocol_format(tree, proto_h225, tvb, 0, tvb_captured_length(tvb), PSNAME" CS"); + it=proto_tree_add_protocol_format(tree, proto_h225, tvb, 0, -1, PSNAME" CS"); tr=proto_item_add_subtree(it, ett_h225); offset = dissect_H323_UserInformation_PDU(tvb, pinfo, tr, NULL); @@ -7574,7 +7574,7 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); - it=proto_tree_add_protocol_format(tree, proto_h225, tvb, offset, tvb_captured_length(tvb), PSNAME" RAS"); + it=proto_tree_add_protocol_format(tree, proto_h225, tvb, offset, -1, PSNAME" RAS"); tr=proto_item_add_subtree(it, ett_h225); offset = dissect_RasMessage_PDU(tvb, pinfo, tr, NULL); diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c index 4e5d2035d7..b8c0bc9bcd 100644 --- a/epan/dissectors/packet-h245.c +++ b/epan/dissectors/packet-h245.c @@ -7231,7 +7231,7 @@ static const per_choice_t DataType_choice[] = { static int dissect_h245_DataType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1008 "../../asn1/h245/h245.cnf" +#line 1007 "../../asn1/h245/h245.cnf" gint choice_index; offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, @@ -14239,8 +14239,7 @@ dissect_h245_T_returnedFunction(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a if (next_tvb && tvb_length(next_tvb)) { saved_h245_pi = h245_pi; h245_pi = NULL; - item = proto_tree_add_text(tree, next_tvb, 0, -1,"The returned function"); - subtree = proto_item_add_subtree(item, ett_h245_returnedFunction); + subtree = proto_tree_add_subtree(tree, next_tvb, 0, -1, ett_h245_returnedFunction, &item, "The returned function"); PROTO_ITEM_SET_GENERATED(item); dissect_h245_MultimediaSystemControlMessage(next_tvb, 0, actx, subtree, hf_h245_pdu_type); h245_pi = saved_h245_pi; @@ -14517,7 +14516,7 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); - it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_captured_length(tvb), PSNAME); + it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, -1, PSNAME); tr=proto_item_add_subtree(it, ett_h245); /* assume that whilst there is more tvb data, there are more h245 commands */ diff --git a/epan/dissectors/packet-isdn-sup.c b/epan/dissectors/packet-isdn-sup.c index 402af9fd23..e4ebb171bc 100644 --- a/epan/dissectors/packet-isdn-sup.c +++ b/epan/dissectors/packet-isdn-sup.c @@ -1,7 +1,7 @@ /* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-isdn-sup.c */ -/* ../../tools/asn2wrs.py -b -k -p isdn-sup -c ./isdn-sup.cnf -s ./packet-isdn-sup-template -D . -O ../../epan/dissectors Addressing-Data-Elements.asn Basic-Service-Elements.asn Embedded-Q931-Types.asn General-Errors.asn Advice-of-Charge-Operations.asn Closed-User-Group-Service-Operations.asn Conference-Add-On-Operations.asn Diversion-Operations.asn MCID-Operations.asn User-To-User-Signalling-Operations.asn Freephone-Operations.asn */ +/* ../../tools/asn2wrs.py -b -p isdn-sup -c ./isdn-sup.cnf -s ./packet-isdn-sup-template -D . -O ../../epan/dissectors Addressing-Data-Elements.asn Basic-Service-Elements.asn Embedded-Q931-Types.asn General-Errors.asn Advice-of-Charge-Operations.asn Closed-User-Group-Service-Operations.asn Conference-Add-On-Operations.asn Diversion-Operations.asn MCID-Operations.asn User-To-User-Signalling-Operations.asn Freephone-Operations.asn */ /* Input file: packet-isdn-sup-template.c */ @@ -2641,7 +2641,7 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * if (!op_ptr) return offset; - ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA); + ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, -1, ENC_NA); isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup); proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode); @@ -2690,7 +2690,7 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * if (!op_ptr) return offset; - ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA); + ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, -1, ENC_NA); isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup); proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode); @@ -2740,7 +2740,7 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * if (!err_ptr) return offset; - ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA); + ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, -1, ENC_NA); isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup); proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_error, tvb, 0, 0, errcode); diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index 383d0362e3..03ac98c025 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -6,10 +6,10 @@ /* Input file: packet-ldap-template.c */ #line 1 "../../asn1/ldap/packet-ldap-template.c" -/* packet-ldap.c +/* packet-ldap-template.c * Routines for ldap packet dissection * - * See RFC 1777 (LDAP v2), RFC 4511 (LDAP v3), and RFC 2222 (SASL). + * See RFC 1777 (LDtAP v2), RFC 4511 (LDAP v3), and RFC 2222 (SASL). * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> @@ -1376,7 +1376,7 @@ dissect_ldap_SaslCredentials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_ldap_T_ntlmsspNegotiate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 704 "../../asn1/ldap/ldap.cnf" +#line 697 "../../asn1/ldap/ldap.cnf" /* make sure the protocol op comes first */ ldap_do_protocolop(actx->pinfo); @@ -1392,7 +1392,7 @@ dissect_ldap_T_ntlmsspNegotiate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_ldap_T_ntlmsspAuth(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 711 "../../asn1/ldap/ldap.cnf" +#line 704 "../../asn1/ldap/ldap.cnf" /* make sure the protocol op comes first */ ldap_do_protocolop(actx->pinfo); @@ -1557,7 +1557,7 @@ dissect_ldap_BindResponse_resultCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U static int dissect_ldap_T_bindResponse_matchedDN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 718 "../../asn1/ldap/ldap.cnf" +#line 711 "../../asn1/ldap/ldap.cnf" tvbuff_t *new_tvb=NULL; offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb); @@ -1856,11 +1856,9 @@ dissect_ldap_T_and(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, const char *old_and_filter_string=and_filter_string; and_filter_string=NULL; - if(tree){ - it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "and: "); - tr=proto_item_add_subtree(it, ett_ldap_T_and); - tree = tr; - } + + tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_T_and, &it, "and: "); + tree = tr; offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset, T_and_set_of, hf_index, ett_ldap_T_and); @@ -1883,7 +1881,7 @@ static int dissect_ldap_T_or_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 589 "../../asn1/ldap/ldap.cnf" +#line 587 "../../asn1/ldap/ldap.cnf" if(or_filter_string){ or_filter_string=wmem_strdup_printf(wmem_packet_scope(), "(|%s%s)",or_filter_string,Filter_string); } else { @@ -1902,17 +1900,15 @@ static const ber_sequence_t T_or_set_of[1] = { static int dissect_ldap_T_or(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 597 "../../asn1/ldap/ldap.cnf" - proto_tree *tr=NULL; - proto_item *it=NULL; +#line 595 "../../asn1/ldap/ldap.cnf" + proto_tree *tr; + proto_item *it; const char *old_or_filter_string=or_filter_string; or_filter_string=NULL; - if(tree){ - it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "or: "); - tr=proto_item_add_subtree(it, ett_ldap_T_or); - tree = tr; - } + tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_T_or, &it, "or: "); + tree = tr; + offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset, T_or_set_of, hf_index, ett_ldap_T_or); @@ -1933,7 +1929,7 @@ static int dissect_ldap_T_not(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_Filter(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 618 "../../asn1/ldap/ldap.cnf" +#line 614 "../../asn1/ldap/ldap.cnf" Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(!%s)",string_or_null(Filter_string)); @@ -2002,7 +1998,7 @@ dissect_ldap_T_substringFilter_substrings_item(gboolean implicit_tag _U_, tvbuff T_substringFilter_substrings_item_choice, hf_index, ett_ldap_T_substringFilter_substrings_item, NULL); -#line 644 "../../asn1/ldap/ldap.cnf" +#line 640 "../../asn1/ldap/ldap.cnf" if (substring_item_final) { substring_value=wmem_strdup_printf(wmem_packet_scope(), "%s%s", (substring_value?substring_value:"*"), @@ -2042,9 +2038,9 @@ static const ber_sequence_t SubstringFilter_sequence[] = { static int dissect_ldap_SubstringFilter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 658 "../../asn1/ldap/ldap.cnf" - proto_tree *tr=NULL; - proto_item *it=NULL; +#line 654 "../../asn1/ldap/ldap.cnf" + proto_tree *tr; + proto_item *it; const char *old_substring_value=substring_value; attr_type=NULL; @@ -2052,11 +2048,10 @@ dissect_ldap_SubstringFilter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o substring_item_init=NULL; substring_item_any=NULL; substring_item_final=NULL; - if(tree){ - it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "substring: "); - tr=proto_item_add_subtree(it, ett_ldap_SubstringFilter); - tree = tr; - } + + tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_SubstringFilter, &it, "substring: "); + tree = tr; + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, SubstringFilter_sequence, hf_index, ett_ldap_SubstringFilter); @@ -2109,7 +2104,7 @@ static int dissect_ldap_T_present(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_ldap_AttributeDescription(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 615 "../../asn1/ldap/ldap.cnf" +#line 611 "../../asn1/ldap/ldap.cnf" Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s=*)",string_or_null(Filter_string)); @@ -2144,7 +2139,7 @@ dissect_ldap_MatchingRuleId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_ldap_T_dnAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 621 "../../asn1/ldap/ldap.cnf" +#line 617 "../../asn1/ldap/ldap.cnf" gboolean val; offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &val); @@ -2179,7 +2174,7 @@ dissect_ldap_MatchingRuleAssertion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_ldap_T_extensibleMatch(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 630 "../../asn1/ldap/ldap.cnf" +#line 626 "../../asn1/ldap/ldap.cnf" attr_type=NULL; matching_rule_string=NULL; ldapvalue_string=NULL; @@ -2188,7 +2183,7 @@ dissect_ldap_T_extensibleMatch(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset = dissect_ldap_MatchingRuleAssertion(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 636 "../../asn1/ldap/ldap.cnf" +#line 632 "../../asn1/ldap/ldap.cnf" Filter_string=wmem_strdup_printf(wmem_packet_scope(), "(%s:%s%s%s=%s)", (attr_type?attr_type:""), (matching_rule_dnattr?"dn:":""), @@ -2231,9 +2226,9 @@ static const ber_choice_t Filter_choice[] = { static int dissect_ldap_Filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 680 "../../asn1/ldap/ldap.cnf" - proto_tree *tr=NULL; - proto_item *it=NULL; +#line 675 "../../asn1/ldap/ldap.cnf" + proto_tree *tr; + proto_item *it; attributedesc_string=NULL; if (Filter_length++ > MAX_FILTER_LEN) { @@ -2246,11 +2241,9 @@ dissect_ldap_Filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ THROW(ReportedBoundsError); } - if(tree){ - it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Filter: "); - tr=proto_item_add_subtree(it, ett_ldap_Filter); - tree = tr; - } + tr=proto_tree_add_subtree(tree, tvb, offset, -1, ett_ldap_Filter, &it, "Filter: "); + tree = tr; + offset = dissect_ber_choice(actx, tree, tvb, offset, Filter_choice, hf_index, ett_ldap_Filter, NULL); @@ -2560,7 +2553,7 @@ dissect_ldap_SEQUENCE_OF_LDAPURL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i static int dissect_ldap_SearchResultReference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 821 "../../asn1/ldap/ldap.cnf" +#line 813 "../../asn1/ldap/ldap.cnf" offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 19, TRUE, dissect_ldap_SEQUENCE_OF_LDAPURL); @@ -2837,7 +2830,7 @@ dissect_ldap_CompareResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_ldap_AbandonRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 828 "../../asn1/ldap/ldap.cnf" +#line 820 "../../asn1/ldap/ldap.cnf" offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 16, TRUE, dissect_ldap_MessageID); @@ -2908,7 +2901,7 @@ dissect_ldap_LDAPOID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U static int dissect_ldap_T_requestValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 753 "../../asn1/ldap/ldap.cnf" +#line 746 "../../asn1/ldap/ldap.cnf" if((object_identifier_id != NULL) && oid_has_dissector(object_identifier_id)) { offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL); @@ -3057,12 +3050,12 @@ dissect_ldap_ExtendedResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_ldap_T_intermediateResponse_responseValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 761 "../../asn1/ldap/ldap.cnf" +#line 754 "../../asn1/ldap/ldap.cnf" const gchar *name; -#line 765 "../../asn1/ldap/ldap.cnf" +#line 758 "../../asn1/ldap/ldap.cnf" if(ldm_tree && object_identifier_id) { proto_item_set_text(ldm_tree, "%s %s", "IntermediateResponse", object_identifier_id); name = oid_resolved_from_string(object_identifier_id); @@ -3244,7 +3237,7 @@ dissect_ldap_ControlType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_ldap_T_controlValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 734 "../../asn1/ldap/ldap.cnf" +#line 727 "../../asn1/ldap/ldap.cnf" gint8 ber_class; gboolean pc, ind; gint32 tag; @@ -3415,7 +3408,7 @@ dissect_ldap_SortResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_ldap_DirSyncFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 778 "../../asn1/ldap/ldap.cnf" +#line 771 "../../asn1/ldap/ldap.cnf" gint8 ber_class; gboolean pc; gint32 tag; @@ -3437,10 +3430,9 @@ dissect_ldap_DirSyncFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs hfinfo = proto_registrar_get_nth(hf_index); if (val >0) { - proto_tree *subtree = NULL; - proto_item *item = NULL; - item = proto_tree_add_text(tree, tvb, otheroffset+1, len, "%s: 0x%08x", hfinfo->name, val); - subtree = proto_item_add_subtree(item, ett_ldap_DirSyncFlagsSubEntry); + proto_tree *subtree; + subtree = proto_tree_add_subtree_format(tree, tvb, otheroffset+1, len, + ett_ldap_DirSyncFlagsSubEntry, NULL, "%s: 0x%08x", hfinfo->name, val); if (val & 0x1) { proto_tree_add_text(subtree, tvb, otheroffset+1, len, "Flag Object_Security"); @@ -4044,8 +4036,7 @@ static void */ if (doing_sasl_security && tvb_get_guint8(tvb, offset) == 0) { - proto_item *sasl_item = NULL; - proto_tree *sasl_tree = NULL; + proto_tree *sasl_tree; tvbuff_t *sasl_tvb; guint sasl_len, sasl_msg_len, length; /* @@ -4091,13 +4082,10 @@ static void if (length > sasl_msg_len) length = sasl_msg_len; sasl_tvb = tvb_new_subset(tvb, offset, length, sasl_msg_len); - if (ldap_tree) { - proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, sasl_tvb, 0, 4, + proto_tree_add_uint(ldap_tree, hf_ldap_sasl_buffer_length, sasl_tvb, 0, 4, sasl_len); - sasl_item = proto_tree_add_text(ldap_tree, sasl_tvb, 0, sasl_msg_len, "SASL Buffer"); - sasl_tree = proto_item_add_subtree(sasl_item, ett_ldap_sasl_blob); - } + sasl_tree = proto_tree_add_subtree(ldap_tree, sasl_tvb, 0, sasl_msg_len, ett_ldap_sasl_blob, NULL, "SASL Buffer"); if (ldap_info->auth_mech != NULL && ((strcmp(ldap_info->auth_mech, "GSS-SPNEGO") == 0) || @@ -4156,8 +4144,7 @@ static void } if (decr_tvb) { - proto_item *enc_item = NULL; - proto_tree *enc_tree = NULL; + proto_tree *enc_tree; /* * The LDAP message was encrypted in the packet, and has @@ -4166,16 +4153,14 @@ static void col_set_str(pinfo->cinfo, COL_INFO, "SASL GSS-API Privacy (decrypted): "); if (sasl_tree) { - enc_item = proto_tree_add_text(sasl_tree, gssapi_tvb, ver_len, -1, - "GSS-API Encrypted payload (%d byte%s)", + enc_tree = proto_tree_add_subtree_format(sasl_tree, gssapi_tvb, ver_len, -1, + ett_ldap_payload, NULL, "GSS-API Encrypted payload (%d byte%s)", sasl_len - ver_len, plurality(sasl_len - ver_len, "", "s")); - enc_tree = proto_item_add_subtree(enc_item, ett_ldap_payload); } dissect_ldap_payload(decr_tvb, pinfo, enc_tree, ldap_info, is_mscldap); } else if (plain_tvb) { - proto_item *plain_item = NULL; - proto_tree *plain_tree = NULL; + proto_tree *plain_tree; /* * The LDAP message wasn't encrypted in the packet; @@ -4184,11 +4169,10 @@ static void col_set_str(pinfo->cinfo, COL_INFO, "SASL GSS-API Integrity: "); if (sasl_tree) { - plain_item = proto_tree_add_text(sasl_tree, gssapi_tvb, ver_len, -1, - "GSS-API payload (%d byte%s)", + plain_tree = proto_tree_add_subtree_format(sasl_tree, gssapi_tvb, ver_len, -1, + ett_ldap_payload, NULL, "GSS-API payload (%d byte%s)", sasl_len - ver_len, plurality(sasl_len - ver_len, "", "s")); - plain_tree = proto_item_add_subtree(plain_item, ett_ldap_payload); } dissect_ldap_payload(plain_tvb, pinfo, plain_tree, ldap_info, is_mscldap); @@ -4298,7 +4282,7 @@ static int dissect_mscldap_netlogon_flags(proto_tree *parent_tree, tvbuff_t *tvb { guint32 flags; proto_item *item; - proto_tree *tree=NULL; + proto_tree *tree; guint *field; header_field_info *hfi; gboolean one_bit_set = FALSE; @@ -4322,9 +4306,7 @@ static int dissect_mscldap_netlogon_flags(proto_tree *parent_tree, tvbuff_t *tvb flags=tvb_get_letohl(tvb, offset); item=proto_tree_add_item(parent_tree, hf_mscldap_netlogon_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); - if(parent_tree){ - tree = proto_item_add_subtree(item, ett_mscldap_netlogon_flags); - } + tree = proto_item_add_subtree(item, ett_mscldap_netlogon_flags); proto_item_append_text(item, " ("); @@ -5740,7 +5722,7 @@ void proto_register_ldap(void) { NULL, HFILL }}, /*--- End of included file: packet-ldap-hfarr.c ---*/ -#line 2251 "../../asn1/ldap/packet-ldap-template.c" +#line 2241 "../../asn1/ldap/packet-ldap-template.c" }; /* List of subtrees */ @@ -5814,7 +5796,7 @@ void proto_register_ldap(void) { &ett_ldap_T_warning, /*--- End of included file: packet-ldap-ettarr.c ---*/ -#line 2265 "../../asn1/ldap/packet-ldap-template.c" +#line 2255 "../../asn1/ldap/packet-ldap-template.c" }; /* UAT for header fields */ static uat_field_t custom_attribute_types_uat_fields[] = { @@ -5980,7 +5962,7 @@ proto_reg_handoff_ldap(void) /*--- End of included file: packet-ldap-dis-tab.c ---*/ -#line 2414 "../../asn1/ldap/packet-ldap-template.c" +#line 2404 "../../asn1/ldap/packet-ldap-template.c" } diff --git a/epan/dissectors/packet-lte-rrc.c b/epan/dissectors/packet-lte-rrc.c index 364121f7f4..641703d977 100644 --- a/epan/dissectors/packet-lte-rrc.c +++ b/epan/dissectors/packet-lte-rrc.c @@ -28081,8 +28081,8 @@ if(ue_cap_tvb){ case RAT_Type_geran_cs: /* geran-cs */ /* Mobile Station Classmark 2 is formatted as TLV with the two first bytes set to 0x33 0x03 */ - item = proto_tree_add_text(subtree, ue_cap_tvb, 0, 5, "Mobile Station Classmark 2"); - subtree2 = proto_item_add_subtree(item, ett_lte_rrc_UE_CapabilityRAT_Container); + subtree2 = proto_tree_add_subtree(subtree, ue_cap_tvb, 0, 5, + ett_lte_rrc_UE_CapabilityRAT_Container, &item, "Mobile Station Classmark 2"); byte = tvb_get_guint8(ue_cap_tvb, 0); if (byte != 0x33) { expert_add_info_format(actx->pinfo, item, &ei_lte_rrc_unexpected_type_value, @@ -28096,16 +28096,16 @@ if(ue_cap_tvb){ de_ms_cm_2(ue_cap_tvb, subtree2, actx->pinfo, 2, 3, NULL, 0); /* Mobile Station Classmark 3 is formatted as V */ length = tvb_reported_length_remaining(ue_cap_tvb, 5); - item = proto_tree_add_text(subtree, ue_cap_tvb, 5, length, "Mobile Station Classmark 3"); - subtree2 = proto_item_add_subtree(item, ett_lte_rrc_UE_CapabilityRAT_Container); + subtree2 = proto_tree_add_subtree(subtree, ue_cap_tvb, 5, length, + ett_lte_rrc_UE_CapabilityRAT_Container, NULL, "Mobile Station Classmark 3"); de_ms_cm_3(ue_cap_tvb, subtree2, actx->pinfo, 5, length, NULL, 0); break; case RAT_Type_geran_ps: /* geran-ps */ /* MS Radio Access Capability is formatted as V */ length = tvb_reported_length(ue_cap_tvb); - item = proto_tree_add_text(subtree, ue_cap_tvb, 0, length, "MS Radio Access Capability"); - subtree2 = proto_item_add_subtree(item, ett_lte_rrc_UE_CapabilityRAT_Container); + subtree2 = proto_tree_add_subtree(subtree, ue_cap_tvb, 0, length, + ett_lte_rrc_UE_CapabilityRAT_Container, NULL, "MS Radio Access Capability"); de_gmm_ms_radio_acc_cap(ue_cap_tvb, subtree2, actx->pinfo, 0, length, NULL, 0); break; case RAT_Type_cdma2000_1XRTT: diff --git a/epan/dissectors/packet-p1.c b/epan/dissectors/packet-p1.c index d19eb99aa7..f7fe6d70b7 100644 --- a/epan/dissectors/packet-p1.c +++ b/epan/dissectors/packet-p1.c @@ -969,7 +969,7 @@ dissect_p1_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, as static int dissect_p1_MTAName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 696 "../../asn1/p1/p1.cnf" +#line 693 "../../asn1/p1/p1.cnf" tvbuff_t *mtaname = NULL; p1_address_ctx_t* ctx = (p1_address_ctx_t*)actx->subtree.tree_ctx; @@ -1047,7 +1047,7 @@ dissect_p1_TokenTypeIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_p1_TokenTypeData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1154 "../../asn1/p1/p1.cnf" +#line 1151 "../../asn1/p1/p1.cnf" if(actx->external.direct_reference) call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, actx->private_data); @@ -1158,7 +1158,7 @@ static const ber_choice_t Credentials_choice[] = { int dissect_p1_Credentials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1162 "../../asn1/p1/p1.cnf" +#line 1159 "../../asn1/p1/p1.cnf" gint credentials = -1; offset = dissect_ber_choice(actx, tree, tvb, offset, @@ -1237,7 +1237,7 @@ dissect_p1_SecurityCategoryIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _ static int dissect_p1_SecurityCategoryValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 562 "../../asn1/p1/p1.cnf" +#line 561 "../../asn1/p1/p1.cnf" const char *name; if (actx->external.direct_reference) { @@ -1417,7 +1417,7 @@ static const value_string p1_MTABindError_vals[] = { static int dissect_p1_MTABindError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1145 "../../asn1/p1/p1.cnf" +#line 1142 "../../asn1/p1/p1.cnf" int error = -1; offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset, 0U, ub_integer_options, hf_index, &error); @@ -1434,7 +1434,7 @@ dissect_p1_MTABindError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_p1_T_x121_dcc_code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 842 "../../asn1/p1/p1.cnf" +#line 839 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -1453,7 +1453,7 @@ dissect_p1_T_x121_dcc_code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_p1_T_iso_3166_alpha2_code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 800 "../../asn1/p1/p1.cnf" +#line 797 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1494,7 +1494,7 @@ dissect_p1_CountryName_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_p1_CountryName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 596 "../../asn1/p1/p1.cnf" +#line 594 "../../asn1/p1/p1.cnf" do_address("/C=", NULL, actx); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, @@ -1510,7 +1510,7 @@ dissect_p1_CountryName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_p1_T_numeric(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 849 "../../asn1/p1/p1.cnf" +#line 846 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -1529,7 +1529,7 @@ dissect_p1_T_numeric(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U static int dissect_p1_T_printable(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 807 "../../asn1/p1/p1.cnf" +#line 804 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1570,7 +1570,7 @@ dissect_p1_AdministrationDomainName_U(gboolean implicit_tag _U_, tvbuff_t *tvb _ static int dissect_p1_AdministrationDomainName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 601 "../../asn1/p1/p1.cnf" +#line 599 "../../asn1/p1/p1.cnf" do_address("/A=", NULL, actx); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, @@ -1586,7 +1586,7 @@ dissect_p1_AdministrationDomainName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_ static int dissect_p1_T_numeric_private_domain_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 863 "../../asn1/p1/p1.cnf" +#line 860 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -1605,7 +1605,7 @@ dissect_p1_T_numeric_private_domain_identifier(gboolean implicit_tag _U_, tvbuff static int dissect_p1_T_printable_private_domain_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 821 "../../asn1/p1/p1.cnf" +#line 818 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1635,7 +1635,7 @@ static const ber_choice_t PrivateDomainIdentifier_choice[] = { static int dissect_p1_PrivateDomainIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 736 "../../asn1/p1/p1.cnf" +#line 733 "../../asn1/p1/p1.cnf" do_address("/P=", NULL, actx); @@ -1669,7 +1669,7 @@ dissect_p1_GlobalDomainIdentifier_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_ static int dissect_p1_GlobalDomainIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1024 "../../asn1/p1/p1.cnf" +#line 1021 "../../asn1/p1/p1.cnf" p1_address_ctx_t* ctx; if (actx->subtree.tree_ctx == NULL) { @@ -1703,7 +1703,7 @@ dissect_p1_GlobalDomainIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_p1_LocalIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1050 "../../asn1/p1/p1.cnf" +#line 1047 "../../asn1/p1/p1.cnf" tvbuff_t *id = NULL; p1_address_ctx_t* ctx = (p1_address_ctx_t*)actx->subtree.tree_ctx; @@ -1744,7 +1744,7 @@ dissect_p1_MTSIdentifier_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_p1_MTSIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1064 "../../asn1/p1/p1.cnf" +#line 1061 "../../asn1/p1/p1.cnf" set_do_address(actx, TRUE); @@ -1763,7 +1763,7 @@ dissect_p1_MTSIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_p1_MessageIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1019 "../../asn1/p1/p1.cnf" +#line 1016 "../../asn1/p1/p1.cnf" actx->subtree.tree = NULL; offset = dissect_p1_MTSIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index); @@ -1778,7 +1778,7 @@ dissect_p1_MessageIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_p1_X121Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 713 "../../asn1/p1/p1.cnf" +#line 710 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -1806,7 +1806,7 @@ dissect_p1_NetworkAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static int dissect_p1_TerminalIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 723 "../../asn1/p1/p1.cnf" +#line 720 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1825,7 +1825,7 @@ dissect_p1_TerminalIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_p1_T_numeric_private_domain_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 856 "../../asn1/p1/p1.cnf" +#line 853 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -1844,7 +1844,7 @@ dissect_p1_T_numeric_private_domain_name(gboolean implicit_tag _U_, tvbuff_t *tv static int dissect_p1_T_printable_private_domain_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 814 "../../asn1/p1/p1.cnf" +#line 811 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1874,7 +1874,7 @@ static const ber_choice_t PrivateDomainName_choice[] = { static int dissect_p1_PrivateDomainName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 730 "../../asn1/p1/p1.cnf" +#line 727 "../../asn1/p1/p1.cnf" do_address("/P=", NULL, actx); @@ -1892,7 +1892,7 @@ dissect_p1_PrivateDomainName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_p1_OrganizationName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 745 "../../asn1/p1/p1.cnf" +#line 742 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1922,7 +1922,7 @@ dissect_p1_NumericUserIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i static int dissect_p1_T_printable_surname(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 904 "../../asn1/p1/p1.cnf" +#line 901 "../../asn1/p1/p1.cnf" tvbuff_t *pstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1941,7 +1941,7 @@ dissect_p1_T_printable_surname(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_p1_T_printable_given_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 911 "../../asn1/p1/p1.cnf" +#line 908 "../../asn1/p1/p1.cnf" tvbuff_t *pstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1960,7 +1960,7 @@ dissect_p1_T_printable_given_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_p1_T_printable_initials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 918 "../../asn1/p1/p1.cnf" +#line 915 "../../asn1/p1/p1.cnf" tvbuff_t *pstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -1979,7 +1979,7 @@ dissect_p1_T_printable_initials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_p1_T_printable_generation_qualifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 925 "../../asn1/p1/p1.cnf" +#line 922 "../../asn1/p1/p1.cnf" tvbuff_t *pstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -2015,7 +2015,7 @@ dissect_p1_PersonalName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_p1_OrganizationalUnitName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 765 "../../asn1/p1/p1.cnf" +#line 762 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; do_address("/OU=", string, actx); @@ -2054,7 +2054,7 @@ static const ber_sequence_t BuiltInStandardAttributes_sequence[] = { static int dissect_p1_BuiltInStandardAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1081 "../../asn1/p1/p1.cnf" +#line 1078 "../../asn1/p1/p1.cnf" actx->subtree.tree = tree; offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, @@ -2070,7 +2070,7 @@ dissect_p1_BuiltInStandardAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U static int dissect_p1_T_printable_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 960 "../../asn1/p1/p1.cnf" +#line 957 "../../asn1/p1/p1.cnf" tvbuff_t *pstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -2089,7 +2089,7 @@ dissect_p1_T_printable_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_p1_T_printable_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 967 "../../asn1/p1/p1.cnf" +#line 964 "../../asn1/p1/p1.cnf" tvbuff_t *pstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -2113,7 +2113,7 @@ static const ber_sequence_t BuiltInDomainDefinedAttribute_sequence[] = { static int dissect_p1_BuiltInDomainDefinedAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 974 "../../asn1/p1/p1.cnf" +#line 971 "../../asn1/p1/p1.cnf" actx->value_ptr = wmem_strbuf_new(wmem_packet_scope(), ""); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, @@ -2196,18 +2196,17 @@ dissect_p1_ExtensionAttributeType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_p1_T_extension_attribute_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 576 "../../asn1/p1/p1.cnf" +#line 575 "../../asn1/p1/p1.cnf" proto_item_append_text(tree, " (%s)", val_to_str(actx->external.indirect_reference, p1_ExtensionAttributeType_vals, "extension-attribute-type %d")); if (dissector_try_uint(p1_extension_attribute_dissector_table, actx->external.indirect_reference, tvb, actx->pinfo, tree)) { offset =tvb_length(tvb); } else { - proto_item *item = NULL; - proto_tree *next_tree = NULL; + proto_item *item; + proto_tree *next_tree; - item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), + next_tree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_p1_unknown_extension_attribute_type, &item, "Dissector for extension-attribute-type %d not implemented. Contact Wireshark developers if you want this supported", actx->external.indirect_reference); - next_tree = proto_item_add_subtree(item, ett_p1_unknown_extension_attribute_type); offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree); expert_add_info(actx->pinfo, item, &ei_p1_unknown_extension_attribute_type); } @@ -2267,7 +2266,7 @@ dissect_p1_ORName_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ int dissect_p1_ORName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1000 "../../asn1/p1/p1.cnf" +#line 997 "../../asn1/p1/p1.cnf" p1_address_ctx_t* ctx; if (actx->subtree.tree_ctx == NULL) { @@ -2483,7 +2482,7 @@ static const value_string p1_BuiltInContentType_U_vals[] = { static int dissect_p1_BuiltInContentType_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 643 "../../asn1/p1/p1.cnf" +#line 641 "../../asn1/p1/p1.cnf" static guint32 ict = -1; p1_address_ctx_t* ctx; @@ -2528,7 +2527,7 @@ dissect_p1_BuiltInContentType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int int dissect_p1_ExtendedContentType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 622 "../../asn1/p1/p1.cnf" +#line 620 "../../asn1/p1/p1.cnf" const char *name = NULL; p1_address_ctx_t* ctx; @@ -2659,7 +2658,7 @@ dissect_p1_PerMessageIndicators(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_p1_Time(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1123 "../../asn1/p1/p1.cnf" +#line 1120 "../../asn1/p1/p1.cnf" tvbuff_t *arrival = NULL; p1_address_ctx_t* ctx = (p1_address_ctx_t*)actx->subtree.tree_ctx; @@ -2724,7 +2723,7 @@ dissect_p1_T_bilateral_domain(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_p1_T_bilateral_information(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1190 "../../asn1/p1/p1.cnf" +#line 1186 "../../asn1/p1/p1.cnf" proto_item *item = NULL; int loffset = 0; guint32 len = 0; @@ -2792,7 +2791,7 @@ static const value_string p1_RoutingAction_vals[] = { static int dissect_p1_RoutingAction(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1135 "../../asn1/p1/p1.cnf" +#line 1132 "../../asn1/p1/p1.cnf" int action = 0; offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, @@ -2853,7 +2852,7 @@ static const ber_sequence_t DomainSuppliedInformation_set[] = { static int dissect_p1_DomainSuppliedInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1102 "../../asn1/p1/p1.cnf" +#line 1099 "../../asn1/p1/p1.cnf" set_do_address(actx, FALSE); @@ -2878,7 +2877,7 @@ static const ber_sequence_t TraceInformationElement_sequence[] = { static int dissect_p1_TraceInformationElement(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1086 "../../asn1/p1/p1.cnf" +#line 1083 "../../asn1/p1/p1.cnf" set_do_address(actx, TRUE); @@ -2969,7 +2968,7 @@ static const value_string p1_StandardExtension_vals[] = { static int dissect_p1_StandardExtension(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 608 "../../asn1/p1/p1.cnf" +#line 606 "../../asn1/p1/p1.cnf" actx->external.indirect_ref_present = TRUE; actx->external.direct_ref_present = FALSE; offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, @@ -2985,7 +2984,7 @@ dissect_p1_StandardExtension(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_p1_T_private_extension(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 613 "../../asn1/p1/p1.cnf" +#line 611 "../../asn1/p1/p1.cnf" actx->external.indirect_ref_present = FALSE; actx->external.direct_reference = NULL; offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &actx->external.direct_reference); @@ -3048,12 +3047,11 @@ dissect_p1_ExtensionValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs if (dissector_try_uint(p1_extension_dissector_table, actx->external.indirect_reference, tvb, actx->pinfo, tree)) { offset = tvb_length(tvb); } else { - proto_item *item = NULL; - proto_tree *next_tree = NULL; + proto_item *item; + proto_tree *next_tree; - item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), + next_tree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_p1_unknown_standard_extension, &item, "Dissector for standard-extension %d not implemented. Contact Wireshark developers if you want this supported", actx->external.indirect_reference); - next_tree = proto_item_add_subtree(item, ett_p1_unknown_standard_extension); offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree); expert_add_info(actx->pinfo, item, &ei_p1_unknown_standard_extension); } @@ -3223,7 +3221,7 @@ dissect_p1_MessageTransferEnvelope(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int dissect_p1_Content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 667 "../../asn1/p1/p1.cnf" +#line 665 "../../asn1/p1/p1.cnf" tvbuff_t *next_tvb; p1_address_ctx_t* ctx = (p1_address_ctx_t*)actx->subtree.tree_ctx; @@ -3234,16 +3232,15 @@ dissect_p1_Content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, if (next_tvb) { if (ctx && ctx->content_type_id) { (void) call_ber_oid_callback(ctx->content_type_id, next_tvb, 0, actx->pinfo, actx->subtree.top_tree ? actx->subtree.top_tree : tree, actx->private_data); - } else if (ctx && ctx->report_unknown_content_type) { - proto_item *item = NULL; - proto_tree *next_tree = NULL; + } else if (ctx && ctx->report_unknown_content_type) { + proto_item *item; + proto_tree *next_tree; - proto_tree_add_expert(actx->subtree.top_tree ? actx->subtree.top_tree : tree, actx->pinfo, &ei_p1_unknown_built_in_content_type, + item = proto_tree_add_expert(actx->subtree.top_tree ? actx->subtree.top_tree : tree, actx->pinfo, &ei_p1_unknown_built_in_content_type, next_tvb, 0, tvb_length_remaining(tvb, offset)); - if (item) { next_tree=proto_item_add_subtree(item, ett_p1_content_unknown); - } - dissect_unknown_ber(actx->pinfo, next_tvb, 0, next_tree); + + dissect_unknown_ber(actx->pinfo, next_tvb, 0, next_tree); } else { proto_item_append_text (actx->created_item, " (unknown content-type)"); } @@ -3638,7 +3635,7 @@ static const ber_choice_t ReportType_choice[] = { static int dissect_p1_ReportType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1222 "../../asn1/p1/p1.cnf" +#line 1218 "../../asn1/p1/p1.cnf" gint report = -1; offset = dissect_ber_choice(actx, tree, tvb, offset, @@ -3778,7 +3775,7 @@ static const ber_choice_t MTS_APDU_choice[] = { static int dissect_p1_MTS_APDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1208 "../../asn1/p1/p1.cnf" +#line 1204 "../../asn1/p1/p1.cnf" gint apdu = -1; offset = dissect_ber_choice(actx, tree, tvb, offset, @@ -3835,7 +3832,7 @@ static const ber_sequence_t MTASuppliedInformation_set[] = { static int dissect_p1_MTASuppliedInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1111 "../../asn1/p1/p1.cnf" +#line 1108 "../../asn1/p1/p1.cnf" set_do_address(actx, FALSE); @@ -3861,7 +3858,7 @@ static const ber_sequence_t InternalTraceInformationElement_sequence[] = { static int dissect_p1_InternalTraceInformationElement(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1094 "../../asn1/p1/p1.cnf" +#line 1091 "../../asn1/p1/p1.cnf" set_do_address(actx, TRUE); @@ -3995,7 +3992,7 @@ static const ber_sequence_t MTSBindResult_set[] = { static int dissect_p1_MTSBindResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1246 "../../asn1/p1/p1.cnf" +#line 1242 "../../asn1/p1/p1.cnf" /* TODO: there may be other entry points where this global should be initialized... */ actx->subtree.tree = NULL; @@ -4128,7 +4125,7 @@ static const ber_sequence_t MessageSubmissionArgument_sequence[] = { static int dissect_p1_MessageSubmissionArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1231 "../../asn1/p1/p1.cnf" +#line 1227 "../../asn1/p1/p1.cnf" p1_initialize_content_globals(actx, tree, TRUE); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, MessageSubmissionArgument_sequence, hf_index, ett_p1_MessageSubmissionArgument); @@ -4702,7 +4699,7 @@ static const ber_sequence_t MessageDeliveryArgument_sequence[] = { static int dissect_p1_MessageDeliveryArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1236 "../../asn1/p1/p1.cnf" +#line 1232 "../../asn1/p1/p1.cnf" p1_initialize_content_globals(actx, tree, TRUE); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, MessageDeliveryArgument_sequence, hf_index, ett_p1_MessageDeliveryArgument); @@ -4812,7 +4809,7 @@ static const ber_sequence_t ReportDeliveryArgument_set[] = { static int dissect_p1_ReportDeliveryArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1241 "../../asn1/p1/p1.cnf" +#line 1237 "../../asn1/p1/p1.cnf" p1_initialize_content_globals(actx, tree, TRUE); offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset, ReportDeliveryArgument_set, hf_index, ett_p1_ReportDeliveryArgument); @@ -4950,7 +4947,7 @@ dissect_p1_RefusedArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_p1_T_refused_extension(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 593 "../../asn1/p1/p1.cnf" +#line 591 "../../asn1/p1/p1.cnf" /*XXX not implemented yet */ @@ -5025,7 +5022,7 @@ dissect_p1_UserName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ static int dissect_p1_T_x121_address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 835 "../../asn1/p1/p1.cnf" +#line 832 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -5730,7 +5727,7 @@ static const ber_sequence_t ORAddress_sequence[] = { int dissect_p1_ORAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 979 "../../asn1/p1/p1.cnf" +#line 976 "../../asn1/p1/p1.cnf" p1_address_ctx_t* ctx; if (actx->subtree.tree_ctx == NULL) { @@ -6226,7 +6223,7 @@ dissect_p1_CertificateSelectors(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_p1_CommonName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 783 "../../asn1/p1/p1.cnf" +#line 780 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -6245,7 +6242,7 @@ dissect_p1_CommonName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ static int dissect_p1_TeletexCommonName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 793 "../../asn1/p1/p1.cnf" +#line 790 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -6343,7 +6340,7 @@ dissect_p1_UniversalCommonName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_p1_TeletexOrganizationName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 755 "../../asn1/p1/p1.cnf" +#line 752 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -6371,7 +6368,7 @@ dissect_p1_UniversalOrganizationName(gboolean implicit_tag _U_, tvbuff_t *tvb _U static int dissect_p1_T_teletex_surname(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 932 "../../asn1/p1/p1.cnf" +#line 929 "../../asn1/p1/p1.cnf" tvbuff_t *tstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -6390,7 +6387,7 @@ dissect_p1_T_teletex_surname(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_p1_T_teletex_given_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 939 "../../asn1/p1/p1.cnf" +#line 936 "../../asn1/p1/p1.cnf" tvbuff_t *tstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -6409,7 +6406,7 @@ dissect_p1_T_teletex_given_name(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_p1_T_teletex_initials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 946 "../../asn1/p1/p1.cnf" +#line 943 "../../asn1/p1/p1.cnf" tvbuff_t *tstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -6428,7 +6425,7 @@ dissect_p1_T_teletex_initials(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_p1_T_teletex_generation_qualifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 953 "../../asn1/p1/p1.cnf" +#line 950 "../../asn1/p1/p1.cnf" tvbuff_t *tstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -6481,7 +6478,7 @@ dissect_p1_UniversalPersonalName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i static int dissect_p1_TeletexOrganizationalUnitName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 773 "../../asn1/p1/p1.cnf" +#line 770 "../../asn1/p1/p1.cnf" tvbuff_t *string = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -6546,7 +6543,7 @@ dissect_p1_PDSName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, static int dissect_p1_T_x121_dcc_code_01(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 870 "../../asn1/p1/p1.cnf" +#line 867 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -6565,7 +6562,7 @@ dissect_p1_T_x121_dcc_code_01(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_p1_T_iso_3166_alpha2_code_01(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 828 "../../asn1/p1/p1.cnf" +#line 825 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, @@ -6606,7 +6603,7 @@ dissect_p1_PhysicalDeliveryCountryName(gboolean implicit_tag _U_, tvbuff_t *tvb static int dissect_p1_T_numeric_code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 877 "../../asn1/p1/p1.cnf" +#line 874 "../../asn1/p1/p1.cnf" tvbuff_t *nstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_NumericString, @@ -7030,7 +7027,7 @@ dissect_p1_TerminalType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_p1_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 885 "../../asn1/p1/p1.cnf" +#line 882 "../../asn1/p1/p1.cnf" tvbuff_t *tstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -7049,7 +7046,7 @@ dissect_p1_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, static int dissect_p1_T_teletex_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 892 "../../asn1/p1/p1.cnf" +#line 889 "../../asn1/p1/p1.cnf" tvbuff_t *tstring = NULL; offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_TeletexString, @@ -7073,7 +7070,7 @@ static const ber_sequence_t TeletexDomainDefinedAttribute_sequence[] = { static int dissect_p1_TeletexDomainDefinedAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 899 "../../asn1/p1/p1.cnf" +#line 896 "../../asn1/p1/p1.cnf" actx->value_ptr = wmem_strbuf_new(wmem_packet_scope(), ""); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, @@ -7136,7 +7133,7 @@ static const ber_sequence_t MTANameAndOptionalGDI_sequence[] = { static int dissect_p1_MTANameAndOptionalGDI(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1072 "../../asn1/p1/p1.cnf" +#line 1069 "../../asn1/p1/p1.cnf" set_do_address(actx, TRUE); @@ -7196,18 +7193,17 @@ dissect_p1_TokenDataType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_p1_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 1174 "../../asn1/p1/p1.cnf" +#line 1171 "../../asn1/p1/p1.cnf" proto_item_append_text(tree, " (%s)", val_to_str(actx->external.indirect_reference, p1_TokenDataType_vals, "tokendata-type %d")); if (dissector_try_uint(p1_tokendata_dissector_table, actx->external.indirect_reference, tvb, actx->pinfo, tree)) { offset = tvb_length(tvb); } else { - proto_item *item = NULL; - proto_tree *next_tree = NULL; + proto_item *item; + proto_tree *next_tree; - item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), + next_tree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_p1_unknown_tokendata_type, &item, "Dissector for tokendata-type %d not implemented. Contact Wireshark developers if you want this supported", actx->external.indirect_reference); - next_tree = proto_item_add_subtree(item, ett_p1_unknown_tokendata_type); offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree); expert_add_info(actx->pinfo, item, &ei_p1_unknown_tokendata_type); } diff --git a/epan/dissectors/packet-q932.c b/epan/dissectors/packet-q932.c index 5b04993d82..72a8a40fde 100644 --- a/epan/dissectors/packet-q932.c +++ b/epan/dissectors/packet-q932.c @@ -752,7 +752,7 @@ dissect_q932_ni_ie(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree static void dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gint offset; - proto_item *ti, *ti_ie; + proto_item *ti; proto_tree *ie_tree; guint8 ie_type, ie_len; @@ -764,9 +764,9 @@ dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { ie_type = tvb_get_guint8(tvb, offset); ie_len = tvb_get_guint8(tvb, offset + 1); - ti_ie = proto_tree_add_text(tree, tvb, offset, -1, "%s", + ie_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_q932_ie, NULL, val_to_str(ie_type, VALS(q932_str_ie_type), "unknown (0x%02X)")); - ie_tree = proto_item_add_subtree(ti_ie, ett_q932_ie); + proto_tree_add_item(ie_tree, hf_q932_ie_type, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_q932_ie_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN); offset += 2; @@ -781,7 +781,7 @@ dissect_q932_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { break; default: if (ie_len > 0) { - if (tree) proto_tree_add_item(ie_tree, hf_q932_ie_data, tvb, offset, ie_len, ENC_NA); + proto_tree_add_item(ie_tree, hf_q932_ie_data, tvb, offset, ie_len, ENC_NA); } } } diff --git a/epan/dissectors/packet-qsig.c b/epan/dissectors/packet-qsig.c index 5277320651..80b66f805c 100644 --- a/epan/dissectors/packet-qsig.c +++ b/epan/dissectors/packet-qsig.c @@ -2076,13 +2076,11 @@ dissect_qsig_T_extensionArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i next_tvb = tvb_new_subset_remaining(tvb, offset); if (!dissector_try_string(extension_dissector_table, extension_oid, next_tvb, actx->pinfo, tree, NULL)) { - proto_item *item=NULL; - proto_tree *next_tree=NULL; + proto_tree *next_tree; + + next_tree=proto_tree_add_subtree_format(tree, next_tvb, 0, -1, ett_qsig_unknown_extension, NULL, + "QSIG: Dissector for extension with OID:%s not implemented.", extension_oid); - item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "QSIG: Dissector for extension with OID:%s not implemented.", extension_oid); - if(item){ - next_tree=proto_item_add_subtree(item, ett_qsig_unknown_extension); - } dissect_unknown_ber(actx->pinfo, next_tvb, offset, next_tree); } @@ -2114,7 +2112,7 @@ dissect_qsig_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_qsig_PSS1InformationElement_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 166 "../../asn1/qsig/qsig.cnf" +#line 164 "../../asn1/qsig/qsig.cnf" tvbuff_t *out_tvb = NULL; proto_tree *data_tree; @@ -9202,7 +9200,7 @@ dissect_qsig_wtmau_DefinedIDs(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_qsig_wtmau_T_param(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 162 "../../asn1/qsig/qsig.cnf" +#line 160 "../../asn1/qsig/qsig.cnf" @@ -12557,7 +12555,7 @@ dissect_qsig_party_category_ie(tvbuff_t *tvb, int offset, packet_info *pinfo _U static void dissect_qsig_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int codeset) { gint offset; - proto_item *ti, *ti_ie, *hidden_item; + proto_item *ti, *hidden_item; proto_tree *ie_tree; guint8 ie_type, ie_len; @@ -12569,9 +12567,9 @@ dissect_qsig_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int codeset ie_type = tvb_get_guint8(tvb, offset); ie_len = tvb_get_guint8(tvb, offset + 1); - ti_ie = proto_tree_add_text(tree, tvb, offset, -1, "%s", + ie_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_qsig_ie, NULL, val_to_str(ie_type, VALS(qsig_str_ie_type[codeset]), "unknown (0x%02X)")); - ie_tree = proto_item_add_subtree(ti_ie, ett_qsig_ie); + proto_tree_add_item(ie_tree, *hf_qsig_ie_type_arr[codeset], tvb, offset, 1, ENC_BIG_ENDIAN); hidden_item = proto_tree_add_item(ie_tree, hf_qsig_ie_type, tvb, offset, 1, ENC_BIG_ENDIAN); PROTO_ITEM_SET_HIDDEN(hidden_item); diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c index afd05ee177..9bc0ba6be9 100644 --- a/epan/dissectors/packet-ros.c +++ b/epan/dissectors/packet-ros.c @@ -264,8 +264,11 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p if(!ros_try_string(oid, next_tvb, pinfo, tree, session) && !dissector_try_string(ros_oid_dissector_table, oid, next_tvb, pinfo, tree, session)){ - proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "ROS: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid); - proto_tree *next_tree=proto_item_add_subtree(item, ett_ros_unknown); + proto_item *item; + proto_tree *next_tree; + + next_tree = proto_tree_add_subtree_format(tree, next_tvb, 0, -1, ett_ros_unknown, &item, + "ROS: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid); expert_add_info_format(pinfo, item, &ei_ros_dissector_oid_not_implemented, "ROS: Dissector for OID %s not implemented", oid); @@ -1000,7 +1003,7 @@ dissect_ros_Code(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, a /*--- End of included file: packet-ros-fn.c ---*/ -#line 368 "../../asn1/ros/packet-ros-template.c" +#line 371 "../../asn1/ros/packet-ros-template.c" /* * Dissect ROS PDUs inside a PPDU. @@ -1056,14 +1059,10 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da old_offset=offset; offset=dissect_ros_ROS(FALSE, tvb, offset, &asn1_ctx , tree, -1); if(offset == old_offset){ - item = proto_tree_add_text(tree, tvb, offset, -1,"Unknown ROS PDU"); - - if(item){ - expert_add_info(pinfo, item, &ei_ros_unknown_ros_pdu); - next_tree=proto_item_add_subtree(item, ett_ros_unknown); - dissect_unknown_ber(pinfo, tvb, offset, next_tree); - } + next_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_ros_unknown, &item, "Unknown ROS PDU"); + expert_add_info(pinfo, item, &ei_ros_unknown_ros_pdu); + dissect_unknown_ber(pinfo, tvb, offset, next_tree); break; } } @@ -1226,7 +1225,7 @@ void proto_register_ros(void) { "OBJECT_IDENTIFIER", HFILL }}, /*--- End of included file: packet-ros-hfarr.c ---*/ -#line 481 "../../asn1/ros/packet-ros-template.c" +#line 480 "../../asn1/ros/packet-ros-template.c" }; /* List of subtrees */ @@ -1247,7 +1246,7 @@ void proto_register_ros(void) { &ett_ros_Code, /*--- End of included file: packet-ros-ettarr.c ---*/ -#line 488 "../../asn1/ros/packet-ros-template.c" +#line 487 "../../asn1/ros/packet-ros-template.c" }; static ei_register_info ei[] = { diff --git a/epan/dissectors/packet-rrc.c b/epan/dissectors/packet-rrc.c index 177ed17089..dace418fce 100644 --- a/epan/dissectors/packet-rrc.c +++ b/epan/dissectors/packet-rrc.c @@ -16417,7 +16417,7 @@ dissect_rrc_ActivationTime(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ static int dissect_rrc_RB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 877 "../../asn1/rrc/rrc.cnf" +#line 876 "../../asn1/rrc/rrc.cnf" offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 1U, 32U, &rbid, FALSE); @@ -16434,7 +16434,7 @@ dissect_rrc_RB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static int dissect_rrc_RLC_SequenceNumber(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 883 "../../asn1/rrc/rrc.cnf" +#line 882 "../../asn1/rrc/rrc.cnf" offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 4095U, &activation_frame, FALSE); @@ -16454,7 +16454,7 @@ static const per_sequence_t RB_ActivationTimeInfo_sequence[] = { static int dissect_rrc_RB_ActivationTimeInfo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 855 "../../asn1/rrc/rrc.cnf" +#line 854 "../../asn1/rrc/rrc.cnf" fp_info *fpinf; rrc_ciphering_info * c_inf; @@ -16608,7 +16608,6 @@ dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1 #line 677 "../../asn1/rrc/rrc.cnf" tvbuff_t *nas_sys_info_gsm_map_tvb = NULL; guint32 length; - proto_item *item; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, @@ -16619,18 +16618,18 @@ dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1 if (actx->private_data) { switch (GPOINTER_TO_UINT(actx->private_data)-1) { case RRC_NAS_SYS_INFO_CN_COMMON: - item = proto_tree_add_text(tree, nas_sys_info_gsm_map_tvb, 0, length, "CN Common GSM-MAP NAS system information"); - subtree = proto_item_add_subtree(item, ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo); + subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CN Common GSM-MAP NAS system information"); de_cn_common_gsm_map_nas_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; case RRC_NAS_SYS_INFO_CS: - item = proto_tree_add_text(tree, nas_sys_info_gsm_map_tvb, 0, length, "CS domain specific system information"); - subtree = proto_item_add_subtree(item, ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo); + subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "CS domain specific system information"); de_cs_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; case RRC_NAS_SYS_INFO_PS: - item = proto_tree_add_text(tree, nas_sys_info_gsm_map_tvb, 0, length, "PS domain specific system information"); - subtree = proto_item_add_subtree(item, ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo); + subtree = proto_tree_add_subtree(tree, nas_sys_info_gsm_map_tvb, 0, length, + ett_rrc_cn_CommonGSM_MAP_NAS_SysInfo, NULL, "PS domain specific system information"); de_ps_domain_spec_sys_info(nas_sys_info_gsm_map_tvb, subtree, actx->pinfo, 0, length, NULL, 0); break; default: @@ -20537,7 +20536,7 @@ dissect_rrc_T_r3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_ static int dissect_rrc_H_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 785 "../../asn1/rrc/rrc.cnf" +#line 784 "../../asn1/rrc/rrc.cnf" tvbuff_t *hrnti_tvb; struct rrc_info *rrcinf; offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, @@ -20546,7 +20545,7 @@ dissect_rrc_H_RNTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot -#line 790 "../../asn1/rrc/rrc.cnf" +#line 789 "../../asn1/rrc/rrc.cnf" rrcinf = (struct rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0); if (!rrcinf) { rrcinf = wmem_new0(wmem_file_scope(), struct rrc_info); @@ -41370,7 +41369,7 @@ dissect_rrc_RLC_Info_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static int dissect_rrc_MAC_d_FlowIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 782 "../../asn1/rrc/rrc.cnf" +#line 781 "../../asn1/rrc/rrc.cnf" offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 7U, &flowd, FALSE); @@ -41418,7 +41417,7 @@ static const per_choice_t DL_TransportChannelType_r5_choice[] = { static int dissect_rrc_DL_TransportChannelType_r5(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 711 "../../asn1/rrc/rrc.cnf" +#line 710 "../../asn1/rrc/rrc.cnf" gint *flowd_p; gint *cur_val=NULL; @@ -44892,7 +44891,7 @@ static const per_choice_t DL_TransportChannelType_r7_choice[] = { static int dissect_rrc_DL_TransportChannelType_r7(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 746 "../../asn1/rrc/rrc.cnf" +#line 745 "../../asn1/rrc/rrc.cnf" gint *flowd_p; gint *cur_val=NULL; @@ -87506,7 +87505,7 @@ static const per_choice_t DL_DCCH_MessageType_choice[] = { static int dissect_rrc_DL_DCCH_MessageType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 887 "../../asn1/rrc/rrc.cnf" +#line 886 "../../asn1/rrc/rrc.cnf" offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rrc_DL_DCCH_MessageType, DL_DCCH_MessageType_choice, &msg_type); @@ -87526,7 +87525,7 @@ static const per_sequence_t DL_DCCH_Message_sequence[] = { static int dissect_rrc_DL_DCCH_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 890 "../../asn1/rrc/rrc.cnf" +#line 889 "../../asn1/rrc/rrc.cnf" offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rrc_DL_DCCH_Message, DL_DCCH_Message_sequence); @@ -87540,7 +87539,7 @@ dissect_rrc_DL_DCCH_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx static int dissect_rrc_START_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 798 "../../asn1/rrc/rrc.cnf" +#line 797 "../../asn1/rrc/rrc.cnf" tvbuff_t * start_val; fp_info *fpinf; rrc_ciphering_info * c_inf; @@ -114235,7 +114234,7 @@ static const per_choice_t HandoverToUTRANCommand_choice[] = { static int dissect_rrc_HandoverToUTRANCommand(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 893 "../../asn1/rrc/rrc.cnf" +#line 892 "../../asn1/rrc/rrc.cnf" offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, ett_rrc_HandoverToUTRANCommand, HandoverToUTRANCommand_choice, NULL); @@ -114376,7 +114375,7 @@ static const per_sequence_t UE_SecurityInformation_sequence[] = { static int dissect_rrc_UE_SecurityInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 896 "../../asn1/rrc/rrc.cnf" +#line 895 "../../asn1/rrc/rrc.cnf" actx->private_data = GUINT_TO_POINTER(RRC_NAS_SYS_INFO_CS+1); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rrc_UE_SecurityInformation, UE_SecurityInformation_sequence); @@ -114779,7 +114778,7 @@ static const per_sequence_t UE_SecurityInformation2_sequence[] = { static int dissect_rrc_UE_SecurityInformation2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 900 "../../asn1/rrc/rrc.cnf" +#line 899 "../../asn1/rrc/rrc.cnf" actx->private_data = GUINT_TO_POINTER(RRC_NAS_SYS_INFO_PS+1); offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_rrc_UE_SecurityInformation2, UE_SecurityInformation2_sequence); diff --git a/epan/dissectors/packet-rtse.c b/epan/dissectors/packet-rtse.c index 5d91a18587..fbe377b952 100644 --- a/epan/dissectors/packet-rtse.c +++ b/epan/dissectors/packet-rtse.c @@ -6,7 +6,7 @@ /* Input file: packet-rtse-template.c */ #line 1 "../../asn1/rtse/packet-rtse-template.c" -/* packet-rtse_asn1.c +/* packet-rtse-template.c * Routines for RTSE packet dissection * Graeme Lunt 2005 * @@ -197,8 +197,10 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info * next_tvb = tvb_new_subset_remaining(tvb, offset); if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)){ - proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_captured_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid); - proto_tree *next_tree=proto_item_add_subtree(item, ett_rtse_unknown); + proto_item *item; + proto_tree *next_tree; + next_tree = proto_tree_add_subtree_format(tree, next_tvb, 0, -1, ett_rtse_unknown, &item, + "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid); expert_add_info_format(pinfo, item, &ei_rtse_dissector_oid_not_implemented, "RTSE: Dissector for OID %s not implemented", oid); @@ -727,7 +729,7 @@ dissect_rtse_RTSE_apdus(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset /*--- End of included file: packet-rtse-fn.c ---*/ -#line 185 "../../asn1/rtse/packet-rtse-template.c" +#line 187 "../../asn1/rtse/packet-rtse-template.c" /* * Dissect RTSE PDUs inside a PPDU. @@ -831,10 +833,9 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d old_offset=offset; offset=dissect_rtse_RTSE_apdus(TRUE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset){ - item = proto_tree_add_text(tree, tvb, offset, -1, "Unknown RTSE PDU"); - + next_tree = proto_tree_add_subtree(tree, tvb, offset, -1, + ett_rtse_unknown, &item, "Unknown RTSE PDU"); expert_add_info (pinfo, item, &ei_rtse_unknown_rtse_pdu); - next_tree=proto_item_add_subtree(item, ett_rtse_unknown); dissect_unknown_ber(pinfo, tvb, offset, next_tree); break; } @@ -995,7 +996,7 @@ void proto_register_rtse(void) { NULL, HFILL }}, /*--- End of included file: packet-rtse-hfarr.c ---*/ -#line 352 "../../asn1/rtse/packet-rtse-template.c" +#line 353 "../../asn1/rtse/packet-rtse-template.c" }; /* List of subtrees */ @@ -1017,7 +1018,7 @@ void proto_register_rtse(void) { &ett_rtse_CallingSSuserReference, /*--- End of included file: packet-rtse-ettarr.c ---*/ -#line 361 "../../asn1/rtse/packet-rtse-template.c" +#line 362 "../../asn1/rtse/packet-rtse-template.c" }; static ei_register_info ei[] = { diff --git a/epan/dissectors/packet-sabp.c b/epan/dissectors/packet-sabp.c index 94b9ca0745..b5a5736d60 100644 --- a/epan/dissectors/packet-sabp.c +++ b/epan/dissectors/packet-sabp.c @@ -6,7 +6,7 @@ /* Input file: packet-sabp-template.c */ #line 1 "../../asn1/sabp/packet-sabp-template.c" -/* packet-sabp.c +/* packet-sabp-template.c * Routines for UTRAN Iu-BC Interface: Service Area Broadcast Protocol (SABP) packet dissection * Copyright 2007, Tomas Kukosa <tomas.kukosa@siemens.com> * @@ -1762,7 +1762,7 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p static void dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *item, *cbs_page_item; + proto_item *cbs_page_item; proto_tree *subtree; tvbuff_t *page_tvb, *unpacked_tvb; int offset = 0; @@ -1782,8 +1782,8 @@ dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } for (n = 0; n < nr_pages; n++) { - item = proto_tree_add_text(tree, tvb, offset, 83, "CB page %u data", n+1); - subtree = proto_item_add_subtree(item, ett_sabp_cbs_page); + subtree = proto_tree_add_subtree_format(tree, tvb, offset, 83, ett_sabp_cbs_page, NULL, + "CB page %u data", n+1); /* octet 2 - 83 CBS-Message-Information-Page 1 */ cbs_page_item = proto_tree_add_item(subtree, hf_sabp_cb_msg_inf_page, tvb, offset, 82, ENC_NA); cb_inf_msg_len = tvb_get_guint8(tvb,offset+82); diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index 6eb1b9501e..1052a83f56 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -651,15 +651,17 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, seq_len += offset - seq_offset; if (!pc && ber_class==BER_CLASS_UNI && tag==BER_UNI_TAG_SEQUENCE) { - proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"VarBind must be an universal class sequence"); - pt = proto_item_add_subtree(pi,ett_decoding_error); + proto_item* pi; + pt = proto_tree_add_subtree(tree, tvb, seq_offset, seq_len, + ett_decoding_error, &pi, "VarBind must be an universal class sequence"); expert_add_info(actx->pinfo, pi, &ei_snmp_varbind_not_uni_class_seq); return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt); } if (ind) { - proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"Indicator must be clear in VarBind"); - pt = proto_item_add_subtree(pi,ett_decoding_error); + proto_item* pi; + pt = proto_tree_add_subtree(tree, tvb, seq_offset, seq_len, + ett_decoding_error, &pi, "Indicator must be clear in VarBind"); expert_add_info(actx->pinfo, pi, &ei_snmp_varbind_has_indicator); return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt); } @@ -670,15 +672,17 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, name_offset = offset = get_ber_length(tvb, offset, &name_len, &ind); if (! ( !pc && ber_class==BER_CLASS_UNI && tag==BER_UNI_TAG_OID) ) { - proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"ObjectName must be an OID in primitive encoding"); - pt = proto_item_add_subtree(pi,ett_decoding_error); + proto_item* pi; + pt = proto_tree_add_subtree(tree, tvb, seq_offset, seq_len, + ett_decoding_error, &pi, "ObjectName must be an OID in primitive encoding"); expert_add_info(actx->pinfo, pi, &ei_snmp_objectname_not_oid); return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt); } if (ind) { - proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"Indicator must be clear in ObjectName"); - pt = proto_item_add_subtree(pi,ett_decoding_error); + proto_item* pi; + pt = proto_tree_add_subtree(tree, tvb, seq_offset, seq_len, + ett_decoding_error, &pi, "Indicator must be clear in ObjectName"); expert_add_info(actx->pinfo, pi, &ei_snmp_objectname_has_indicator); return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt); } @@ -691,8 +695,9 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, value_offset = get_ber_length(tvb, offset, &value_len, &ind); if (! (!pc) ) { - proto_item* pi = proto_tree_add_text(tree, tvb, seq_offset, seq_len,"the value must be in primitive encoding"); - pt = proto_item_add_subtree(pi,ett_decoding_error); + proto_item* pi; + pt = proto_tree_add_subtree(tree, tvb, seq_offset, seq_len, + ett_decoding_error, &pi, "the value must be in primitive encoding"); expert_add_info(actx->pinfo, pi, &ei_snmp_value_not_primitive_encoding); return dissect_unknown_ber(actx->pinfo, tvb, seq_offset, pt); } @@ -702,8 +707,7 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, /* we add the varbind tree root with a dummy label we'll fill later on */ - pi_varbind = proto_tree_add_text(tree,tvb,seq_offset,seq_len,"VarBind"); - pt_varbind = proto_item_add_subtree(pi_varbind,ett_varbind); + pt_varbind = proto_tree_add_subtree(tree,tvb,seq_offset,seq_len,ett_varbind,&pi_varbind,"VarBind"); *label = '\0'; pi_name = proto_tree_add_item(pt_varbind,hf_snmp_objectname,tvb,name_offset,name_len,ENC_NA); @@ -719,8 +723,7 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, proto_item* pi; repr = oid_encoded2string(oid_bytes, name_len); - pi = proto_tree_add_text(pt_name,tvb, 0, 0, "invalid oid: %s", repr); - pt = proto_item_add_subtree(pi, ett_decoding_error); + pt = proto_tree_add_subtree_format(pt_name,tvb, 0, 0, ett_decoding_error, &pi, "invalid oid: %s", repr); expert_add_info_format(actx->pinfo, pi, &ei_snmp_invalid_oid, "invalid oid: %s", repr); return dissect_unknown_ber(actx->pinfo, tvb, name_offset, pt); } @@ -753,8 +756,8 @@ dissect_snmp_VarBind(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, note = "endOfMibView"; break; default: { - pi = proto_tree_add_text(pt_varbind,tvb,0,0,"Wrong tag for Error Value: expected 0, 1, or 2 but got: %d",tag); - pt = proto_item_add_subtree(pi,ett_decoding_error); + pt = proto_tree_add_subtree_format(pt_varbind,tvb,0,0,ett_decoding_error,&pi, + "Wrong tag for Error Value: expected 0, 1, or 2 but got: %d",tag); expert_add_info(actx->pinfo, pi, &ei_snmp_varbind_wrong_tag); return dissect_unknown_ber(actx->pinfo, tvb, value_start, pt); } @@ -1167,19 +1170,21 @@ set_label: switch (format_error) { case BER_WRONG_LENGTH: { + proto_item* pi; proto_tree* p_tree = proto_item_add_subtree(pi_value,ett_decoding_error); - proto_item* pi = proto_tree_add_text(p_tree,tvb,0,0,"Wrong value length: %u expecting: %u <= len <= %u", + pt = proto_tree_add_subtree_format(p_tree,tvb,0,0,ett_decoding_error,&pi, + "Wrong value length: %u expecting: %u <= len <= %u", value_len, min_len, max_len == -1 ? 0xFFFFFF : max_len); - pt = proto_item_add_subtree(pi,ett_decoding_error); expert_add_info(actx->pinfo, pi, &ei_snmp_varbind_wrong_length_value); return dissect_unknown_ber(actx->pinfo, tvb, value_start, pt); } case BER_WRONG_TAG: { + proto_item* pi; proto_tree* p_tree = proto_item_add_subtree(pi_value,ett_decoding_error); - proto_item* pi = proto_tree_add_text(p_tree,tvb,0,0,"Wrong class/tag for Value expected: %d,%d got: %d,%d", + pt = proto_tree_add_subtree_format(p_tree,tvb,0,0,ett_decoding_error,&pi, + "Wrong class/tag for Value expected: %d,%d got: %d,%d", oid_info->value_type->ber_class, oid_info->value_type->ber_tag, ber_class, tag); - pt = proto_item_add_subtree(pi,ett_decoding_error); expert_add_info(actx->pinfo, pi, &ei_snmp_varbind_wrong_class_tag); return dissect_unknown_ber(actx->pinfo, tvb, value_start, pt); } @@ -3092,7 +3097,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro /*--- End of included file: packet-snmp-fn.c ---*/ -#line 1881 "../../asn1/snmp/packet-snmp-template.c" +#line 1886 "../../asn1/snmp/packet-snmp-template.c" guint @@ -3919,7 +3924,7 @@ void proto_register_snmp(void) { NULL, HFILL }}, /*--- End of included file: packet-snmp-hfarr.c ---*/ -#line 2443 "../../asn1/snmp/packet-snmp-template.c" +#line 2448 "../../asn1/snmp/packet-snmp-template.c" }; /* List of subtrees */ @@ -3959,7 +3964,7 @@ void proto_register_snmp(void) { &ett_snmp_RReqPDU_U, /*--- End of included file: packet-snmp-ettarr.c ---*/ -#line 2459 "../../asn1/snmp/packet-snmp-template.c" +#line 2464 "../../asn1/snmp/packet-snmp-template.c" }; static ei_register_info ei[] = { { &ei_snmp_failed_decrypted_data_pdu, { "snmp.failed_decrypted_data_pdu", PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU", EXPFILL }}, diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c index a1e32b045c..97a5b1f7d1 100644 --- a/epan/dissectors/packet-spnego.c +++ b/epan/dissectors/packet-spnego.c @@ -6,7 +6,7 @@ /* Input file: packet-spnego-template.c */ #line 1 "../../asn1/spnego/packet-spnego-template.c" -/* packet-spnego.c +/* packet-spnego-template.c * Routines for the simple and protected GSS-API negotiation mechanism * as described in RFC 2478. * Copyright 2002, Tim Potter <tpot@samba.org> @@ -1392,15 +1392,13 @@ dissect_spnego_krb5_cfx_flags(tvbuff_t *tvb, int offset, proto_tree *spnego_krb5_tree, guint8 cfx_flags) { - proto_tree *cfx_flags_tree = NULL; - proto_item *tf = NULL; + proto_tree *cfx_flags_tree; + proto_item *tf; - if (spnego_krb5_tree) { - tf = proto_tree_add_uint(spnego_krb5_tree, + tf = proto_tree_add_uint(spnego_krb5_tree, hf_spnego_krb5_cfx_flags, tvb, offset, 1, cfx_flags); - cfx_flags_tree = proto_item_add_subtree(tf, ett_spnego_krb5_cfx_flags); - } + cfx_flags_tree = proto_item_add_subtree(tf, ett_spnego_krb5_cfx_flags); proto_tree_add_boolean(cfx_flags_tree, hf_spnego_krb5_cfx_flags_04, @@ -1952,7 +1950,7 @@ void proto_register_spnego(void) { NULL, HFILL }}, /*--- End of included file: packet-spnego-hfarr.c ---*/ -#line 1407 "../../asn1/spnego/packet-spnego-template.c" +#line 1405 "../../asn1/spnego/packet-spnego-template.c" }; /* List of subtrees */ @@ -1975,7 +1973,7 @@ void proto_register_spnego(void) { &ett_spnego_InitialContextToken_U, /*--- End of included file: packet-spnego-ettarr.c ---*/ -#line 1417 "../../asn1/spnego/packet-spnego-template.c" +#line 1415 "../../asn1/spnego/packet-spnego-template.c" }; /* Register protocol */ diff --git a/epan/dissectors/packet-sv.c b/epan/dissectors/packet-sv.c index 6fa8e87df3..ab0ee9e81d 100644 --- a/epan/dissectors/packet-sv.c +++ b/epan/dissectors/packet-sv.c @@ -166,7 +166,7 @@ dissect_PhsMeas1(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tv gint32 tag; guint32 len; proto_item *it; - proto_tree *subtree = NULL; + proto_tree *subtree; gint32 value; guint32 qual; guint32 i; @@ -195,10 +195,7 @@ dissect_PhsMeas1(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tv len=tvb_length_remaining(tvb, offset); } - if (tree) { - it = proto_tree_add_text(tree, tvb, offset, len, "PhsMeas1"); - subtree = proto_item_add_subtree(it, ett_phsmeas); - } + subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_phsmeas, NULL, "PhsMeas1"); sv_data.num_phsMeas = 0; for (i = 0; i < len/8; i++) { @@ -438,7 +435,7 @@ dissect_sv_SampledValues(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse /*--- End of included file: packet-sv-fn.c ---*/ -#line 192 "../../asn1/sv/packet-sv-template.c" +#line 189 "../../asn1/sv/packet-sv-template.c" /* * Dissect SV PDUs inside a PPDU. @@ -448,16 +445,15 @@ dissect_sv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { int offset = 0; int old_offset; - proto_item *item = NULL; - proto_tree *tree = NULL; + proto_item *item; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - if (parent_tree){ - item = proto_tree_add_item(parent_tree, proto_sv, tvb, 0, -1, ENC_NA); - tree = proto_item_add_subtree(item, ett_sv); - } + item = proto_tree_add_item(parent_tree, proto_sv, tvb, 0, -1, ENC_NA); + tree = proto_item_add_subtree(item, ett_sv); + col_set_str(pinfo->cinfo, COL_PROTOCOL, PNAME); col_clear(pinfo->cinfo, COL_INFO); @@ -612,7 +608,7 @@ void proto_register_sv(void) { NULL, HFILL }}, /*--- End of included file: packet-sv-hfarr.c ---*/ -#line 309 "../../asn1/sv/packet-sv-template.c" +#line 305 "../../asn1/sv/packet-sv-template.c" }; /* List of subtrees */ @@ -629,7 +625,7 @@ void proto_register_sv(void) { &ett_sv_ASDU, /*--- End of included file: packet-sv-ettarr.c ---*/ -#line 317 "../../asn1/sv/packet-sv-template.c" +#line 313 "../../asn1/sv/packet-sv-template.c" }; static ei_register_info ei[] = { diff --git a/epan/dissectors/packet-tcap.c b/epan/dissectors/packet-tcap.c index 1f770dc171..60a8068cdc 100644 --- a/epan/dissectors/packet-tcap.c +++ b/epan/dissectors/packet-tcap.c @@ -759,10 +759,8 @@ dissect_tcap_OrigTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int #line 126 "../../asn1/tcap/tcap.cnf" tvbuff_t *parameter_tvb; guint8 len, i; -proto_item *tid_item; proto_tree *subtree; -tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Source Transaction ID"); -subtree = proto_item_add_subtree(tid_item, ett_otid); +subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_otid, NULL, "Source Transaction ID"); dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid, NULL); PROTO_ITEM_SET_HIDDEN(actx->created_item); @@ -811,7 +809,7 @@ static const ber_sequence_t Begin_sequence[] = { static int dissect_tcap_Begin(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 204 "../../asn1/tcap/tcap.cnf" +#line 200 "../../asn1/tcap/tcap.cnf" gp_tcapsrt_info->ope=TC_BEGIN; /* Do not change col_add_str() to col_append_str() here: we _want_ this call @@ -833,13 +831,11 @@ gp_tcapsrt_info->ope=TC_BEGIN; static int dissect_tcap_DestTransactionID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 167 "../../asn1/tcap/tcap.cnf" +#line 165 "../../asn1/tcap/tcap.cnf" tvbuff_t *parameter_tvb; guint8 len , i; -proto_item *tid_item; proto_tree *subtree; -tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Destination Transaction ID"); -subtree = proto_item_add_subtree(tid_item, ett_dtid); +subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dtid, NULL, "Destination Transaction ID"); dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid, NULL); PROTO_ITEM_SET_HIDDEN(actx->created_item); @@ -885,7 +881,7 @@ static const ber_sequence_t End_sequence[] = { static int dissect_tcap_End(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 218 "../../asn1/tcap/tcap.cnf" +#line 214 "../../asn1/tcap/tcap.cnf" gp_tcapsrt_info->ope=TC_END; col_set_str(actx->pinfo->cinfo, COL_INFO, "End "); @@ -907,7 +903,7 @@ static const ber_sequence_t Continue_sequence[] = { static int dissect_tcap_Continue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 225 "../../asn1/tcap/tcap.cnf" +#line 221 "../../asn1/tcap/tcap.cnf" gp_tcapsrt_info->ope=TC_CONT; col_set_str(actx->pinfo->cinfo, COL_INFO, "Continue "); @@ -978,7 +974,7 @@ static const ber_sequence_t Abort_sequence[] = { static int dissect_tcap_Abort(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 232 "../../asn1/tcap/tcap.cnf" +#line 228 "../../asn1/tcap/tcap.cnf" gp_tcapsrt_info->ope=TC_ABORT; col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort "); @@ -2360,9 +2356,8 @@ tcaphash_begin_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, #endif p_tcaphash_context=p_tcaphash_begincall->context; if (gtcap_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, -1, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); pi = proto_tree_add_uint_format(stat_tree, hf_tcapsrt_Duplicate, tvb, 0, 0, p_tcaphash_context->first_frame, "Duplicate with session %u in frame %u", @@ -2403,9 +2398,8 @@ tcaphash_begin_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if ( gtcap_DisplaySRT && tree && p_tcaphash_context && p_tcaphash_context->session_id) { - stat_item = proto_tree_add_text(tree, tvb, 0, 0, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); pi = proto_tree_add_uint(stat_tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id); PROTO_ITEM_SET_GENERATED(pi); @@ -2552,9 +2546,8 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (gtcap_DisplaySRT && tree && p_tcaphash_context && p_tcaphash_context->session_id) { - stat_item = proto_tree_add_text(tree, tvb, 0, -1, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); pi = proto_tree_add_uint(stat_tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id); PROTO_ITEM_SET_GENERATED(pi); } @@ -2656,9 +2649,8 @@ tcaphash_end_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dbg(12,"Found, req=%d ",p_tcaphash_context->first_frame); #endif if (gtcap_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, -1, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); pi = proto_tree_add_uint(stat_tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id); PROTO_ITEM_SET_GENERATED(pi); @@ -2780,9 +2772,8 @@ tcaphash_ansi_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, isResponse=TRUE; if (gtcap_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, -1, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); pi = proto_tree_add_uint(stat_tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id); PROTO_ITEM_SET_GENERATED(pi); @@ -2873,9 +2864,8 @@ tcaphash_ansi_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, #endif if (gtcap_DisplaySRT && tree) { - stat_item = proto_tree_add_text(tree, tvb, 0, -1, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); pi = proto_tree_add_uint(stat_tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id); PROTO_ITEM_SET_GENERATED(pi); @@ -2926,9 +2916,8 @@ tcaphash_ansi_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if ( gtcap_DisplaySRT && tree && p_tcaphash_context && p_tcaphash_context->session_id) { - stat_item = proto_tree_add_text(tree, tvb, 0, -1, "Stat"); + stat_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett_tcap_stat, &stat_item, "Stat"); PROTO_ITEM_SET_GENERATED(stat_item); - stat_tree = proto_item_add_subtree(stat_item, ett_tcap_stat); pi = proto_tree_add_uint(stat_tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id); PROTO_ITEM_SET_GENERATED(pi); } @@ -3352,7 +3341,7 @@ proto_reg_handoff_tcap(void) /*--- End of included file: packet-tcap-dis-tab.c ---*/ -#line 2077 "../../asn1/tcap/packet-tcap-template.c" +#line 2070 "../../asn1/tcap/packet-tcap-template.c" } static void init_tcap(void); @@ -3683,7 +3672,7 @@ proto_register_tcap(void) NULL, HFILL }}, /*--- End of included file: packet-tcap-hfarr.c ---*/ -#line 2139 "../../asn1/tcap/packet-tcap-template.c" +#line 2132 "../../asn1/tcap/packet-tcap-template.c" }; /* Setup protocol subtree array */ @@ -3732,7 +3721,7 @@ proto_register_tcap(void) &ett_tcap_Associate_source_diagnostic, /*--- End of included file: packet-tcap-ettarr.c ---*/ -#line 2149 "../../asn1/tcap/packet-tcap-template.c" +#line 2142 "../../asn1/tcap/packet-tcap-template.c" }; /*static enum_val_t tcap_options[] = { @@ -3840,7 +3829,6 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset gint tag_offset, saved_offset, len_offset; tvbuff_t *next_tvb; proto_tree *subtree; - proto_item *pi; gint8 ber_class; gboolean pc; gint32 tag; @@ -3863,10 +3851,9 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset if (pc) { - pi = proto_tree_add_text(tree, tvb, saved_offset, - len + (len_offset - saved_offset), + subtree = proto_tree_add_subtree(tree, tvb, saved_offset, + len + (len_offset - saved_offset), ett_param, NULL, "CONSTRUCTOR"); - subtree = proto_item_add_subtree(pi, ett_param); proto_tree_add_uint_format(subtree, hf_tcap_tag, tvb, saved_offset, tag_length, tag, "CONSTRUCTOR Tag"); @@ -3889,12 +3876,10 @@ dissect_tcap_param(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int offset } else { - pi = proto_tree_add_text(tree, tvb, saved_offset, - len + (len_offset - saved_offset), + subtree = proto_tree_add_subtree_format(tree, tvb, saved_offset, + len + (len_offset - saved_offset), ett_param, NULL, "Parameter (0x%.2x)", tag); - subtree = proto_item_add_subtree(pi, ett_param); - proto_tree_add_uint(subtree, hf_tcap_tag, tvb, saved_offset, tag_length, tag); diff --git a/epan/dissectors/packet-x509af.c b/epan/dissectors/packet-x509af.c index 94853471cf..e51b4631d4 100644 --- a/epan/dissectors/packet-x509af.c +++ b/epan/dissectors/packet-x509af.c @@ -897,8 +897,7 @@ const char *x509af_get_last_algorithm_id(void) { static int dissect_pkix_crl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_tree *tree; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -907,10 +906,7 @@ dissect_pkix_crl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi col_set_str(pinfo->cinfo, COL_INFO, "Certificate Revocation List"); - if(parent_tree){ - item=proto_tree_add_text(parent_tree, tvb, 0, -1, "Certificate Revocation List"); - tree = proto_item_add_subtree(item, ett_pkix_crl); - } + tree=proto_tree_add_subtree(parent_tree, tvb, 0, -1, ett_pkix_crl, NULL, "Certificate Revocation List"); return dissect_x509af_CertificateList(FALSE, tvb, 0, &asn1_ctx, tree, -1); } @@ -1229,7 +1225,7 @@ void proto_register_x509af(void) { "INTEGER", HFILL }}, /*--- End of included file: packet-x509af-hfarr.c ---*/ -#line 97 "../../asn1/x509af/packet-x509af-template.c" +#line 93 "../../asn1/x509af/packet-x509af-template.c" }; /* List of subtrees */ @@ -1272,7 +1268,7 @@ void proto_register_x509af(void) { &ett_x509af_DSS_Params, /*--- End of included file: packet-x509af-ettarr.c ---*/ -#line 103 "../../asn1/x509af/packet-x509af-template.c" +#line 99 "../../asn1/x509af/packet-x509af-template.c" }; /* Register protocol */ @@ -1315,7 +1311,7 @@ void proto_reg_handoff_x509af(void) { /*--- End of included file: packet-x509af-dis-tab.c ---*/ -#line 131 "../../asn1/x509af/packet-x509af-template.c" +#line 127 "../../asn1/x509af/packet-x509af-template.c" /*XXX these should really go to a better place but since that I have not that ITU standard, ill put it here for the time |