diff options
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/tcap/ansi_tcap.cnf | 62 | ||||
-rw-r--r-- | asn1/tcap/packet-ansi_tcap-template.c | 71 | ||||
-rw-r--r-- | asn1/tcap/packet-ansi_tcap-template.h | 2 |
3 files changed, 120 insertions, 15 deletions
diff --git a/asn1/tcap/ansi_tcap.cnf b/asn1/tcap/ansi_tcap.cnf index 2b3200e635..a685253b1a 100644 --- a/asn1/tcap/ansi_tcap.cnf +++ b/asn1/tcap/ansi_tcap.cnf @@ -22,7 +22,10 @@ tvbuff_t *parameter_tvb; offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index, ¶meter_tvb); if(!parameter_tvb) - return offset; + return offset; + + find_tcap_subdisector(parameter_tvb, actx, tcap_top_tree); + #.FN_FTR Invoke ansi_tcap_private.d.pdu = 1; @@ -34,10 +37,13 @@ ReturnResult/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX #.FN_BODY ReturnResult/parameter tvbuff_t *parameter_tvb; -proto_tree_add_text(tree, tvb, offset, -1, "ReturnResult/result/result"); offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index, ¶meter_tvb); + if(!parameter_tvb) + return offset; + + find_tcap_subdisector(parameter_tvb, actx, tcap_top_tree); #.FN_FTR ReturnResult ansi_tcap_private.d.pdu = 2; @@ -51,12 +57,60 @@ ReturnError/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX #.FN_BODY ReturnError/parameter tvbuff_t *parameter_tvb; -proto_tree_add_text(tree, tvb, offset, -1, "ReturnError/parameter"); - offset = dissect_ber_octet_string(TRUE, actx, tree, tvb, offset, hf_index, ¶meter_tvb); + if(!parameter_tvb) + return offset; + + find_tcap_subdisector(parameter_tvb, actx, tcap_top_tree); + #.FN_FTR ReturnError ansi_tcap_private.d.pdu = 3; + +#--- ObjectIDApplicationContext -- +#.FN_BODY ObjectIDApplicationContext FN_VARIANT = _str VAL_PTR = &oid_str + + static const char * oid_str; + + %(DEFAULT_BODY)s + ansi_tcap_private.objectApplicationId_oid= (void*) cur_oid; + ansi_tcap_private.oid_is_present=TRUE; + +#.FN_HDR PackageType/unidirectional +gp_tcapsrt_info->ope=TC_ANSI_ALL; +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "unidirectional "); + +#.FN_HDR PackageType/queryWithPerm +gp_tcapsrt_info->ope=TC_ANSI_ALL; +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "queryWithPerm "); + +#.FN_HDR PackageType/queryWithoutPerm +gp_tcapsrt_info->ope=TC_ANSI_ALL; +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "queryWithoutPerm "); + +#.FN_HDR PackageType/response +gp_tcapsrt_info->ope=TC_ANSI_ALL; +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "response "); + +#.FN_HDR PackageType/conversationWithPerm +gp_tcapsrt_info->ope=TC_ANSI_ALL; +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "conversationWithPerm "); + +#.FN_HDR PackageType/conversationWithoutPerm +gp_tcapsrt_info->ope=TC_ANSI_ALL; +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "conversationWithoutPerm "); + +#.FN_HDR PackageType/abort +gp_tcapsrt_info->ope=TC_ANSI_ABORT; +if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "Abort "); + #.FN_BODY TransactionID/_untag VAL_PTR = &next_tvb tvbuff_t *next_tvb; diff --git a/asn1/tcap/packet-ansi_tcap-template.c b/asn1/tcap/packet-ansi_tcap-template.c index 56e31beeac..8b0fdbe7a6 100644 --- a/asn1/tcap/packet-ansi_tcap-template.c +++ b/asn1/tcap/packet-ansi_tcap-template.c @@ -88,7 +88,7 @@ extern gboolean gtcap_DisplaySRT; extern guint gtcap_RepetitionTimeout; extern guint gtcap_LostTimeout; -static dissector_handle_t tcap_handle = NULL; +/* static dissector_handle_t tcap_handle = NULL; */ static dissector_table_t ber_oid_dissector_table=NULL; static const char * cur_oid; static const char * tcapext_oid; @@ -97,11 +97,10 @@ static proto_tree * tcap_stat_tree=NULL; static proto_item * tcap_stat_item=NULL; static dissector_handle_t data_handle; +static dissector_handle_t ansi_map_handle; static dissector_table_t sccp_ssn_table; -static void raz_ansi_tcap_private(struct ansi_tcap_private_t * p_ansi_tcap_private); - static GHashTable* ansi_sub_dissectors = NULL; static GHashTable* itu_sub_dissectors = NULL; @@ -110,6 +109,7 @@ struct ansi_tcap_private_t ansi_tcap_private; static void ansi_tcap_ctx_init(struct ansi_tcap_private_t *a_tcap_ctx) { memset(a_tcap_ctx, '\0', sizeof(*a_tcap_ctx)); a_tcap_ctx->signature = ANSI_TCAP_CTX_SIGNATURE; + ansi_tcap_private.oid_is_present = FALSE; } static void dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree); @@ -129,7 +129,62 @@ dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) { } */ - +/* As currently ANSI MAP is the only possible sub dissector this function + * must be improved to handle general cases. + * + * + * + * TODO: + * 1)Handle national codes + * Design option + * - Create a ansi.tcap.national dissector table and have dissectors for + * national codes register there and let ansi tcap call them. + * 2)Handle Private codes properly + * Design question + * Unclear how to differentiate between different private "code sets". + * Use SCCP SSN table as before? or a ansi.tcap.private dissector table? + * + */ +static gboolean +find_tcap_subdisector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){ + + /* If "DialoguePortion objectApplicationId ObjectIDApplicationContext + * points to the subdissector this code can be used. + * + if(ansi_tcap_private.d.oid_is_present){ + call_ber_oid_callback(ansi_tcap_private.objectApplicationId_oid, tvb, 0, actx-pinfo, tree); + return TRUE; + } + */ + if(ansi_tcap_private.d.OperationCode == 0){ + /* national */ + proto_tree_add_text(tree, tvb, 0, -1, + "Dissector for ANSI TCAP NATIONAL code:%u not implemented. Contact Wireshark developers if you want this supported", + ansi_tcap_private.d.OperationCode_national); + return FALSE; + }else if(ansi_tcap_private.d.OperationCode == 1){ + /* private */ + if((ansi_tcap_private.d.OperationCode_private & 0x0900) != 0x0900){ + proto_tree_add_text(tree, tvb, 0, -1, + "Dissector for ANSI TCAP PRIVATE code:%u not implemented. Contact Wireshark developers if you want this supported", + ansi_tcap_private.d.OperationCode_private); + return FALSE; + } + } + /* This is abit of a hack as it assumes the private codes with a "family" of 0x09 is ANSI MAP + * Se TODO above. + * N.S0005-0 v 1.0 TCAP Formats and Procedures 5-16 Application Services + * 6.3.2 Component Portion + * The Operation Code is partitioned into an Operation Family followed by a + * Specifier associated with each Operation Family member. For TIA/EIA-41 the + * Operation Family is coded as decimal 9. Bit H of the Operation Family is always + * coded as 0. + */ + + call_dissector(ansi_map_handle, tvb, actx->pinfo, tree); + + return FALSE; +} #include "packet-ansi_tcap-fn.c" @@ -166,7 +221,6 @@ dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } cur_oid = NULL; tcapext_oid = NULL; - raz_ansi_tcap_private(&ansi_tcap_private); pinfo->private_data = &ansi_tcap_private; gp_tcapsrt_info=tcapsrt_razinfo(); @@ -202,17 +256,14 @@ dissect_ansi_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } } -static void raz_ansi_tcap_private(struct ansi_tcap_private_t * p_ansi_tcap_private) -{ - memset(p_ansi_tcap_private,0,sizeof(struct ansi_tcap_private_t) ); -} void proto_reg_handoff_ansi_tcap(void) { data_handle = find_dissector("data"); - + ansi_map_handle = find_dissector("ansi_map"); + ber_oid_dissector_table = find_dissector_table("ber.oid"); } diff --git a/asn1/tcap/packet-ansi_tcap-template.h b/asn1/tcap/packet-ansi_tcap-template.h index 3dfcfde5db..7ee09a57e2 100644 --- a/asn1/tcap/packet-ansi_tcap-template.h +++ b/asn1/tcap/packet-ansi_tcap-template.h @@ -31,7 +31,7 @@ struct ansi_tcap_private_t { guint32 signature; - gboolean acv; /* Is the Application Context Version present */ + gboolean oid_is_present; /* Is the Application Context Version present */ void * objectApplicationId_oid; guint32 session_id; void * context; |