name change
[obnox/wireshark/wip.git] / epan / circuit.h
1 /* circuit.h
2  * Routines for building lists of packets that are part of a "circuit"
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __CIRCUIT_H__
26 #define __CIRCUIT_H__
27
28 #include "packet.h"             /* for circuit dissector type */
29
30 /*
31  * Data structure representing a circuit.
32  */
33 typedef struct circuit_key {
34         circuit_type ctype;
35         guint32 circuit_id;
36 } circuit_key;
37
38 typedef struct circuit {
39         struct circuit *next;           /* pointer to next circuit with given circuit ID */
40         guint32 first_frame;            /* # of first frame for that circuit */
41         guint32 last_frame;             /* # of last frame for that circuit */
42         guint32 index;                  /* unique ID for circuit */
43         GSList *data_list;              /* list of data associated with circuit */
44         dissector_handle_t dissector_handle;
45                                         /* handle for protocol dissector client associated with circuit */
46         guint   options;                /* wildcard flags */
47         circuit_key *key_ptr;           /* pointer to the key for this circuit */
48 } circuit_t;
49
50 extern void circuit_init(void);
51
52 extern circuit_t *circuit_new(circuit_type ctype, guint32 circuit_id,
53     guint32 first_frame);
54
55 extern circuit_t *find_circuit(circuit_type ctype, guint32 circuit_id,
56     guint32 frame);
57
58 extern void close_circuit(circuit_t *circuit, guint32 last_frame);
59
60 extern void circuit_add_proto_data(circuit_t *conv, int proto,
61     void *proto_data);
62 extern void *circuit_get_proto_data(circuit_t *conv, int proto);
63 extern void circuit_delete_proto_data(circuit_t *conv, int proto);
64
65 extern void circuit_set_dissector(circuit_t *circuit,
66     dissector_handle_t handle);
67 extern dissector_handle_t circuit_get_dissector(circuit_t *circuit);
68 extern gboolean
69 try_circuit_dissector(circuit_type ctype, guint32 circuit_id, guint32 frame,
70    tvbuff_t *tvb,  packet_info *pinfo, proto_tree *tree);
71
72 #endif /* circuit.h */
73