diff options
author | Tomas Kukosa <tomas.kukosa@siemens.com> | 2010-09-08 09:02:16 +0000 |
---|---|---|
committer | Tomas Kukosa <tomas.kukosa@siemens.com> | 2010-09-08 09:02:16 +0000 |
commit | eb503df011140380ae57f5d93d533bf162c2f8fd (patch) | |
tree | 800151b06ccedf15941252c7a248dd7f37eb759d | |
parent | 4e4ee5e1996d1870c84687c90e0095969b578aae (diff) |
Do not report undecoded message to expert info for ReturnResult without result filed
svn path=/trunk/; revision=34076
-rw-r--r-- | asn1/ros/ros-res.cnf | 17 | ||||
-rw-r--r-- | epan/asn1.h | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-h450-ros.c | 19 | ||||
-rw-r--r-- | epan/dissectors/packet-q932-ros.c | 19 |
4 files changed, 33 insertions, 23 deletions
diff --git a/asn1/ros/ros-res.cnf b/asn1/ros/ros-res.cnf index bdf7edf1b5..4f85d0c419 100644 --- a/asn1/ros/ros-res.cnf +++ b/asn1/ros/ros-res.cnf @@ -7,6 +7,7 @@ dissector_handle_t res_handle = NULL; const gchar *descr = ""; + actx->rose_ctx->d.code = -1; res_next_tvb = NULL; #.FN_FTR ReturnResult actx->rose_ctx->d.pdu = 2; @@ -36,12 +37,14 @@ if (actx->rose_ctx->fillin_ptr) g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size); - if (!res_next_tvb) { /* empty result */ - res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0); - } - actx->pinfo->private_data = actx->rose_ctx; - call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); - if (!res_handle) { - expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr); + if (actx->rose_ctx->d.code != -1) { + if (!res_next_tvb) { /* empty result */ + res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0); + } + actx->pinfo->private_data = actx->rose_ctx; + call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); + if (!res_handle) { + expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr); + } } #.END diff --git a/epan/asn1.h b/epan/asn1.h index 743a28bbd6..beeb74ad91 100644 --- a/epan/asn1.h +++ b/epan/asn1.h @@ -162,6 +162,7 @@ typedef struct _rose_ctx_t { */ gint code; /* + -1 : none (optional in ReturnResult) 0 : local, 1 : global */ diff --git a/epan/dissectors/packet-h450-ros.c b/epan/dissectors/packet-h450-ros.c index bc37fa1b26..30114eeb57 100644 --- a/epan/dissectors/packet-h450-ros.c +++ b/epan/dissectors/packet-h450-ros.c @@ -289,12 +289,13 @@ dissect_h450_ros_ReturnResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act dissector_handle_t res_handle = NULL; const gchar *descr = ""; + actx->rose_ctx->d.code = -1; res_next_tvb = NULL; offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_h450_ros_ReturnResult, ReturnResult_sequence); -#line 12 "ros-res.cnf" +#line 13 "ros-res.cnf" actx->rose_ctx->d.pdu = 2; if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) { @@ -322,13 +323,15 @@ dissect_h450_ros_ReturnResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act if (actx->rose_ctx->fillin_ptr) g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size); - if (!res_next_tvb) { /* empty result */ - res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0); - } - actx->pinfo->private_data = actx->rose_ctx; - call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); - if (!res_handle) { - expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr); + if (actx->rose_ctx->d.code != -1) { + if (!res_next_tvb) { /* empty result */ + res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0); + } + actx->pinfo->private_data = actx->rose_ctx; + call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); + if (!res_handle) { + expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr); + } } return offset; diff --git a/epan/dissectors/packet-q932-ros.c b/epan/dissectors/packet-q932-ros.c index 076f2f862c..99abc58478 100644 --- a/epan/dissectors/packet-q932-ros.c +++ b/epan/dissectors/packet-q932-ros.c @@ -364,12 +364,13 @@ dissect_q932_ros_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int dissector_handle_t res_handle = NULL; const gchar *descr = ""; + actx->rose_ctx->d.code = -1; res_next_tvb = NULL; offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, ReturnResult_sequence, hf_index, ett_q932_ros_ReturnResult); -#line 12 "ros-res.cnf" +#line 13 "ros-res.cnf" actx->rose_ctx->d.pdu = 2; if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) { @@ -397,13 +398,15 @@ dissect_q932_ros_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int if (actx->rose_ctx->fillin_ptr) g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size); - if (!res_next_tvb) { /* empty result */ - res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0); - } - actx->pinfo->private_data = actx->rose_ctx; - call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); - if (!res_handle) { - expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr); + if (actx->rose_ctx->d.code != -1) { + if (!res_next_tvb) { /* empty result */ + res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0); + } + actx->pinfo->private_data = actx->rose_ctx; + call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree); + if (!res_handle) { + expert_add_info_format(actx->pinfo, tree, PI_UNDECODED, PI_WARN, "Undecoded %s", descr); + } } return offset; |