2001-04-01 04:11:51 +00:00
|
|
|
/* frame_data.h
|
|
|
|
* Definitions for frame_data structures and routines
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2001-04-01 04:11:51 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-04-01 04:11:51 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
2001-04-01 04:11:51 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
2001-04-01 04:11:51 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
2001-04-01 04:11:51 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FRAME_DATA_H__
|
|
|
|
#define __FRAME_DATA_H__
|
|
|
|
|
2009-09-21 17:12:46 +00:00
|
|
|
#include <epan/column_info.h>
|
|
|
|
#include <epan/tvbuff.h>
|
2005-08-24 21:31:56 +00:00
|
|
|
#include <epan/nstime.h>
|
2001-04-01 04:11:51 +00:00
|
|
|
|
2009-11-29 22:51:28 +00:00
|
|
|
#define PINFO_FD_NUM(pinfo) ((pinfo)->fd->num)
|
|
|
|
#define PINFO_FD_VISITED(pinfo) ((pinfo)->fd->flags.visited)
|
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** @todo XXX - some of this stuff is used only while a packet is being dissected;
|
2001-04-01 04:11:51 +00:00
|
|
|
should we keep that stuff in the "packet_info" structure, instead, to
|
|
|
|
save memory? */
|
2009-09-21 17:12:46 +00:00
|
|
|
|
2010-08-28 19:27:19 +00:00
|
|
|
/** The frame number is the ordinal number of the frame in the capture, so
|
2005-09-11 22:25:33 +00:00
|
|
|
it's 1-origin. In various contexts, 0 as a frame number means "frame
|
|
|
|
number unknown". */
|
2001-04-01 04:11:51 +00:00
|
|
|
typedef struct _frame_data {
|
2010-08-29 10:47:38 +00:00
|
|
|
struct _frame_data *next; /**< Next element in list */
|
|
|
|
struct _frame_data *prev; /**< Previous element in list */
|
|
|
|
GSList *pfd; /**< Per frame proto data */
|
|
|
|
guint32 num; /**< Frame number */
|
|
|
|
guint32 pkt_len; /**< Packet length */
|
|
|
|
guint32 cap_len; /**< Amount actually captured */
|
|
|
|
guint32 cum_bytes; /**< Cumulative bytes into the capture */
|
|
|
|
gint64 file_off; /**< File offset */
|
|
|
|
guint16 subnum; /**< subframe number, for protocols that require this */
|
|
|
|
gint16 lnk_t; /**< Per-packet encapsulation/data-link type */
|
2001-04-01 04:11:51 +00:00
|
|
|
struct {
|
2010-08-29 10:47:38 +00:00
|
|
|
unsigned int passed_dfilter : 1; /**< 1 = display, 0 = no display */
|
|
|
|
unsigned int encoding : 2; /**< Character encoding (ASCII, EBCDIC...) */
|
|
|
|
unsigned int visited : 1; /**< Has this packet been visited yet? 1=Yes,0=No*/
|
|
|
|
unsigned int marked : 1; /**< 1 = marked by user, 0 = normal */
|
|
|
|
unsigned int ref_time : 1; /**< 1 = marked as a reference time frame, 0 = normal */
|
|
|
|
unsigned int ignored : 1; /**< 1 = ignore this frame, 0 = normal */
|
2001-04-01 04:11:51 +00:00
|
|
|
} flags;
|
2009-09-07 13:54:46 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
const void *color_filter; /**< Per-packet matching color_filter_t object */
|
2009-09-07 13:54:46 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
nstime_t abs_ts; /**< Absolute timestamp */
|
|
|
|
nstime_t rel_ts; /**< Relative timestamp (yes, it can be negative) */
|
|
|
|
nstime_t del_dis_ts; /**< Delta timestamp to previous displayed frame (yes, it can be negative) */
|
|
|
|
nstime_t del_cap_ts; /**< Delta timestamp to previous captured frame (yes, it can be negative) */
|
2009-09-07 13:54:46 +00:00
|
|
|
|
2009-09-21 17:12:46 +00:00
|
|
|
#ifdef NEW_PACKET_LIST
|
2010-08-29 10:47:38 +00:00
|
|
|
gchar **col_text; /**< The column text for some columns, see colum_utils */
|
|
|
|
guint *col_text_len; /**< The length of the column text strings in 'col_text' */
|
2009-09-21 17:12:46 +00:00
|
|
|
#endif
|
2001-04-01 04:11:51 +00:00
|
|
|
} frame_data;
|
|
|
|
|
2010-08-28 19:27:19 +00:00
|
|
|
/**
|
2002-02-18 01:08:44 +00:00
|
|
|
* A data source.
|
|
|
|
* Has a tvbuff and a name.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
tvbuff_t *tvb;
|
2009-07-12 10:19:13 +00:00
|
|
|
gboolean name_initialized;
|
|
|
|
const char *name;
|
2002-02-18 01:08:44 +00:00
|
|
|
} data_source;
|
|
|
|
|
2001-04-01 04:11:51 +00:00
|
|
|
/* Utility routines used by packet*.c */
|
|
|
|
|
2006-01-24 19:03:09 +00:00
|
|
|
extern void p_add_proto_data(frame_data *fd, int proto, void *proto_data);
|
|
|
|
extern void *p_get_proto_data(frame_data *fd, int proto);
|
|
|
|
extern void p_remove_proto_data(frame_data *fd, int proto);
|
2001-04-01 04:11:51 +00:00
|
|
|
|
2010-08-28 19:27:19 +00:00
|
|
|
/** compare two frame_datas */
|
2009-07-22 08:09:22 +00:00
|
|
|
extern gint frame_data_compare(const frame_data *fdata1, const frame_data *fdata2, int field);
|
|
|
|
|
2009-09-20 18:18:29 +00:00
|
|
|
extern void frame_data_cleanup(frame_data *fdata);
|
|
|
|
|
2009-09-21 11:26:23 +00:00
|
|
|
extern void frame_data_init(frame_data *fdata, guint32 num,
|
|
|
|
const struct wtap_pkthdr *phdr, gint64 offset,
|
2009-09-22 14:23:20 +00:00
|
|
|
guint32 cum_bytes);
|
2010-08-28 19:27:19 +00:00
|
|
|
/**
|
|
|
|
* Sets the frame data struct values before dissection.
|
|
|
|
*/
|
2009-09-22 14:23:20 +00:00
|
|
|
extern void frame_data_set_before_dissect(frame_data *fdata,
|
|
|
|
nstime_t *elapsed_time,
|
2009-09-21 11:26:23 +00:00
|
|
|
nstime_t *first_ts,
|
|
|
|
nstime_t *prev_dis_ts,
|
|
|
|
nstime_t *prev_cap_ts);
|
|
|
|
|
2009-09-22 14:23:20 +00:00
|
|
|
extern void frame_data_set_after_dissect(frame_data *fdata,
|
|
|
|
guint32 *cum_bytes,
|
|
|
|
nstime_t *prev_dis_ts);
|
|
|
|
|
2001-04-01 04:11:51 +00:00
|
|
|
#endif /* __FRAME_DATA__ */
|
2009-09-20 18:18:29 +00:00
|
|
|
|