diff options
-rw-r--r-- | asn1/h248/packet-h248-template.c | 97 | ||||
-rw-r--r-- | epan/dissectors/packet-h248.c | 107 | ||||
-rw-r--r-- | epan/dissectors/packet-h248_q1950.c | 352 |
3 files changed, 427 insertions, 129 deletions
diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c index 797012c55c..251689a1c2 100644 --- a/asn1/h248/packet-h248-template.c +++ b/asn1/h248/packet-h248-template.c @@ -22,7 +22,6 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -90,15 +89,6 @@ static gint ett_h248_no_evt = -1; static dissector_handle_t h248_term_handle; -#if 0 -static GHashTable* h248_pkg_signals = NULL; -static GHashTable* h248_pkg_events = NULL; -static GHashTable* h248_pkg_properties = NULL; -static GHashTable* h248_wild_terms = NULL; - -static dissector_table_t h248_pkg_bin_dissector_table=NULL; -#endif - static emem_tree_t* msgs = NULL; static emem_tree_t* trxs = NULL; static emem_tree_t* ctxs_by_trx = NULL; @@ -116,10 +106,18 @@ static tvbuff_t* h248_tvb; static dissector_handle_t h248_handle; static dissector_handle_t h248_term_handle; +static const value_string term_types[] = { + { H248_TERM_TYPE_AAL1, "aal1" }, + { H248_TERM_TYPE_AAL2, "aal2" }, + { H248_TERM_TYPE_AAL1_STRUCT, "aal1struct" }, + { H248_TERM_TYPE_IP_RTP, "ipRtp" }, + { H248_TERM_TYPE_TDM, "tdm" }, + { 0, NULL } +}; + /* Forward declarations */ static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); - static const value_string package_name_vals[] = { { 0x0000, "Media stream properties H.248.1 Annex C" }, { 0x0001, "Generic H.248.1 Annex E" }, @@ -588,10 +586,10 @@ extern void h248_param_external_dissector(proto_tree* tree, tvbuff_t* tvb, packe } -static h248_package_t no_package = { 0xffff, &hf_h248_no_pkg, &ett_h248_no_pkg, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -static h248_pkg_sig_t no_signal = { 0, &hf_h248_no_sig, &ett_h248_no_sig, NULL, NULL }; -static h248_pkg_param_t no_param = { 0, &hf_h248_param, h248_param_item, NULL }; -static h248_pkg_evt_t no_event = { 0, &hf_h248_no_evt, &ett_h248_no_evt, NULL, NULL }; +static const h248_package_t no_package = { 0xffff, &hf_h248_no_pkg, &ett_h248_no_pkg, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; +static const h248_pkg_sig_t no_signal = { 0, &hf_h248_no_sig, &ett_h248_no_sig, NULL, NULL }; +static const h248_pkg_param_t no_param = { 0, &hf_h248_param, h248_param_item, NULL }; +static const h248_pkg_evt_t no_event = { 0, &hf_h248_no_evt, &ett_h248_no_evt, NULL, NULL }; static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32* trx_id_p) { guint64 trx_id = 0; @@ -680,19 +678,6 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_ return offset; } - - -static const value_string BNCChar_vals[] = { - { H248_TERM_TYPE_AAL1, "aal1" }, - { H248_TERM_TYPE_AAL2, "aal2" }, - { H248_TERM_TYPE_AAL1_STRUCT, "aal1struct" }, - { H248_TERM_TYPE_IP_RTP, "ipRtp" }, - { H248_TERM_TYPE_TDM, "tdm" }, - { 0, NULL } -}; - - - static GPtrArray* packages = NULL; void h248_register_package(const h248_package_t* pkg) { @@ -764,8 +749,7 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse } -static int -dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { +static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *package_tree=NULL; guint16 name_major, name_minor; @@ -829,8 +813,7 @@ dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_ -static int -dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index) { +static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *package_tree=NULL; guint16 name_major, name_minor; @@ -891,8 +874,7 @@ dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, packe return offset; } -static int -dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) { gint8 class; gboolean pc, ind; @@ -942,13 +924,16 @@ dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pa } -static int -dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; const h248_pkg_param_t* sigpar; - + const gchar* strval; + proto_item* pi; + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &next_tvb); + pi = get_ber_last_created_item(); + switch(tvb_length(next_tvb)) { case 4: param_id = tvb_get_ntohl(next_tvb,0); break; case 3: param_id = tvb_get_ntoh24(next_tvb,0); break; @@ -968,11 +953,18 @@ dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs } } + if (curr_info.sig->param_names && ( strval = match_strval(param_id, curr_info.sig->param_names) )) { + strval = ep_strdup_printf("%s (%d)",strval,param_id); + } else { + strval = ep_strdup_printf("Unknown (%d)",param_id); + } + + proto_item_set_text(pi,"Parameter: %s", strval); + return offset; } -static int -dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; int old_offset, end_offset; gint8 class; @@ -1001,13 +993,15 @@ dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, return end_offset; } -static int -dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; const h248_pkg_param_t* evtpar; + const gchar* strval; + proto_item* pi; offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &next_tvb); + pi = get_ber_last_created_item(); if (next_tvb) { switch(tvb_length(next_tvb)) { @@ -1019,6 +1013,7 @@ dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int of } } + curr_info.par = &no_param; if (curr_info.evt->parameters) { @@ -1031,12 +1026,20 @@ dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int of } else { curr_info.par = &no_param; } + + if (curr_info.evt->param_names && ( strval = match_strval(param_id, curr_info.evt->param_names) )) { + strval = ep_strdup_printf("%s (%d)",strval,param_id); + } else { + strval = ep_strdup_printf("Unknown (%d)",param_id); + } + + proto_item_set_text(pi,"Parameter: %s", strval); + return offset; } -static int -dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; int old_offset, end_offset; gint8 class; @@ -1065,8 +1068,7 @@ dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offse return end_offset; } -static int -dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { +static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *mtp_tree=NULL; guint32 val; @@ -1851,7 +1853,7 @@ void proto_register_h248(void) { VALS(signal_name_vals), 0, "Package", HFILL }}, { &hf_h248_pkg_bcp_BNCChar_PDU, { "BNCChar", "h248.package_bcp.BNCChar", - FT_UINT32, BASE_DEC, VALS(BNCChar_vals), 0, + FT_UINT32, BASE_DEC, VALS(term_types), 0, "BNCChar", HFILL }}, { &hf_h248_error_code, @@ -1900,7 +1902,7 @@ void proto_register_h248(void) { { &hf_h248_ctx, { "Context", "h248.ctx", FT_UINT32, BASE_HEX, NULL, 0, "", HFILL }}, { &hf_h248_ctx_term, { "Termination", "h248.ctx.term", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }}, - { &hf_h248_ctx_term_type, { "Type", "h248.ctx.term.type", FT_UINT32, BASE_HEX, VALS(BNCChar_vals), 0, "", HFILL }}, + { &hf_h248_ctx_term_type, { "Type", "h248.ctx.term.type", FT_UINT32, BASE_HEX, VALS(term_types), 0, "", HFILL }}, { &hf_h248_ctx_term_bir, { "BIR", "h248.ctx.term.bir", FT_STRING, BASE_HEX, NULL, 0, "", HFILL }}, { &hf_h248_ctx_term_nsap, { "NSAP", "h248.ctx.term.nsap", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }}, { &hf_h248_ctx_cmd, { "Command", "h248.ctx.cmd", FT_FRAMENUM, BASE_DEC, NULL, 0, "", HFILL }}, @@ -1967,3 +1969,4 @@ void proto_reg_handoff_h248(void) { } + diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c index b0135c7691..b3ab84339d 100644 --- a/epan/dissectors/packet-h248.c +++ b/epan/dissectors/packet-h248.c @@ -30,7 +30,6 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -384,7 +383,7 @@ static int hf_h248_NotifyCompletion_otherReason = -1; static int hf_h248_NotifyCompletion_onIteration = -1; /*--- End of included file: packet-h248-hf.c ---*/ -#line 71 "packet-h248-template.c" +#line 70 "packet-h248-template.c" /* Initialize the subtree pointers */ static gint ett_h248 = -1; @@ -547,19 +546,10 @@ static gint ett_h248_TimeNotation = -1; static gint ett_h248_Value = -1; /*--- End of included file: packet-h248-ett.c ---*/ -#line 90 "packet-h248-template.c" +#line 89 "packet-h248-template.c" static dissector_handle_t h248_term_handle; -#if 0 -static GHashTable* h248_pkg_signals = NULL; -static GHashTable* h248_pkg_events = NULL; -static GHashTable* h248_pkg_properties = NULL; -static GHashTable* h248_wild_terms = NULL; - -static dissector_table_t h248_pkg_bin_dissector_table=NULL; -#endif - static emem_tree_t* msgs = NULL; static emem_tree_t* trxs = NULL; static emem_tree_t* ctxs_by_trx = NULL; @@ -577,10 +567,18 @@ static tvbuff_t* h248_tvb; static dissector_handle_t h248_handle; static dissector_handle_t h248_term_handle; +static const value_string term_types[] = { + { H248_TERM_TYPE_AAL1, "aal1" }, + { H248_TERM_TYPE_AAL2, "aal2" }, + { H248_TERM_TYPE_AAL1_STRUCT, "aal1struct" }, + { H248_TERM_TYPE_IP_RTP, "ipRtp" }, + { H248_TERM_TYPE_TDM, "tdm" }, + { 0, NULL } +}; + /* Forward declarations */ static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); - static const value_string package_name_vals[] = { { 0x0000, "Media stream properties H.248.1 Annex C" }, { 0x0001, "Generic H.248.1 Annex E" }, @@ -1049,10 +1047,10 @@ extern void h248_param_external_dissector(proto_tree* tree, tvbuff_t* tvb, packe } -static h248_package_t no_package = { 0xffff, &hf_h248_no_pkg, &ett_h248_no_pkg, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -static h248_pkg_sig_t no_signal = { 0, &hf_h248_no_sig, &ett_h248_no_sig, NULL, NULL }; -static h248_pkg_param_t no_param = { 0, &hf_h248_param, h248_param_item, NULL }; -static h248_pkg_evt_t no_event = { 0, &hf_h248_no_evt, &ett_h248_no_evt, NULL, NULL }; +static const h248_package_t no_package = { 0xffff, &hf_h248_no_pkg, &ett_h248_no_pkg, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; +static const h248_pkg_sig_t no_signal = { 0, &hf_h248_no_sig, &ett_h248_no_sig, NULL, NULL }; +static const h248_pkg_param_t no_param = { 0, &hf_h248_param, h248_param_item, NULL }; +static const h248_pkg_evt_t no_event = { 0, &hf_h248_no_evt, &ett_h248_no_evt, NULL, NULL }; static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint32* trx_id_p) { guint64 trx_id = 0; @@ -1141,19 +1139,6 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_ return offset; } - - -static const value_string BNCChar_vals[] = { - { H248_TERM_TYPE_AAL1, "aal1" }, - { H248_TERM_TYPE_AAL2, "aal2" }, - { H248_TERM_TYPE_AAL1_STRUCT, "aal1struct" }, - { H248_TERM_TYPE_IP_RTP, "ipRtp" }, - { H248_TERM_TYPE_TDM, "tdm" }, - { 0, NULL } -}; - - - static GPtrArray* packages = NULL; void h248_register_package(const h248_package_t* pkg) { @@ -1225,8 +1210,7 @@ static int dissect_h248_PkgdName(gboolean implicit_tag, tvbuff_t *tvb, int offse } -static int -dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { +static int dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *package_tree=NULL; guint16 name_major, name_minor; @@ -1290,8 +1274,7 @@ dissect_h248_EventName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_ -static int -dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index) { +static int dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, packet_info *pinfo , proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *package_tree=NULL; guint16 name_major, name_minor; @@ -1352,8 +1335,7 @@ dissect_h248_SignalName(gboolean implicit_tag , tvbuff_t *tvb, int offset, packe return offset; } -static int -dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) { gint8 class; gboolean pc, ind; @@ -1403,13 +1385,16 @@ dissect_h248_PropertyID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, pa } -static int -dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; const h248_pkg_param_t* sigpar; - + const gchar* strval; + proto_item* pi; + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &next_tvb); + pi = get_ber_last_created_item(); + switch(tvb_length(next_tvb)) { case 4: param_id = tvb_get_ntohl(next_tvb,0); break; case 3: param_id = tvb_get_ntoh24(next_tvb,0); break; @@ -1429,11 +1414,18 @@ dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs } } + if (curr_info.sig->param_names && ( strval = match_strval(param_id, curr_info.sig->param_names) )) { + strval = ep_strdup_printf("%s (%d)",strval,param_id); + } else { + strval = ep_strdup_printf("Unknown (%d)",param_id); + } + + proto_item_set_text(pi,"Parameter: %s", strval); + return offset; } -static int -dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; int old_offset, end_offset; gint8 class; @@ -1462,13 +1454,15 @@ dissect_h248_SigParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, return end_offset; } -static int -dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; guint32 param_id = 0xffffffff; const h248_pkg_param_t* evtpar; + const gchar* strval; + proto_item* pi; offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &next_tvb); + pi = get_ber_last_created_item(); if (next_tvb) { switch(tvb_length(next_tvb)) { @@ -1480,6 +1474,7 @@ dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int of } } + curr_info.par = &no_param; if (curr_info.evt->parameters) { @@ -1492,12 +1487,20 @@ dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *tvb, int of } else { curr_info.par = &no_param; } + + if (curr_info.evt->param_names && ( strval = match_strval(param_id, curr_info.evt->param_names) )) { + strval = ep_strdup_printf("%s (%d)",strval,param_id); + } else { + strval = ep_strdup_printf("Unknown (%d)",param_id); + } + + proto_item_set_text(pi,"Parameter: %s", strval); + return offset; } -static int -dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { +static int dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { tvbuff_t *next_tvb; int old_offset, end_offset; gint8 class; @@ -1526,8 +1529,7 @@ dissect_h248_EventParamValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offse return end_offset; } -static int -dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { +static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { tvbuff_t *new_tvb; proto_tree *mtp_tree=NULL; guint32 val; @@ -6348,7 +6350,7 @@ dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag _U_, tvbuff_t *tvb, in /*--- End of included file: packet-h248-fn.c ---*/ -#line 1761 "packet-h248-template.c" +#line 1763 "packet-h248-template.c" static void dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -6442,7 +6444,7 @@ void proto_register_h248(void) { VALS(signal_name_vals), 0, "Package", HFILL }}, { &hf_h248_pkg_bcp_BNCChar_PDU, { "BNCChar", "h248.package_bcp.BNCChar", - FT_UINT32, BASE_DEC, VALS(BNCChar_vals), 0, + FT_UINT32, BASE_DEC, VALS(term_types), 0, "BNCChar", HFILL }}, { &hf_h248_error_code, @@ -7704,11 +7706,11 @@ void proto_register_h248(void) { "", HFILL }}, /*--- End of included file: packet-h248-hfarr.c ---*/ -#line 1900 "packet-h248-template.c" +#line 1902 "packet-h248-template.c" { &hf_h248_ctx, { "Context", "h248.ctx", FT_UINT32, BASE_HEX, NULL, 0, "", HFILL }}, { &hf_h248_ctx_term, { "Termination", "h248.ctx.term", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }}, - { &hf_h248_ctx_term_type, { "Type", "h248.ctx.term.type", FT_UINT32, BASE_HEX, VALS(BNCChar_vals), 0, "", HFILL }}, + { &hf_h248_ctx_term_type, { "Type", "h248.ctx.term.type", FT_UINT32, BASE_HEX, VALS(term_types), 0, "", HFILL }}, { &hf_h248_ctx_term_bir, { "BIR", "h248.ctx.term.bir", FT_STRING, BASE_HEX, NULL, 0, "", HFILL }}, { &hf_h248_ctx_term_nsap, { "NSAP", "h248.ctx.term.nsap", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }}, { &hf_h248_ctx_cmd, { "Command", "h248.ctx.cmd", FT_FRAMENUM, BASE_DEC, NULL, 0, "", HFILL }}, @@ -7873,7 +7875,7 @@ void proto_register_h248(void) { &ett_h248_Value, /*--- End of included file: packet-h248-ettarr.c ---*/ -#line 1925 "packet-h248-template.c" +#line 1927 "packet-h248-template.c" }; module_t *h248_module; @@ -7919,3 +7921,4 @@ void proto_reg_handoff_h248(void) { } + diff --git a/epan/dissectors/packet-h248_q1950.c b/epan/dissectors/packet-h248_q1950.c index 8852bf9c67..617ebecdfb 100644 --- a/epan/dissectors/packet-h248_q1950.c +++ b/epan/dissectors/packet-h248_q1950.c @@ -35,6 +35,7 @@ #define PFNAME "h248q1950" static int proto_q1950 = -1; +static gboolean implicit = FALSE; /* A.3 Bearer characteristics package */ static int hf_h248_pkg_BCP = -1; @@ -42,8 +43,6 @@ static int hf_h248_pkg_BCP_BNCChar = -1; static int ett_h248_pkg_BCP = -1; -static gboolean implicit = FALSE; - static const value_string h248_pkg_BCP_parameters[] = { { 0x0001, "BNCChar (BNC Characteristics)" }, {0, NULL} @@ -76,6 +75,88 @@ static h248_package_t h248_pkg_BCP = { }; /* A.4 Bearer Network connection cut-through package */ +static int hf_h248_pkg_BNCCT = -1; + +static int hf_h248_pkg_BNCCT_prop = -1; + +static int ett_h248_pkg_BNCCT = -1; + +static const value_string h248_pkg_BNCCT_parameters[] = { + { 0x0001, "BNC Cut Through Capability" }, + { 0, NULL } +}; + +static const value_string h248_pkg_BNCCT_props_vals[] = { + {1,"BNCCT"}, + {0,NULL} +}; + +static const value_string h248_pkg_BNCCT_prop_vals[] = { + {1,"Early"}, + {2,"Late"}, + {0,NULL} +}; + +/* Properties */ +static const h248_pkg_param_t h248_pkg_BNCCT_props[] = { + { 0x0001, &hf_h248_pkg_BNCCT_prop, h248_param_ber_integer, &implicit }, + { 0, NULL, NULL, NULL} +}; + +/* Packet defenitions */ +static h248_package_t h248_pkg_BNCCT = { + 0x001f, + &hf_h248_pkg_BNCCT, + &ett_h248_pkg_BNCCT, + h248_pkg_BNCCT_props_vals, + NULL, + NULL, + NULL, + h248_pkg_BNCCT_props, /* Properties */ + NULL, /* signals */ + NULL, /* events */ + NULL /* statistics */ +}; + +/* A.5 Bearer Reuse Idle Package */ +static int hf_h248_pkg_RI = -1; + +static int hf_h248_pkg_RII= -1; + +static int ett_h248_pkg_RI= -1; + +static const value_string h248_pkg_RI_parameters[] = { + { 0x0001, "Reuse Idle Indication" }, + { 0, NULL } +}; + +static const value_string h248_pkg_RII_vals[] = { + {0,"Not_Reuse_Idle"}, + {1,"ReUse_Idle"}, + {0,NULL} +}; + +/* Properties */ +h248_pkg_param_t h248_pkg_RI_props[] = { + { 0x0001, &hf_h248_pkg_RII, h248_param_ber_integer, &implicit }, + { 0, NULL, NULL, NULL} +}; + +/* Packet defenitions */ +static h248_package_t h248_pkg_RI = { + 0x0020, + &hf_h248_pkg_RI, + &ett_h248_pkg_RI, + h248_pkg_RI_parameters, + NULL, + NULL, + NULL, + h248_pkg_RI_props, /* Properties */ + NULL, /* signals */ + NULL, /* events */ + NULL /* statistics */ +}; + /* A.5 Bearer Reuse Idle Package */ @@ -84,16 +165,112 @@ static h248_package_t h248_pkg_BCP = { Package ID: 0x0021 */ +static int hf_h248_pkg_GB= -1; +static int hf_h248_pkg_GB_BNCChange= -1; +static int hf_h248_pkg_GB_BNCChange_type= -1; +static int hf_h248_pkg_GB_EstBNC= -1; +static int hf_h248_pkg_GB_ModBNC= -1; +static int hf_h248_pkg_GB_RelBNC = -1; +static int hf_h248_pkg_GB_RelBNC_Generalcause = -1; +static int hf_h248_pkg_GB_RelBNC_Failurecause = -1; +static int hf_h248_pkg_GB_RelBNC_Reset = -1; + +static gint ett_h248_pkg_GB= -1; +static gint ett_h248_pkg_GB_EstBNC= -1; +static gint ett_h248_pkg_GB_ModBNC= -1; +static gint ett_h248_pkg_GB_RelBNC= -1; +static gint ett_h248_pkg_GB_BNCChange= -1; + +static const value_string h248_pkg_GB_events_vals[] = { + { 0x0001, "BNCChange" }, + { 0, NULL } +}; + + +static const value_string h248_pkg_GB_BNCChange_type_vals[] = { + {0x01, "Bearer Established"}, + {0x02,"Bearer Modified"}, + {0x03,"Bearer Cut through"}, + {0x04,"Bearer Modification Failure"}, + {0,NULL} +}; + +static const h248_pkg_param_t h248_pkg_GB_BNCChange_pars[] = { + { 0x0001, &hf_h248_pkg_GB_BNCChange_type, h248_param_ber_integer, &implicit }, + { 0, NULL, NULL, NULL} +}; + +static const h248_pkg_evt_t h248_pkg_GB_events[] = { + { 0x0001, &hf_h248_pkg_GB_BNCChange, &ett_h248_pkg_GB_BNCChange, h248_pkg_GB_BNCChange_pars,h248_pkg_GB_events_vals}, + { 0, NULL, NULL, NULL} +}; + +static const value_string h248_pkg_GB_signals_vals[] = { + {0x01, "Establish BNC"}, + {0x02,"Modify BNC"}, + {0,NULL} +}; + +static const value_string h248_pkg_GB_RelBNC_vals[] = { + {0x01, "Generalcause"}, + {0x02,"Failurecause"}, + {0x03,"Reset"}, + {0,NULL} +}; + +static const value_string h248_pkg_GB_RelBNC_Generalcause_vals[] = { + {0x01, "Normal Release"}, + {0x02,"Unavailable Resources"}, + {0x03,"Failure, Temporary"}, + {0x04,"Failure, Permanent"}, + {0x05,"Interworking Error"}, + {0x06,"Unsupported"}, + {0,NULL} +}; + +static const h248_pkg_param_t h248_pkg_GB_RelBNC_pars[] = { + { 0x0001, &hf_h248_pkg_GB_RelBNC_Generalcause, h248_param_ber_integer, &implicit }, + { 0x0002, &hf_h248_pkg_GB_RelBNC_Failurecause, h248_param_ber_octetstring, &implicit }, + { 0x0003, &hf_h248_pkg_GB_RelBNC_Reset, h248_param_ber_boolean, &implicit }, + { 0, NULL, NULL, NULL} +}; + + +static const h248_pkg_sig_t h248_pkg_GB_signals[] = { + { 0x0001,&hf_h248_pkg_GB_EstBNC,&ett_h248_pkg_GB_EstBNC, NULL, NULL}, + { 0x0002,&hf_h248_pkg_GB_ModBNC,&ett_h248_pkg_GB_ModBNC, NULL, NULL}, + { 0x0003,&hf_h248_pkg_GB_RelBNC,&ett_h248_pkg_GB_RelBNC, h248_pkg_GB_RelBNC_pars, h248_pkg_GB_RelBNC_vals}, + { 0, NULL, NULL, NULL, NULL} +}; + +static h248_package_t h248_pkg_GB = { + 0x0021, + &hf_h248_pkg_GB, + &ett_h248_pkg_GB, + NULL, + h248_pkg_GB_events_vals, + h248_pkg_GB_signals_vals, + NULL, + NULL, /* Properties */ + h248_pkg_GB_signals, /* signals */ + h248_pkg_GB_events, /* events */ + NULL /* statistics */ +}; + + /* A.7 Bearer control tunnelling package */ static dissector_handle_t sdp_dissector = NULL; -static int hf_h248_pkg_bct = -1; -static int hf_h248_pkg_bct_tind = -1; +static int hf_h248_pkg_bt = -1; +static int hf_h248_pkg_bt_tind = -1; +static int hf_h248_pkg_bt_tunopt = -1; +static int hf_h248_pkg_bt_bit = -1; -static gint ett_h248_pkg_bct = -1; -static gint ett_h248_pkg_bct_tind = -1; +static gint ett_h248_pkg_bt = -1; +static gint ett_h248_pkg_bt_tind = -1; +static gint ett_h248_pkg_bt_bit= -1; -static void dissect_bct_tind_bit(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* i _U_, void* d _U_) { +static void dissect_bt_tunneled_proto(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* i _U_, void* d _U_) { tvbuff_t* sdp_tvb = NULL; gint8 class; gboolean pc; @@ -115,30 +292,68 @@ static void dissect_bct_tind_bit(proto_tree* tree, tvbuff_t* tvb, packet_info* p } -static h248_pkg_param_t h248_pkg_bct_tind[] = { - { 0x0001, &hf_h248_pkg_bct_tind, dissect_bct_tind_bit, &implicit }, + +/* Properties */ +static const value_string h248_pkg_bt_props_vals[] = { + {1,"Tunnelling Options"}, + {0,NULL} +}; + +static const value_string h248_pkg_bt_tunopt_vals[] = { + {1,"1 (In the same message as the command response to the command which generated the bearer control tunnel)"}, + {2,"2 (Tunnel message at any time)"}, + {3,"NO"}, + {0,NULL} +}; + +static const h248_pkg_param_t h248_pkg_bt_props[] = { + { 0x0001, &hf_h248_pkg_bt_tunopt, h248_param_ber_integer, &implicit }, { 0, NULL, NULL, NULL} }; /* Events */ -static h248_pkg_evt_t h248_pkg_bct_events[] = { - { 0x0001, &hf_h248_pkg_bct_tind, &ett_h248_pkg_bct_tind, h248_pkg_bct_tind}, +static const value_string h248_pkg_bt_evt_vals[] = { + {1,"Tunnel indication"}, + {0,NULL} +}; + +static const value_string h248_pkg_bt_tind_vals[] = { + {1,"Tunnel Indication"}, + {0,NULL} +}; + +static const h248_pkg_param_t h248_pkg_bt_bit_params[] = { + { 0x0001, &hf_h248_pkg_bt_bit, dissect_bt_tunneled_proto, &implicit }, { 0, NULL, NULL, NULL} }; +static const value_string h248_pkg_bt_sigs_vals[] = { + {1,"Bearer Information Tunnel"}, + {0,NULL} +}; + +static const h248_pkg_evt_t h248_pkg_bt_events[] = { + { 0x0001, &hf_h248_pkg_bt_tind, &ett_h248_pkg_bt_tind, h248_pkg_bt_bit_params, h248_pkg_bt_tind_vals}, + { 0, NULL, NULL, NULL, NULL} +}; + +static const h248_pkg_sig_t h248_pkg_bt_signals[] = { + { 0x0001,&hf_h248_pkg_bt_bit,&ett_h248_pkg_bt_bit, h248_pkg_bt_bit_params, h248_pkg_bt_tind_vals}, + { 0, NULL, NULL, NULL, NULL} +}; /* Packet defenitions */ static h248_package_t h248_pkg_bct = { 0x0022, - &hf_h248_pkg_bct, - &ett_h248_pkg_bct, - NULL, - NULL, - NULL, + &hf_h248_pkg_bt, + &ett_h248_pkg_bt, + h248_pkg_bt_props_vals, + h248_pkg_bt_sigs_vals, + h248_pkg_bt_evt_vals, NULL, NULL, /* Properties */ - NULL, /* signals */ - h248_pkg_bct_events, /* events */ + h248_pkg_bt_signals, /* signals */ + h248_pkg_bt_events, /* events */ NULL /* statistics */ }; @@ -196,7 +411,7 @@ static h248_package_t h248_pkg_bcg = { NULL, NULL, NULL, /* Properties */ - h248_pkg_bcg_signals, /* signals */ + h248_pkg_bcg_signals, /* signals */ NULL, /* events */ NULL /* statistics */ }; @@ -214,6 +429,82 @@ void proto_register_q1950(void) { { "BNCChar (BNC Characteristics)", "h248.pkg.bcp.bncchar", FT_UINT32, BASE_HEX, VALS(bearer_network_connection_characteristics_vals), 0, "BNC Characteristics", HFILL } }, + + /* A.4 Bearer Network connection cut-through package */ + { &hf_h248_pkg_BNCCT, + { "BNCCT (Bearer network connection cut-through package)", "h248.pkg.BNCCT", + FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } + }, + { &hf_h248_pkg_BNCCT_prop, + { "Bearer network connection cut-through capability", "h248.pkg.bcp.bncct", + FT_UINT32, BASE_HEX, VALS(h248_pkg_BNCCT_prop_vals), 0, "This property allows the MGC to ask the MG when the cut through of a bearer will occur, early or late.", HFILL } + }, + + { &hf_h248_pkg_GB, + { "GB (Generic bearer connection)", "h248.pkg.GB", + FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } + }, + { &hf_h248_pkg_GB_BNCChange, + { "BNCChange", "h248.pkg.GB.BNCChang", + FT_BYTES, BASE_HEX, NULL, 0, "This event occurs whenever a change to a Bearer Network connection occurs", HFILL } + }, + { &hf_h248_pkg_GB_BNCChange_type, + { "Type", "h248.pkg.GB.BNCChang.Type", + FT_UINT32, BASE_HEX, VALS(h248_pkg_GB_BNCChange_type_vals), 0, "", HFILL } + }, + { &hf_h248_pkg_GB_EstBNC, + { "Type", "h248.pkg.GB.BNCChang.EstBNC", + FT_BYTES, BASE_HEX, NULL, 0, "This signal triggers the bearer control function to send bearer establishment signalling", HFILL } + }, + { &hf_h248_pkg_GB_ModBNC, + { "Type", "h248.pkg.GB.BNCChang.Type", + FT_BYTES, BASE_HEX, NULL, 0, "This signal triggers the bearer control function to send bearer modification", HFILL } + }, + { &hf_h248_pkg_GB_RelBNC, + { "RelBNC", "h248.pkg.GB.BNCChang.RelBNC", + FT_BYTES, BASE_HEX, NULL, 0, "This signal triggers the bearer control function to send bearer release", HFILL } + }, + { &hf_h248_pkg_GB_RelBNC_Generalcause, + { "Generalcause", "h248.pkg.GB.BNCChang.RelBNC.Generalcause", + FT_UINT32, BASE_HEX, VALS(h248_pkg_GB_RelBNC_Generalcause_vals), 0, "This indicates the general reason for the Release", HFILL } + }, + { &hf_h248_pkg_GB_RelBNC_Failurecause, + { "Failurecause", "h248.pkg.GB.BNCChang.RelBNC.Failurecause", + FT_BYTES, BASE_HEX, NULL, 0, "The Release Cause is the value generated by the Released equipment", HFILL } + }, + { &hf_h248_pkg_GB_RelBNC_Reset, + { "RelBNC", "h248.pkg.GB.BNCChang.RelBNC", + FT_BOOLEAN, BASE_NONE, NULL, 0, "This signal triggers the bearer control function to send bearer release", HFILL } + }, + + /* A.5 Bearer Network connection cut-through package */ + { &hf_h248_pkg_RI, + { "RI (Reuse idle package)", "h248.pkg.RI", + FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } + }, + { &hf_h248_pkg_RII, + { "Reuse Idle Indication", "h248.pkg.bcp.rii", + FT_UINT32, BASE_HEX, VALS(h248_pkg_RII_vals), 0, "This property indicates that the provided bearer network connection relates to an Idle Bearer.", HFILL } + }, + + { &hf_h248_pkg_bt, + { "BT (Bearer control Tunneling)", "h248.pkg.BT", + FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } + }, + { &hf_h248_pkg_bt_tunopt, + { "Tunnelling Options", "h248.pkg.BT.TunOpt", + FT_UINT32, BASE_HEX, NULL, 0, "", HFILL } + }, + { &hf_h248_pkg_bt_tind, + { "tind (Tunnel INDication)", "h248.pkg.BT.TIND", + FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } + }, + { &hf_h248_pkg_bt_bit, + { "Bearer Information Transport", "h248.pkg.BT.BIT", + FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } + }, + + /* A.8 Basic call progress tones generator with directionality */ { &hf_h248_pkg_bcg, { "bcg (Basic call progress tones generator with directionality)", "h248.pkg.bcg", @@ -259,22 +550,19 @@ void proto_register_q1950(void) { { "bpy (Pay tone)", "h248.pkg.bcg.bpy", FT_UINT8, BASE_HEX, NULL, 0, "", HFILL } }, - { &ett_h248_pkg_bct, - { "BCT (Bearer Control Tunneling)", "h248.pkg.bct", - FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } - }, - { &hf_h248_pkg_bct_tind, - { "tind (Tunnel INDication)", "h248.pkg.bct.tind", - FT_BYTES, BASE_HEX, NULL, 0, "", HFILL } - }, - + //~ hf_h248_pkg_bcg_sig_bcr + }; static gint *ett[] = { &ett_h248_pkg_BCP, - &ett_h248_pkg_bct, - &ett_h248_pkg_bct_tind + &ett_h248_pkg_bt, + &ett_h248_pkg_bt_tind, + &ett_h248_pkg_bt_bit, + &ett_h248_pkg_BNCCT, + &ett_h248_pkg_RI, }; + proto_q1950 = proto_register_protocol(PNAME, PSNAME, PFNAME); proto_register_field_array(proto_q1950, hf, array_length(hf)); @@ -283,8 +571,12 @@ void proto_register_q1950(void) { /* 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); + } void proto_reg_handoff_q1950(void) { |