diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-09-10 05:57:30 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-09-10 05:57:30 +0000 |
commit | 8a23b29c91d1e57c5c6b18a8a767ed77a1cc081b (patch) | |
tree | 40000abb2e8e755f0015df8fc4c981169cec5873 /asn1 | |
parent | c6c330b092caaa12f42b865600d2377e0a977ffc (diff) |
From Alex Lindberg:
Add H248V1 suport.
(H248 dissector fails on poorly formed AuditReply packet from Media Gateway)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3953
svn path=/trunk/; revision=29835
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/h248/Makefile.common | 3 | ||||
-rw-r--r-- | asn1/h248/h248.cnf | 62 | ||||
-rw-r--r-- | asn1/h248/h248v1support.asn | 49 | ||||
-rw-r--r-- | asn1/h248/packet-h248-template.c | 16 |
4 files changed, 128 insertions, 2 deletions
diff --git a/asn1/h248/Makefile.common b/asn1/h248/Makefile.common index def870ceb3..eac4e7e8cc 100644 --- a/asn1/h248/Makefile.common +++ b/asn1/h248/Makefile.common @@ -29,7 +29,8 @@ NEED_PACKET_PROTO_H = 1 EXT_ASN_FILE_LIST = -ASN_FILE_LIST = h248v3.asn +ASN_FILE_LIST = h248v3.asn \ + h248v1support.asn # The packet-$(PROTOCOL_NAME)-template.h and $(PROTOCOL_NAME).asn # files do not exist for all protocols: Please add/remove as required. diff --git a/asn1/h248/h248.cnf b/asn1/h248/h248.cnf index 5f87b43e42..b98fb65ac5 100644 --- a/asn1/h248/h248.cnf +++ b/asn1/h248/h248.cnf @@ -94,6 +94,10 @@ TransactionPending/transactionId tpend_transactionId gcp_analyze_msg(h248_tree, h248_tvb, curr_info.msg, &h248_arrel); #.END +#.FN_BODY Message/version VAL_PTR = &h248_version + %(DEFAULT_BODY)s +#.END + #.FN_BODY TransactionRequest/transactionId guint32 trx_id = 0; offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id); @@ -253,11 +257,37 @@ TransactionPending/transactionId tpend_transactionId H248_TAP(); #.END +#.FN_BODY CommandReply/auditCapReply +/* h248v1 support */ + if(h248_version > 1) { + %(DEFAULT_BODY)s +} else { + /* call V1 of the dissector */ + offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); +} +#.END + #.FN_HDR CommandReply/auditValueReply curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITVAL_REPLY,offset,keep_persistent_data); H248_TAP(); #.END +#.FN_BODY CommandReply/auditValueReply +/* h248v1 support */ + if(h248_version > 1) { + %(DEFAULT_BODY)s +} else { + /* call V1 of the dissector */ + offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); +} +#.END + +#.FN_BODY AuditReplyV1 +/* h248v1 support */ + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, + AuditReplyV1_sequence, hf_h248_auditValueReplyV1, ett_h248_AuditReplyV1); +#.END + #.FN_BODY ErrorDescriptor/errorCode offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_h248_error_code, &error_code); expert_add_info_format(actx->pinfo, actx->created_item, PI_RESPONSE_CODE, PI_WARN, "Errored Command"); @@ -317,7 +347,18 @@ TransactionPending/transactionId tpend_transactionId } #.END - +#.FN_BODY SCreasonValue +/* H248 v1 support */ + if ( h248_version >1 ) { + /* Not V1, so call "standard" function */ +%(DEFAULT_BODY)s +} else { + /* V1 so Value == octet string */ + offset = dissect_h248_ValueV1( implicit_tag, tvb, offset, actx, tree, hf_index); +}; + +#.END + #.FN_BODY SCreasonValueOctetStr VAL_PTR = ¶meter_tvb tvbuff_t *parameter_tvb; @@ -327,6 +368,25 @@ TransactionPending/transactionId tpend_transactionId return offset; dissect_h248_ServiceChangeReasonStr(FALSE, parameter_tvb, 0, actx, tree, hf_h248_serviceChangeReasonStr); +#.END + +#.FN_BODY EventParameter +/* H248 v1 support */ + if (h248_version >1) { + %(DEFAULT_BODY)s +} else { + offset = dissect_h248_EventParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); +} +#.END + +#.FN_BODY PropertyParm +/* H248 v1 support */ + if (h248_version >1) { + %(DEFAULT_BODY)s +} else { + offset = dissect_h248_PropertyParmV1( implicit_tag, tvb, offset, actx, tree, hf_index); +} +#.END #.TYPE_ATTR IP4Address/address TYPE = FT_IPv4 DISPLAY = BASE_NONE STRINGS = NULL diff --git a/asn1/h248/h248v1support.asn b/asn1/h248/h248v1support.asn new file mode 100644 index 0000000000..ac38fc0aa7 --- /dev/null +++ b/asn1/h248/h248v1support.asn @@ -0,0 +1,49 @@ +-- Required for support for h248v1 +-- +-- $Id$ +-- +-- This file represents the differences between h248v1 and the h248v3, the current version +-- This file is included in the Makefile generate_dissectors and related tasks necessary +-- to generate epan/dissectors/packet-h248.[ch] + +H238V1-SUPPORT DEFINITIONS IMPLICIT TAGS ::= +BEGIN + + -- V1 version of AuditReply + AuditReplyV1 ::= SEQUENCE + { + terminationID [0] TerminationID, + auditResult [1] AuditResultV1 + } + + -- V1 Version of AuditResult + AuditResultV1 ::= CHOICE + { + contectAuditResult [0] TerminationID, + terminationAuditResult [1] TerminationAudit + } + + -- V1 + EventParameterV1 ::= SEQUENCE + { + eventParamterName [0] Name, + value [1] ValueV1 + } + + -- V1 + PropertyParmV1 ::= SEQUENCE + { + name [0] PkgdName, + value [1] SEQUENCE OF OCTET STRING, + extraInfo [2] CHOICE + { + relation [0] Relation, + range [1] BOOLEAN, + sublist [2] BOOLEAN + } OPTIONAL, + ... + } + + ValueV1 ::= OCTET STRING + +END
\ No newline at end of file diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c index 994e4cc35f..e373407c12 100644 --- a/asn1/h248/packet-h248-template.c +++ b/asn1/h248/packet-h248-template.c @@ -63,6 +63,9 @@ static int hf_h248_param = -1; static int hf_h248_serviceChangeReasonStr = -1; +/* h248v1 support */ +static int hf_h248_auditValueReplyV1 = -1; + #include "packet-h248-hf.c" /* Initialize the subtree pointers */ @@ -106,6 +109,12 @@ static dissector_handle_t h248_tpkt_handle; /* Forward declarations */ static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +/* h248v1 support */ +static int dissect_h248_AuditReplyV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +static int dissect_h248_ValueV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +static int dissect_h248_EventParameterV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +static int dissect_h248_PropertyParmV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); + /* http://www.iana.org/assignments/megaco-h248 last updated 2007-11-28*/ static const value_string package_name_vals[] = { { 0x0000, "Media stream properties H.248.1 Annex C" }, @@ -659,6 +668,7 @@ static const value_string wildcard_levels[] = { static h248_curr_info_t curr_info = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; static guint32 error_code; +static guint32 h248_version = 0; /* h248v1 support */ static gcp_wildcard_t wild_term; static guint8 wild_card = 0xFF; /* place to store wildcardField */ @@ -1422,6 +1432,12 @@ void proto_register_h248(void) { FT_STRING, BASE_NONE, NULL, 0, "h248.IA5String", HFILL }}, +/* h248v1 support */ + { &hf_h248_auditValueReplyV1, + { "auditValueReplyV1", "h248.auditValueReplyV1", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL }}, + #include "packet-h248-hfarr.c" GCP_HF_ARR_ELEMS("h248",h248_arrel) |