aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tcap-persistentdata.h
blob: 9136bf8f74398ca85c22a9512ffb78ca38b0a809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
 * tcap-persistentdata.h
 * Definitions for lists and hash tables used in wireshark's tcap dissector
 * for calculation of delays in tcap-transactions
 * Copyright 2006 Florent Drouin (based on h225-persistentdata from Lars Roland)
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * $Id$
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifndef __tcapsrt_HASH__
#define __tcapsrt_HASH__

#include "epan/packet.h"
#include "epan/conversation.h"
#include "epan/dissectors/packet-tcap.h"

#define LENGTH_OID 16
struct tcaphash_context_t {
  struct tcaphash_context_key_t * key;
  guint32 session_id;
  guint32 first_frame;
  guint32 last_frame;
  nstime_t begin_time;	/* time of arrival of TC_BEGIN */
  nstime_t end_time;	/* time of closing message */
  gboolean responded;	/* true, if request has been responded */
  gboolean closed;
  gboolean upper_dissector;
  gboolean oid_present;
  gchar oid[LENGTH_OID+1];
  gboolean subdissector_present;
  dissector_handle_t subdissector_handle;
  void (* callback) (tvbuff_t *,packet_info *, proto_tree *, struct tcaphash_context_t *);
  struct tcaphash_begincall_t * begincall; 
  struct tcaphash_contcall_t * contcall; 
  struct tcaphash_endcall_t * endcall;
  struct tcaphash_ansicall_t * ansicall; 
};

struct tcaphash_begincall_t {
  struct tcaphash_begin_info_key_t * beginkey;
  struct tcaphash_context_t * context;
  gboolean father;
  struct tcaphash_begincall_t * next_begincall; 
  struct tcaphash_begincall_t * previous_begincall; 
};

struct tcaphash_contcall_t { 
  struct tcaphash_cont_info_key_t * contkey;
  struct tcaphash_context_t * context;
  gboolean father;
  struct tcaphash_contcall_t * next_contcall; 
  struct tcaphash_contcall_t * previous_contcall; 
};

struct tcaphash_endcall_t {
  struct tcaphash_end_info_key_t * endkey;
  struct tcaphash_context_t * context;
  gboolean father;
  struct tcaphash_endcall_t * next_endcall; 
  struct tcaphash_endcall_t * previous_endcall; 
};

struct tcaphash_ansicall_t {
  struct tcaphash_ansi_info_key_t * ansikey;
  struct tcaphash_context_t * context;
  gboolean father;
  struct tcaphash_ansicall_t * next_ansicall; 
  struct tcaphash_ansicall_t * previous_ansicall; 
};

/* The Key for the hash table is the TCAP origine transaction identifier 
   of the TC_BEGIN containing the InitialDP */

struct tcaphash_context_key_t {
  guint32 session_id;
};

struct tcaphash_begin_info_key_t {
  guint32 hashKey;
  guint32 tid;
  guint32 opc_hash;
  guint32 dpc_hash;
};

struct tcaphash_cont_info_key_t {
  guint32 hashKey;
  guint32 src_tid;
  guint32 dst_tid;
  guint32 opc_hash;
  guint32 dpc_hash;
};

struct tcaphash_end_info_key_t {
  guint32 hashKey;
  guint32 tid;
  guint32 opc_hash;
  guint32 dpc_hash;
};

struct tcaphash_ansi_info_key_t {
  guint32 hashKey;
  guint32 tid;
  guint32 opc_hash;
  guint32 dpc_hash;
};


/* List of infos to store for the analyse */
struct tcapsrt_info_t {
  guint32 tcap_session_id;
  guint32 src_tid;
  guint32 dst_tid;
  guint8 ope;
};

void tcapsrt_init_routine(void);

struct tcapsrt_info_t * tcapsrt_razinfo(void);

void tcapsrt_close(struct tcaphash_context_t * p_tcaphash_context,
		   packet_info * pinfo _U_);

struct tcaphash_context_t * tcapsrt_call_matching(tvbuff_t *tvb,
						  packet_info * pinfo _U_,
						  proto_tree *tree,
						  struct tcapsrt_info_t * p_tcap_info);

WS_VAR_IMPORT gboolean gtcap_StatSRT;

#endif /* __tcapsrt_HASH__*/