From 02a83915359f7fadf149df0fe0dea8e971bb32f4 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 2 Nov 2013 15:52:25 +0000 Subject: Require dissector_try_string to pass a data parameter to its subdissectors. There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new. svn path=/trunk/; revision=53049 --- asn1/dop/packet-dop-template.c | 2 +- asn1/h225/h225.cnf | 4 ++-- asn1/h245/h245.cnf | 18 +++++++++--------- asn1/hnbap/packet-hnbap-template.c | 6 +++--- asn1/ldap/ldap.cnf | 2 +- asn1/nbap/packet-nbap-template.c | 6 +++--- asn1/qsig/qsig.cnf | 2 +- asn1/rnsap/packet-rnsap-template.c | 6 +++--- asn1/ros/packet-ros-template.c | 2 +- asn1/rtse/packet-rtse-template.c | 2 +- asn1/t124/t124.cnf | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) (limited to 'asn1') diff --git a/asn1/dop/packet-dop-template.c b/asn1/dop/packet-dop-template.c index 8995f4fede..e8033d785a 100644 --- a/asn1/dop/packet-dop-template.c +++ b/asn1/dop/packet-dop-template.c @@ -94,7 +94,7 @@ call_dop_oid_callback(const char *base_string, tvbuff_t *tvb, int offset, packet col_append_fstr(pinfo->cinfo, COL_INFO, " %s", col_info); - if (dissector_try_string(dop_dissector_table, binding_param, tvb, pinfo, tree)) { + if (dissector_try_string(dop_dissector_table, binding_param, tvb, pinfo, tree, NULL)) { offset = tvb_reported_length (tvb); } else { proto_item *item=NULL; diff --git a/asn1/h225/h225.cnf b/asn1/h225/h225.cnf index 1dbe50e7c7..57bf82d86e 100644 --- a/asn1/h225/h225.cnf +++ b/asn1/h225/h225.cnf @@ -674,7 +674,7 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode if (gefx) { /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ actx->pinfo->private_data = actx; - dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree); + dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, NULL); } actx->private_data = gefx; /* subdissector could overwrite it */ #.END @@ -706,7 +706,7 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode gefx = gef_ctx_get(actx->private_data); if (gefx) { /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } #.END diff --git a/asn1/h245/h245.cnf b/asn1/h245/h245.cnf index 87461f7a11..23d8cf070d 100644 --- a/asn1/h245/h245.cnf +++ b/asn1/h245/h245.cnf @@ -698,7 +698,7 @@ if (h245_pi != NULL) if (gefx) { /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ actx->pinfo->private_data = actx; - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } actx->private_data = parent_gefx; #.END @@ -721,7 +721,7 @@ if (h245_pi != NULL) if (gefx) { /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ actx->pinfo->private_data = actx; - dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree); + dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, NULL); } actx->private_data = gefx; /* subdissector could overwrite it */ #.END @@ -752,7 +752,7 @@ if (h245_pi != NULL) if (gefx) { /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ actx->pinfo->private_data = actx; - dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree); + dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, NULL); } actx->private_data = gefx; /* subdissector could overwrite it */ #.END @@ -780,7 +780,7 @@ if (h245_pi != NULL) value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint8), sizeof(guint8)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ add_new_data_source(%(ACTX)s->pinfo, value_tvb, "booleanArray"); - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } #.END #.FN_BODY ParameterValue/unsignedMin VAL_PTR = &value @@ -797,7 +797,7 @@ if (h245_pi != NULL) value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ add_new_data_source(%(ACTX)s->pinfo, value_tvb, "unsignedMin"); - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } #.END #.FN_BODY ParameterValue/unsignedMax VAL_PTR = &value @@ -814,7 +814,7 @@ if (h245_pi != NULL) value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ add_new_data_source(%(ACTX)s->pinfo, value_tvb, "unsignedMax"); - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } #.END #.FN_BODY ParameterValue/unsigned32Min VAL_PTR = &value @@ -831,7 +831,7 @@ if (h245_pi != NULL) value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ add_new_data_source(%(ACTX)s->pinfo, value_tvb, "unsigned32Min"); - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } #.END #.FN_BODY ParameterValue/unsigned32Max VAL_PTR = &value @@ -848,7 +848,7 @@ if (h245_pi != NULL) value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ add_new_data_source(%(ACTX)s->pinfo, value_tvb, "unsigned32Max"); - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } #.END #.FN_BODY ParameterValue/octetString VAL_PTR = &value_tvb @@ -859,7 +859,7 @@ if (h245_pi != NULL) gefx = gef_ctx_get(actx->private_data); if (gefx) { /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/ - dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s); + dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, NULL); } #.END diff --git a/asn1/hnbap/packet-hnbap-template.c b/asn1/hnbap/packet-hnbap-template.c index 914720b73e..479f8b82fd 100644 --- a/asn1/hnbap/packet-hnbap-template.c +++ b/asn1/hnbap/packet-hnbap-template.c @@ -94,19 +94,19 @@ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_in static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureCode) return 0; - return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureCode) return 0; - return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureCode) return 0; - return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } #endif diff --git a/asn1/ldap/ldap.cnf b/asn1/ldap/ldap.cnf index 8760206b8a..5b348c160d 100644 --- a/asn1/ldap/ldap.cnf +++ b/asn1/ldap/ldap.cnf @@ -472,7 +472,7 @@ ldap_conv_info_t *ldap_info; proto_tree_add_item (tree, *hf_id, next_tvb, 0, tvb_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA); /* if we have an attribute type that isn't binary see if there is a better dissector */ - else if(!attr_type || !next_tvb || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree)) { + else if(!attr_type || !next_tvb || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree, NULL)) { offset = old_offset; /* do the default thing */ diff --git a/asn1/nbap/packet-nbap-template.c b/asn1/nbap/packet-nbap-template.c index 5535feb248..28775aa50b 100644 --- a/asn1/nbap/packet-nbap-template.c +++ b/asn1/nbap/packet-nbap-template.c @@ -333,19 +333,19 @@ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_in static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureID) return 0; - return (dissector_try_string(nbap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(nbap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureID) return 0; - return (dissector_try_string(nbap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(nbap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureID) return 0; - return (dissector_try_string(nbap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(nbap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static void add_hsdsch_bind(packet_info *pinfo){ address null_addr; diff --git a/asn1/qsig/qsig.cnf b/asn1/qsig/qsig.cnf index e181d8a02c..081888ed0f 100644 --- a/asn1/qsig/qsig.cnf +++ b/asn1/qsig/qsig.cnf @@ -146,7 +146,7 @@ NameData TYPE = FT_STRING DISPLAY = BASE_NONE tvbuff_t *next_tvb; next_tvb = tvb_new_subset_remaining(tvb, offset); - if (!dissector_try_string(extension_dissector_table, extension_oid, next_tvb, actx->pinfo, tree)) { + if (!dissector_try_string(extension_dissector_table, extension_oid, next_tvb, actx->pinfo, tree, NULL)) { proto_item *item=NULL; proto_tree *next_tree=NULL; diff --git a/asn1/rnsap/packet-rnsap-template.c b/asn1/rnsap/packet-rnsap-template.c index 3e5680ea12..dca0dffff5 100644 --- a/asn1/rnsap/packet-rnsap-template.c +++ b/asn1/rnsap/packet-rnsap-template.c @@ -106,19 +106,19 @@ static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_ static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureID) return 0; - return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureID) return 0; - return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { if (!ProcedureID) return 0; - return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0; } static void diff --git a/asn1/ros/packet-ros-template.c b/asn1/ros/packet-ros-template.c index f2287d820c..4cbf770875 100644 --- a/asn1/ros/packet-ros-template.c +++ b/asn1/ros/packet-ros-template.c @@ -214,7 +214,7 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p next_tvb = tvb_new_subset_remaining(tvb, offset); if(!ros_try_string(oid, next_tvb, pinfo, tree) && - !dissector_try_string(ros_oid_dissector_table, oid, next_tvb, pinfo, tree)){ + !dissector_try_string(ros_oid_dissector_table, oid, next_tvb, pinfo, tree, NULL)){ 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); diff --git a/asn1/rtse/packet-rtse-template.c b/asn1/rtse/packet-rtse-template.c index c7f053453a..10a306ff4a 100644 --- a/asn1/rtse/packet-rtse-template.c +++ b/asn1/rtse/packet-rtse-template.c @@ -147,7 +147,7 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info * tvbuff_t *next_tvb; next_tvb = tvb_new_subset_remaining(tvb, offset); - if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree)){ + if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, NULL)){ proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_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); diff --git a/asn1/t124/t124.cnf b/asn1/t124/t124.cnf index acd15ef7d6..7062ca7ac8 100644 --- a/asn1/t124/t124.cnf +++ b/asn1/t124/t124.cnf @@ -156,7 +156,7 @@ RegistryAllocateHandleResponse/result AllocateHandleResponseResult ns = tvb_get_string(NULL, t124NSIdentifier, 0, tvb_length(t124NSIdentifier)); if(ns != NULL) { - dissector_try_string(t124_ns_dissector_table, ns, next_tvb, actx->pinfo, top_tree); + dissector_try_string(t124_ns_dissector_table, ns, next_tvb, actx->pinfo, top_tree, NULL); g_free(ns); } } -- cgit v1.2.3