wireshark/asn1/tcap/tcap.cnf

232 lines
6.9 KiB
Plaintext
Raw Normal View History

# tcap.cnf
# tcap conformation file
#.OMIT_ASSIGNMENT
RLRQ-apdu
RLRE-apdu
Release-request-reason
Release-response-reason
#.END
#.MODULE_IMPORT
#.EXPORTS
DialoguePDU
UniDialoguePDU
#.REGISTER_NEW
DialoguePDU B "0.0.17.773.1.1.1" "id-as-dialogue"
UniDialoguePDU B "0.0.17.773.1.2.1" "id-as-uniDialogue"
#.PDU_NEW
#.NO_EMIT ONLY_VALS
TCMessage
ERROR
#.NO_EMIT
#.TYPE_RENAME
AUDT-apdu/_untag/protocol-version AUDT_protocol_version
AARQ-apdu/_untag/protocol-version AARQ_protocol_version
AARE-apdu/_untag/protocol-version AARE_protocol_version
AARE-apdu/_untag/application-context-name AARE_application_context_name
AARQ-apdu/_untag/application-context-name AARQ_application_context_name
AUDT-apdu/_untag/application-context-name AUDT_application_context_name
AARQ-apdu/_untag/user-information AARQ_user_information
AARE-apdu/_untag/user-information AARE_user_information
ABRT-apdu/_untag/user-information ABRT_user_information
AUDT-apdu/_untag/user-information AUDT_user_information
#.FIELD_RENAME
AUDT-apdu/_untag/protocol-version audt_protocol_version
AARQ-apdu/_untag/protocol-version aarq_protocol_version
AARE-apdu/_untag/protocol-version aare_protocol_version
AARQ-apdu/_untag/application-context-name aarq_application_context_name
AARE-apdu/_untag/application-context-name aare_application_context_name
AUDT-apdu/_untag/application-context-name audt_application_context_name
AARQ-apdu/_untag/user-information aarq_user_information
AARE-apdu/_untag/user-information aare_user_information
AUDT-apdu/_untag/user-information audt_user_information
ABRT-apdu/_untag/user-information abrt_user_information
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY DialogueOC
offset = dissect_tcap_ExternalPDU(FALSE /*implicit_tag*/, tvb, offset, actx, tree, -1);
#----------------------------------------------------------------------------------------
#.FN_BODY ExternalPDU
%(DEFAULT_BODY)s
#----------------------------------------------------------------------------------------
#.FN_BODY Dialog1
offset = dissect_tcap_DialoguePDU(TRUE, tvb, offset, actx, tree, -1);
#----------------------------------------------------------------------------------------
#.FN_BODY Parameter
offset = dissect_tcap_param(actx,tree,tvb,offset);
#----------------------------------------------------------------------------------------
#.FN_BODY Component
tvbuff_t *next_tvb;
gint8 ber_class;
gboolean pc;
gint tag;
guint32 len, comp_offset;
gint ind_field;
comp_offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
comp_offset = dissect_ber_length(actx->pinfo, tree, tvb, comp_offset, &len, &ind_field);
/* we can believe the length now */
next_tvb = tvb_new_subset_length(tvb, offset, len+comp_offset-offset);
if (!next_tvb)
return comp_offset;
TRY {
%(DEFAULT_BODY)s
}
Move show_exception() and show_reported_bounds_error() to epan/show_exception.c, as it's used outside epan/dissectors/packet-frame.c. Update their callers to include <epan/show_exception.h> to get their declaration. Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if there's more stuff in the packet to dissect after the dissector call that threw the exception, doesn't mean you shouldn't go ahead and dissect that stuff. Use it in all those cases, including ones where BoundsError was inappropriately being caught (you want those passed up to the top level, so that the packet is reported as having been cut short in the capture process). Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that correspond to running past the end of the data for a tvbuff; use it rather than explicitly catching those exceptions individually, and rather than just catching all exceptions (the only place that DissectorError should be caught, for example, is at the top level, so dissector bugs show up in the protocol tree). Don't catch and then immediately rethrow exceptions without doing anything else; just let the exceptions go up to the final catcher. Use show_exception() to report non-fatal errors, rather than doing it yourself. If a dissector is called from Lua, catch all non-fatal errors and use show_exception() to report them rather than catching only ReportedBoundsError and adding a proto_malformed item. Don't catch exceptions when constructing a trailer tvbuff in packet-ieee8023.c - just construct it after the payload has been dissected, and let whatever exceptions that throws be handled at the top level. Avoid some TRY/CATCH/ENDTRY cases by using checks such as tvb_bytes_exist() before even looking in the tvbuff. svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
CATCH_NONFATAL_ERRORS {
show_exception(tvb, actx->pinfo, tree, EXCEPT_CODE, GET_MESSAGE);
}
ENDTRY;
dissect_tcap_ITU_ComponentPDU(implicit_tag, next_tvb, 0, actx, tcap_top_tree, hf_index);
/* return comp_offset+len; or return offset (will be automatically added) */
#----------------------------------------------------------------------------------------
#.FN_BODY AUDT-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid
%(DEFAULT_BODY)s
tcap_private.oid= (const void*) cur_oid;
tcap_private.acv=TRUE;
#----------------------------------------------------------------------------------------
#.FN_BODY AARQ-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid
%(DEFAULT_BODY)s
tcap_private.oid= (const void*) cur_oid;
tcap_private.acv=TRUE;
#----------------------------------------------------------------------------------------
#.FN_BODY AARE-apdu/_untag/application-context-name FN_VARIANT = _str VAL_PTR = &cur_oid
%(DEFAULT_BODY)s
tcap_private.oid= (const void*) cur_oid;
tcap_private.acv=TRUE;
#----------------------------------------------------------------------------------------
#.FN_BODY OrigTransactionID
tvbuff_t *parameter_tvb;
guint8 len, i;
proto_tree *subtree;
subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_otid, NULL, "Source Transaction ID");
dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid, NULL);
PROTO_ITEM_SET_HIDDEN(actx->created_item);
offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_otid,
&parameter_tvb);
if (parameter_tvb){
len = tvb_reported_length_remaining(parameter_tvb, 0);
switch(len) {
case 1:
gp_tcapsrt_info->src_tid=tvb_get_guint8(parameter_tvb, 0);
break;
case 2:
gp_tcapsrt_info->src_tid=tvb_get_ntohs(parameter_tvb, 0);
break;
case 4:
gp_tcapsrt_info->src_tid=tvb_get_ntohl(parameter_tvb, 0);
break;
default:
gp_tcapsrt_info->src_tid=0;
break;
}
if (len){
col_append_str(actx->pinfo->cinfo, COL_INFO, "otid(");
for(i=0;i<len;i++)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i));
col_append_str(actx->pinfo->cinfo, COL_INFO, ") ");
}
}
#----------------------------------------------------------------------------------------
#.FN_BODY DestTransactionID
tvbuff_t *parameter_tvb;
guint8 len , i;
proto_tree *subtree;
subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dtid, NULL, "Destination Transaction ID");
dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_tid, NULL);
PROTO_ITEM_SET_HIDDEN(actx->created_item);
offset = dissect_ber_octet_string(implicit_tag, actx, subtree, tvb, offset, hf_tcap_dtid,
&parameter_tvb);
if (parameter_tvb){
len = tvb_reported_length_remaining(parameter_tvb, 0);
switch(len) {
case 1:
gp_tcapsrt_info->dst_tid=tvb_get_guint8(parameter_tvb, 0);
break;
case 2:
gp_tcapsrt_info->dst_tid=tvb_get_ntohs(parameter_tvb, 0);
break;
case 4:
gp_tcapsrt_info->dst_tid=tvb_get_ntohl(parameter_tvb, 0);
break;
default:
gp_tcapsrt_info->dst_tid=0;
break;
}
if (len){
col_append_str(actx->pinfo->cinfo, COL_INFO, "dtid(");
for(i=0;i<len;i++)
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "%%02x",tvb_get_guint8(parameter_tvb,i));
col_append_str(actx->pinfo->cinfo, COL_INFO, ") ");
}
}
#.FN_HDR Begin
gp_tcapsrt_info->ope=TC_BEGIN;
/* Do not change col_add_str() to col_append_str() here: we _want_ this call
* to overwrite whatever's currently in the INFO column (e.g., "UDT" from
* the SCCP dissector).
*
* If there's something there that should not be overwritten, whoever
* put that info there should call col_set_fence() to protect it.
*/
col_set_str(actx->pinfo->cinfo, COL_INFO, "Begin ");
#.END
#.FN_HDR End
gp_tcapsrt_info->ope=TC_END;
col_set_str(actx->pinfo->cinfo, COL_INFO, "End ");
#.END
#.FN_HDR Continue
gp_tcapsrt_info->ope=TC_CONT;
col_set_str(actx->pinfo->cinfo, COL_INFO, "Continue ");
#.END
#.FN_HDR Abort
gp_tcapsrt_info->ope=TC_ABORT;
col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
#.END