aboutsummaryrefslogtreecommitdiffstats
path: root/epan/epan.h
blob: a2d97585f8dc110d3862a23c885b78490cd9fb12 (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
/* epan.h
 *
 * $Id: epan.h,v 1.6 2001/04/02 00:38:34 hagbard Exp $
 *
 * Ethereal Protocol Analyzer Library
 *
 */

#ifndef EPAN_H
#define EPAN_H

#include <glib.h>

/* XXX - for now */
#include "packet.h"

void epan_init(const char * plugindir, void (register_all_protocols)(void),
	       void (register_all_handoffs)(void));
void epan_cleanup(void);
void epan_conversation_init(void);



/* A client will create one epan_t for an entire dissection session.
 * A single epan_t will be used to analyze the entire sequence of packets,
 * sequentially, in a single session. A session corresponds to a single
 * packet trace file. The reaons epan_t exists is that some packets in
 * some protocols cannot be decoded without knowledge of previous packets.
 * This inter-packet "state" is stored in the epan_t.
 */
typedef struct epan_session epan_t;

epan_t*
epan_new(void);

void
epan_free(epan_t*);




/* Dissection of a single byte array. Holds tvbuff info as
 * well as proto_tree info. As long as the epan_dissect_t for a byte
 * array is in existence, you must not free or move that byte array,
 * as the structures that the epan_dissect_t contains might have pointers
 * to addresses in your byte array.
 */
typedef struct {
	tvbuff_t	*tvb;
	proto_tree	*tree;
} epan_dissect_t;

epan_dissect_t*
epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd, proto_tree *tree);

void
epan_dissect_free(epan_dissect_t* edt);





/* Should this be ".libepan"? For backwards-compatibility, I'll keep
 * it ".ethereal" for now.
 */
#define PF_DIR ".ethereal"



#endif /* EPAN_H */