From 9b3d4ae0a13ebacc8b0a570e58b5ba83dfdefee0 Mon Sep 17 00:00:00 2001 From: sahlberg Date: Thu, 15 Nov 2007 10:38:43 +0000 Subject: only dissect it as t125 if it looks like t125 dissect_ber_choice() returns the index of the choice taken not the tag value git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23460 f5534014-38df-0310-8fa8-9805f1628bb7 --- asn1/t125/packet-t125-template.c | 18 +++++++++--------- asn1/t125/t125.cnf | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'asn1') diff --git a/asn1/t125/packet-t125-template.c b/asn1/t125/packet-t125-template.c index 04106c447d..b28e8890ee 100644 --- a/asn1/t125/packet-t125-template.c +++ b/asn1/t125/packet-t125-template.c @@ -22,14 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * To quote the author of the previous H245 dissector: - * "This is a complete replacement of the previous limitied dissector - * that Ronnie was crazy enough to write by hand. It was a lot of time - * to hack it by hand, but it is incomplete and buggy and it is good when - * it will go away." - * Ronnie did a great job and all the VoIP users had made good use of it! - * Credit to Tomas Kukosa for developing the asn2wrs compiler. - * */ #ifdef HAVE_CONFIG_H @@ -68,6 +60,9 @@ dissect_t125(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree) { proto_item *item = NULL; proto_tree *tree = NULL; + gint8 class; + gboolean pc; + gint32 tag; if (check_col(pinfo->cinfo, COL_PROTOCOL)){ col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.125"); @@ -79,8 +74,13 @@ dissect_t125(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree) item = proto_tree_add_item(parent_tree, proto_t125, tvb, 0, tvb_length(tvb), FALSE); tree = proto_item_add_subtree(item, ett_t125); + get_ber_identifier(tvb, 0, &class, &pc, &tag); - dissect_ConnectMCSPDU_PDU(tvb, pinfo, tree); + if ( (class==BER_CLASS_APP) && (tag>=101) && (tag<=104) ){ + dissect_ConnectMCSPDU_PDU(tvb, pinfo, tree); + } else { + proto_tree_add_text(tree, tvb, 0, -1, "T.125 payload"); + } return tvb_length(tvb); } diff --git a/asn1/t125/t125.cnf b/asn1/t125/t125.cnf index 1adccdeff7..978779ea09 100644 --- a/asn1/t125/t125.cnf +++ b/asn1/t125/t125.cnf @@ -19,22 +19,24 @@ DomainMCSPDU #---------------------------------------------------------------------------------------- #.FN_BODY ConnectMCSPDU VAL_PTR = &connectmcs_value - guint32 connectmcs_value; + gint connectmcs_value; %(DEFAULT_BODY)s - if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){ - col_add_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "MCS: %%s ", - val_to_str(connectmcs_value, t125_ConnectMCSPDU_vals, "")); + if( (connectmcs_value!=-1) && t125_ConnectMCSPDU_vals[connectmcs_value].strptr ){ + if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){ + col_add_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "MCS: %%s ", t125_ConnectMCSPDU_vals[connectmcs_value].strptr); + } } #.END #.FN_BODY DomainMCSPDU VAL_PTR = &domainmcs_value - guint32 domainmcs_value; + gint domainmcs_value; %(DEFAULT_BODY)s - if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){ - col_add_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "MCS: %%s ", - val_to_str(domainmcs_value, t125_DomainMCSPDU_vals, "")); + if( (domainmcs_value!=-1) && t125_DomainMCSPDU_vals[domainmcs_value].strptr ){ + if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){ + col_add_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "MCS: %%s ", t125_DomainMCSPDU_vals[domainmcs_value].strptr); + } } #.END -- cgit v1.2.3