diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-02-06 14:14:38 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2016-02-06 16:16:10 +0000 |
commit | bafdbb1882282e6ca3285510f2fd5add13936664 (patch) | |
tree | d33493fbffaaebabc3b5a8380f78f22cfb50a4dd /asn1 | |
parent | 4a2cd6c79ecbf2cb21f985f01ce1c1e3030285ec (diff) |
TCAP: fix indent and add modelines (use 2 spaces)
Change-Id: I3ac35f3dd6514469bdcabd0acd67970077d5c364
Reviewed-on: https://code.wireshark.org/review/13793
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/tcap/packet-tcap-template.c | 59 | ||||
-rw-r--r-- | asn1/tcap/tcap.cnf | 215 |
2 files changed, 150 insertions, 124 deletions
diff --git a/asn1/tcap/packet-tcap-template.c b/asn1/tcap/packet-tcap-template.c index 90381a60c2..b3df5bb755 100644 --- a/asn1/tcap/packet-tcap-template.c +++ b/asn1/tcap/packet-tcap-template.c @@ -122,32 +122,32 @@ static GHashTable* ansi_sub_dissectors = NULL; static GHashTable* itu_sub_dissectors = NULL; extern void add_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) { - g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector); - dissector_add_uint("sccp.ssn",ssn,tcap_handle); + g_hash_table_insert(ansi_sub_dissectors,GUINT_TO_POINTER(ssn),dissector); + dissector_add_uint("sccp.ssn",ssn,tcap_handle); } extern void add_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector) { - g_hash_table_insert(itu_sub_dissectors,GUINT_TO_POINTER(ssn),dissector); - dissector_add_uint("sccp.ssn",ssn,tcap_handle); + g_hash_table_insert(itu_sub_dissectors,GUINT_TO_POINTER(ssn),dissector); + dissector_add_uint("sccp.ssn",ssn,tcap_handle); } extern void delete_ansi_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) { - g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn)); - if (!get_itu_tcap_subdissector(ssn)) + g_hash_table_remove(ansi_sub_dissectors,GUINT_TO_POINTER(ssn)); + if (!get_itu_tcap_subdissector(ssn)) dissector_delete_uint("sccp.ssn",ssn,tcap_handle); } extern void delete_itu_tcap_subdissector(guint32 ssn, dissector_handle_t dissector _U_) { - g_hash_table_remove(itu_sub_dissectors,GUINT_TO_POINTER(ssn)); - if (!get_ansi_tcap_subdissector(ssn)) - dissector_delete_uint("sccp.ssn", ssn,tcap_handle); + g_hash_table_remove(itu_sub_dissectors,GUINT_TO_POINTER(ssn)); + if (!get_ansi_tcap_subdissector(ssn)) + dissector_delete_uint("sccp.ssn", ssn,tcap_handle); } dissector_handle_t get_ansi_tcap_subdissector(guint32 ssn) { - return (dissector_handle_t)g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn)); + return (dissector_handle_t)g_hash_table_lookup(ansi_sub_dissectors,GUINT_TO_POINTER(ssn)); } dissector_handle_t get_itu_tcap_subdissector(guint32 ssn) { - return (dissector_handle_t)g_hash_table_lookup(itu_sub_dissectors,GUINT_TO_POINTER(ssn)); + return (dissector_handle_t)g_hash_table_lookup(itu_sub_dissectors,GUINT_TO_POINTER(ssn)); } #include "packet-tcap-fn.c" @@ -1967,8 +1967,8 @@ const value_string tcap_component_type_str[] = { static int dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_item *item=NULL; + proto_tree *tree=NULL; struct tcaphash_context_t * p_tcap_context; dissector_handle_t subdissector_handle; @@ -1978,14 +1978,14 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d gint tag; /* Check if ANSI TCAP and call the ANSI TCAP dissector if that's the case - * PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU, - * queryWithPerm [PRIVATE 2] IMPLICIT TransactionPDU, - * queryWithoutPerm [PRIVATE 3] IMPLICIT TransactionPDU, - * response [PRIVATE 4] IMPLICIT TransactionPDU, - * conversationWithPerm [PRIVATE 5] IMPLICIT TransactionPDU, - * conversationWithoutPerm [PRIVATE 6] IMPLICIT TransactionPDU, - * abort [PRIVATE 22] IMPLICIT Abort - * } + * PackageType ::= CHOICE { unidirectional [PRIVATE 1] IMPLICIT UniTransactionPDU, + * queryWithPerm [PRIVATE 2] IMPLICIT TransactionPDU, + * queryWithoutPerm [PRIVATE 3] IMPLICIT TransactionPDU, + * response [PRIVATE 4] IMPLICIT TransactionPDU, + * conversationWithPerm [PRIVATE 5] IMPLICIT TransactionPDU, + * conversationWithoutPerm [PRIVATE 6] IMPLICIT TransactionPDU, + * abort [PRIVATE 22] IMPLICIT Abort + * } * * */ @@ -2436,11 +2436,11 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs = get_itu_tcap_subdissector(actx->pinfo->match_uint))) { /* Found according to SSN */ is_subdissector=TRUE; - } else { + } else { /* Nothing found, take the Data handler */ subdissector_handle = data_handle; is_subdissector=TRUE; - } /* SSN */ + } /* SSN */ } /* ACN */ } else { /* There is no A.C.N for this transaction, so search in the SSN table */ @@ -2479,3 +2479,16 @@ call_tcap_dissector(dissector_handle_t handle, tvbuff_t* tvb, packet_info* pinfo requested_subdissector_handle = NULL; } + +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 2 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=2 tabstop=8 expandtab: + * :indentSize=2:tabSize=8:noTabs=true: + */ diff --git a/asn1/tcap/tcap.cnf b/asn1/tcap/tcap.cnf index b56b2217e3..0629f7616a 100644 --- a/asn1/tcap/tcap.cnf +++ b/asn1/tcap/tcap.cnf @@ -79,123 +79,123 @@ ABRT-apdu/_untag/user-information abrt_user_information #---------------------------------------------------------------------------------------- #.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 -} -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); + 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 + } + 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; + 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; + 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; + 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, + 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, ¶meter_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, ") "); - } - -} + 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, - ¶meter_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, ") "); - } -} + 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, + ¶meter_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; @@ -206,26 +206,39 @@ gp_tcapsrt_info->ope=TC_BEGIN; * 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 "); + 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 "); + 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 "); + 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 "); + col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort "); #.END + +# +# Editor modelines - http://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 2 +# tab-width: 8 +# indent-tabs-mode: nil +# End: +# +# vi: set shiftwidth=2 tabstop=8 expandtab: +# :indentSize=2:tabSize=8:noTabs=true: +# |