aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/pres/packet-pres-template.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2012-12-12 15:17:36 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2012-12-12 15:17:36 +0000
commitf6f46de2ca806a7293bbc1a82191f5dffc84de7c (patch)
tree25149877950915fcbba8cddd1bfcccfe2f24ff07 /asn1/pres/packet-pres-template.c
parent349e61ce9e1c90609a9fb0eefa31c8ee943aa80f (diff)
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
Diffstat (limited to 'asn1/pres/packet-pres-template.c')
-rw-r--r--asn1/pres/packet-pres-template.c44
1 files changed, 21 insertions, 23 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"