diff options
-rw-r--r-- | asn1/h248/h248.cnf | 97 | ||||
-rw-r--r-- | asn1/h248/h248v1support.asn | 17 | ||||
-rw-r--r-- | asn1/h248/packet-h248-template.c | 362 | ||||
-rw-r--r-- | asn1/h248/packet-h248-template.h | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-h248.c | 684 | ||||
-rw-r--r-- | epan/dissectors/packet-h248.h | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_10.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_2.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_3gpp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_7.c | 41 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_annex_c.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_annex_e.c | 109 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_q1950.c | 13 |
13 files changed, 727 insertions, 640 deletions
diff --git a/asn1/h248/h248.cnf b/asn1/h248/h248.cnf index 1aa47ed058..2981f51acb 100644 --- a/asn1/h248/h248.cnf +++ b/asn1/h248/h248.cnf @@ -22,7 +22,7 @@ EventParameterName EventParamValue ContextID EventParamValueV1 -#SigParamValueV1 +SigParamValueV1 #.TYPE_RENAME IndAudMediaDescriptor/streams IndAudMediaDescriptorStreams @@ -47,6 +47,8 @@ IndAudEventBufferDescriptor/eventName iAEBDEventName TerminationID/id terminationId IndAudStreamParms/localControlDescriptor iASPLocalControlDescriptor IndAudStreamParms/localDescriptor iASPLocalDescriptor +LocalControlDescriptor/propertyParms lCDpropertyParms +TerminationStateDescriptor/propertyParms tSDpropertyParms MediaDescriptor/streams/oneStream mediaDescriptorOneStream MediaDescriptor/streams/multiStream mediaDescriptorMultiStream MediaDescriptor/streams/multiStream/_item mediaDescriptorMultiStream_item @@ -64,12 +66,15 @@ IndAudSignal/signalName iASignalName IndAudSeqSigList/signalList iASignalList IndAudSignalsDescriptor/signal indAudSignal IndAudSignalsDescriptor/seqSigList indAudSeqSigList -IndAudTerminationStateDescriptor/serviceState iATSDServiceState +IndAudTerminationStateDescriptor/serviceState iATSDServiceState IndAudStreamParms/remoteDescriptor iASPRemoteDescriptor PropertyParm/value propertyParamValue IndAudMediaDescriptor/streams indAudMediaDescriptorStreams AmmRequest/terminationID terminationIDList AmmsReply/terminationID terminationIDList +AmmDescriptor/statisticsDescriptor aDstatisticsDescriptor +AuditReturnParameter/statisticsDescriptor aRPstatisticsDescriptor +StreamParms/statisticsDescriptor sPstatisticsDescriptor SubtractRequest/terminationID terminationIDList NotifyRequest/terminationID terminationIDList NotifyReply/terminationID terminationIDList @@ -83,12 +88,10 @@ TransactionRequest/transactionId transactionId SegmentReply/transactionId seg_rep_transactionId TransactionReply/transactionId trep_transactionId TransactionPending/transactionId tpend_transactionId -PropertyParmV1/values prop_param_values EventParameterV1/value event_param_value SigParameterV1/value sig_param_value -PropertyParmV1/value prop_parm_value AuditReplyV1/auditResult audit_result -PropertyParmV1/extraInfo extra_info + #.FN_HDR Message curr_info.msg = gcp_msg(actx->pinfo,tvb_raw_offset(tvb),keep_persistent_data); @@ -96,12 +99,12 @@ PropertyParmV1/extraInfo extra_info #.FN_FTR Message col_add_str(actx->pinfo->cinfo, COL_INFO, gcp_msg_to_str(curr_info.msg,keep_persistent_data)); - + if (keep_persistent_data) gcp_analyze_msg(h248_tree, h248_tvb, curr_info.msg, &h248_arrel); #.END -#.FN_BODY Message/version VAL_PTR = &h248_version +#.FN_BODY Message/version VAL_PTR = &h248_version %(DEFAULT_BODY)s #.END @@ -118,7 +121,7 @@ PropertyParmV1/extraInfo extra_info curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_PENDING, keep_persistent_data); error_code = 0; -#.FN_BODY TransactionReply/transactionId +#.FN_BODY TransactionReply/transactionId guint32 trx_id = 0; offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id); curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_REPLY, keep_persistent_data); @@ -269,8 +272,8 @@ PropertyParmV1/extraInfo extra_info 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); + /* call V1 of the dissector */ + offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); } #.END @@ -284,8 +287,8 @@ PropertyParmV1/extraInfo extra_info 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); + /* call V1 of the dissector */ + offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); } #.END @@ -298,13 +301,13 @@ PropertyParmV1/extraInfo extra_info #.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"); - + if (curr_info.cmd) { gcp_cmd_set_error(curr_info.cmd,error_code); } else if (curr_info.trx) { gcp_trx_set_error(curr_info.trx,error_code); } - + return offset; #.END @@ -324,13 +327,13 @@ PropertyParmV1/extraInfo extra_info wild_term = tvb_get_guint8(new_tvb,0) & 0x80 ? GCP_WILDCARD_CHOOSE : GCP_WILDCARD_ALL; /* limitation: assume only one wildcard is used */ wild_card = tvb_get_guint8(new_tvb,0); - + #.END #.FN_BODY TerminationID/id tvbuff_t* new_tvb; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); - + if (new_tvb) { curr_info.term->len = tvb_length(new_tvb); curr_info.term->type = 0; /* unknown */ @@ -343,9 +346,9 @@ PropertyParmV1/extraInfo extra_info curr_info.term = gcp_cmd_add_term(curr_info.msg, curr_info.trx, curr_info.cmd, curr_info.term, wild_term, keep_persistent_data); if (h248_term_handle) { - actx->pinfo->private_data = &wild_card; + actx->pinfo->private_data = &wild_card; call_dissector(h248_term_handle, new_tvb, actx->pinfo, tree); - wild_card = 0xFF; + wild_card = 0xFF; } } else { curr_info.term->len = 0; @@ -356,18 +359,17 @@ PropertyParmV1/extraInfo extra_info #.FN_BODY SCreasonValue /* H248 v1 support */ - if ( h248_version >1 ) { + if ( h248_version > 1 ) { /* Not V1, so call "standard" function */ -%(DEFAULT_BODY)s +%(DEFAULT_BODY)s } else { - /* V1 so Value == octet string */ - offset = dissect_h248_ValueV1( implicit_tag, tvb, offset, actx, tree, hf_index); + /* 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; %(DEFAULT_BODY)s @@ -385,47 +387,44 @@ PropertyParmV1/extraInfo extra_info #.FN_BODY ValueV1 /* check tvb to verify all values ascii or not. If so, output string, else hex */ len=tvb_length_remaining(tvb, offset); - for( i=0;i<len;i++) { - if(!isascii(tvb_get_guint8(tvb, offset+i)) || tvb_get_guint8(tvb, offset+i) == 0) { - /* not ascii or NULL character so do string as hex string */ - proto_tree_add_text(tree, tvb, offset, len,"%s: 0x%s", - (proto_registrar_get_nth(hf_index))->name, - tvb_bytes_to_str(tvb, 0, len)); - return len; + if ( curr_info.par && curr_info.par->dissector) { + curr_info.par->dissector(tree, /*next_*/tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); + } else { + /* if no registered dissector create output */ + for( i=0;i<len;i++) { + if(!isascii(tvb_get_guint8(tvb, offset+i)) || tvb_get_guint8(tvb, offset+i) == 0) { + /* not ascii or NULL character so do string as hex string */ + proto_tree_add_text(tree, tvb, offset, len,"%s: 0x%s", + (proto_registrar_get_nth(hf_index))->name, + tvb_bytes_to_str(tvb, 0, len)); + return len; + }; }; - }; - /* if here, then string is ascii */ - proto_tree_add_text(tree, tvb, offset, len,"%s: %s", - (proto_registrar_get_nth(hf_index))->name, - tvb_format_text(tvb, 0, len)); + /* if here, then string is ascii */ + proto_tree_add_text(tree, tvb, offset, len,"%s: %s", + (proto_registrar_get_nth(hf_index))->name, + tvb_format_text(tvb, 0, len)); + } offset = len; + #.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); + offset = dissect_h248_EventParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); } #.END #.FN_BODY SigParameter /* H248 v1 support */ - if (h248_version >1) { - %(DEFAULT_BODY)s -} else { - offset = dissect_h248_SigParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); -} -#.END - - -#.FN_BODY PropertyParm -/* H248 v1 support */ - if (h248_version >1) { + if (h248_version > 1) { %(DEFAULT_BODY)s } else { - offset = dissect_h248_PropertyParmV1( implicit_tag, tvb, offset, actx, tree, hf_index); + offset = dissect_h248_SigParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); } #.END diff --git a/asn1/h248/h248v1support.asn b/asn1/h248/h248v1support.asn index a7b103682b..4c594280c2 100644 --- a/asn1/h248/h248v1support.asn +++ b/asn1/h248/h248v1support.asn @@ -31,24 +31,13 @@ BEGIN } -- 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, - ... - } - - -- V1 + SigParameterV1 ::= SEQUENCE { sigParameterName [0] SigParameterName, value [1] SigParamValueV1 +-- value [1] ValueV1 + } ValueV1 ::= OCTET STRING diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c index e553658814..895e69755f 100644 --- a/asn1/h248/packet-h248-template.c +++ b/asn1/h248/packet-h248-template.c @@ -41,6 +41,7 @@ /* Initialize the protocol and registered fields */ static int proto_h248 = -1; +static int hf_248_magic_num = -1; static int hf_h248_mtpaddress_ni = -1; static int hf_h248_mtpaddress_pc = -1; static int hf_h248_pkg_name = -1; @@ -89,6 +90,7 @@ static gcp_hf_ett_t h248_arrel = {{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1}}; #include "packet-h248-ett.c" static dissector_handle_t h248_term_handle; +static dissector_table_t subdissector_table; static emem_tree_t* msgs = NULL; static emem_tree_t* trxs = NULL; @@ -114,13 +116,25 @@ static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t * /* 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); static int dissect_h248_SigParameterV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +static int dissect_h248_SigParamValueV1(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); +#if 0 +static const value_string context_id_type[] = { + {NULL_CONTEXT,"0 (Null Context)"}, + {CHOOSE_CONTEXT,"$ (Choose Context)"}, + {ALL_CONTEXTS,"* (All Contexts)"}, + {0,NULL} +}; +#endif + +/* the following value_strings are used to build defalut packages. + To add additional detail to a package, build a register a h248_package_t structure + */ -/* 2010-11-15: New entries added based on: http://www.iana.org/assignments/megaco-h248 last updated 2010-10-01 */ -static const value_string package_name_vals[] = { +static const value_string base_package_name_vals[] = { { 0x0000, "Media stream properties H.248.1 Annex C" }, { 0x0001, "Generic H.248.1 Annex E" }, { 0x0002, "root H.248.1 Annex E" }, @@ -325,7 +339,6 @@ static const value_string package_name_vals[] = { { 0x00cd, "Resource Management Rules Package" }, /* H.248.63 */ { 0x00ce, "Resource Management Configuration Package" }, /* H.248.63 */ { 0x00cf, "Abstract Resource Management Packages" }, /* H.248.63 */ - { 0x00d0, "IP layer octets count statistics Package" }, /* H.248.61 */ { 0x00d1, "Content of Communication Identity Package" }, /* H.248.60 */ { 0x00d2, "RSVP extension package" }, /* H.248.65 */ @@ -385,7 +398,6 @@ static const value_string package_name_vals[] = { { 0x0108, "MGC Controlled Bearer Level ALG Package" }, /* H.248.78 */ { 0x0109, "Enhanced Revised Offer/Answer SDP Support Package" }, /* H.248.80 */ { 0x010a, "Enhanced SDP Media Capabilities Negotiation Support Package" }, /* H.248.80 */ - { 0x8000, "Ericsson IU" }, { 0x8001, "Ericsson UMTS and GSM Circuit" }, { 0x8002, "Ericsson Tone Generator Package" }, @@ -403,16 +415,14 @@ static const value_string package_name_vals[] = { { 0x800e, "Ericsson Tracing Enhancements Package" }, { 0x800f, "Ericsson Partially Wildcarded TerminationID Package" }, { 0x8010, "SCTP Stream Handling Package" }, - {0, NULL} }; -static value_string_ext package_name_vals_ext = VALUE_STRING_EXT_INIT(package_name_vals); /* * This table consist of PackageName + EventName and its's corresponding string * */ -static const value_string event_name_vals[] = { +static const value_string base_event_name_vals[] = { { 0x00000000, "Media stream properties H.248.1 Annex C" }, { 0x00010000, "g H.248.1 Annex E" }, { 0x00010001, "g/Cause" }, @@ -473,12 +483,11 @@ static const value_string event_name_vals[] = { { 0x800a0000, "Nokia Bearer Characteristics Package" }, {0, NULL} }; -static value_string_ext event_name_vals_ext = VALUE_STRING_EXT_INIT(event_name_vals); /* * This table consist of PackageName + SignalName and its's corresponding string */ -static const value_string signal_name_vals[] = { +static const value_string base_signal_name_vals[] = { { 0x00000000, "Media stream properties H.248.1 Annex C" }, { 0x00010000, "g H.248.1 Annex E" }, { 0x00030001, "tonegen/pt(Play tone)" }, @@ -515,31 +524,17 @@ static const value_string signal_name_vals[] = { { 0x00210001, "GB/EstBNC(Establish BNC)" }, { 0x00210002, "GB/ModBNC (Modify BNC)" }, { 0x00210003, "GB/RelBNC(Release BNC)" }, - { 0x002a0001, "H.245/cs (channel state)" }, { 0x002a0002, "H.245/termtype (Terminal Type)" }, - { 0x002c0001, "H.324/cmod (Communication mode)" }, { 0x002c0002, "H.324/muxlv (Highest Multiplexing level)" }, { 0x002c0003, "H.324/demux (Demultiplex)" }, { 0x002c0004, "H.324/h223capr (Remote H.223 capability)" }, { 0x002c0005, "H.324/muxtbl_in (Incoming Multiplex Table)" }, { 0x002c0006, "H.324/muxtbl_out (Outgoing Multiplex Table)" }, - { 0x800a0000, "Nokia Bearer Characteristics Package" }, {0, NULL} }; -static value_string_ext signal_name_vals_ext = VALUE_STRING_EXT_INIT(signal_name_vals); - -#if 0 -static const value_string context_id_type[] = { - {NULL_CONTEXT,"0 (Null Context)"}, - {CHOOSE_CONTEXT,"$ (Choose Context)"}, - {ALL_CONTEXTS,"* (All Contexts)"}, - {0,NULL} -}; -#endif - static const value_string h248_reasons[] = { @@ -708,13 +703,13 @@ extern void h248_param_ber_integer(proto_tree* tree, tvbuff_t* tvb, packet_info* extern void h248_param_ber_octetstring(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) { asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - dissect_ber_octet_string(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); + dissect_ber_octet_string(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); } extern void h248_param_ber_boolean(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) { asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - dissect_ber_boolean(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); + dissect_ber_boolean(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); } extern void h248_param_bytes_item(proto_tree* tree, @@ -747,14 +742,14 @@ static const h248_pkg_sig_t no_signal = { 0, &hf_h248_no_sig, &ett_h248_no_sig, static const h248_pkg_param_t no_param = { 0, &hf_h248_param, h248_param_uint_item, NULL }; static const h248_pkg_evt_t no_event = { 0, &hf_h248_no_evt, &ett_h248_no_evt, NULL, NULL }; -static GPtrArray* packages = NULL; +const h248_package_t *find_package_id(guint16 pkgid); +static GTree* packages = NULL; extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u1 _U_, void* u2 _U_) { tvbuff_t *new_tvb = NULL; proto_tree *package_tree=NULL; guint16 name_major, name_minor; const h248_package_t* pkg = NULL; - guint i; int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -765,10 +760,10 @@ extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pi /* this field is always 4 bytes so just read it into two integers */ name_major=tvb_get_ntohs(new_tvb, 0); name_minor=tvb_get_ntohs(new_tvb, 2); - + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(asn1_ctx.created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ @@ -776,20 +771,8 @@ extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pi const gchar* strval; package_tree = proto_item_add_subtree(asn1_ctx.created_item, ett_packagename); - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); - - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; - + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); pi = proto_tree_add_uint(package_tree, hf_248_pkg_param, tvb, offset-2, 2, name_minor); @@ -893,12 +876,131 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_ return offset; } -void h248_register_package(const h248_package_t* pkg) { - if (! packages) packages = g_ptr_array_new(); +s_h248_package_t *s_find_package_id(guint16 pkgid) { + s_h248_package_t *s_pkg = NULL; + s_pkg = g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid))); + return s_pkg; +} - g_ptr_array_add(packages,(void*)pkg); +const h248_package_t *find_package_id(guint16 pkgid) { + s_h248_package_t *s_pkg = NULL; + s_pkg = s_find_package_id(pkgid); /*(packages, GUINT_TO_POINTER((guint32)(pkgid))); */ + if (! s_pkg ) return &no_package; + return s_pkg->pkg; } +static gint32 comparePkgID(gconstpointer a, gconstpointer b) { + return GPOINTER_TO_UINT(b) - GPOINTER_TO_UINT(a); +} + +gboolean is_pkg_default(guint16 pkgid) { + s_h248_package_t *s_pkg = NULL; + s_pkg = g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid))); + if(! s_pkg ) return TRUE; + return s_pkg->is_default; +} + +void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action) { + h248_package_t *pkg_found = NULL, *pkg_high = NULL, *pkg_low = NULL; + s_h248_package_t *s_pkg = NULL; + value_string *vst; + gboolean pkg_default = FALSE; + gint j = 0, idx = 0, i = 0, k = 0; + if (! packages) { + /* no packaegs are yet registerd so create tree and add default packages to tree + */ + packages = g_tree_new(comparePkgID); /* init tree if no entries */ + while (base_package_name_vals[i].strptr != NULL) { + pkg_found = g_new0(h248_package_t, 1); /* create a h248 package structure */ + pkg_found->id = base_package_name_vals[i].value; + vst = g_new0(value_string,2); + vst[0].strptr = base_package_name_vals[i].strptr; + pkg_found->param_names = vst; + pkg_found->hfid = &hf_h248_pkg_name; + pkg_found->ett = &ett_packagename; + match_strval_idx((pkg_found->id)<<16,base_event_name_vals, &j); + /* now look for events and signals that may be defined for package. If found, create value_strings */ + if (j != -1) { + j++; idx=j; + while((base_event_name_vals[j].strptr!=NULL) && (((base_event_name_vals[j].value)>>16) == (pkg_found->id))) { + j++; + }; + if (idx < j) { + vst = g_new0(value_string,j-idx+1); + for (k=0;idx<j;k++) { + vst[k].strptr = base_event_name_vals[idx].strptr; + vst[k].value = (base_event_name_vals[idx].value & 0xffff); + idx++; + }; + pkg_found->event_names = vst; + } + } + /* now look at signals */ + if (!match_strval_idx((pkg_found->id)<<16, base_signal_name_vals, &j)) { + j++; idx=j; + while((base_signal_name_vals[j].strptr != NULL) && ((base_signal_name_vals[j].value>>16) == (pkg_found->id))) { + }; + if (idx < j) { + vst = g_new0(value_string,j-idx+1); + for (k=0;idx<i;k++) { + vst[k].strptr = base_signal_name_vals[idx].strptr; + vst[k].value = (base_signal_name_vals[idx].value &0xffff); + idx++; + }; + pkg_found->signal_names = vst; + } + }; + s_pkg = g_new0(s_h248_package_t,1); + s_pkg->is_default = TRUE; + s_pkg->pkg = pkg_found; + g_tree_insert(packages, GINT_TO_POINTER(pkg_found->id), (gpointer)s_pkg); + i++; + }; + pkg_found = NULL; /* reset pointer */ + }; + pkg_default = is_pkg_default(pkg->id); + if (((reg_action==REPLACE_PKG) || (reg_action==ADD_PKG)) && pkg_default) { + /* add/replace in tree */ + s_pkg = g_new0(s_h248_package_t,1); + s_pkg->is_default = FALSE; + s_pkg->pkg = (h248_package_t *)pkg; + g_tree_replace(packages, GINT_TO_POINTER(pkg->id), (gpointer)s_pkg); + return; + }; + if(pkg_default) reg_action = MERGE_PKG_HIGH; /* always make new package overide default */ + s_pkg = s_find_package_id(pkg->id); + if (s_pkg == NULL) { /* no need to merge - package not in tree */ + s_pkg = g_new0(s_h248_package_t,1); + s_pkg->is_default = FALSE; + s_pkg->pkg = (h248_package_t *)pkg; + g_tree_insert(packages, GINT_TO_POINTER(pkg->id), (gpointer)s_pkg); + return; + } + pkg_found = s_pkg->pkg; + if (reg_action==MERGE_PKG_HIGH) { + pkg_high = (h248_package_t *)pkg; + pkg_low = pkg_found; + }; + if (reg_action==MERGE_PKG_LOW) { + pkg_high = pkg_found; + pkg_low = (h248_package_t *)pkg; + }; + /* if h248_package_t High Priority value !NULL, replace it in the found tree entry else use current entry */ + (pkg_high->hfid ? (pkg_found->hfid=pkg_high->hfid) : (pkg_found->hfid=pkg_low->hfid)); + (pkg_high->ett ? (pkg_found->ett=pkg_high->ett ):( pkg_found->ett=pkg_low->ett)); + (pkg_high->param_names ? (pkg_found->param_names=pkg_high->param_names ):( pkg_found->param_names=pkg_low->param_names)); + (pkg_high->signal_names ? (pkg_found->signal_names=pkg_high->signal_names ):( pkg_found->signal_names=pkg_low->signal_names)); + (pkg_high->event_names ? (pkg_found->event_names=pkg_high->event_names ):( pkg_found->event_names=pkg_low->event_names)); + (pkg_high->stats_names ? (pkg_found->stats_names=pkg_high->stats_names ):( pkg_found->stats_names=pkg_low->stats_names)); + (pkg_high->properties ? (pkg_found->properties=pkg_high->properties ):( pkg_found->properties=pkg_low->properties)); + (pkg_high->signals ? (pkg_found->signals=pkg_high->signals ):( pkg_found->signals=pkg_low->signals)); + (pkg_high->events ? (pkg_found->events=pkg_high->events ):( pkg_found->events=pkg_low->events)); + (pkg_high->statistics ? (pkg_found->statistics=pkg_high->statistics ):( pkg_found->statistics=pkg_low->statistics)); + s_pkg->pkg = pkg_found; + s_pkg->is_default = FALSE; +} + + static guint32 packageandid; static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { @@ -906,8 +1008,7 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse proto_tree *package_tree=NULL; guint16 name_major, name_minor; const h248_package_t* pkg = NULL; - guint i; - + offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); if (new_tvb) { @@ -916,28 +1017,18 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse name_minor=tvb_get_ntohs(new_tvb, 2); packageandid=(name_major<<16)|name_minor; + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(actx->created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ package_tree = proto_item_add_subtree(actx->created_item, ett_packagename); - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "PkgName%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); } - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; - { proto_item* pi = proto_tree_add_uint(package_tree, hf_248_pkg_param, tvb, offset-2, 2, name_minor); const gchar* strval; @@ -965,7 +1056,6 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs guint16 name_major, name_minor; const h248_package_t* pkg = NULL; const h248_pkg_evt_t* evt = NULL; - guint i; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); @@ -975,27 +1065,16 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs name_minor=tvb_get_ntohs(new_tvb, 2); packageandid=(name_major<<16)|name_minor; + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(actx->created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ package_tree = proto_item_add_subtree(actx->created_item, ett_packagename); } - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); - - - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); curr_info.pkg = pkg; @@ -1042,7 +1121,6 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of guint16 name_major, name_minor; const h248_package_t* pkg = NULL; const h248_pkg_sig_t* sig; - guint i; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); @@ -1052,26 +1130,16 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of name_minor=tvb_get_ntohs(new_tvb, 2); packageandid=(name_major<<16)|name_minor; + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(actx->created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ package_tree = proto_item_add_subtree(actx->created_item, ett_packagename); } - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); - - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if (pkg->signals) { for (sig = pkg->signals; sig->hfid; sig++) { @@ -1116,10 +1184,8 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int gboolean pc, ind; gint32 tag; guint32 len; - /*guint16 name_major;*/ guint16 name_minor; int end_offset; - tvbuff_t *next_tvb; const h248_package_t* pkg; const h248_pkg_param_t* prop; @@ -1134,8 +1200,6 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int } - next_tvb = tvb_new_subset(tvb, offset , len , len ); - /*name_major = packageandid >> 16;*/ name_minor = packageandid & 0xffff; pkg = (curr_info.pkg) ? curr_info.pkg : &no_package; @@ -1149,16 +1213,16 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int } else { prop = &no_param; } - if (prop && prop->hfid ) { if (!prop->dissector) prop = &no_param; - prop->dissector(tree, next_tvb, actx->pinfo, *(prop->hfid), &curr_info, prop->data); + prop->dissector(tree, tvb, actx->pinfo, *(prop->hfid), &curr_info, prop->data); } return end_offset; } + static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; @@ -1200,7 +1264,6 @@ static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tv } static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { - tvbuff_t *next_tvb; int end_offset; gint8 class; gboolean pc, ind; @@ -1218,15 +1281,18 @@ static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, } - next_tvb = tvb_new_subset(tvb,offset,len,len); - if ( curr_info.par && curr_info.par->dissector) { - curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); + curr_info.par->dissector(tree, tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); } return end_offset; } +static int dissect_h248_SigParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { + return dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); +} + + static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; @@ -1275,60 +1341,34 @@ static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t * static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; - int end_offset; - gint8 class; - gboolean pc, ind; - gint32 tag; - guint32 len; - - offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - end_offset=offset+len; - - if( (class!=BER_CLASS_UNI) - ||(tag!=BER_UNI_TAG_OCTETSTRING) ){ - proto_tree_add_text(tree, tvb, offset-2, 2, "H.248 BER Error: OctetString expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag); + int old_offset, end_offset; + gint8 class1; + gboolean pc1, ind1; + gint32 tag1; + guint32 len1; + offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class1, &pc1, &tag1); + offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len1, &ind1); + end_offset=offset+len1; + /* check to see if 1) is octet string and 2) if another OS is embedded */ + if( !(tag1==BER_UNI_TAG_OCTETSTRING || tag1==BER_UNI_TAG_BOOLEAN || BER_UNI_TAG_ENUMERATED)) { /* allow octet string and boolean constructs */ + proto_tree_add_text(tree, tvb, offset-2, 2, "H.248 BER Error: OctetString expected but Class:%d PC:%d Tag:%d was unexpected", class1, pc1, tag1); return end_offset; - } - - - next_tvb = tvb_new_subset(tvb,offset,len,len); - - if ( curr_info.par && curr_info.par->dissector) { + } + next_tvb = tvb_new_subset(tvb,offset,len1,len1); + old_offset=offset; + offset = old_offset; /* restore initial offset before calling dissector functions */ + if ( curr_info.par && curr_info.par->dissector) { curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); } return end_offset; } -static int dissect_h248_EventParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { - tvbuff_t *next_tvb; - int end_offset; - gint8 class; - gboolean pc, ind; - gint32 tag; - guint32 len; - - offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - end_offset=offset+len; - - if( (class!=BER_CLASS_UNI) - ||(tag!=BER_UNI_TAG_OCTETSTRING) ){ - proto_tree_add_text(tree, tvb, offset-2, 2, "H.248 BER Error: OctetString expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag); - return end_offset; - } - - - next_tvb = tvb_new_subset(tvb,offset,len,len); - - if ( curr_info.par && curr_info.par->dissector) { - curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); - } - - return end_offset; +static int dissect_h248_EventParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { + return dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &tvb); } + static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *mtp_tree=NULL; @@ -1402,6 +1442,16 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } } + { + proto_item *hidden_item = NULL; + guint32 magic_num = 0, offset = 0; + magic_num = tvb_get_ntohl(tvb, offset); + hidden_item = proto_tree_add_uint(tree, hf_248_magic_num, tvb, offset, 4, magic_num); + PROTO_ITEM_SET_HIDDEN(hidden_item); + if( dissector_try_uint(subdissector_table, magic_num, tvb, pinfo, tree) ) { + return; + } + } } /* Make entry in the Protocol column on summary display */ @@ -1423,15 +1473,17 @@ void proto_register_h248(void) { /* List of fields */ static hf_register_info hf[] = { + { &hf_248_magic_num, { + "Magic Number for Avaya H248", "h248.magic_num", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_h248_mtpaddress_ni, { "NI", "h248.mtpaddress.ni", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_h248_mtpaddress_pc, { "PC", "h248.mtpaddress.pc", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, - { &hf_h248_pkg_name, { + { &hf_h248_pkg_name, { "Package", "h248.package_name", FT_UINT16, BASE_HEX|BASE_EXT_STRING, - &package_name_vals_ext, 0, NULL, HFILL }}, + NULL, 0, NULL, HFILL }}, { &hf_248_pkg_param, { "Parameter ID", "h248.package_paramid", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, @@ -1443,10 +1495,10 @@ void proto_register_h248(void) { NULL, 0, "Parameter ID", HFILL }}, { &hf_h248_event_name, { "Package and Event name", "h248.event_name", FT_UINT32, BASE_HEX|BASE_EXT_STRING, - &event_name_vals_ext, 0, "Package", HFILL }}, + NULL, 0, "Package", HFILL }}, { &hf_h248_signal_name, { "Package and Signal name", "h248.signal_name", FT_UINT32, BASE_HEX|BASE_EXT_STRING, - &signal_name_vals_ext, 0, "Package", HFILL }}, + NULL, 0, "Package", HFILL }}, { &hf_h248_pkg_bcp_BNCChar_PDU, { "BNCChar", "h248.package_bcp.BNCChar", FT_UINT32, BASE_DEC, VALS(gcp_term_types), 0, @@ -1532,6 +1584,8 @@ void proto_register_h248(void) { /* Register fields and subtrees */ proto_register_field_array(proto_h248, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + subdissector_table = register_dissector_table("h248.magic_num", "H248 Magic Num", FT_UINT32, BASE_HEX); h248_module = prefs_register_protocol(proto_h248, proto_reg_handoff_h248); prefs_register_bool_preference(h248_module, "ctx_info", diff --git a/asn1/h248/packet-h248-template.h b/asn1/h248/packet-h248-template.h index 0c4c0bad4b..5fb16ac5d7 100644 --- a/asn1/h248/packet-h248-template.h +++ b/asn1/h248/packet-h248-template.h @@ -28,7 +28,6 @@ #ifndef PACKET_H248_H #include <epan/gcp.h> - /*#include "packet-h248-exp.h"*/ typedef struct _h248_curr_info_t h248_curr_info_t; @@ -43,6 +42,13 @@ extern void h248_param_ber_boolean(proto_tree*, tvbuff_t*, packet_info* , int, h extern void external_dissector(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* dissector_handle); extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u _U_, void* dissector_hdl); +typedef enum { + ADD_PKG, /* add package at registration ONLY if no matching package ID */ + REPLACE_PKG, /* replace/add package at registration */ + MERGE_PKG_HIGH, /* merge h248_package_t at registration favor new package */ + MERGE_PKG_LOW /* merge h248_package_t at registration favor current package */ +} pkg_reg_action; + typedef struct _h248_pkg_param_t { guint32 id; int* hfid; @@ -88,6 +94,11 @@ typedef struct _h248_package_t { const h248_pkg_stat_t* statistics; } h248_package_t; +typedef struct _save_h248_package_t { + h248_package_t *pkg; + gboolean is_default; +} s_h248_package_t; + struct _h248_curr_info_t { gcp_ctx_t* ctx; gcp_trx_t* trx; @@ -101,6 +112,6 @@ struct _h248_curr_info_t { const h248_pkg_param_t* par; }; -void h248_register_package(const h248_package_t*); +void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action); #endif /* PACKET_H248_H */ diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c index d1848dc63f..c6035bc2e0 100644 --- a/epan/dissectors/packet-h248.c +++ b/epan/dissectors/packet-h248.c @@ -49,6 +49,7 @@ /* Initialize the protocol and registered fields */ static int proto_h248 = -1; +static int hf_248_magic_num = -1; static int hf_h248_mtpaddress_ni = -1; static int hf_h248_mtpaddress_pc = -1; static int hf_h248_pkg_name = -1; @@ -188,7 +189,7 @@ static int hf_h248_eventBufferDescriptor = -1; /* EventBufferDescriptor */ static int hf_h248_signalsDescriptor = -1; /* SignalsDescriptor */ static int hf_h248_digitMapDescriptor = -1; /* DigitMapDescriptor */ static int hf_h248_auditDescriptor = -1; /* AuditDescriptor */ -static int hf_h248_statisticsDescriptor = -1; /* StatisticsDescriptor */ +static int hf_h248_aDstatisticsDescriptor = -1; /* StatisticsDescriptor */ static int hf_h248_terminationAudit = -1; /* TerminationAudit */ static int hf_h248_terminationID = -1; /* TerminationID */ static int hf_h248_contextAuditResult = -1; /* TerminationIDList */ @@ -198,6 +199,7 @@ static int hf_h248_auditResultTermList = -1; /* TermListAuditResult */ static int hf_h248_terminationAuditResult = -1; /* TerminationAudit */ static int hf_h248_TerminationAudit_item = -1; /* AuditReturnParameter */ static int hf_h248_observedEventsDescriptor = -1; /* ObservedEventsDescriptor */ +static int hf_h248_aRPstatisticsDescriptor = -1; /* StatisticsDescriptor */ static int hf_h248_packagesDescriptor = -1; /* PackagesDescriptor */ static int hf_h248_emptyDescriptors = -1; /* AuditDescriptor */ static int hf_h248_auditToken = -1; /* T_auditToken */ @@ -219,7 +221,7 @@ static int hf_h248_indAudStreamParms = -1; /* IndAudStreamParms */ static int hf_h248_iASPLocalControlDescriptor = -1; /* IndAudLocalControlDescriptor */ static int hf_h248_iASPLocalDescriptor = -1; /* IndAudLocalRemoteDescriptor */ static int hf_h248_iASPRemoteDescriptor = -1; /* IndAudLocalRemoteDescriptor */ -static int hf_h248_statisticsDescriptor_01 = -1; /* IndAudStatisticsDescriptor */ +static int hf_h248_statisticsDescriptor = -1; /* IndAudStatisticsDescriptor */ static int hf_h248_iALCDStreamMode = -1; /* NULL */ static int hf_h248_iALCDReserveValue = -1; /* NULL */ static int hf_h248_iALCDReserveGroup = -1; /* NULL */ @@ -277,11 +279,12 @@ static int hf_h248_streamParms = -1; /* StreamParms */ static int hf_h248_localControlDescriptor = -1; /* LocalControlDescriptor */ static int hf_h248_localDescriptor = -1; /* LocalRemoteDescriptor */ static int hf_h248_remoteDescriptor = -1; /* LocalRemoteDescriptor */ +static int hf_h248_sPstatisticsDescriptor = -1; /* StatisticsDescriptor */ static int hf_h248_streamMode = -1; /* StreamMode */ static int hf_h248_reserveValue = -1; /* BOOLEAN */ static int hf_h248_reserveGroup = -1; /* BOOLEAN */ -static int hf_h248_propertyParms_01 = -1; /* SEQUENCE_OF_PropertyParm */ -static int hf_h248_propertyParms_item = -1; /* PropertyParm */ +static int hf_h248_lCDpropertyParms = -1; /* SEQUENCE_OF_PropertyParm */ +static int hf_h248_lCDpropertyParms_item = -1; /* PropertyParm */ static int hf_h248_propertyName = -1; /* PropertyName */ static int hf_h248_propertyParamValue = -1; /* SEQUENCE_OF_PropertyID */ static int hf_h248_propertyParamValue_item = -1; /* PropertyID */ @@ -289,6 +292,8 @@ static int hf_h248_propParm_extraInfo = -1; /* PropParm_extraInfo */ static int hf_h248_propGrps = -1; /* SEQUENCE_OF_PropertyGroup */ static int hf_h248_propGrps_item = -1; /* PropertyGroup */ static int hf_h248_PropertyGroup_item = -1; /* PropertyParm */ +static int hf_h248_tSDpropertyParms = -1; /* SEQUENCE_OF_PropertyParm */ +static int hf_h248_tSDpropertyParms_item = -1; /* PropertyParm */ static int hf_h248_tSEventBufferControl = -1; /* EventBufferControl */ static int hf_h248_serviceState = -1; /* ServiceState */ static int hf_h248_muxType = -1; /* MuxType */ @@ -373,9 +378,6 @@ static int hf_h248_audit_result = -1; /* AuditResultV1 */ static int hf_h248_contectAuditResult = -1; /* TerminationID */ static int hf_h248_eventParamterName = -1; /* EventParameterName */ static int hf_h248_event_param_value = -1; /* EventParamValueV1 */ -static int hf_h248_prop_parm_value = -1; /* T_prop_parm_value */ -static int hf_h248_prop_parm_value_item = -1; /* OCTET_STRING */ -static int hf_h248_extra_info = -1; /* T_extra_info */ static int hf_h248_sig_param_value = -1; /* SigParamValueV1 */ /* named bits */ static int hf_h248_T_auditToken_muxToken = -1; @@ -395,7 +397,7 @@ static int hf_h248_NotifyCompletion_otherReason = -1; static int hf_h248_NotifyCompletion_onIteration = -1; /*--- End of included file: packet-h248-hf.c ---*/ -#line 73 "../../asn1/h248/packet-h248-template.c" +#line 74 "../../asn1/h248/packet-h248-template.c" /* Initialize the subtree pointers */ static gint ett_h248 = -1; @@ -557,15 +559,13 @@ static gint ett_h248_Value = -1; static gint ett_h248_AuditReplyV1 = -1; static gint ett_h248_AuditResultV1 = -1; static gint ett_h248_EventParameterV1 = -1; -static gint ett_h248_PropertyParmV1 = -1; -static gint ett_h248_T_prop_parm_value = -1; -static gint ett_h248_T_extra_info = -1; static gint ett_h248_SigParameterV1 = -1; /*--- End of included file: packet-h248-ett.c ---*/ -#line 90 "../../asn1/h248/packet-h248-template.c" +#line 91 "../../asn1/h248/packet-h248-template.c" static dissector_handle_t h248_term_handle; +static dissector_table_t subdissector_table; static emem_tree_t* msgs = NULL; static emem_tree_t* trxs = NULL; @@ -591,13 +591,25 @@ static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t * /* 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); static int dissect_h248_SigParameterV1(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index); +static int dissect_h248_SigParamValueV1(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); +#if 0 +static const value_string context_id_type[] = { + {NULL_CONTEXT,"0 (Null Context)"}, + {CHOOSE_CONTEXT,"$ (Choose Context)"}, + {ALL_CONTEXTS,"* (All Contexts)"}, + {0,NULL} +}; +#endif -/* 2010-11-15: New entries added based on: http://www.iana.org/assignments/megaco-h248 last updated 2010-10-01 */ -static const value_string package_name_vals[] = { +/* the following value_strings are used to build defalut packages. + To add additional detail to a package, build a register a h248_package_t structure + */ + +static const value_string base_package_name_vals[] = { { 0x0000, "Media stream properties H.248.1 Annex C" }, { 0x0001, "Generic H.248.1 Annex E" }, { 0x0002, "root H.248.1 Annex E" }, @@ -802,7 +814,6 @@ static const value_string package_name_vals[] = { { 0x00cd, "Resource Management Rules Package" }, /* H.248.63 */ { 0x00ce, "Resource Management Configuration Package" }, /* H.248.63 */ { 0x00cf, "Abstract Resource Management Packages" }, /* H.248.63 */ - { 0x00d0, "IP layer octets count statistics Package" }, /* H.248.61 */ { 0x00d1, "Content of Communication Identity Package" }, /* H.248.60 */ { 0x00d2, "RSVP extension package" }, /* H.248.65 */ @@ -862,7 +873,6 @@ static const value_string package_name_vals[] = { { 0x0108, "MGC Controlled Bearer Level ALG Package" }, /* H.248.78 */ { 0x0109, "Enhanced Revised Offer/Answer SDP Support Package" }, /* H.248.80 */ { 0x010a, "Enhanced SDP Media Capabilities Negotiation Support Package" }, /* H.248.80 */ - { 0x8000, "Ericsson IU" }, { 0x8001, "Ericsson UMTS and GSM Circuit" }, { 0x8002, "Ericsson Tone Generator Package" }, @@ -880,16 +890,14 @@ static const value_string package_name_vals[] = { { 0x800e, "Ericsson Tracing Enhancements Package" }, { 0x800f, "Ericsson Partially Wildcarded TerminationID Package" }, { 0x8010, "SCTP Stream Handling Package" }, - {0, NULL} }; -static value_string_ext package_name_vals_ext = VALUE_STRING_EXT_INIT(package_name_vals); /* * This table consist of PackageName + EventName and its's corresponding string * */ -static const value_string event_name_vals[] = { +static const value_string base_event_name_vals[] = { { 0x00000000, "Media stream properties H.248.1 Annex C" }, { 0x00010000, "g H.248.1 Annex E" }, { 0x00010001, "g/Cause" }, @@ -950,12 +958,11 @@ static const value_string event_name_vals[] = { { 0x800a0000, "Nokia Bearer Characteristics Package" }, {0, NULL} }; -static value_string_ext event_name_vals_ext = VALUE_STRING_EXT_INIT(event_name_vals); /* * This table consist of PackageName + SignalName and its's corresponding string */ -static const value_string signal_name_vals[] = { +static const value_string base_signal_name_vals[] = { { 0x00000000, "Media stream properties H.248.1 Annex C" }, { 0x00010000, "g H.248.1 Annex E" }, { 0x00030001, "tonegen/pt(Play tone)" }, @@ -992,31 +999,17 @@ static const value_string signal_name_vals[] = { { 0x00210001, "GB/EstBNC(Establish BNC)" }, { 0x00210002, "GB/ModBNC (Modify BNC)" }, { 0x00210003, "GB/RelBNC(Release BNC)" }, - { 0x002a0001, "H.245/cs (channel state)" }, { 0x002a0002, "H.245/termtype (Terminal Type)" }, - { 0x002c0001, "H.324/cmod (Communication mode)" }, { 0x002c0002, "H.324/muxlv (Highest Multiplexing level)" }, { 0x002c0003, "H.324/demux (Demultiplex)" }, { 0x002c0004, "H.324/h223capr (Remote H.223 capability)" }, { 0x002c0005, "H.324/muxtbl_in (Incoming Multiplex Table)" }, { 0x002c0006, "H.324/muxtbl_out (Outgoing Multiplex Table)" }, - { 0x800a0000, "Nokia Bearer Characteristics Package" }, {0, NULL} }; -static value_string_ext signal_name_vals_ext = VALUE_STRING_EXT_INIT(signal_name_vals); - -#if 0 -static const value_string context_id_type[] = { - {NULL_CONTEXT,"0 (Null Context)"}, - {CHOOSE_CONTEXT,"$ (Choose Context)"}, - {ALL_CONTEXTS,"* (All Contexts)"}, - {0,NULL} -}; -#endif - static const value_string h248_reasons[] = { @@ -1185,13 +1178,13 @@ extern void h248_param_ber_integer(proto_tree* tree, tvbuff_t* tvb, packet_info* extern void h248_param_ber_octetstring(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) { asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - dissect_ber_octet_string(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); + dissect_ber_octet_string(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); } extern void h248_param_ber_boolean(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) { asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - dissect_ber_boolean(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); + dissect_ber_boolean(implicit ? *((gboolean*)implicit) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL); } extern void h248_param_bytes_item(proto_tree* tree, @@ -1224,14 +1217,14 @@ static const h248_pkg_sig_t no_signal = { 0, &hf_h248_no_sig, &ett_h248_no_sig, static const h248_pkg_param_t no_param = { 0, &hf_h248_param, h248_param_uint_item, NULL }; static const h248_pkg_evt_t no_event = { 0, &hf_h248_no_evt, &ett_h248_no_evt, NULL, NULL }; -static GPtrArray* packages = NULL; +const h248_package_t *find_package_id(guint16 pkgid); +static GTree* packages = NULL; extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u1 _U_, void* u2 _U_) { tvbuff_t *new_tvb = NULL; proto_tree *package_tree=NULL; guint16 name_major, name_minor; const h248_package_t* pkg = NULL; - guint i; int offset = 0; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); @@ -1242,10 +1235,10 @@ extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pi /* this field is always 4 bytes so just read it into two integers */ name_major=tvb_get_ntohs(new_tvb, 0); name_minor=tvb_get_ntohs(new_tvb, 2); - + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(asn1_ctx.created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ @@ -1253,20 +1246,8 @@ extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pi const gchar* strval; package_tree = proto_item_add_subtree(asn1_ctx.created_item, ett_packagename); - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); - - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; - + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); pi = proto_tree_add_uint(package_tree, hf_248_pkg_param, tvb, offset-2, 2, name_minor); @@ -1370,12 +1351,131 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_ return offset; } -void h248_register_package(const h248_package_t* pkg) { - if (! packages) packages = g_ptr_array_new(); - - g_ptr_array_add(packages,(void*)pkg); +s_h248_package_t *s_find_package_id(guint16 pkgid) { + s_h248_package_t *s_pkg = NULL; + s_pkg = g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid))); + return s_pkg; +} + +const h248_package_t *find_package_id(guint16 pkgid) { + s_h248_package_t *s_pkg = NULL; + s_pkg = s_find_package_id(pkgid); /*(packages, GUINT_TO_POINTER((guint32)(pkgid))); */ + if (! s_pkg ) return &no_package; + return s_pkg->pkg; +} + +static gint32 comparePkgID(gconstpointer a, gconstpointer b) { + return GPOINTER_TO_UINT(b) - GPOINTER_TO_UINT(a); +} + +gboolean is_pkg_default(guint16 pkgid) { + s_h248_package_t *s_pkg = NULL; + s_pkg = g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid))); + if(! s_pkg ) return TRUE; + return s_pkg->is_default; +} + +void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action) { + h248_package_t *pkg_found = NULL, *pkg_high = NULL, *pkg_low = NULL; + s_h248_package_t *s_pkg = NULL; + value_string *vst; + gboolean pkg_default = FALSE; + gint j = 0, idx = 0, i = 0, k = 0; + if (! packages) { + /* no packaegs are yet registerd so create tree and add default packages to tree + */ + packages = g_tree_new(comparePkgID); /* init tree if no entries */ + while (base_package_name_vals[i].strptr != NULL) { + pkg_found = g_new0(h248_package_t, 1); /* create a h248 package structure */ + pkg_found->id = base_package_name_vals[i].value; + vst = g_new0(value_string,2); + vst[0].strptr = base_package_name_vals[i].strptr; + pkg_found->param_names = vst; + pkg_found->hfid = &hf_h248_pkg_name; + pkg_found->ett = &ett_packagename; + match_strval_idx((pkg_found->id)<<16,base_event_name_vals, &j); + /* now look for events and signals that may be defined for package. If found, create value_strings */ + if (j != -1) { + j++; idx=j; + while((base_event_name_vals[j].strptr!=NULL) && (((base_event_name_vals[j].value)>>16) == (pkg_found->id))) { + j++; + }; + if (idx < j) { + vst = g_new0(value_string,j-idx+1); + for (k=0;idx<j;k++) { + vst[k].strptr = base_event_name_vals[idx].strptr; + vst[k].value = (base_event_name_vals[idx].value & 0xffff); + idx++; + }; + pkg_found->event_names = vst; + } + } + /* now look at signals */ + if (!match_strval_idx((pkg_found->id)<<16, base_signal_name_vals, &j)) { + j++; idx=j; + while((base_signal_name_vals[j].strptr != NULL) && ((base_signal_name_vals[j].value>>16) == (pkg_found->id))) { + }; + if (idx < j) { + vst = g_new0(value_string,j-idx+1); + for (k=0;idx<i;k++) { + vst[k].strptr = base_signal_name_vals[idx].strptr; + vst[k].value = (base_signal_name_vals[idx].value &0xffff); + idx++; + }; + pkg_found->signal_names = vst; + } + }; + s_pkg = g_new0(s_h248_package_t,1); + s_pkg->is_default = TRUE; + s_pkg->pkg = pkg_found; + g_tree_insert(packages, GINT_TO_POINTER(pkg_found->id), (gpointer)s_pkg); + i++; + }; + pkg_found = NULL; /* reset pointer */ + }; + pkg_default = is_pkg_default(pkg->id); + if (((reg_action==REPLACE_PKG) || (reg_action==ADD_PKG)) && pkg_default) { + /* add/replace in tree */ + s_pkg = g_new0(s_h248_package_t,1); + s_pkg->is_default = FALSE; + s_pkg->pkg = (h248_package_t *)pkg; + g_tree_replace(packages, GINT_TO_POINTER(pkg->id), (gpointer)s_pkg); + return; + }; + if(pkg_default) reg_action = MERGE_PKG_HIGH; /* always make new package overide default */ + s_pkg = s_find_package_id(pkg->id); + if (s_pkg == NULL) { /* no need to merge - package not in tree */ + s_pkg = g_new0(s_h248_package_t,1); + s_pkg->is_default = FALSE; + s_pkg->pkg = (h248_package_t *)pkg; + g_tree_insert(packages, GINT_TO_POINTER(pkg->id), (gpointer)s_pkg); + return; + } + pkg_found = s_pkg->pkg; + if (reg_action==MERGE_PKG_HIGH) { + pkg_high = (h248_package_t *)pkg; + pkg_low = pkg_found; + }; + if (reg_action==MERGE_PKG_LOW) { + pkg_high = pkg_found; + pkg_low = (h248_package_t *)pkg; + }; + /* if h248_package_t High Priority value !NULL, replace it in the found tree entry else use current entry */ + (pkg_high->hfid ? (pkg_found->hfid=pkg_high->hfid) : (pkg_found->hfid=pkg_low->hfid)); + (pkg_high->ett ? (pkg_found->ett=pkg_high->ett ):( pkg_found->ett=pkg_low->ett)); + (pkg_high->param_names ? (pkg_found->param_names=pkg_high->param_names ):( pkg_found->param_names=pkg_low->param_names)); + (pkg_high->signal_names ? (pkg_found->signal_names=pkg_high->signal_names ):( pkg_found->signal_names=pkg_low->signal_names)); + (pkg_high->event_names ? (pkg_found->event_names=pkg_high->event_names ):( pkg_found->event_names=pkg_low->event_names)); + (pkg_high->stats_names ? (pkg_found->stats_names=pkg_high->stats_names ):( pkg_found->stats_names=pkg_low->stats_names)); + (pkg_high->properties ? (pkg_found->properties=pkg_high->properties ):( pkg_found->properties=pkg_low->properties)); + (pkg_high->signals ? (pkg_found->signals=pkg_high->signals ):( pkg_found->signals=pkg_low->signals)); + (pkg_high->events ? (pkg_found->events=pkg_high->events ):( pkg_found->events=pkg_low->events)); + (pkg_high->statistics ? (pkg_found->statistics=pkg_high->statistics ):( pkg_found->statistics=pkg_low->statistics)); + s_pkg->pkg = pkg_found; + s_pkg->is_default = FALSE; } + static guint32 packageandid; static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { @@ -1383,8 +1483,7 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse proto_tree *package_tree=NULL; guint16 name_major, name_minor; const h248_package_t* pkg = NULL; - guint i; - + offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); if (new_tvb) { @@ -1393,28 +1492,18 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse name_minor=tvb_get_ntohs(new_tvb, 2); packageandid=(name_major<<16)|name_minor; + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(actx->created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ package_tree = proto_item_add_subtree(actx->created_item, ett_packagename); - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "PkgName%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); } - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; - { proto_item* pi = proto_tree_add_uint(package_tree, hf_248_pkg_param, tvb, offset-2, 2, name_minor); const gchar* strval; @@ -1442,7 +1531,6 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs guint16 name_major, name_minor; const h248_package_t* pkg = NULL; const h248_pkg_evt_t* evt = NULL; - guint i; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); @@ -1452,27 +1540,16 @@ static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offs name_minor=tvb_get_ntohs(new_tvb, 2); packageandid=(name_major<<16)|name_minor; + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(actx->created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ package_tree = proto_item_add_subtree(actx->created_item, ett_packagename); } - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); - - - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); curr_info.pkg = pkg; @@ -1519,7 +1596,6 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of guint16 name_major, name_minor; const h248_package_t* pkg = NULL; const h248_pkg_sig_t* sig; - guint i; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); @@ -1529,26 +1605,16 @@ static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int of name_minor=tvb_get_ntohs(new_tvb, 2); packageandid=(name_major<<16)|name_minor; + pkg = find_package_id(name_major); /* do the prettification */ proto_item_append_text(actx->created_item, " %s (%04x)", - val_to_str_ext_const(name_major, &package_name_vals_ext, "Unknown Package"), + val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if(tree){ package_tree = proto_item_add_subtree(actx->created_item, ett_packagename); } - proto_tree_add_uint(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major); - - for(i=0; i < packages->len; i++) { - pkg = g_ptr_array_index(packages,i); - - if (name_major == pkg->id) { - break; - } else { - pkg = NULL; - } - } - - if (! pkg ) pkg = &no_package; + proto_tree_add_uint_format(package_tree, hf_h248_pkg_name, tvb, offset-4, 2, name_major, + "%s (0x%04x)", val_to_str(0, pkg->param_names, "Unknown Package"), name_major); if (pkg->signals) { for (sig = pkg->signals; sig->hfid; sig++) { @@ -1593,10 +1659,8 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int gboolean pc, ind; gint32 tag; guint32 len; - /*guint16 name_major;*/ guint16 name_minor; int end_offset; - tvbuff_t *next_tvb; const h248_package_t* pkg; const h248_pkg_param_t* prop; @@ -1611,8 +1675,6 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int } - next_tvb = tvb_new_subset(tvb, offset , len , len ); - /*name_major = packageandid >> 16;*/ name_minor = packageandid & 0xffff; pkg = (curr_info.pkg) ? curr_info.pkg : &no_package; @@ -1626,16 +1688,16 @@ static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int } else { prop = &no_param; } - if (prop && prop->hfid ) { if (!prop->dissector) prop = &no_param; - prop->dissector(tree, next_tvb, actx->pinfo, *(prop->hfid), &curr_info, prop->data); + prop->dissector(tree, tvb, actx->pinfo, *(prop->hfid), &curr_info, prop->data); } return end_offset; } + static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; @@ -1677,7 +1739,6 @@ static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tv } static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { - tvbuff_t *next_tvb; int end_offset; gint8 class; gboolean pc, ind; @@ -1695,15 +1756,18 @@ static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, } - next_tvb = tvb_new_subset(tvb,offset,len,len); - if ( curr_info.par && curr_info.par->dissector) { - curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); + curr_info.par->dissector(tree, tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); } return end_offset; } +static int dissect_h248_SigParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { + return dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); +} + + static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; @@ -1752,60 +1816,34 @@ static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t * static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; - int end_offset; - gint8 class; - gboolean pc, ind; - gint32 tag; - guint32 len; - - offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - end_offset=offset+len; - - if( (class!=BER_CLASS_UNI) - ||(tag!=BER_UNI_TAG_OCTETSTRING) ){ - proto_tree_add_text(tree, tvb, offset-2, 2, "H.248 BER Error: OctetString expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag); + int old_offset, end_offset; + gint8 class1; + gboolean pc1, ind1; + gint32 tag1; + guint32 len1; + offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class1, &pc1, &tag1); + offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len1, &ind1); + end_offset=offset+len1; + /* check to see if 1) is octet string and 2) if another OS is embedded */ + if( !(tag1==BER_UNI_TAG_OCTETSTRING || tag1==BER_UNI_TAG_BOOLEAN || BER_UNI_TAG_ENUMERATED)) { /* allow octet string and boolean constructs */ + proto_tree_add_text(tree, tvb, offset-2, 2, "H.248 BER Error: OctetString expected but Class:%d PC:%d Tag:%d was unexpected", class1, pc1, tag1); return end_offset; - } - - - next_tvb = tvb_new_subset(tvb,offset,len,len); - - if ( curr_info.par && curr_info.par->dissector) { + } + next_tvb = tvb_new_subset(tvb,offset,len1,len1); + old_offset=offset; + offset = old_offset; /* restore initial offset before calling dissector functions */ + if ( curr_info.par && curr_info.par->dissector) { curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); } return end_offset; } -static int dissect_h248_EventParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { - tvbuff_t *next_tvb; - int end_offset; - gint8 class; - gboolean pc, ind; - gint32 tag; - guint32 len; - - offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag); - offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind); - end_offset=offset+len; - - if( (class!=BER_CLASS_UNI) - ||(tag!=BER_UNI_TAG_OCTETSTRING) ){ - proto_tree_add_text(tree, tvb, offset-2, 2, "H.248 BER Error: OctetString expected but Class:%d PC:%d Tag:%d was unexpected", class, pc, tag); - return end_offset; - } - - - next_tvb = tvb_new_subset(tvb,offset,len,len); - - if ( curr_info.par && curr_info.par->dissector) { - curr_info.par->dissector(tree, next_tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); - } - - return end_offset; +static int dissect_h248_EventParamValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index _U_) { + return dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &tvb); } + static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *mtp_tree=NULL; @@ -1896,7 +1934,7 @@ dissect_h248_AuthenticationHeader(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_h248_T_version(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 105 "../../asn1/h248/h248.cnf" +#line 108 "../../asn1/h248/h248.cnf" offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, &h248_version); @@ -2036,16 +2074,16 @@ dissect_h248_MId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, a static int dissect_h248_T_errorCode(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 299 "../../asn1/h248/h248.cnf" +#line 302 "../../asn1/h248/h248.cnf" 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"); - + if (curr_info.cmd) { gcp_cmd_set_error(curr_info.cmd,error_code); } else if (curr_info.trx) { gcp_trx_set_error(curr_info.trx,error_code); } - + return offset; @@ -2092,7 +2130,7 @@ dissect_h248_TransactionId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_h248_T_transactionId(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 109 "../../asn1/h248/h248.cnf" +#line 112 "../../asn1/h248/h248.cnf" guint32 trx_id = 0; offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id); curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_REQUEST, keep_persistent_data); @@ -2107,7 +2145,7 @@ dissect_h248_T_transactionId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_h248_ContextId(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 134 "../../asn1/h248/h248.cnf" +#line 137 "../../asn1/h248/h248.cnf" guint32 ctx_id = 0; offset = dissect_h248_ctx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &ctx_id); curr_info.ctx = gcp_ctx(curr_info.msg,curr_info.trx,ctx_id,keep_persistent_data); @@ -2141,7 +2179,7 @@ dissect_h248_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U static int dissect_h248_WildcardField(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 317 "../../asn1/h248/h248.cnf" +#line 320 "../../asn1/h248/h248.cnf" tvbuff_t* new_tvb; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); tree = proto_item_add_subtree(actx->created_item,ett_wildcard); @@ -2152,7 +2190,7 @@ dissect_h248_WildcardField(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off wild_term = tvb_get_guint8(new_tvb,0) & 0x80 ? GCP_WILDCARD_CHOOSE : GCP_WILDCARD_ALL; /* limitation: assume only one wildcard is used */ wild_card = tvb_get_guint8(new_tvb,0); - + return offset; @@ -2175,10 +2213,10 @@ dissect_h248_SEQUENCE_OF_WildcardField(gboolean implicit_tag _U_, tvbuff_t *tvb static int dissect_h248_T_terminationId(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 331 "../../asn1/h248/h248.cnf" +#line 334 "../../asn1/h248/h248.cnf" tvbuff_t* new_tvb; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &new_tvb); - + if (new_tvb) { curr_info.term->len = tvb_length(new_tvb); curr_info.term->type = 0; /* unknown */ @@ -2191,9 +2229,9 @@ dissect_h248_T_terminationId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o curr_info.term = gcp_cmd_add_term(curr_info.msg, curr_info.trx, curr_info.cmd, curr_info.term, wild_term, keep_persistent_data); if (h248_term_handle) { - actx->pinfo->private_data = &wild_card; + actx->pinfo->private_data = &wild_card; call_dissector(h248_term_handle, new_tvb, actx->pinfo, tree); - wild_card = 0xFF; + wild_card = 0xFF; } } else { curr_info.term->len = 0; @@ -2214,7 +2252,7 @@ static const ber_sequence_t TerminationID_sequence[] = { static int dissect_h248_TerminationID(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 312 "../../asn1/h248/h248.cnf" +#line 315 "../../asn1/h248/h248.cnf" curr_info.term = ep_new0(gcp_term_t); wild_term = GCP_WILDCARD_NONE; @@ -2292,14 +2330,14 @@ static const ber_sequence_t T_topologyReq_sequence_of[1] = { static int dissect_h248_T_topologyReq(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 217 "../../asn1/h248/h248.cnf" +#line 220 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_TOPOLOGY_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset, T_topologyReq_sequence_of, hf_index, ett_h248_T_topologyReq); -#line 221 "../../asn1/h248/h248.cnf" +#line 224 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -2389,17 +2427,9 @@ static const ber_sequence_t PropertyParm_sequence[] = { static int dissect_h248_PropertyParm(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 424 "../../asn1/h248/h248.cnf" -/* H248 v1 support */ - if (h248_version >1) { - offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, + offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, PropertyParm_sequence, hf_index, ett_h248_PropertyParm); -} else { - offset = dissect_h248_PropertyParmV1( implicit_tag, tvb, offset, actx, tree, hf_index); -} - - return offset; } @@ -2543,13 +2573,13 @@ dissect_h248_ContextAttrAuditRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U static int dissect_h248_T_contextAttrAuditReq(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/h248/h248.cnf" +#line 228 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_CTX_ATTR_AUDIT_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_ContextAttrAuditRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 229 "../../asn1/h248/h248.cnf" +#line 232 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -2603,7 +2633,7 @@ dissect_h248_ServiceState(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static const ber_sequence_t TerminationStateDescriptor_sequence[] = { - { &hf_h248_propertyParms_01, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_h248_SEQUENCE_OF_PropertyParm }, + { &hf_h248_tSDpropertyParms, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_h248_SEQUENCE_OF_PropertyParm }, { &hf_h248_tSEventBufferControl, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_EventBufferControl }, { &hf_h248_serviceState , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_ServiceState }, { NULL, 0, 0, 0, NULL } @@ -2641,7 +2671,7 @@ static const ber_sequence_t LocalControlDescriptor_sequence[] = { { &hf_h248_streamMode , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_StreamMode }, { &hf_h248_reserveValue , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_BOOLEAN }, { &hf_h248_reserveGroup , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_BOOLEAN }, - { &hf_h248_propertyParms_01, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_h248_SEQUENCE_OF_PropertyParm }, + { &hf_h248_lCDpropertyParms, BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_h248_SEQUENCE_OF_PropertyParm }, { NULL, 0, 0, 0, NULL } }; @@ -2767,7 +2797,7 @@ static const ber_sequence_t StreamParms_sequence[] = { { &hf_h248_localControlDescriptor, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_LocalControlDescriptor }, { &hf_h248_localDescriptor, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_LocalRemoteDescriptor }, { &hf_h248_remoteDescriptor, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_LocalRemoteDescriptor }, - { &hf_h248_statisticsDescriptor, BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_StatisticsDescriptor }, + { &hf_h248_sPstatisticsDescriptor, BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_StatisticsDescriptor }, { NULL, 0, 0, 0, NULL } }; @@ -3196,14 +3226,14 @@ static const ber_sequence_t SigParameter_sequence[] = { static int dissect_h248_SigParameter(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 414 "../../asn1/h248/h248.cnf" +#line 423 "../../asn1/h248/h248.cnf" /* H248 v1 support */ - if (h248_version >1) { + if (h248_version > 1) { offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, SigParameter_sequence, hf_index, ett_h248_SigParameter); } else { - offset = dissect_h248_SigParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); + offset = dissect_h248_SigParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); } @@ -3432,14 +3462,14 @@ static const ber_sequence_t EventParameter_sequence[] = { static int dissect_h248_EventParameter(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 405 "../../asn1/h248/h248.cnf" +#line 414 "../../asn1/h248/h248.cnf" /* H248 v1 support */ if (h248_version > 1) { offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, EventParameter_sequence, hf_index, ett_h248_EventParameter); } else { - offset = dissect_h248_EventParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); + offset = dissect_h248_EventParameterV1( implicit_tag, tvb, offset, actx, tree, hf_index); } @@ -3718,7 +3748,7 @@ static const ber_sequence_t IndAudStreamParms_sequence[] = { { &hf_h248_iASPLocalControlDescriptor, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_IndAudLocalControlDescriptor }, { &hf_h248_iASPLocalDescriptor, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_IndAudLocalRemoteDescriptor }, { &hf_h248_iASPRemoteDescriptor, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_IndAudLocalRemoteDescriptor }, - { &hf_h248_statisticsDescriptor_01, BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_IndAudStatisticsDescriptor }, + { &hf_h248_statisticsDescriptor, BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_IndAudStatisticsDescriptor }, { NULL, 0, 0, 0, NULL } }; @@ -3991,7 +4021,7 @@ static const ber_choice_t AmmDescriptor_choice[] = { { 5, &hf_h248_signalsDescriptor, BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG, dissect_h248_SignalsDescriptor }, { 6, &hf_h248_digitMapDescriptor, BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG, dissect_h248_DigitMapDescriptor }, { 7, &hf_h248_auditDescriptor, BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_h248_AuditDescriptor }, - { 8, &hf_h248_statisticsDescriptor, BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_h248_StatisticsDescriptor }, + { 8, &hf_h248_aDstatisticsDescriptor, BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_h248_StatisticsDescriptor }, { 0, NULL, 0, 0, 0, NULL } }; @@ -4036,13 +4066,13 @@ dissect_h248_AmmRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_h248_T_addReq(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 150 "../../asn1/h248/h248.cnf" +#line 153 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_ADD_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_AmmRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 155 "../../asn1/h248/h248.cnf" +#line 158 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4052,14 +4082,14 @@ dissect_h248_T_addReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ static int dissect_h248_T_moveReq(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 159 "../../asn1/h248/h248.cnf" +#line 162 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOVE_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_AmmRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 165 "../../asn1/h248/h248.cnf" +#line 168 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4069,13 +4099,13 @@ dissect_h248_T_moveReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_h248_T_modReq(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 169 "../../asn1/h248/h248.cnf" +#line 172 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOD_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_AmmRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 173 "../../asn1/h248/h248.cnf" +#line 176 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4100,13 +4130,13 @@ dissect_h248_SubtractRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_h248_T_subtractReq(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 177 "../../asn1/h248/h248.cnf" +#line 180 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SUB_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_SubtractRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 181 "../../asn1/h248/h248.cnf" +#line 184 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4132,13 +4162,13 @@ dissect_h248_AuditRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs static int dissect_h248_T_auditCapRequest(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 185 "../../asn1/h248/h248.cnf" +#line 188 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITCAP_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_AuditRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 189 "../../asn1/h248/h248.cnf" +#line 192 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4148,13 +4178,13 @@ dissect_h248_T_auditCapRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int static int dissect_h248_T_auditValueRequest(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 193 "../../asn1/h248/h248.cnf" +#line 196 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITVAL_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_AuditRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 197 "../../asn1/h248/h248.cnf" +#line 200 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4240,13 +4270,13 @@ dissect_h248_NotifyRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_h248_T_notifyReq(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 201 "../../asn1/h248/h248.cnf" +#line 204 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_NOTIFY_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_h248_NotifyRequest(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 205 "../../asn1/h248/h248.cnf" +#line 208 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4331,8 +4361,7 @@ dissect_h248_ServiceChangeProfile(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_h248_SCreasonValueOctetStr(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 370 "../../asn1/h248/h248.cnf" - +#line 373 "../../asn1/h248/h248.cnf" tvbuff_t *parameter_tvb; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, ¶meter_tvb); @@ -4354,18 +4383,18 @@ static const ber_sequence_t SCreasonValue_sequence_of[1] = { static int dissect_h248_SCreasonValue(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 358 "../../asn1/h248/h248.cnf" +#line 361 "../../asn1/h248/h248.cnf" /* H248 v1 support */ - if ( h248_version >1 ) { + if ( h248_version > 1 ) { /* Not V1, so call "standard" function */ offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset, SCreasonValue_sequence_of, hf_index, ett_h248_SCreasonValue); - + } else { - /* V1 so Value == octet string */ - offset = dissect_h248_ValueV1( implicit_tag, tvb, offset, actx, tree, hf_index); + /* V1 so Value == octet string */ + offset = dissect_h248_ValueV1( implicit_tag, tvb, offset, actx, tree, hf_index); }; - + return offset; @@ -4414,14 +4443,14 @@ static const ber_sequence_t ServiceChangeRequest_sequence[] = { static int dissect_h248_ServiceChangeRequest(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 209 "../../asn1/h248/h248.cnf" +#line 212 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SVCCHG_REQ,offset,keep_persistent_data); H248_TAP(); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, ServiceChangeRequest_sequence, hf_index, ett_h248_ServiceChangeRequest); -#line 213 "../../asn1/h248/h248.cnf" +#line 216 "../../asn1/h248/h248.cnf" curr_info.cmd = NULL; return offset; @@ -4539,7 +4568,7 @@ dissect_h248_TransactionRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_h248_T_tpend_transactionId(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 116 "../../asn1/h248/h248.cnf" +#line 119 "../../asn1/h248/h248.cnf" guint32 trx_id = 0; offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id); curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_PENDING, keep_persistent_data); @@ -4568,7 +4597,7 @@ dissect_h248_TransactionPending(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_h248_T_trep_transactionId(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 122 "../../asn1/h248/h248.cnf" +#line 125 "../../asn1/h248/h248.cnf" guint32 trx_id = 0; offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id); curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_REPLY, keep_persistent_data); @@ -4634,7 +4663,7 @@ static const ber_choice_t AuditReturnParameter_choice[] = { { 6, &hf_h248_signalsDescriptor, BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG, dissect_h248_SignalsDescriptor }, { 7, &hf_h248_digitMapDescriptor, BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_h248_DigitMapDescriptor }, { 8, &hf_h248_observedEventsDescriptor, BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_h248_ObservedEventsDescriptor }, - { 9, &hf_h248_statisticsDescriptor, BER_CLASS_CON, 9, BER_FLAGS_IMPLTAG, dissect_h248_StatisticsDescriptor }, + { 9, &hf_h248_aRPstatisticsDescriptor, BER_CLASS_CON, 9, BER_FLAGS_IMPLTAG, dissect_h248_StatisticsDescriptor }, { 10, &hf_h248_packagesDescriptor, BER_CLASS_CON, 10, BER_FLAGS_IMPLTAG, dissect_h248_PackagesDescriptor }, { 11, &hf_h248_emptyDescriptors, BER_CLASS_CON, 11, BER_FLAGS_IMPLTAG, dissect_h248_AuditDescriptor }, { 0, NULL, 0, 0, 0, NULL } @@ -4681,7 +4710,7 @@ dissect_h248_AmmsReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_h248_T_addReply(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 233 "../../asn1/h248/h248.cnf" +#line 236 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_ADD_REPLY,offset,keep_persistent_data); H248_TAP(); @@ -4694,7 +4723,7 @@ dissect_h248_T_addReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_h248_T_moveReply(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 238 "../../asn1/h248/h248.cnf" +#line 241 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOVE_REPLY,offset,keep_persistent_data); H248_TAP(); @@ -4707,7 +4736,7 @@ dissect_h248_T_moveReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_h248_T_modReply(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 243 "../../asn1/h248/h248.cnf" +#line 246 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOD_REPLY,offset,keep_persistent_data); H248_TAP(); @@ -4720,7 +4749,7 @@ dissect_h248_T_modReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_h248_T_subtractReply(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 248 "../../asn1/h248/h248.cnf" +#line 251 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SUB_REPLY,offset,keep_persistent_data); H248_TAP(); @@ -4789,18 +4818,18 @@ dissect_h248_AuditReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset static int dissect_h248_T_auditCapReply(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 263 "../../asn1/h248/h248.cnf" +#line 266 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITCAP_REPLY,offset,keep_persistent_data); H248_TAP(); -#line 268 "../../asn1/h248/h248.cnf" +#line 271 "../../asn1/h248/h248.cnf" /* h248v1 support */ if(h248_version > 1) { offset = dissect_h248_AuditReply(implicit_tag, tvb, offset, actx, tree, hf_index); } else { - /* call V1 of the dissector */ - offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); + /* call V1 of the dissector */ + offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); } @@ -4811,18 +4840,18 @@ dissect_h248_T_auditCapReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_h248_T_auditValueReply(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 278 "../../asn1/h248/h248.cnf" +#line 281 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITVAL_REPLY,offset,keep_persistent_data); H248_TAP(); -#line 283 "../../asn1/h248/h248.cnf" +#line 286 "../../asn1/h248/h248.cnf" /* h248v1 support */ if(h248_version > 1) { offset = dissect_h248_AuditReply(implicit_tag, tvb, offset, actx, tree, hf_index); } else { - /* call V1 of the dissector */ - offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); + /* call V1 of the dissector */ + offset = dissect_h248_AuditReplyV1(implicit_tag, tvb, offset, actx, tree, hf_index); } @@ -4848,7 +4877,7 @@ dissect_h248_NotifyReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse static int dissect_h248_T_notifyReply(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 253 "../../asn1/h248/h248.cnf" +#line 256 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_NOTIFY_REPLY,offset,keep_persistent_data); H248_TAP(); @@ -4906,7 +4935,7 @@ static const ber_sequence_t ServiceChangeReply_sequence[] = { static int dissect_h248_ServiceChangeReply(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 258 "../../asn1/h248/h248.cnf" +#line 261 "../../asn1/h248/h248.cnf" curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SVCCHG_REPLY,offset,keep_persistent_data); H248_TAP(); @@ -4977,7 +5006,7 @@ dissect_h248_ActionReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, ActionReply_sequence, hf_index, ett_h248_ActionReply); -#line 143 "../../asn1/h248/h248.cnf" +#line 146 "../../asn1/h248/h248.cnf" if (!curr_info.cmd) { curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_REPLY,offset,keep_persistent_data); H248_TAP(); @@ -5081,7 +5110,7 @@ dissect_h248_TransactionResponseAck(gboolean implicit_tag _U_, tvbuff_t *tvb _U_ static int dissect_h248_T_seg_rep_transactionId(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 128 "../../asn1/h248/h248.cnf" +#line 131 "../../asn1/h248/h248.cnf" guint32 trx_id = 0; offset = dissect_h248_trx_id(implicit_tag, actx->pinfo, tree, tvb, offset, &trx_id); curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_ACK, keep_persistent_data); @@ -5181,15 +5210,15 @@ static const ber_sequence_t Message_sequence[] = { static int dissect_h248_Message(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 94 "../../asn1/h248/h248.cnf" +#line 97 "../../asn1/h248/h248.cnf" curr_info.msg = gcp_msg(actx->pinfo,tvb_raw_offset(tvb),keep_persistent_data); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, Message_sequence, hf_index, ett_h248_Message); -#line 98 "../../asn1/h248/h248.cnf" +#line 101 "../../asn1/h248/h248.cnf" col_add_str(actx->pinfo->cinfo, COL_INFO, gcp_msg_to_str(curr_info.msg,keep_persistent_data)); - + if (keep_persistent_data) gcp_analyze_msg(h248_tree, h248_tvb, curr_info.msg, &h248_arrel); @@ -5253,7 +5282,7 @@ static const ber_sequence_t AuditReplyV1_sequence[] = { static int dissect_h248_AuditReplyV1(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 293 "../../asn1/h248/h248.cnf" +#line 296 "../../asn1/h248/h248.cnf" /* h248v1 support */ offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, AuditReplyV1_sequence, hf_h248_auditValueReplyV1, ett_h248_AuditReplyV1); @@ -5279,68 +5308,6 @@ dissect_h248_EventParameterV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int } -static const ber_sequence_t T_prop_parm_value_sequence_of[1] = { - { &hf_h248_prop_parm_value_item, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_h248_OCTET_STRING }, -}; - -static int -dissect_h248_T_prop_parm_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_) { - offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset, - T_prop_parm_value_sequence_of, hf_index, ett_h248_T_prop_parm_value); - - return offset; -} - - -static const value_string h248_T_extra_info_vals[] = { - { 0, "relation" }, - { 1, "range" }, - { 2, "sublist" }, - { 0, NULL } -}; - -static const ber_choice_t T_extra_info_choice[] = { - { 0, &hf_h248_relation , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_h248_Relation }, - { 1, &hf_h248_range , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_h248_BOOLEAN }, - { 2, &hf_h248_sublist , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_h248_BOOLEAN }, - { 0, NULL, 0, 0, 0, NULL } -}; - -static int -dissect_h248_T_extra_info(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_ber_choice(actx, tree, tvb, offset, - T_extra_info_choice, hf_index, ett_h248_T_extra_info, - NULL); - - return offset; -} - - -static const ber_sequence_t PropertyParmV1_sequence[] = { - { &hf_h248_name , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_h248_PkgdName }, - { &hf_h248_prop_parm_value, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_h248_T_prop_parm_value }, - { &hf_h248_extra_info , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_h248_T_extra_info }, - { NULL, 0, 0, 0, NULL } -}; - -static int -dissect_h248_PropertyParmV1(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_ber_sequence(implicit_tag, actx, tree, tvb, offset, - PropertyParmV1_sequence, hf_index, ett_h248_PropertyParmV1); - - return offset; -} - - - -static int -dissect_h248_SigParamValueV1(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_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, - NULL); - - return offset; -} - static const ber_sequence_t SigParameterV1_sequence[] = { { &hf_h248_sigParameterName, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_h248_SigParameterName }, @@ -5360,27 +5327,33 @@ dissect_h248_SigParameterV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of static int dissect_h248_ValueV1(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 381 "../../asn1/h248/h248.cnf" +#line 383 "../../asn1/h248/h248.cnf" guint8 i; guint32 len; -#line 386 "../../asn1/h248/h248.cnf" +#line 388 "../../asn1/h248/h248.cnf" /* check tvb to verify all values ascii or not. If so, output string, else hex */ len=tvb_length_remaining(tvb, offset); - for( i=0;i<len;i++) { - if(!isascii(tvb_get_guint8(tvb, offset+i)) || tvb_get_guint8(tvb, offset+i) == 0) { - /* not ascii or NULL character so do string as hex string */ - proto_tree_add_text(tree, tvb, offset, len,"%s: 0x%s", - (proto_registrar_get_nth(hf_index))->name, - tvb_bytes_to_str(tvb, 0, len)); - return len; + if ( curr_info.par && curr_info.par->dissector) { + curr_info.par->dissector(tree, /*next_*/tvb, actx->pinfo, *(curr_info.par->hfid), &curr_info, curr_info.par->data); + } else { + /* if no registered dissector create output */ + for( i=0;i<len;i++) { + if(!isascii(tvb_get_guint8(tvb, offset+i)) || tvb_get_guint8(tvb, offset+i) == 0) { + /* not ascii or NULL character so do string as hex string */ + proto_tree_add_text(tree, tvb, offset, len,"%s: 0x%s", + (proto_registrar_get_nth(hf_index))->name, + tvb_bytes_to_str(tvb, 0, len)); + return len; + }; }; - }; - /* if here, then string is ascii */ - proto_tree_add_text(tree, tvb, offset, len,"%s: %s", - (proto_registrar_get_nth(hf_index))->name, - tvb_format_text(tvb, 0, len)); + /* if here, then string is ascii */ + proto_tree_add_text(tree, tvb, offset, len,"%s: %s", + (proto_registrar_get_nth(hf_index))->name, + tvb_format_text(tvb, 0, len)); + } offset = len; + return offset; @@ -5388,7 +5361,7 @@ dissect_h248_ValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U /*--- End of included file: packet-h248-fn.c ---*/ -#line 1364 "../../asn1/h248/packet-h248-template.c" +#line 1404 "../../asn1/h248/packet-h248-template.c" static void dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle); @@ -5430,6 +5403,16 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } } + { + proto_item *hidden_item = NULL; + guint32 magic_num = 0, offset = 0; + magic_num = tvb_get_ntohl(tvb, offset); + hidden_item = proto_tree_add_uint(tree, hf_248_magic_num, tvb, offset, 4, magic_num); + PROTO_ITEM_SET_HIDDEN(hidden_item); + if( dissector_try_uint(subdissector_table, magic_num, tvb, pinfo, tree) ) { + return; + } + } } /* Make entry in the Protocol column on summary display */ @@ -5451,15 +5434,17 @@ void proto_register_h248(void) { /* List of fields */ static hf_register_info hf[] = { + { &hf_248_magic_num, { + "Magic Number for Avaya H248", "h248.magic_num", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}}, { &hf_h248_mtpaddress_ni, { "NI", "h248.mtpaddress.ni", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_h248_mtpaddress_pc, { "PC", "h248.mtpaddress.pc", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, - { &hf_h248_pkg_name, { + { &hf_h248_pkg_name, { "Package", "h248.package_name", FT_UINT16, BASE_HEX|BASE_EXT_STRING, - &package_name_vals_ext, 0, NULL, HFILL }}, + NULL, 0, NULL, HFILL }}, { &hf_248_pkg_param, { "Parameter ID", "h248.package_paramid", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, @@ -5471,10 +5456,10 @@ void proto_register_h248(void) { NULL, 0, "Parameter ID", HFILL }}, { &hf_h248_event_name, { "Package and Event name", "h248.event_name", FT_UINT32, BASE_HEX|BASE_EXT_STRING, - &event_name_vals_ext, 0, "Package", HFILL }}, + NULL, 0, "Package", HFILL }}, { &hf_h248_signal_name, { "Package and Signal name", "h248.signal_name", FT_UINT32, BASE_HEX|BASE_EXT_STRING, - &signal_name_vals_ext, 0, "Package", HFILL }}, + NULL, 0, "Package", HFILL }}, { &hf_h248_pkg_bcp_BNCChar_PDU, { "BNCChar", "h248.package_bcp.BNCChar", FT_UINT32, BASE_DEC, VALS(gcp_term_types), 0, @@ -5963,7 +5948,7 @@ void proto_register_h248(void) { { "auditDescriptor", "h248.auditDescriptor", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, - { &hf_h248_statisticsDescriptor, + { &hf_h248_aDstatisticsDescriptor, { "statisticsDescriptor", "h248.statisticsDescriptor", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, @@ -6003,6 +5988,10 @@ void proto_register_h248(void) { { "observedEventsDescriptor", "h248.observedEventsDescriptor", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, + { &hf_h248_aRPstatisticsDescriptor, + { "statisticsDescriptor", "h248.statisticsDescriptor", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_packagesDescriptor, { "packagesDescriptor", "h248.packagesDescriptor", FT_UINT32, BASE_DEC, NULL, 0, @@ -6087,7 +6076,7 @@ void proto_register_h248(void) { { "remoteDescriptor", "h248.remoteDescriptor", FT_NONE, BASE_NONE, NULL, 0, "IndAudLocalRemoteDescriptor", HFILL }}, - { &hf_h248_statisticsDescriptor_01, + { &hf_h248_statisticsDescriptor, { "statisticsDescriptor", "h248.statisticsDescriptor", FT_NONE, BASE_NONE, NULL, 0, "IndAudStatisticsDescriptor", HFILL }}, @@ -6319,6 +6308,10 @@ void proto_register_h248(void) { { "remoteDescriptor", "h248.remoteDescriptor", FT_NONE, BASE_NONE, NULL, 0, "LocalRemoteDescriptor", HFILL }}, + { &hf_h248_sPstatisticsDescriptor, + { "statisticsDescriptor", "h248.statisticsDescriptor", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_h248_streamMode, { "streamMode", "h248.streamMode", FT_UINT32, BASE_DEC, VALS(h248_StreamMode_vals), 0, @@ -6331,11 +6324,11 @@ void proto_register_h248(void) { { "reserveGroup", "h248.reserveGroup", FT_BOOLEAN, BASE_NONE, NULL, 0, "BOOLEAN", HFILL }}, - { &hf_h248_propertyParms_01, + { &hf_h248_lCDpropertyParms, { "propertyParms", "h248.propertyParms", FT_UINT32, BASE_DEC, NULL, 0, "SEQUENCE_OF_PropertyParm", HFILL }}, - { &hf_h248_propertyParms_item, + { &hf_h248_lCDpropertyParms_item, { "PropertyParm", "h248.PropertyParm", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, @@ -6367,6 +6360,14 @@ void proto_register_h248(void) { { "PropertyParm", "h248.PropertyParm", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }}, + { &hf_h248_tSDpropertyParms, + { "propertyParms", "h248.propertyParms", + FT_UINT32, BASE_DEC, NULL, 0, + "SEQUENCE_OF_PropertyParm", HFILL }}, + { &hf_h248_tSDpropertyParms_item, + { "PropertyParm", "h248.PropertyParm", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL }}, { &hf_h248_tSEventBufferControl, { "eventBufferControl", "h248.eventBufferControl", FT_UINT32, BASE_DEC, VALS(h248_EventBufferControl_vals), 0, @@ -6703,18 +6704,6 @@ void proto_register_h248(void) { { "value", "h248.value", FT_BYTES, BASE_NONE, NULL, 0, "EventParamValueV1", HFILL }}, - { &hf_h248_prop_parm_value, - { "value", "h248.value", - FT_UINT32, BASE_DEC, NULL, 0, - "T_prop_parm_value", HFILL }}, - { &hf_h248_prop_parm_value_item, - { "value item", "h248.value_item", - FT_BYTES, BASE_NONE, NULL, 0, - "OCTET_STRING", HFILL }}, - { &hf_h248_extra_info, - { "extraInfo", "h248.extraInfo", - FT_UINT32, BASE_DEC, VALS(h248_T_extra_info_vals), 0, - "T_extra_info", HFILL }}, { &hf_h248_sig_param_value, { "value", "h248.value", FT_BYTES, BASE_NONE, NULL, 0, @@ -6781,7 +6770,7 @@ void proto_register_h248(void) { NULL, HFILL }}, /*--- End of included file: packet-h248-hfarr.c ---*/ -#line 1504 "../../asn1/h248/packet-h248-template.c" +#line 1556 "../../asn1/h248/packet-h248-template.c" GCP_HF_ARR_ELEMS("h248",h248_arrel) @@ -6944,13 +6933,10 @@ void proto_register_h248(void) { &ett_h248_AuditReplyV1, &ett_h248_AuditResultV1, &ett_h248_EventParameterV1, - &ett_h248_PropertyParmV1, - &ett_h248_T_prop_parm_value, - &ett_h248_T_extra_info, &ett_h248_SigParameterV1, /*--- End of included file: packet-h248-ettarr.c ---*/ -#line 1522 "../../asn1/h248/packet-h248-template.c" +#line 1574 "../../asn1/h248/packet-h248-template.c" }; module_t *h248_module; @@ -6964,6 +6950,8 @@ void proto_register_h248(void) { /* Register fields and subtrees */ proto_register_field_array(proto_h248, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + subdissector_table = register_dissector_table("h248.magic_num", "H248 Magic Num", FT_UINT32, BASE_HEX); h248_module = prefs_register_protocol(proto_h248, proto_reg_handoff_h248); prefs_register_bool_preference(h248_module, "ctx_info", diff --git a/epan/dissectors/packet-h248.h b/epan/dissectors/packet-h248.h index 03fb356cf3..aa9876a126 100644 --- a/epan/dissectors/packet-h248.h +++ b/epan/dissectors/packet-h248.h @@ -36,7 +36,6 @@ #ifndef PACKET_H248_H #include <epan/gcp.h> - /*#include "packet-h248-exp.h"*/ typedef struct _h248_curr_info_t h248_curr_info_t; @@ -51,6 +50,13 @@ extern void h248_param_ber_boolean(proto_tree*, tvbuff_t*, packet_info* , int, h extern void external_dissector(proto_tree*, tvbuff_t*, packet_info* , int, h248_curr_info_t*,void* dissector_handle); extern void h248_param_PkgdName(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo , int hfid _U_, h248_curr_info_t* u _U_, void* dissector_hdl); +typedef enum { + ADD_PKG, /* add package at registration ONLY if no matching package ID */ + REPLACE_PKG, /* replace/add package at registration */ + MERGE_PKG_HIGH, /* merge h248_package_t at registration favor new package */ + MERGE_PKG_LOW /* merge h248_package_t at registration favor current package */ +} pkg_reg_action; + typedef struct _h248_pkg_param_t { guint32 id; int* hfid; @@ -96,6 +102,11 @@ typedef struct _h248_package_t { const h248_pkg_stat_t* statistics; } h248_package_t; +typedef struct _save_h248_package_t { + h248_package_t *pkg; + gboolean is_default; +} s_h248_package_t; + struct _h248_curr_info_t { gcp_ctx_t* ctx; gcp_trx_t* trx; @@ -109,6 +120,6 @@ struct _h248_curr_info_t { const h248_pkg_param_t* par; }; -void h248_register_package(const h248_package_t*); +void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action); #endif /* PACKET_H248_H */ diff --git a/epan/dissectors/packet-h248_10.c b/epan/dissectors/packet-h248_10.c index 61012c5d8b..a43a0ea10e 100644 --- a/epan/dissectors/packet-h248_10.c +++ b/epan/dissectors/packet-h248_10.c @@ -77,10 +77,12 @@ static const h248_package_t h248_pkg_CHP = { 0x0029, &proto_h248_CHP, &ett_h248_CHP, + h248_CHP_prop_vals, NULL, h248_CHP_events_vals, NULL, + NULL, NULL, h248_CHP_mgcon_events, @@ -105,7 +107,7 @@ void proto_register_h248_dot10(void) { proto_register_subtree_array(ett, array_length(ett)); - h248_register_package(&h248_pkg_CHP); + h248_register_package(&h248_pkg_CHP,REPLACE_PKG); } diff --git a/epan/dissectors/packet-h248_2.c b/epan/dissectors/packet-h248_2.c index 3079fc0d2c..bfde05ac07 100644 --- a/epan/dissectors/packet-h248_2.c +++ b/epan/dissectors/packet-h248_2.c @@ -151,7 +151,7 @@ void proto_register_h248_dot2(void) { proto_register_subtree_array(ett, array_length(ett)); - h248_register_package(&h248_pkg_ctype); + h248_register_package(&h248_pkg_ctype,MERGE_PKG_HIGH); } diff --git a/epan/dissectors/packet-h248_3gpp.c b/epan/dissectors/packet-h248_3gpp.c index cc42180634..739e1df68c 100644 --- a/epan/dissectors/packet-h248_3gpp.c +++ b/epan/dissectors/packet-h248_3gpp.c @@ -578,8 +578,8 @@ void proto_register_h248_3gpp(void) { proto_register_subtree_array(ett, array_length(ett)); - h248_register_package(&h248_package_3GUP); - h248_register_package(&h248_package_3GCSD); - h248_register_package(&h248_package_3GTFO); + h248_register_package(&h248_package_3GUP,REPLACE_PKG); + h248_register_package(&h248_package_3GCSD, REPLACE_PKG); + h248_register_package(&h248_package_3GTFO, REPLACE_PKG); } diff --git a/epan/dissectors/packet-h248_7.c b/epan/dissectors/packet-h248_7.c index d94ad99b32..383b602647 100644 --- a/epan/dissectors/packet-h248_7.c +++ b/epan/dissectors/packet-h248_7.c @@ -57,36 +57,41 @@ static gint ett_h248_an = -1; static gint ett_h248_an_apf = -1; static gint ett_h248_an_apv = -1; +static const value_string h248_an_prop_vals[] = { + { 0, "Generic Announcment Package (an) (H.248.7)" }, + { 0, NULL } +}; + static const value_string h248_an_signals_vals[] = { - { 0x0001, "apf"}, - { 0x0002, "apv"}, + { 0x0001, "Annoumcement Play Fixed (apf)"}, + { 0x0002, "Announcement Play Variable (apv)"}, {0,NULL} }; static const value_string h248_an_apf_params_vals[] = { - { 0x0001, "an"}, - { 0x0002, "noc"}, - { 0x0003, "av"}, - { 0x0004, "di"}, + { 0x0001, "Name (an)"}, + { 0x0002, "Number of Cycles (noc)"}, + { 0x0003, "Variant (av)"}, + { 0x0004, "Direction (di)"}, {0,NULL} }; static const value_string h248_an_apv_params_vals[] = { - { 0x0001, "an"}, - { 0x0002, "noc"}, - { 0x0003, "av"}, - { 0x0004, "num"}, - { 0x0005, "spi"}, - { 0x0006, "sp"}, - { 0x0007, "di"}, + { 0x0001, "Name (an)"}, + { 0x0002, "Number of Cycles (noc)"}, + { 0x0003, "Variant (av)"}, + { 0x0004, "Number (num)"}, + { 0x0005, "Specific Parameters Interpretation (spi)"}, + { 0x0006, "Specific Parameters (sp)"}, + { 0x0007, "Direction (di)"}, {0,NULL} }; static const value_string h248_an_di_vals[] = { - { 0x0001, "ext"}, - { 0x0002, "int"}, - { 0x0003, "both"}, + { 0x0001, "External (ext)"}, + { 0x0002, "Internal (int)"}, + { 0x0003, "Both (both)"}, {0,NULL} }; @@ -122,7 +127,7 @@ static const h248_package_t h248_pkg_an = { 0x001d, &proto_h248_an, &ett_h248_an, - NULL, + h248_an_prop_vals, h248_an_signals_vals, NULL, NULL, @@ -168,7 +173,7 @@ void proto_register_h248_7(void) { proto_register_subtree_array(ett, array_length(ett)); - h248_register_package(&h248_pkg_an); + h248_register_package(&h248_pkg_an,REPLACE_PKG); } diff --git a/epan/dissectors/packet-h248_annex_c.c b/epan/dissectors/packet-h248_annex_c.c index 67c8582887..d03c21647c 100644 --- a/epan/dissectors/packet-h248_annex_c.c +++ b/epan/dissectors/packet-h248_annex_c.c @@ -1510,6 +1510,6 @@ void proto_register_h248_annex_c(void) { proto_register_subtree_array(ett, array_length(ett)); - h248_register_package(&h248_annexc_package); + h248_register_package(&h248_annexc_package,MERGE_PKG_HIGH); } diff --git a/epan/dissectors/packet-h248_annex_e.c b/epan/dissectors/packet-h248_annex_e.c index 3ef38f31c7..2f75286ab6 100644 --- a/epan/dissectors/packet-h248_annex_e.c +++ b/epan/dissectors/packet-h248_annex_e.c @@ -29,6 +29,14 @@ # include "config.h" #endif + +/*****/ +#include <epan/proto.h> +#include <epan/tvbuff.h> +#include <epan/tvbuff-int.h> +#include <epan/tvbparse.h> +/*****/ + #include "packet-h248.h" #define PNAME "H.248 Annex E" #define PSNAME "H248E" @@ -197,7 +205,7 @@ static const value_string h248_pkg_tonegen_props_vals[] = { }; static const value_string h248_pkg_tonegen_sigs_vals[] = { - { 0x0001, "Play Tone (pt)1" }, + { 0x0001, "Play Tone (pt)" }, { 0, NULL } }; @@ -534,7 +542,7 @@ static h248_pkg_param_t h248_pkg_dd_ds_events[] = { }; static const h248_pkg_param_t h248_pkg_dd_event_params[] = { - { 0x0001, &hf_h248_pkg_dd_evt_tl_param, h248_param_uint_item, &implicit }, + { 0x0001, &hf_h248_pkg_dd_evt_tl_param, h248_param_ber_integer, &implicit }, { 0x0002, &hf_h248_pkg_dd_evt_dur_param, h248_param_ber_integer, &implicit }, { 0x0003, &hf_h248_pkg_dd_evt_tid_param, h248_param_ber_integer, &implicit }, { 0, NULL, NULL, NULL } @@ -624,7 +632,7 @@ static const value_string h248_pkg_cg_pt_btd_param_vals[] = { }; static const h248_pkg_param_t h248_pkg_cg_sig_pt_params[] = { - { 0x0001, &hf_h248_pkg_cg_sig_pt_tl, h248_param_ber_integer, &implicit }, + { 0x0001, &hf_h248_pkg_cg_sig_pt_tl, h248_param_ber_integer, &implicit }, { 0x0002, &hf_h248_pkg_cg_sig_pt_ind, h248_param_ber_integer, &implicit }, { 0x0003, &hf_h248_pkg_cg_sig_pt_btd, h248_param_ber_integer, &implicit }, { 0, NULL, NULL, NULL} @@ -682,6 +690,9 @@ static h248_package_t h248_pkg_cd = { /* H.248.1 E.9 Analog Line Supervision Package */ static int hf_h248_pkg_al = -1; +static int hf_h248_pkg_al_sig_cadence = -1; +static int hf_h248_pkg_al_sig_cadence_on_off = -1; +static int hf_h248_pkg_al_sig_freq = -1; static int hf_h248_pkg_al_evt_onhook = -1; static int hf_h248_pkg_al_evt_offhook = -1; static int hf_h248_pkg_al_evt_flashhook = -1; @@ -692,6 +703,8 @@ static int hf_h248_pkg_al_evt_offhook_par_init = -1; static int hf_h248_pkg_al_evt_flashhook_par_mindur = -1; static gint ett_h248_pkg_al = -1; +static gint ett_h248_pkg_al_sig_cadence = -1; +static gint ett_h248_pkg_al_sig_freq = -1; static gint ett_h248_pkg_al_evt_onhook = -1; static gint ett_h248_pkg_al_evt_offhook = -1; static gint ett_h248_pkg_al_evt_flashhook = -1; @@ -701,6 +714,14 @@ static const value_string h248_pkg_al_props_vals[] = { { 0, NULL } }; +static const value_string h248_pkg_al_sig_params_vals[] = { + { 1, "One" }, + { 2, "Two" }, + { 0x0006, "Cadence" }, + { 0x0007, "Frequency (Hz)" }, + { 0, NULL } +}; + static const value_string h248_pkg_al_evt_onhook_params_vals[] = { { 0x0001, "strict"}, { 0x0002, "init"}, @@ -712,15 +733,17 @@ static const value_string h248_pkg_al_evt_flashhook_params_vals[] = { { 0, NULL} }; -static const value_string h248_pkg_al_evts_vals[] = { - { 0x0004, "onhook"}, - { 0x0005, "offhook"}, - { 0x0006, "flashhook"}, - { 0, NULL} +/* Packet defenitions */ +static const value_string h248_pkg_al_sig_evts_vals[] _U_ = { + /* Signals */ + { 0x0002, "ri (Ring)" }, + /* Events */ + { 0x0004, "on (On-hook)" }, + { 0x0005, "off (Off-hook)" }, + { 0x0006, "fl (Flashhook)" }, + {0, NULL}, }; - - /* Events defenitions */ static const value_string h248_pkg_al_evt_onhook_strict_vals[] = { { 0, "exact"}, @@ -739,6 +762,12 @@ static const true_false_string h248_pkg_al_evt_offhook_par_init_vals = { "actual state transition to off-hook" }; + +static h248_pkg_param_t h248_pkg_al_sig_cadence[] = { + { 0x0006, &hf_h248_pkg_al_sig_cadence_on_off, h248_param_ber_octetstring, &h248_e_implicit }, + { 0, NULL, NULL, NULL } +}; + static h248_pkg_param_t h248_pkg_al_evt_onhook_params[] = { { 0x0001, &hf_h248_pkg_al_evt_onhook_par_strict, h248_param_ber_integer, &h248_e_implicit }, { 0x0002, &hf_h248_pkg_al_evt_onhook_par_init, h248_param_ber_boolean, &h248_e_implicit }, @@ -756,6 +785,11 @@ static h248_pkg_param_t h248_pkg_al_evt_flashhook_params[] = { { 0, NULL, NULL, NULL} }; +static h248_pkg_sig_t h248_pkg_al_sig[] = { + { 0x0002, &hf_h248_pkg_al_sig_cadence, &ett_h248_pkg_al_sig_cadence, h248_pkg_al_sig_cadence, h248_pkg_al_sig_params_vals}, + { 0, NULL, NULL, NULL, NULL } +}; + static h248_pkg_evt_t h248_pkg_al_evts[] = { { 0x0004, &hf_h248_pkg_al_evt_onhook, &ett_h248_pkg_al_evt_onhook, h248_pkg_al_evt_onhook_params, h248_pkg_al_evt_onhook_params_vals}, { 0x0005, &hf_h248_pkg_al_evt_offhook, &ett_h248_pkg_al_evt_offhook, h248_pkg_al_evt_offhook_params, h248_pkg_al_evt_onhook_params_vals }, @@ -764,28 +798,16 @@ static h248_pkg_evt_t h248_pkg_al_evts[] = { { 0, NULL, NULL, NULL, NULL} }; -/* Packet defenitions */ -static const value_string h248_pkg_al_parameters[] _U_ = { - /* Signals */ - { 0x0002, "ri (Ring)" }, - /* Events */ - { 0x0004, "on (On-hook)" }, - { 0x0005, "off (Off-hook)" }, - { 0x0006, "fl (Flashhook)" }, - - {0, NULL}, -}; - static h248_package_t h248_pkg_al = { 0x0009, &hf_h248_pkg_al, &ett_h248_pkg_al, h248_pkg_al_props_vals, - NULL, - h248_pkg_al_evts_vals, + h248_pkg_al_sig_evts_vals, + h248_pkg_al_sig_evts_vals, NULL, NULL, /* Properties */ - NULL, /* signals */ + h248_pkg_al_sig, /* signals */ h248_pkg_al_evts, /* events */ NULL /* statistics */ }; @@ -942,7 +964,7 @@ void proto_register_h248_annex_e(void) { /* H.248.1.E 3 Tone Generator (tonegeg) */ { &hf_h248_pkg_tonegen, { "Tone Generator (tonegen)", "h248.pkg.tonegen", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_tonegen_sig_pt, { "Play Tone (pt)", "h248.pkg.tonegen.pg", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, - { &hf_h248_pkg_tonegen_sig_pt_tl, { "Tone List ID (tl)2", "h248.pkg.tonegen.pt.tl", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, + { &hf_h248_pkg_tonegen_sig_pt_tl, { "Tone List ID (tl)", "h248.pkg.tonegen.pt.tl", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_tonegen_sig_pt_ind, { "Inter-signal Duration (ind)", "h248.pkg.tonegem.pt.ind", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_tonegen_sig_pg_btd, { "Tone Direction (btd)", "h248.pkg.tonegen.pt.btd", FT_UINT32, BASE_NONE, VALS(h248_pkg_tonegen_pt_btd_param_vals), 0, NULL, HFILL }}, @@ -988,7 +1010,7 @@ void proto_register_h248_annex_e(void) { /* H.248.1.E.7 Call Progress Tones Generator package */ { &hf_h248_pkg_cg, { "Call Progress Tones Generator", "h248.pkg.cg", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_cg_sig_pt, { "Play Tone (pt)", "h248.pkg.cg.pt", FT_UINT16, BASE_HEX, VALS(h248_pkg_cg_sig_cd_evt_vals), 0, NULL, HFILL }}, - { &hf_h248_pkg_cg_sig_pt_tl, {"Tone List", "h248.pkg.cg.pt.tl", FT_UINT16, BASE_HEX, VALS(h248_pkg_cg_sig_cd_evt_vals), 0, NULL, HFILL }}, + { &hf_h248_pkg_cg_sig_pt_tl, {"Tone List", "h248.pkg.cg.pt.tl", FT_UINT16, BASE_DEC_HEX, VALS(h248_pkg_cg_sig_cd_evt_vals), 0, NULL, HFILL }}, { &hf_h248_pkg_cg_sig_pt_ind, { "Inter-Signal Duration (ind)", "h248.pkg-cg.pt.ind", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_cg_sig_pt_btd, { "Tone Direction (btd)", "h248.pkg.cg.pt.btd", FT_UINT8, BASE_DEC, VALS(h248_pkg_cg_pt_btd_param_vals), 0, NULL, HFILL }}, @@ -1007,6 +1029,9 @@ void proto_register_h248_annex_e(void) { /* H.248.1 E.9 Analog Line Supervision Package */ { &hf_h248_pkg_al, { "Analog Line Supervision Package", "h248.pkg.al", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, + { &hf_h248_pkg_al_sig_cadence, { "Cadence", "h248.pkg.al.sig.cadence", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, + { &hf_h248_pkg_al_sig_cadence_on_off, { "On/Off Cadence", "h248.pkg.al.sig.cadence_on_off", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, + { &hf_h248_pkg_al_sig_freq, { "Ring Frequency", "h248.pkg.al.sig.freq", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_al_evt_onhook, { "onhook", "h248.pkg.al.onhook", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_al_evt_offhook, { "offhook", "h248.pkg.al.offhook", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, { &hf_h248_pkg_al_evt_flashhook, { "flashhook", "h248.pkg.al.flashhook", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, @@ -1086,6 +1111,8 @@ void proto_register_h248_annex_e(void) { /* al 0x0009 */ &ett_h248_pkg_al, + &ett_h248_pkg_al_sig_cadence, + &ett_h248_pkg_al_sig_freq, &ett_h248_pkg_al_evt_flashhook, &ett_h248_pkg_al_evt_offhook, &ett_h248_pkg_al_evt_onhook, @@ -1109,19 +1136,21 @@ void proto_register_h248_annex_e(void) { proto_register_subtree_array(ett, array_length(ett)); - h248_register_package(&h248_pkg_generic); /* 0x0001 */ - h248_register_package(&h248_pkg_root); /* 0x0002 */ - h248_register_package(&h248_pkg_tonegen); /* 0x0003 */ - h248_register_package(&h248_pkg_tonedet); /* 0x0004 */ - h248_register_package(&h248_pkg_dg); /* 0X0005 */ - h248_register_package(&h248_pkg_dd); /* 0x0006 */ - h248_register_package(&h248_pkg_cg); /* 0x0007 */ - h248_register_package(&h248_pkg_cd); /* 0x0008 */ - h248_register_package(&h248_pkg_al); /* 0x0009 */ - h248_register_package(&h248_pkg_ct); /* 0x000a */ - h248_register_package(&h248_pkg_nt); /* 0x000b */ - h248_register_package(&h248_pkg_rtp); /* 0x000c */ - h248_register_package(&h248_pkg_tdmc); /* 0x000d */ + /* MERGE_PKG_LOW is use to allow other custom version of these + *H248 package to take presidence if already loaded */ + h248_register_package(&h248_pkg_generic,MERGE_PKG_LOW); /* 0x0001 */ + h248_register_package(&h248_pkg_root,MERGE_PKG_LOW); /* 0x0002 */ + h248_register_package(&h248_pkg_tonegen,MERGE_PKG_LOW); /* 0x0003 */ + h248_register_package(&h248_pkg_tonedet,MERGE_PKG_LOW); /* 0x0004 */ + h248_register_package(&h248_pkg_dg,MERGE_PKG_LOW); /* 0X0005 */ + h248_register_package(&h248_pkg_dd,MERGE_PKG_LOW); /* 0x0006 */ + h248_register_package(&h248_pkg_cg,MERGE_PKG_LOW); /* 0x0007 */ + h248_register_package(&h248_pkg_cd, MERGE_PKG_LOW); /* 0x0008 */ + h248_register_package(&h248_pkg_al,MERGE_PKG_LOW); /* 0x0009 */ + h248_register_package(&h248_pkg_ct, MERGE_PKG_LOW); /* 0x000a */ + h248_register_package(&h248_pkg_nt, MERGE_PKG_LOW); /* 0x000b */ + h248_register_package(&h248_pkg_rtp,MERGE_PKG_LOW); /* 0x000c */ + h248_register_package(&h248_pkg_tdmc,MERGE_PKG_LOW); /* 0x000d */ } diff --git a/epan/dissectors/packet-h248_q1950.c b/epan/dissectors/packet-h248_q1950.c index cf13da9d19..f2f4eac462 100644 --- a/epan/dissectors/packet-h248_q1950.c +++ b/epan/dissectors/packet-h248_q1950.c @@ -55,7 +55,6 @@ static const value_string h248_pkg_BCP_parameters[] _U_ = { static const value_string h248_pkg_BCP_props_vals[] = { {0, "Bearer Characteristics Q.1950 Annex A (bcp)" }, {1, "BNC Characteristics (BNCChar)"}, - {1,"BNCChar"}, {0,NULL} }; @@ -623,11 +622,11 @@ void proto_register_q1950(void) { proto_register_subtree_array(ett, array_length(ett)); /* Register the packages */ - h248_register_package(&h248_pkg_BCP); - h248_register_package(&h248_pkg_BNCCT); - h248_register_package(&h248_pkg_RI); - h248_register_package(&h248_pkg_GB); - h248_register_package(&h248_pkg_bcg); - h248_register_package(&h248_pkg_bct); + h248_register_package(&h248_pkg_BCP,REPLACE_PKG); + h248_register_package(&h248_pkg_BNCCT,REPLACE_PKG); + h248_register_package(&h248_pkg_RI,REPLACE_PKG); + h248_register_package(&h248_pkg_GB,REPLACE_PKG); + h248_register_package(&h248_pkg_bcg,REPLACE_PKG); + h248_register_package(&h248_pkg_bct,REPLACE_PKG); } |