from Alex Lindberg:

Update to packet-h248.c and associated h248 dissecorts.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7332

svn path=/trunk/; revision=43107
This commit is contained in:
Anders Broman 2012-06-05 10:54:21 +00:00
parent 5bd0c263f2
commit 189ea54f0b
13 changed files with 732 additions and 645 deletions

View File

@ -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 = &parameter_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) {
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) {
%(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

View File

@ -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

View File

@ -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);
/* 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 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_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
*/
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();
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) {
@ -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",

View File

@ -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 */

File diff suppressed because it is too large Load Diff

View File

@ -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 */

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 */
}

View File

@ -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);
}