diff options
author | gal <gal@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-06-27 17:51:19 +0000 |
---|---|---|
committer | gal <gal@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-06-27 17:51:19 +0000 |
commit | 2c5ad51bd837dc71089941126503107942f0304e (patch) | |
tree | 8429cace8094017d733f80ad4a75918a21b7d741 /epan/dissectors | |
parent | 8d47110c76c39d57968d7861745fa2131ca9a2a4 (diff) |
This patch make PRES context identifiers conversation aware.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22207 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-pres.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c index 5eafbaff27..8f249e2760 100644 --- a/epan/dissectors/packet-pres.c +++ b/epan/dissectors/packet-pres.c @@ -72,9 +72,9 @@ static guint32 presentation_context_identifier; /* to keep track of presentation context identifiers and protocol-oids */ typedef struct _pres_ctx_oid_t { - /* XXX here we should keep track of conversation as well */ guint32 ctx_id; char *oid; + guint32 index; } pres_ctx_oid_t; static GHashTable *pres_ctx_oid_table = NULL; @@ -220,13 +220,13 @@ pres_ctx_oid_hash(gconstpointer k) pres_ctx_oid_t *pco=(pres_ctx_oid_t *)k; return pco->ctx_id; } -/* XXX this one should be made ADDRESS/PORT aware */ + static gint pres_ctx_oid_equal(gconstpointer k1, gconstpointer k2) { pres_ctx_oid_t *pco1=(pres_ctx_oid_t *)k1; pres_ctx_oid_t *pco2=(pres_ctx_oid_t *)k2; - return pco1->ctx_id==pco2->ctx_id; + return (pco1->ctx_id==pco2->ctx_id && pco1->index==pco2->index); } static void @@ -245,16 +245,23 @@ static void register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid) { pres_ctx_oid_t *pco, *tmppco; - pco=se_alloc(sizeof(pres_ctx_oid_t)); - pco->ctx_id=idx; + conversation_t *conversation; if(!oid){ /* we did not get any oid name, malformed packet? */ - pco->oid=NULL; return; } + pco=se_alloc(sizeof(pres_ctx_oid_t)); + pco->ctx_id=idx; pco->oid=se_strdup(oid); + conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, + pinfo->ptype, pinfo->srcport, pinfo->destport, 0); + if (conversation) { + pco->index = conversation->index; + } else { + pco->index = 0; + } /* if this ctx already exists, remove the old one first */ tmppco=(pres_ctx_oid_t *)g_hash_table_lookup(pres_ctx_oid_table, pco); @@ -268,7 +275,17 @@ char * find_oid_by_pres_ctx_id(packet_info *pinfo _U_, guint32 idx) { pres_ctx_oid_t pco, *tmppco; + conversation_t *conversation; + pco.ctx_id=idx; + conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, + pinfo->ptype, pinfo->srcport, pinfo->destport, 0); + if (conversation) { + pco.index = conversation->index; + } else { + pco.index = 0; + } + tmppco=(pres_ctx_oid_t *)g_hash_table_lookup(pres_ctx_oid_table, &pco); if(tmppco){ return tmppco->oid; @@ -1418,7 +1435,7 @@ dissect_pres_RSA_PPDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ /*--- End of included file: packet-pres-fn.c ---*/ -#line 151 "packet-pres-template.c" +#line 168 "packet-pres-template.c" /* @@ -1881,7 +1898,7 @@ void proto_register_pres(void) { "", HFILL }}, /*--- End of included file: packet-pres-hfarr.c ---*/ -#line 305 "packet-pres-template.c" +#line 322 "packet-pres-template.c" }; /* List of subtrees */ @@ -1927,7 +1944,7 @@ void proto_register_pres(void) { &ett_pres_User_session_requirements, /*--- End of included file: packet-pres-ettarr.c ---*/ -#line 311 "packet-pres-template.c" +#line 328 "packet-pres-template.c" }; /* Register protocol */ |