# tcap.cnf # tcap conformation file # #.MODULE_IMPORT #.EXPORTS #.PDU #.NO_EMIT #.TYPE_RENAME #.FIELD_RENAME #.FN_BODY DialogueOC tvbuff_t *next_tvb; guint8 class; gboolean pc; guint32 tag; guint32 len; guint32 ind_field; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, &ind_field); next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field)); if (!next_tvb) return offset; dissect_tcap_ExternalPDU(TRUE, next_tvb, 2, pinfo, tree, -1); return offset+len; #.FN_BODY Dialog1 guint8 class; gboolean pc; guint32 tag; guint32 len; guint32 ind_field; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, &ind_field); dissect_tcap_DialoguePDU(TRUE, tvb, 0, pinfo, tree, -1); return offset+len; #.FN_BODY Parameter tvbuff_t *next_tvb; guint8 class; gboolean pc; guint32 tag; guint32 len; guint32 ind_field; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, &ind_field); /* need to strip the EOC off the next_tvb */ next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field)); if (!next_tvb) return offset; dissect_tcap_param(pinfo,tree,tvb,0); offset += len; return offset; #.FN_BODY User_information tvbuff_t *next_tvb; guint8 class; gboolean pc; guint32 tag; guint32 len; guint32 ind_field; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, &ind_field); next_tvb = tvb_new_subset(tvb, offset, len-(2*ind_field), len-(2*ind_field)); if (!next_tvb) return offset+len; dissect_tcap_UserInformation(TRUE, next_tvb, 0, pinfo, tree, -1); return offset+len; #.FN_BODY Component tvbuff_t *next_tvb; guint8 class; gboolean pc; guint32 tag; guint32 len, s_offset; guint32 ind_field; /* * ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it. */ ber_oid_dissector_table = find_dissector_table("ber.oid"); tcap_itu_ssn_dissector_table = find_dissector_table("tcap.itu_ssn"); s_offset = offset; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, &ind_field); /* we can believe the length now */ next_tvb = tvb_new_subset(tvb, s_offset, len+(offset-s_offset), len+(offset-s_offset)); if (!next_tvb) return offset+len; dissect_ber_choice(pinfo, tree, next_tvb, 0, Component_choice, hf_index, ett_tcap_Component,NULL); if (ber_oid_dissector_table && cur_oid){ if(!dissector_try_string(ber_oid_dissector_table, cur_oid, next_tvb, pinfo, tcap_top_tree)) { dissector_try_port(tcap_itu_ssn_dissector_table, pinfo->match_port, next_tvb,pinfo, tcap_top_tree); } } else dissector_try_port(tcap_itu_ssn_dissector_table, pinfo->match_port, next_tvb, pinfo, tcap_top_tree); return offset+len; #.FN_BODY Applicationcontext static char buffer[128]; cur_oid = buffer; pinfo->private_data = buffer; offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, hf_index, cur_oid); #.FN_BODY UserInfoOID static char buffer[128]; tcapext_oid = buffer; pinfo->private_data = buffer; offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, hf_index, tcapext_oid); #.FN_BODY ExternUserInfo tvbuff_t *next_tvb; guint8 class; gboolean pc; guint32 tag; guint32 len, start_offset; guint32 ind_field; /* * ok lets look at the oid and ssn and try and find a dissector, otherwise lets decode it. */ ber_oid_dissector_table = find_dissector_table("ber.oid"); start_offset = offset; offset = get_ber_identifier(tvb, offset, &class, &pc, &tag); offset = get_ber_length(tree, tvb, offset, &len, &ind_field); /* Use the recived length, XXX What if it was indefenet? length is good now */ next_tvb = tvb_new_subset(tvb, start_offset, len +(offset - start_offset), len+(offset - start_offset)); if (!next_tvb) return offset+len; if (ber_oid_dissector_table && tcapext_oid){ if(!dissector_try_string(ber_oid_dissector_table, tcapext_oid, next_tvb, pinfo, tcap_top_tree)) { } } dissect_tcap_param(pinfo,tree,next_tvb,0); offset+=len; #.FN_BODY ANSIParameters /* we are doing the ParamSet here so need to look at the tags*/ guint32 len; len = tvb_length_remaining(tvb, offset); if (len > 2) /* arghhh I dont know whether this is constructed or not! */ offset = dissect_tcap_param(pinfo,tree,tvb,offset); else offset = dissect_ber_octet_string(TRUE, pinfo, tree, tvb, 0, hf_index, NULL); #.FN_BODY ComponentPDU tvbuff_t *next_tvb; next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_length_remaining(tvb, offset)); dissector_try_port(tcap_ansi_ssn_dissector_table, pinfo->match_port, next_tvb, pinfo, tcap_top_tree); offset = dissect_ber_choice(pinfo, tree, tvb, offset, ComponentPDU_choice, hf_index, ett_tcap_ComponentPDU,NULL); #.FN_BODY OrigTransactionID tvbuff_t *parameter_tvb; guint8 len, i; proto_item *tid_item; proto_tree *subtree; tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Source Transaction ID"); subtree = proto_item_add_subtree(tid_item, ett_otid); offset = dissect_ber_octet_string(implicit_tag, pinfo, subtree, tvb, offset, hf_tcap_tid, ¶meter_tvb); if (parameter_tvb){ len = tvb_length_remaining(parameter_tvb, 0); if ((len)&&(check_col(pinfo->cinfo, COL_INFO))){ col_append_fstr(pinfo->cinfo, COL_INFO, "otid("); for(i=0;icinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i)); col_append_fstr(pinfo->cinfo, COL_INFO, ") "); } } #.FN_BODY DestTransactionID tvbuff_t *parameter_tvb; guint8 len , i; proto_item *tid_item; proto_tree *subtree; tid_item = proto_tree_add_text(tree, tvb, offset, -1, "Destination Transaction ID"); subtree = proto_item_add_subtree(tid_item, ett_otid); offset = dissect_ber_octet_string(implicit_tag, pinfo, subtree, tvb, offset, hf_tcap_tid, ¶meter_tvb); if (parameter_tvb){ len = tvb_length_remaining(parameter_tvb, 0); if ((len)&&(check_col(pinfo->cinfo, COL_INFO))){ col_append_fstr(pinfo->cinfo, COL_INFO, "dtid("); for(i=0;icinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i)); col_append_fstr(pinfo->cinfo, COL_INFO, ") "); } } #.FN_BODY Begin if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, " Begin "); offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, Begin_sequence, hf_index, ett_tcap_Begin); #.FN_BODY End if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, " End "); offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, End_sequence, hf_index, ett_tcap_End); #.FN_BODY Continue if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, " Continue "); offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, Continue_sequence, hf_index, ett_tcap_Continue); #.FN_BODY Abort if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, " Abort "); offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, Abort_sequence, hf_index, ett_tcap_Abort); #.FN_BODY AbortPDU if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, " Abort "); offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, AbortPDU_sequence, hf_index, ett_tcap_AbortPDU); #.FN_BODY TransactionPDU if ((hf_index == hf_tcap_ansiqueryWithPerm)&&(check_col(pinfo->cinfo, COL_INFO))) col_append_fstr(pinfo->cinfo, COL_INFO, " QueryWithPerm"); if ((hf_index == hf_tcap_ansiqueryWithoutPerm)&&(check_col(pinfo->cinfo, COL_INFO))) col_append_fstr(pinfo->cinfo, COL_INFO, " QueryWithOutPerm"); if ((hf_index == hf_tcap_ansiresponse)&&(check_col(pinfo->cinfo, COL_INFO))) col_append_fstr(pinfo->cinfo, COL_INFO, " Response"); if ((hf_index == hf_tcap_ansiconversationWithPerm)&&(check_col(pinfo->cinfo, COL_INFO))) col_append_fstr(pinfo->cinfo, COL_INFO, " ConversationWithPerm"); if ((hf_index == hf_tcap_ansiconversationWithoutPerm)&&(check_col(pinfo->cinfo, COL_INFO))) col_append_fstr(pinfo->cinfo, COL_INFO, " ConversationWithoutPerm"); offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, TransactionPDU_sequence, hf_index, ett_tcap_TransactionPDU); #.END