From f6f46de2ca806a7293bbc1a82191f5dffc84de7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 12 Dec 2012 15:17:36 +0000 Subject: Moved users table lookup to find_oid_by_pres_ctx_id() so other dissectors (acse, ros, rtse) can benefit from the configured settings. svn path=/trunk/; revision=46520 --- asn1/pres/packet-pres-template.c | 44 +++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'asn1/pres/packet-pres-template.c') 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" -- cgit v1.2.3