diff options
-rw-r--r-- | asn1/pres/packet-pres-template.c | 44 | ||||
-rw-r--r-- | asn1/pres/packet-pres-template.h | 2 | ||||
-rw-r--r-- | asn1/pres/pres.cnf | 13 | ||||
-rw-r--r-- | epan/dissectors/packet-pres.c | 73 | ||||
-rw-r--r-- | epan/dissectors/packet-pres.h | 2 |
5 files changed, 62 insertions, 72 deletions
diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c index 059c75dc36..2a3fb99a68 100644 --- a/asn1/pres/packet-pres-template.c +++ b/asn1/pres/packet-pres-template.c @@ -159,8 +159,26 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid) g_hash_table_insert(pres_ctx_oid_table, pco, pco); } +static char * +find_oid_in_users_table(packet_info *pinfo, guint32 ctx_id) +{ + guint i; + + for (i = 0; i < num_pres_users; i++) { + pres_user_t *u = &(pres_users[i]); + + if (u->ctx_id == ctx_id) { + /* Register oid so other dissectors can find this connection */ + register_ctx_id_and_oid(pinfo, u->ctx_id, u->oid); + return u->oid; + } + } + + return NULL; +} + char * -find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx) +find_oid_by_pres_ctx_id(packet_info *pinfo, guint32 idx) { pres_ctx_oid_t pco, *tmppco; conversation_t *conversation; @@ -178,7 +196,8 @@ find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx) if(tmppco){ return tmppco->oid; } - return NULL; + + return find_oid_in_users_table(pinfo, idx); } static void * @@ -201,27 +220,6 @@ pres_free_cb(void *r) g_free(u->oid); } -static gboolean -pres_try_users_table(guint32 ctx_id, tvbuff_t *tvb, int offset, packet_info *pinfo) -{ - tvbuff_t *next_tvb; - guint i; - - for (i = 0; i < num_pres_users; i++) { - pres_user_t *u = &(pres_users[i]); - - if (u->ctx_id == ctx_id) { - /* Register oid so other dissectors can find this connection */ - register_ctx_id_and_oid(pinfo, u->ctx_id, u->oid); - next_tvb = tvb_new_subset_remaining(tvb, offset); - call_ber_oid_callback(u->oid, next_tvb, offset, pinfo, global_tree); - return TRUE; - } - } - - return FALSE; -} - #include "packet-pres-fn.c" diff --git a/asn1/pres/packet-pres-template.h b/asn1/pres/packet-pres-template.h index 372d692b7b..aad083d868 100644 --- a/asn1/pres/packet-pres-template.h +++ b/asn1/pres/packet-pres-template.h @@ -27,6 +27,6 @@ /*#include "packet-pres-exp.h"*/ -extern char *find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx); +extern char *find_oid_by_pres_ctx_id(packet_info *pinfo, guint32 idx); #endif /* PACKET_PRES_H */ diff --git a/asn1/pres/pres.cnf b/asn1/pres/pres.cnf index cf6c6a6171..01d56074e5 100644 --- a/asn1/pres/pres.cnf +++ b/asn1/pres/pres.cnf @@ -43,11 +43,10 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason next_tvb = tvb_new_subset_remaining(tvb, offset); call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { - if (!pres_try_users_table(presentation_context_identifier, tvb, offset, actx->pinfo)) { - proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); - expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); - } + proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); + expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); } + #.FN_BODY PDV-list/presentation-data-values/octet-aligned tvbuff_t *next_tvb; @@ -58,10 +57,8 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb); call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { - if (!pres_try_users_table(presentation_context_identifier, tvb, offset, actx->pinfo)) { - proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); - expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); - } + proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); + expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); %(DEFAULT_BODY)s } diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c index 6c32ed65e4..91a7c4593b 100644 --- a/epan/dissectors/packet-pres.c +++ b/epan/dissectors/packet-pres.c @@ -292,8 +292,26 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid) g_hash_table_insert(pres_ctx_oid_table, pco, pco); } +static char * +find_oid_in_users_table(packet_info *pinfo, guint32 ctx_id) +{ + guint i; + + for (i = 0; i < num_pres_users; i++) { + pres_user_t *u = &(pres_users[i]); + + if (u->ctx_id == ctx_id) { + /* Register oid so other dissectors can find this connection */ + register_ctx_id_and_oid(pinfo, u->ctx_id, u->oid); + return u->oid; + } + } + + return NULL; +} + char * -find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx) +find_oid_by_pres_ctx_id(packet_info *pinfo, guint32 idx) { pres_ctx_oid_t pco, *tmppco; conversation_t *conversation; @@ -311,7 +329,8 @@ find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx) if(tmppco){ return tmppco->oid; } - return NULL; + + return find_oid_in_users_table(pinfo, idx); } static void * @@ -334,27 +353,6 @@ pres_free_cb(void *r) g_free(u->oid); } -static gboolean -pres_try_users_table(guint32 ctx_id, tvbuff_t *tvb, int offset, packet_info *pinfo) -{ - tvbuff_t *next_tvb; - guint i; - - for (i = 0; i < num_pres_users; i++) { - pres_user_t *u = &(pres_users[i]); - - if (u->ctx_id == ctx_id) { - /* Register oid so other dissectors can find this connection */ - register_ctx_id_and_oid(pinfo, u->ctx_id, u->oid); - next_tvb = tvb_new_subset_remaining(tvb, offset); - call_ber_oid_callback(u->oid, next_tvb, offset, pinfo, global_tree); - return TRUE; - } - } - - return FALSE; -} - /*--- Included file: packet-pres-fn.c ---*/ @@ -436,7 +434,7 @@ dissect_pres_Called_presentation_selector(gboolean implicit_tag _U_, tvbuff_t *t static int dissect_pres_Presentation_context_identifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 76 "../../asn1/pres/pres.cnf" +#line 73 "../../asn1/pres/pres.cnf" const char *name; char *oid; @@ -499,13 +497,13 @@ static const ber_sequence_t Context_list_item_sequence[] = { static int dissect_pres_Context_list_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 101 "../../asn1/pres/pres.cnf" +#line 98 "../../asn1/pres/pres.cnf" abstract_syntax_name_oid=NULL; offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, Context_list_item_sequence, hf_index, ett_pres_Context_list_item); -#line 104 "../../asn1/pres/pres.cnf" +#line 101 "../../asn1/pres/pres.cnf" register_ctx_id_and_oid(actx->pinfo, presentation_context_identifier, abstract_syntax_name_oid); return offset; @@ -645,13 +643,12 @@ dissect_pres_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in next_tvb = tvb_new_subset_remaining(tvb, offset); call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { - if (!pres_try_users_table(presentation_context_identifier, tvb, offset, actx->pinfo)) { - proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); - expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); - } + proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); + expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); } + return offset; } @@ -659,7 +656,7 @@ dissect_pres_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_pres_T_octet_aligned(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 52 "../../asn1/pres/pres.cnf" +#line 51 "../../asn1/pres/pres.cnf" tvbuff_t *next_tvb; char *oid; @@ -669,10 +666,8 @@ dissect_pres_T_octet_aligned(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb); call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { - if (!pres_try_users_table(presentation_context_identifier, tvb, offset, actx->pinfo)) { - proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); - expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); - } + proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); + expert_add_info_format(actx->pinfo, ti, PI_UNDECODED, PI_WARN, "Dissector is not available"); offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); @@ -1090,7 +1085,7 @@ static const value_string pres_Abort_reason_vals[] = { static int dissect_pres_Abort_reason(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 94 "../../asn1/pres/pres.cnf" +#line 91 "../../asn1/pres/pres.cnf" guint32 reason; offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index, @@ -1376,7 +1371,7 @@ static void dissect_UDC_type_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot /*--- End of included file: packet-pres-fn.c ---*/ -#line 227 "../../asn1/pres/packet-pres-template.c" +#line 225 "../../asn1/pres/packet-pres-template.c" /* @@ -1864,7 +1859,7 @@ void proto_register_pres(void) { NULL, HFILL }}, /*--- End of included file: packet-pres-hfarr.c ---*/ -#line 398 "../../asn1/pres/packet-pres-template.c" +#line 396 "../../asn1/pres/packet-pres-template.c" }; /* List of subtrees */ @@ -1911,7 +1906,7 @@ void proto_register_pres(void) { &ett_pres_UD_type, /*--- End of included file: packet-pres-ettarr.c ---*/ -#line 404 "../../asn1/pres/packet-pres-template.c" +#line 402 "../../asn1/pres/packet-pres-template.c" }; static uat_field_t users_flds[] = { diff --git a/epan/dissectors/packet-pres.h b/epan/dissectors/packet-pres.h index 8a37b0ecb6..809b233972 100644 --- a/epan/dissectors/packet-pres.h +++ b/epan/dissectors/packet-pres.h @@ -35,6 +35,6 @@ /*#include "packet-pres-exp.h"*/ -extern char *find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx); +extern char *find_oid_by_pres_ctx_id(packet_info *pinfo, guint32 idx); #endif /* PACKET_PRES_H */ |