aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tcap-persistentdata.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2007-04-23 10:45:00 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2007-04-23 10:45:00 +0000
commit20a3a52951ef6f5029f7ab9ae5475e41ae027fe4 (patch)
treea8804f6d8c5ef50c16a3efc91be69382e33046b3 /epan/tcap-persistentdata.c
parentc84eda3a80250e06b2b777d45231ce42c992f0cf (diff)
Mark all the items for TCAP statistics as generated
svn path=/trunk/; revision=21524
Diffstat (limited to 'epan/tcap-persistentdata.c')
-rw-r--r--epan/tcap-persistentdata.c266
1 files changed, 138 insertions, 128 deletions
diff --git a/epan/tcap-persistentdata.c b/epan/tcap-persistentdata.c
index 36109a3f35..d41cd5d56c 100644
--- a/epan/tcap-persistentdata.c
+++ b/epan/tcap-persistentdata.c
@@ -136,7 +136,7 @@ static void
dbg(unsigned level, char* fmt, ...)
{
va_list ap;
-
+
if (level > debug_level) return;
va_start(ap,fmt);
vfprintf(stderr, fmt, ap);
@@ -149,7 +149,7 @@ tcaphash_context_equal(gconstpointer k1, gconstpointer k2)
{
const struct tcaphash_context_key_t *key1 = (const struct tcaphash_context_key_t *) k1;
const struct tcaphash_context_key_t *key2 = (const struct tcaphash_context_key_t *) k2;
-
+
return (key1->session_id == key2->session_id);
}
@@ -169,14 +169,14 @@ tcaphash_begin_equal(gconstpointer k1, gconstpointer k2)
const struct tcaphash_begin_info_key_t *key2 = (const struct tcaphash_begin_info_key_t *) k2;
if (key1->hashKey == key2->hashKey) {
-
+
if ( ( (key1->opc_hash == key2->opc_hash) &&
(key1->dpc_hash == key2->dpc_hash) &&
- (key1->tid == key2->tid) )
+ (key1->tid == key2->tid) )
||
( (key1->opc_hash == key2->dpc_hash) &&
(key1->dpc_hash == key2->opc_hash) &&
- (key1->tid == key2->tid) )
+ (key1->tid == key2->tid) )
)
return TRUE;
}
@@ -207,7 +207,7 @@ tcaphash_cont_equal(gconstpointer k1, gconstpointer k2)
(key1->src_tid == key2->src_tid) &&
(key1->dst_tid == key2->dst_tid) ) {
return TRUE;
- }
+ }
else if ( (key1->opc_hash == key2->dpc_hash) &&
(key1->dpc_hash == key2->opc_hash) &&
(key1->src_tid == key2->dst_tid) &&
@@ -238,11 +238,11 @@ tcaphash_end_equal(gconstpointer k1, gconstpointer k2)
if (key1->hashKey == key2->hashKey) {
if ( ( (key1->opc_hash == key2->opc_hash) &&
(key1->dpc_hash == key2->dpc_hash) &&
- (key1->tid == key2->tid) )
+ (key1->tid == key2->tid) )
||
( (key1->opc_hash == key2->dpc_hash) &&
(key1->dpc_hash == key2->opc_hash) &&
- (key1->tid == key2->tid) ) )
+ (key1->tid == key2->tid) ) )
return TRUE;
}
return FALSE;
@@ -258,8 +258,8 @@ tcaphash_end_calchash(gconstpointer k)
return hashkey;
}
-/*
- * Update a record with the data of the Request
+/*
+ * Update a record with the data of the Request
*/
static void
update_tcaphash_begincall(struct tcaphash_begincall_t *p_tcaphash_begincall,
@@ -271,9 +271,9 @@ update_tcaphash_begincall(struct tcaphash_begincall_t *p_tcaphash_begincall,
p_tcaphash_begincall->context->begin_time = pinfo->fd->abs_ts;
}
-/*
+/*
* Append a new dialogue, using the same Key, to the chained list
- * The time is stored too
+ * The time is stored too
*/
static struct tcaphash_begincall_t *
append_tcaphash_begincall(struct tcaphash_begincall_t *prev_begincall,
@@ -281,7 +281,7 @@ append_tcaphash_begincall(struct tcaphash_begincall_t *prev_begincall,
packet_info *pinfo)
{
struct tcaphash_begincall_t *p_new_tcaphash_begincall = NULL;
-
+
/* Append the transaction to the list, when the same key is found
This should append when the tcap-transaction Id is reused */
@@ -290,7 +290,7 @@ append_tcaphash_begincall(struct tcaphash_begincall_t *prev_begincall,
p_tcaphash_context->begincall=p_new_tcaphash_begincall;
p_new_tcaphash_begincall->beginkey=prev_begincall->beginkey;
p_new_tcaphash_begincall->context->first_frame = pinfo->fd->num;
- p_new_tcaphash_begincall->next_begincall=NULL;
+ p_new_tcaphash_begincall->next_begincall=NULL;
p_new_tcaphash_begincall->previous_begincall=prev_begincall;
p_new_tcaphash_begincall->father=FALSE;
@@ -313,15 +313,15 @@ append_tcaphash_contcall(struct tcaphash_contcall_t *prev_contcall,
struct tcaphash_context_t *p_tcaphash_context)
{
struct tcaphash_contcall_t *p_new_tcaphash_contcall = NULL;
-
+
/* Append the transaction to the list, when the same key is found
This should append when the tcap-transaction Id is reused */
-
+
p_new_tcaphash_contcall = se_alloc0(sizeof(struct tcaphash_contcall_t));
p_new_tcaphash_contcall->context=p_tcaphash_context;
p_tcaphash_context->contcall=p_new_tcaphash_contcall;
p_new_tcaphash_contcall->contkey=prev_contcall->contkey;
- p_new_tcaphash_contcall->next_contcall=NULL;
+ p_new_tcaphash_contcall->next_contcall=NULL;
p_new_tcaphash_contcall->previous_contcall=prev_contcall;
p_new_tcaphash_contcall->father=FALSE;
@@ -339,7 +339,7 @@ append_tcaphash_endcall(struct tcaphash_endcall_t *prev_endcall,
struct tcaphash_context_t *p_tcaphash_context)
{
struct tcaphash_endcall_t *p_new_tcaphash_endcall = NULL;
-
+
/* Append the transaction to the list, when the same key is found
This should append when the tcap-transaction Id is reused */
@@ -347,7 +347,7 @@ append_tcaphash_endcall(struct tcaphash_endcall_t *prev_endcall,
p_new_tcaphash_endcall->context=p_tcaphash_context;
p_tcaphash_context->endcall=p_new_tcaphash_endcall;
p_new_tcaphash_endcall->endkey=prev_endcall->endkey;
- p_new_tcaphash_endcall->next_endcall=NULL;
+ p_new_tcaphash_endcall->next_endcall=NULL;
p_new_tcaphash_endcall->previous_endcall=prev_endcall;
p_new_tcaphash_endcall->father=FALSE;
@@ -360,8 +360,8 @@ append_tcaphash_endcall(struct tcaphash_endcall_t *prev_endcall,
}
-/*
- * Find the dialog by Key and Time
+/*
+ * Find the dialog by Key and Time
*/
static struct tcaphash_begincall_t *
find_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key,
@@ -369,7 +369,7 @@ find_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key,
{
struct tcaphash_begincall_t *p_tcaphash_begincall = NULL;
p_tcaphash_begincall = (struct tcaphash_begincall_t *)g_hash_table_lookup(tcaphash_begin, p_tcaphash_begin_key);
-
+
if(p_tcaphash_begincall) {
do {
if ( p_tcaphash_begincall->context ) {
@@ -379,7 +379,7 @@ find_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key,
( !isBegin &&
pinfo->fd->num >= p_tcaphash_begincall->context->first_frame &&
( p_tcaphash_begincall->context->last_frame?pinfo->fd->num <= p_tcaphash_begincall->context->last_frame:1 )
- )
+ )
) {
/* We have a dialogue, with this key, opened before this request */
#ifdef DEBUG_TCAPSRT
@@ -401,7 +401,7 @@ find_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key,
} else {
#ifdef DEBUG_TCAPSRT
dbg(23,"Not in Bhash ");
-#endif
+#endif
}
return NULL;
}
@@ -414,7 +414,7 @@ find_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
{
struct tcaphash_contcall_t *p_tcaphash_contcall = NULL;
p_tcaphash_contcall = (struct tcaphash_contcall_t *)g_hash_table_lookup(tcaphash_cont, p_tcaphash_cont_key);
-
+
if(p_tcaphash_contcall) {
do {
if ( p_tcaphash_contcall->context &&
@@ -423,7 +423,7 @@ find_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
/* We have a dialogue, with this key, opened before this request */
#ifdef DEBUG_TCAPSRT
dbg(10,"C%d ", p_tcaphash_contcall->context->session_id);
-#endif
+#endif
return p_tcaphash_contcall;
break;
} else {
@@ -444,7 +444,7 @@ find_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
#ifdef DEBUG_TCAPSRT
dbg(23,"Not in Chash ");
#endif
- }
+ }
return NULL;
}
@@ -454,23 +454,23 @@ find_tcaphash_end(struct tcaphash_end_info_key_t *p_tcaphash_end_key,
{
struct tcaphash_endcall_t *p_tcaphash_endcall = NULL;
p_tcaphash_endcall = (struct tcaphash_endcall_t *)g_hash_table_lookup(tcaphash_end, p_tcaphash_end_key);
-
+
if(p_tcaphash_endcall) {
do {
if ( p_tcaphash_endcall->context ) {
if ( ( isEnd &&
- (p_tcaphash_endcall->context->last_frame?pinfo->fd->num == p_tcaphash_endcall->context->last_frame:1)
+ (p_tcaphash_endcall->context->last_frame?pinfo->fd->num == p_tcaphash_endcall->context->last_frame:1)
)
||
( !isEnd &&
pinfo->fd->num >= p_tcaphash_endcall->context->first_frame &&
- (p_tcaphash_endcall->context->last_frame?pinfo->fd->num <= p_tcaphash_endcall->context->last_frame:1)
+ (p_tcaphash_endcall->context->last_frame?pinfo->fd->num <= p_tcaphash_endcall->context->last_frame:1)
)
) {
/* We have a dialogue, with this key, opened before this request */
#ifdef DEBUG_TCAPSRT
dbg(10,"E%d ", p_tcaphash_endcall->context->session_id);
-#endif
+#endif
return p_tcaphash_endcall;
break;
} else {
@@ -492,12 +492,12 @@ find_tcaphash_end(struct tcaphash_end_info_key_t *p_tcaphash_end_key,
#ifdef DEBUG_TCAPSRT
dbg(23,"Not in Ehash ");
#endif
- }
+ }
return NULL;
}
/*
- * New record to create, to identify a new transaction
+ * New record to create, to identify a new transaction
*/
static struct tcaphash_context_t *
new_tcaphash_context(struct tcaphash_context_key_t *p_tcaphash_context_key,
@@ -505,8 +505,8 @@ new_tcaphash_context(struct tcaphash_context_key_t *p_tcaphash_context_key,
{
struct tcaphash_context_key_t *p_new_tcaphash_context_key;
struct tcaphash_context_t *p_new_tcaphash_context = NULL;
-
- /* Register the transaction in the hash table
+
+ /* Register the transaction in the hash table
with the tcap transaction Id as Main Key
Once created, this entry will be updated later */
@@ -526,7 +526,7 @@ new_tcaphash_context(struct tcaphash_context_key_t *p_tcaphash_context_key,
}
/*
- * New record to create, to identify a new transaction
+ * New record to create, to identify a new transaction
*/
static struct tcaphash_begincall_t *
new_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key,
@@ -534,8 +534,8 @@ new_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key,
{
struct tcaphash_begin_info_key_t *p_new_tcaphash_begin_key;
struct tcaphash_begincall_t *p_new_tcaphash_begincall = NULL;
-
- /* Register the transaction in the hash table
+
+ /* Register the transaction in the hash table
with the tcap transaction Id as Main Key
Once created, this entry will be updated later */
@@ -564,7 +564,7 @@ new_tcaphash_begin(struct tcaphash_begin_info_key_t *p_tcaphash_begin_key,
/*
- * New record to create, to identify a new transaction
+ * New record to create, to identify a new transaction
*/
static struct tcaphash_contcall_t *
new_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
@@ -572,8 +572,8 @@ new_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
{
struct tcaphash_cont_info_key_t *p_new_tcaphash_cont_key;
struct tcaphash_contcall_t *p_new_tcaphash_contcall = NULL;
-
- /* Register the transaction in the hash table
+
+ /* Register the transaction in the hash table
with the tcap transaction Id as Main Key
Once created, this entry will be updated later */
@@ -583,9 +583,9 @@ new_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
p_new_tcaphash_cont_key->dst_tid = p_tcaphash_cont_key->dst_tid;
p_new_tcaphash_cont_key->opc_hash = p_tcaphash_cont_key->opc_hash;
p_new_tcaphash_cont_key->dpc_hash = p_tcaphash_cont_key->dpc_hash;
-
+
p_new_tcaphash_contcall = se_alloc0(sizeof(struct tcaphash_contcall_t));
- p_new_tcaphash_contcall->contkey=p_new_tcaphash_cont_key;
+ p_new_tcaphash_contcall->contkey=p_new_tcaphash_cont_key;
p_new_tcaphash_contcall->context=p_tcaphash_context;
p_tcaphash_context->contcall=p_new_tcaphash_contcall;
p_new_tcaphash_contcall->father=TRUE;
@@ -602,7 +602,7 @@ new_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
/*
- * New record to create, to identify a new transaction
+ * New record to create, to identify a new transaction
*/
static struct tcaphash_endcall_t *
new_tcaphash_end(struct tcaphash_end_info_key_t *p_tcaphash_end_key,
@@ -610,8 +610,8 @@ new_tcaphash_end(struct tcaphash_end_info_key_t *p_tcaphash_end_key,
{
struct tcaphash_end_info_key_t *p_new_tcaphash_end_key;
struct tcaphash_endcall_t *p_new_tcaphash_endcall = NULL;
-
- /* Register the transaction in the hash table
+
+ /* Register the transaction in the hash table
with the tcap transaction Id as Main Key
Once created, this entry will be updated later */
@@ -624,11 +624,11 @@ new_tcaphash_end(struct tcaphash_end_info_key_t *p_tcaphash_end_key,
p_new_tcaphash_endcall = se_alloc0(sizeof(struct tcaphash_endcall_t));
p_new_tcaphash_endcall->endkey=p_new_tcaphash_end_key;
p_new_tcaphash_endcall->context=p_tcaphash_context;
- p_tcaphash_context->endcall=p_new_tcaphash_endcall;
+ p_tcaphash_context->endcall=p_new_tcaphash_endcall;
p_new_tcaphash_endcall->father=TRUE;
p_new_tcaphash_endcall->next_endcall=NULL;
p_new_tcaphash_endcall->previous_endcall=NULL;
-
+
#ifdef DEBUG_TCAPSRT
dbg(10,"E%d ", p_new_tcaphash_endcall->context->session_id);
#endif
@@ -639,7 +639,7 @@ new_tcaphash_end(struct tcaphash_end_info_key_t *p_tcaphash_end_key,
-static struct tcaphash_contcall_t *
+static struct tcaphash_contcall_t *
create_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
struct tcaphash_context_t *p_tcaphash_context)
{
@@ -648,7 +648,7 @@ create_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
p_tcaphash_contcall1 = (struct tcaphash_contcall_t *)
g_hash_table_lookup(tcaphash_cont, p_tcaphash_cont_key);
-
+
if (p_tcaphash_contcall1) {
/* Walk through list of transaction with identical keys */
/* go the the end to insert new record */
@@ -668,16 +668,16 @@ create_tcaphash_cont(struct tcaphash_cont_info_key_t *p_tcaphash_cont_key,
}
-static struct tcaphash_endcall_t *
+static struct tcaphash_endcall_t *
create_tcaphash_end(struct tcaphash_end_info_key_t *p_tcaphash_end_key,
struct tcaphash_context_t *p_tcaphash_context)
{
struct tcaphash_endcall_t *p_tcaphash_endcall1 = NULL;
struct tcaphash_endcall_t *p_tcaphash_endcall = NULL;
-
+
p_tcaphash_endcall1 = (struct tcaphash_endcall_t *)
g_hash_table_lookup(tcaphash_end, p_tcaphash_end_key);
-
+
if (p_tcaphash_endcall1) {
/* Walk through list of transaction with identical keys */
/* go the the end to insert new record */
@@ -718,7 +718,7 @@ tcapsrt_init_routine(void)
dbg(16,"Destroy hash_begin ");
#endif
g_hash_table_destroy(tcaphash_begin);
- }
+ }
if (tcaphash_cont != NULL) {
#ifdef DEBUG_TCAPSRT
@@ -752,7 +752,7 @@ tcapsrt_init_routine(void)
/*
* Service Responsee Time analyze
- * Called just after dissector call
+ * Called just after dissector call
*/
struct tcaphash_context_t *
tcapsrt_call_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
@@ -761,7 +761,7 @@ tcapsrt_call_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
struct tcaphash_context_t *tcap_context=NULL;
switch (p_tcapsrt_info->ope) {
-
+
case TC_BEGIN: /*InitialDP*/
#ifdef DEBUG_TCAPSRT
dbg(1,"TC_BEGIN ");
@@ -772,24 +772,24 @@ tcapsrt_call_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case TC_CONT:
#ifdef DEBUG_TCAPSRT
dbg(1,"TC_CONT ");
-#endif
+#endif
tcap_context=tcaphash_cont_matching(tvb, pinfo, tree, p_tcapsrt_info);
break;
case TC_ABORT:
#ifdef DEBUG_TCAPSRT
dbg(1,"TC_ABORT ");
-#endif
+#endif
tcap_context=tcaphash_end_matching(tvb, pinfo, tree, p_tcapsrt_info);
break;
-
+
case TC_END:
#ifdef DEBUG_TCAPSRT
dbg(1,"TC_END ");
#endif
tcap_context=tcaphash_end_matching(tvb, pinfo, tree, p_tcapsrt_info);
break;
-
+
default:
#ifdef DEBUG_TCAPSRT
dbg(1,"Unknow %d ", p_tcapsrt_info->ope);
@@ -804,12 +804,12 @@ tcapsrt_call_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
-/*
+/*
* Create the record identifiying the TCAP transaction
- * When the identifier for the transaction is reused, check
+ * When the identifier for the transaction is reused, check
* the following criteria before to append a new record:
- * - a timeout corresponding to a message retransmission is detected,
- * - a message hast been lost
+ * - a timeout corresponding to a message retransmission is detected,
+ * - a message hast been lost
* - or the previous transaction has been be closed
*/
static struct tcaphash_context_t *
@@ -817,11 +817,11 @@ tcaphash_begin_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
struct tcapsrt_info_t *p_tcapsrt_info)
{
struct tcaphash_context_t *p_tcaphash_context=NULL;
- struct tcaphash_context_key_t tcaphash_context_key;
+ struct tcaphash_context_key_t tcaphash_context_key;
struct tcaphash_begincall_t *p_tcaphash_begincall, *p_new_tcaphash_begincall;
struct tcaphash_begin_info_key_t tcaphash_begin_key;
- proto_item *ti;
-
+ proto_item *pi;
+
/* prepare the key data */
tcaphash_begin_key.tid = p_tcapsrt_info->src_tid;
tcaphash_begin_key.opc_hash = mtp3_pc_hash( ((address *)(&pinfo->src))->data);
@@ -840,7 +840,7 @@ tcaphash_begin_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (p_tcaphash_begincall) {
/* Walk through list of transaction with identical keys */
- do {
+ do {
/* Check if the request with this reqSeqNum has been seen, with the same Message Type */
if (pinfo->fd->num == p_tcaphash_begincall->context->first_frame) {
/* We have seen this request before -> do nothing */
@@ -856,18 +856,18 @@ tcaphash_begin_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* if last request has been responded (response number in known)
and this request appears after last response (has bigger frame number)
and last request occured after the timeout for repetition,
- or
+ or
if last request hasn't been responded (so number unknown)
and this request appears after last request (has bigger frame number)
and this request occured after the timeout for message lost */
if ( ( p_tcaphash_begincall->context->last_frame != 0
- && pinfo->fd->num > p_tcaphash_begincall->context->first_frame
+ && pinfo->fd->num > p_tcaphash_begincall->context->first_frame
&& (guint) pinfo->fd->abs_ts.secs > (guint)(p_tcaphash_begincall->context->begin_time.secs + gtcap_RepetitionTimeout)
) ||
( p_tcaphash_begincall->context->last_frame == 0
&& pinfo->fd->num > p_tcaphash_begincall->context->first_frame
- && (guint)pinfo->fd->abs_ts.secs > (guint)(p_tcaphash_begincall->context->begin_time.secs + gtcap_LostTimeout)
- )
+ && (guint)pinfo->fd->abs_ts.secs > (guint)(p_tcaphash_begincall->context->begin_time.secs + gtcap_LostTimeout)
+ )
)
{
/* we decide that we have a new request */
@@ -875,46 +875,48 @@ tcaphash_begin_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#ifdef DEBUG_TCAPSRT
dbg(12,"(timeout) Append key %lx ",tcaphash_begin_key.hashKey);
dbg(12,"Frame %u rsp %u ",pinfo->fd->num,p_tcaphash_begincall->context->last_frame );
-#endif
+#endif
tcaphash_context_key.session_id = tcapsrt_global_SessionId++;
- p_tcaphash_context = new_tcaphash_context(&tcaphash_context_key, pinfo);
+ p_tcaphash_context = new_tcaphash_context(&tcaphash_context_key, pinfo);
p_new_tcaphash_begincall = append_tcaphash_begincall(p_tcaphash_begincall,
p_tcaphash_context,
pinfo);
-
+
#ifdef DEBUG_TCAPSRT
dbg(12,"Update key %lx ",tcaphash_begin_key.hashKey);
#endif
update_tcaphash_begincall(p_new_tcaphash_begincall, pinfo);
p_tcaphash_begincall=p_new_tcaphash_begincall;
} else {
-
+
/* If the Tid is reused for a closed Transaction */
/* Or if we received an InitialDP for a non closed Transaction */
if ( p_tcaphash_begincall->context->closed) {
#ifdef DEBUG_TCAPSRT
dbg(12,"(closed) Append key %lu ",tcaphash_begin_key.hashKey);
dbg(12,"Frame %u rsp %u ",pinfo->fd->num,p_tcaphash_begincall->context->last_frame );
-#endif
+#endif
tcaphash_context_key.session_id = tcapsrt_global_SessionId++;
- p_tcaphash_context = new_tcaphash_context(&tcaphash_context_key, pinfo);
+ p_tcaphash_context = new_tcaphash_context(&tcaphash_context_key, pinfo);
p_new_tcaphash_begincall = append_tcaphash_begincall(p_tcaphash_begincall,
p_tcaphash_context,
pinfo);
-
+
#ifdef DEBUG_TCAPSRT
dbg(12,"Update key %lu ",tcaphash_begin_key.hashKey);
#endif
update_tcaphash_begincall(p_new_tcaphash_begincall, pinfo);
p_tcaphash_begincall=p_new_tcaphash_begincall;
-
+
} else {
/* No, so it's a duplicate request.Mark it as such. */
#ifdef DEBUG_TCAPSRT
dbg(21,"Display_duplicate ");
#endif
- if (gtcap_DisplaySRT)
- proto_tree_add_uint_hidden(tree, hf_tcapsrt_Duplicate, tvb, 0,0, p_tcapsrt_info->src_tid);
+ if (gtcap_DisplaySRT) {
+ pi = proto_tree_add_uint_hidden(tree, hf_tcapsrt_Duplicate, tvb, 0,0, p_tcapsrt_info->src_tid);
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
p_tcaphash_context=p_tcaphash_begincall->context;
} /* test with Timeout */
} /* closed */
@@ -928,37 +930,40 @@ tcaphash_begin_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else { /* p_tcaphash_begincall has not been found */
#ifdef DEBUG_TCAPSRT
dbg(10,"New key %lx ",tcaphash_begin_key.hashKey);
-#endif
+#endif
tcaphash_context_key.session_id = tcapsrt_global_SessionId++;
- p_tcaphash_context = new_tcaphash_context(&tcaphash_context_key, pinfo);
+ p_tcaphash_context = new_tcaphash_context(&tcaphash_context_key, pinfo);
p_tcaphash_begincall = new_tcaphash_begin(&tcaphash_begin_key, p_tcaphash_context);
-
+
#ifdef DEBUG_TCAPSRT
dbg(11,"Update key %lx ",tcaphash_begin_key.hashKey);
dbg(11,"Frame reqlink #%u ", pinfo->fd->num);
#endif
update_tcaphash_begincall(p_tcaphash_begincall, pinfo);
}
-
+
/* display tcap session, if available */
if ( gtcap_DisplaySRT &&
p_tcaphash_context &&
- p_tcaphash_context->session_id)
- proto_tree_add_uint(tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id);
-
+ p_tcaphash_context->session_id) {
+ pi = proto_tree_add_uint(tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id);
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
+
+
/* add link to response frame, if available */
if( gtcap_DisplaySRT &&
p_tcaphash_begincall->context->last_frame != 0){
#ifdef DEBUG_TCAPSRT
dbg(20,"Display_frameRsplink %d ",p_tcaphash_begincall->context->last_frame);
#endif
- ti = proto_tree_add_uint_format(tree, hf_tcapsrt_BeginSession, tvb, 0, 0,
+ pi = proto_tree_add_uint_format(tree, hf_tcapsrt_BeginSession, tvb, 0, 0,
p_tcaphash_begincall->context->last_frame,
"End of session in frame %u",
p_tcaphash_begincall->context->last_frame);
- PROTO_ITEM_SET_GENERATED(ti);
- }
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
return p_tcaphash_context;
}
@@ -974,10 +979,11 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
struct tcaphash_context_t *p_tcaphash_context=NULL;
struct tcaphash_contcall_t *p_tcaphash_contcall;
struct tcaphash_cont_info_key_t tcaphash_cont_key;
+ proto_item *pi;
#ifdef DEBUG_TCAPSRT
dbg(10,"\n Hcont #%u ", pinfo->fd->num);
-#endif
+#endif
/* look only for matching request, if matching conversation is available. */
tcaphash_cont_key.src_tid = p_tcapsrt_info->src_tid;
@@ -988,7 +994,7 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#ifdef DEBUG_TCAPSRT
dbg(11,"Ckey %lx ", tcaphash_cont_key.hashKey);
- dbg(51,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
+ dbg(51,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
dbg(51,"Tid %lx %lx ",tcaphash_cont_key.src_tid, tcaphash_cont_key.dst_tid);
#endif
p_tcaphash_contcall = find_tcaphash_cont(&tcaphash_cont_key, pinfo);
@@ -1014,7 +1020,7 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#ifdef DEBUG_TCAPSRT
dbg(11,"Bkey %lx ", tcaphash_begin_key.hashKey);
- dbg(51,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
+ dbg(51,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
dbg(51,"Tid %lx ",tcaphash_begin_key.tid);
#endif
p_tcaphash_begincall = find_tcaphash_begin(&tcaphash_begin_key, pinfo,FALSE);
@@ -1022,7 +1028,7 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
!p_tcaphash_begincall->context->contcall ) {
#ifdef DEBUG_TCAPSRT
dbg(12,"BFound ");
-#endif
+#endif
p_tcaphash_context=p_tcaphash_begincall->context;
p_tcaphash_context->responded=TRUE;
@@ -1031,7 +1037,7 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#endif
p_tcaphash_contcall = create_tcaphash_cont(&tcaphash_cont_key,
p_tcaphash_begincall->context);
-
+
#ifdef DEBUG_TCAPSRT
dbg(11,"Update Ckey %lx ",tcaphash_begin_key.hashKey);
dbg(11,"Frame reqlink #%u ", pinfo->fd->num);
@@ -1046,7 +1052,7 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#endif
p_tcaphash_endcall = create_tcaphash_end(&tcaphash_end_key,
p_tcaphash_begincall->context);
-
+
#ifdef DEBUG_TCAPSRT
dbg(11,"Update Ekey %lx ",tcaphash_end_key.hashKey);
dbg(11,"Frame reqlink #%u ", pinfo->fd->num);
@@ -1054,15 +1060,17 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else { /* Begin not found */
#ifdef DEBUG_TCAPSRT
dbg(12,"BnotFound ");
-#endif
+#endif
} /* begin found */
} /* cont found */
/* display tcap session, if available */
if (gtcap_DisplaySRT &&
p_tcaphash_context &&
- p_tcaphash_context->session_id)
- proto_tree_add_uint(tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id);
-
+ p_tcaphash_context->session_id) {
+ pi = proto_tree_add_uint(tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id);
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
+
return p_tcaphash_context;
}
@@ -1075,15 +1083,15 @@ tcaphash_cont_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static struct tcaphash_context_t *
tcaphash_end_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
struct tcapsrt_info_t *p_tcapsrt_info)
-{
+{
struct tcaphash_context_t *p_tcaphash_context=NULL;
struct tcaphash_end_info_key_t tcaphash_end_key;
struct tcaphash_endcall_t *p_tcaphash_endcall=NULL;
struct tcaphash_begin_info_key_t tcaphash_begin_key;
- struct tcaphash_begincall_t *p_tcaphash_begincall=NULL;
- proto_item *ti;
+ struct tcaphash_begincall_t *p_tcaphash_begincall=NULL;
+ proto_item *pi;
nstime_t delta;
@@ -1098,71 +1106,73 @@ tcaphash_end_matching(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
#ifdef DEBUG_TCAPSRT
dbg(11,"Ekey %lx ",tcaphash_end_key.hashKey);
- dbg(11,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
+ dbg(11,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
dbg(51,"Tid %lx ",tcaphash_end_key.tid);
#endif
p_tcaphash_endcall = find_tcaphash_end(&tcaphash_end_key, pinfo,TRUE);
-
+
if(!p_tcaphash_endcall) {
#ifdef DEBUG_TCAPSRT
- dbg(12,"EnotFound ");
-#endif
+ dbg(12,"EnotFound ");
+#endif
tcaphash_begin_key.tid = p_tcapsrt_info->dst_tid;
tcaphash_begin_key.opc_hash=mtp3_pc_hash( ((address*)(&pinfo->src))->data);
tcaphash_begin_key.dpc_hash=mtp3_pc_hash( ((address*)(&pinfo->dst))->data);
tcaphash_begin_key.hashKey=tcaphash_begin_calchash(&tcaphash_begin_key);
-
+
#ifdef DEBUG_TCAPSRT
dbg(11,"Bkey %lx ", tcaphash_begin_key.hashKey);
- dbg(51,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
+ dbg(51,"PC %s %s ",address_to_str(&pinfo->src), address_to_str(&pinfo->dst));
dbg(51,"Tid %lx ",tcaphash_begin_key.tid);
#endif
p_tcaphash_begincall = find_tcaphash_begin(&tcaphash_begin_key, pinfo,FALSE);
}
-
+
if (p_tcaphash_endcall) {
/* Use the TC_BEGIN Destination reference */
p_tcaphash_context=p_tcaphash_endcall->context;
} else if (p_tcaphash_begincall) {
- /* Use the TC_BEGIN Source reference */
+ /* Use the TC_BEGIN Source reference */
p_tcaphash_context=p_tcaphash_begincall->context;
}
if (p_tcaphash_context) {
-
+
#ifdef DEBUG_TCAPSRT
dbg(12,"Found, req=%d ",p_tcaphash_context->first_frame);
#endif
- if (gtcap_DisplaySRT)
- proto_tree_add_uint(tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id);
+ if (gtcap_DisplaySRT) {
+ pi = proto_tree_add_uint(tree, hf_tcapsrt_SessionId, tvb, 0,0, p_tcaphash_context->session_id);
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
#ifdef DEBUG_TCAPSRT
dbg(20,"Display framereqlink %d ",p_tcaphash_context->first_frame);
#endif
/* Indicate the frame to which this is a reply. */
if (gtcap_DisplaySRT) {
- ti = proto_tree_add_uint_format(tree, hf_tcapsrt_EndSession, tvb, 0, 0,
+ pi = proto_tree_add_uint_format(tree, hf_tcapsrt_EndSession, tvb, 0, 0,
p_tcaphash_context->first_frame,
"Begin of session in frame %u",
p_tcaphash_context->first_frame);
- PROTO_ITEM_SET_GENERATED(ti);
+ PROTO_ITEM_SET_GENERATED(pi);
/* Calculate Service Response Time */
nstime_delta(&delta, &pinfo->fd->abs_ts, &p_tcaphash_context->begin_time);
-
+
/* display Service Response Time and make it filterable */
- ti = proto_tree_add_time(tree, hf_tcapsrt_SessionTime, tvb, 0, 0, &delta);
- PROTO_ITEM_SET_GENERATED(ti);
+ pi = proto_tree_add_time(tree, hf_tcapsrt_SessionTime, tvb, 0, 0, &delta);
+ PROTO_ITEM_SET_GENERATED(pi);
}
/* Close the context and remove it */
tcapsrt_close(p_tcaphash_context,pinfo);
- } /* context present */
+ } /* context present */
return p_tcaphash_context;
}
/*
* Initialize the Message Info used by the main dissector
- * Data are linked to a TCAP transaction
+ * Data are linked to a TCAP transaction
*/
struct tcapsrt_info_t *
tcapsrt_razinfo(void)
@@ -1174,9 +1184,9 @@ tcapsrt_razinfo(void)
if(tcapsrt_global_current==MAX_TCAP_INSTANCE){
tcapsrt_global_current=0;
}
-
+
p_tcapsrt_info=&tcapsrt_global_info[tcapsrt_global_current];
- memset(p_tcapsrt_info,0,sizeof(struct tcapsrt_info_t));
+ memset(p_tcapsrt_info,0,sizeof(struct tcapsrt_info_t));
return p_tcapsrt_info;
}
@@ -1202,7 +1212,7 @@ tcapsrt_close(struct tcaphash_context_t *p_tcaphash_context,
#endif
g_hash_table_remove(tcaphash_end, p_tcaphash_context->endcall->endkey);
}
-
+
/* If the contkey is present */
if ( p_tcaphash_context->contcall
&& !gtcap_PersistentSRT) {
@@ -1211,7 +1221,7 @@ tcapsrt_close(struct tcaphash_context_t *p_tcaphash_context,
#endif
g_hash_table_remove(tcaphash_cont, p_tcaphash_context->contcall->contkey);
}
-
+
/* If the beginkey is present */
if (p_tcaphash_context->begincall->next_begincall) {
if (p_tcaphash_context->begincall->previous_begincall ) {
@@ -1237,7 +1247,7 @@ tcapsrt_close(struct tcaphash_context_t *p_tcaphash_context,
dbg(20,"remove context ");
#endif
g_hash_table_remove(tcaphash_context, p_tcaphash_context->key);
-
+
} /* begincall without chained string */
} else { /* no context */
#ifdef DEBUG_TCAPSRT