Don't give tvbuffs names; instead, give data sources names, where a
[metze/wireshark/wip.git] / epan / frame_data.h
1 /* frame_data.h
2  * Definitions for frame_data structures and routines
3  *
4  * $Id: frame_data.h,v 1.4 2002/02/18 01:08:41 guy Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
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 __FRAME_DATA_H__
26 #define __FRAME_DATA_H__
27
28 #include "column_info.h"
29 #include "tvbuff.h"
30
31 /* XXX - some of this stuff is used only while a packet is being dissected;
32    should we keep that stuff in the "packet_info" structure, instead, to
33    save memory? */
34 typedef struct _frame_data {
35   struct _frame_data *next; /* Next element in list */
36   struct _frame_data *prev; /* Previous element in list */
37   GSList      *pfd;         /* Per frame proto data */
38   GSList      *data_src;    /* Frame data sources */
39   guint32      num;         /* Frame number */
40   guint32      pkt_len;     /* Packet length */
41   guint32      cap_len;     /* Amount actually captured */
42   gint32       rel_secs;    /* Relative seconds (yes, it can be negative) */
43   gint32       rel_usecs;   /* Relative microseconds (yes, it can be negative) */
44   guint32      abs_secs;    /* Absolute seconds */
45   guint32      abs_usecs;   /* Absolute microseconds */
46   gint32       del_secs;    /* Delta seconds (yes, it can be negative) */
47   gint32       del_usecs;   /* Delta microseconds (yes, it can be negative) */
48   long         file_off;    /* File offset */
49   int          lnk_t;       /* Per-packet encapsulation/data-link type */
50   struct {
51         unsigned int passed_dfilter     : 1; /* 1 = display, 0 = no display */
52         unsigned int encoding           : 2; /* Character encoding (ASCII, EBCDIC...) */
53         unsigned int visited            : 1; /* Has this packet been visited yet? 1=Yes,0=No*/
54         unsigned int marked             : 1; /* 1 = marked by user, 0 = normal */
55   } flags;
56 } frame_data;
57
58 /*
59  * A data source.
60  * Has a tvbuff and a name.
61  */
62 typedef struct {
63   tvbuff_t *tvb;
64   char *name;
65 } data_source;
66
67 /* Utility routines used by packet*.c */
68
69 void       p_add_proto_data(frame_data *, int, void *);
70 void       *p_get_proto_data(frame_data *, int);
71
72 /* An init routine to be called by epan_init */
73 void frame_data_init(void);
74
75 /* A cleanup routine to be called by epan_cleanup */
76 void frame_data_cleanup(void);
77
78 #endif  /* __FRAME_DATA__ */