name change
[metze/wireshark/wip.git] / epan / epan.h
1 /* epan.h
2  *
3  * $Id$
4  *
5  * Wireshark Protocol Analyzer Library
6  *
7  * Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22  */
23
24 #ifndef EPAN_H
25 #define EPAN_H
26
27 #include <glib.h>
28 #include "frame_data.h"
29 #include "column_info.h"
30
31 typedef struct _epan_dissect_t epan_dissect_t;
32
33 #include "dfilter/dfilter.h"
34
35 /* init the whole epan module, this is used to be called only once in a program */
36 void epan_init(const char * plugindir, void (*register_all_protocols)(void),
37                void (*register_all_handoffs)(void),
38                void (*report_failure)(const char *, va_list),
39                void (*report_open_failure)(const char *, int, gboolean),
40                void (*report_read_failure)(const char *, int));
41 /* cleanup the whole epan module, this is used to be called only once in a program */
42 void epan_cleanup(void);
43 /* Initialize the table of conversations. */
44 void epan_conversation_init(void);
45 /* Initialize the table of circuits. */
46 /* XXX - what is a circuit and should this better be combined with epan_conversation_init? */
47 void epan_circuit_init(void);
48
49 /* A client will create one epan_t for an entire dissection session.
50  * A single epan_t will be used to analyze the entire sequence of packets,
51  * sequentially, in a single session. A session corresponds to a single
52  * packet trace file. The reaons epan_t exists is that some packets in
53  * some protocols cannot be decoded without knowledge of previous packets.
54  * This inter-packet "state" is stored in the epan_t.
55  */
56 /* XXX - NOTE: epan_t, epan_new and epan_free are currently unused! */
57 typedef struct epan_session epan_t;
58
59 epan_t*
60 epan_new(void);
61
62 void
63 epan_free(epan_t*);
64
65
66 /* get a new single packet dissection */
67 /* should be freed using epan_dissect_free() after packet dissection completed */
68 epan_dissect_t*
69 epan_dissect_new(gboolean create_proto_tree, gboolean proto_tree_visible);
70
71 /* run a single packet dissection */
72 void
73 epan_dissect_run(epan_dissect_t *edt, void* pseudo_header,
74         const guint8* data, frame_data *fd, column_info *cinfo);
75
76 /* Prime a proto_tree using the fields/protocols used in a dfilter. */
77 void
78 epan_dissect_prime_dfilter(epan_dissect_t *edt, const dfilter_t *dfcode);
79
80 /* fill the dissect run output into the packet list columns */
81 void
82 epan_dissect_fill_in_columns(epan_dissect_t *edt);
83
84 /* free a single packet dissection */
85 void
86 epan_dissect_free(epan_dissect_t* edt);
87
88 #endif /* EPAN_H */