parent
b190de385a
commit
9fd46d8299
|
@ -33,7 +33,7 @@ First we need to include the definitions for conversations and memory
|
|||
management.
|
||||
|
||||
#include <epan/conversation.h>
|
||||
#include <epan/emem.h>
|
||||
#include <epan/wmem/wmem.h>
|
||||
|
||||
Then we also need a few header fields to show the relations between request
|
||||
and response as well as the response time.
|
||||
|
@ -68,7 +68,7 @@ this would be a good place to store that additional info you may want to keep
|
|||
around.
|
||||
|
||||
typedef struct _pana_conv_info_t {
|
||||
emem_tree_t *pdus;
|
||||
wmem_tree_t *pdus;
|
||||
} pana_conv_info_t;
|
||||
|
||||
Finally for the meat of it, add the conversation and tracking code to the
|
||||
|
@ -100,32 +100,31 @@ actual dissector.
|
|||
* No. Attach that information to the conversation, and add
|
||||
* it to the list of information structures.
|
||||
*/
|
||||
pana_info = se_alloc(sizeof(pana_conv_info_t));
|
||||
pana_info->pdus = se_tree_create_non_persistent(
|
||||
EMEM_TREE_TYPE_RED_BLACK, "pana_pdus");
|
||||
pana_info = wmem_new(wmem_file_scope(), pana_conv_info_t);
|
||||
pana_info->pdus=wmem_tree_new(wmem_file_scope());
|
||||
|
||||
conversation_add_proto_data(conversation, proto_pana, pana_info);
|
||||
}
|
||||
if (!pinfo->fd->flags.visited) {
|
||||
if (flags&PANA_FLAG_R) {
|
||||
/* This is a request */
|
||||
pana_trans = se_alloc(sizeof(pana_transaction_t));
|
||||
pana_trans=wmem_new(wmem_file_scope(), pana_transaction_t);
|
||||
pana_trans->req_frame = pinfo->fd->num;
|
||||
pana_trans->rep_frame = 0;
|
||||
pana_trans->req_time = pinfo->fd->abs_ts;
|
||||
se_tree_insert32(pana_info->pdus, seq_num, (void *)pana_trans);
|
||||
wmem_tree_insert32(pana_info->pdus, seq_num, (void *)pana_trans);
|
||||
} else {
|
||||
pana_trans = se_tree_lookup32(pana_info->pdus, seq_num);
|
||||
pana_trans=(pana_transaction_t *)wmem_tree_lookup32(pana_info->pdus, seq_num);
|
||||
if (pana_trans) {
|
||||
pana_trans->rep_frame = pinfo->fd->num;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pana_trans = se_tree_lookup32(pana_info->pdus, seq_num);
|
||||
pana_trans=(pana_transaction_t *)wmem_tree_lookup32(pana_info->pdus, seq_num);
|
||||
}
|
||||
if (!pana_trans) {
|
||||
/* create a "fake" pana_trans structure */
|
||||
pana_trans = ep_alloc(sizeof(pana_transaction_t));
|
||||
pana_trans=wmem_new(wmem_packet_scope(), pana_transaction_t);
|
||||
pana_trans->req_frame = 0;
|
||||
pana_trans->rep_frame = 0;
|
||||
pana_trans->req_time = pinfo->fd->abs_ts;
|
||||
|
|
Loading…
Reference in New Issue