Custom column updates:
[metze/wireshark/wip.git] / epan / frame_data.h
1 /* frame_data.h
2  * Definitions for frame_data structures and routines
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 __FRAME_DATA_H__
26 #define __FRAME_DATA_H__
27
28 #include "column_info.h"
29 #include "tvbuff.h"
30 #include <epan/nstime.h>
31
32
33 /* XXX - some of this stuff is used only while a packet is being dissected;
34    should we keep that stuff in the "packet_info" structure, instead, to
35    save memory? */
36 /* The frame number is the ordinal number of the frame in the capture, so
37    it's 1-origin.  In various contexts, 0 as a frame number means "frame
38    number unknown". */
39 typedef struct _frame_data {
40   struct _frame_data *next; /* Next element in list */
41   struct _frame_data *prev; /* Previous element in list */
42   GSList      *pfd;         /* Per frame proto data */
43   guint32      num;         /* Frame number */
44   guint32      pkt_len;     /* Packet length */
45   guint32      cap_len;     /* Amount actually captured */
46   guint32      cum_bytes;   /* Cumulative bytes into the capture */
47   nstime_t     abs_ts;      /* Absolute timestamp */
48   nstime_t     rel_ts;      /* Relative timestamp (yes, it can be negative) */
49   nstime_t     del_dis_ts;  /* Delta timestamp to previous displayed frame (yes, it can be negative) */
50   nstime_t     del_cap_ts;  /* Delta timestamp to previous captured frame (yes, it can be negative) */
51   gint64       file_off;    /* File offset */
52   int          lnk_t;       /* Per-packet encapsulation/data-link type */
53   struct {
54         unsigned int passed_dfilter     : 1; /* 1 = display, 0 = no display */
55         unsigned int encoding           : 2; /* Character encoding (ASCII, EBCDIC...) */
56         unsigned int visited            : 1; /* Has this packet been visited yet? 1=Yes,0=No*/
57         unsigned int marked             : 1; /* 1 = marked by user, 0 = normal */
58         unsigned int ref_time           : 1; /* 1 = marked as a reference time frame, 0 = normal */
59   } flags;
60   void *color_filter;       /* Per-packet matching color_filter_t object */
61   col_expr_t   col_expr;   /* Column expressions & values */
62 } frame_data;
63
64 /*
65  * A data source.
66  * Has a tvbuff and a name.
67  */
68 typedef struct {
69   tvbuff_t *tvb;
70   char *name;
71 } data_source;
72
73 /* Utility routines used by packet*.c */
74
75 extern void p_add_proto_data(frame_data *fd, int proto, void *proto_data);
76 extern void *p_get_proto_data(frame_data *fd, int proto);
77 extern void p_remove_proto_data(frame_data *fd, int proto);
78
79 #endif  /* __FRAME_DATA__ */