/* cfile.h * capture_file definition & GUI-independent manipulation * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs * * 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. * * 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. * * 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 __CFILE_H__ #define __CFILE_H__ #include "frame_data_sequence.h" /* Current state of file. */ typedef enum { FILE_CLOSED, /* No file open */ FILE_READ_IN_PROGRESS, /* Reading a file we've opened */ FILE_READ_ABORTED, /* Read aborted by user */ FILE_READ_DONE /* Read completed */ } file_state; /* Character set for text search. */ typedef enum { SCS_ASCII_AND_UNICODE, SCS_ASCII, SCS_UNICODE /* add EBCDIC when it's implemented */ } search_charset_t; typedef enum { SD_FORWARD, SD_BACKWARD } search_direction; /* * We store the frame_data structures in a radix tree, with 1024 * elements per level. The leaf nodes are arrays of 1024 frame_data * structures; the nodes above them are arrays of 1024 pointers to * the nodes below them. The capture_file structure has a pointer * to the root node. * * As frame numbers are 32 bits, and as 1024 is 2^10, that gives us * up to 4 levels of tree. */ #define LOG2_NODES_PER_LEVEL 10 #define NODES_PER_LEVEL (1<N/B */ /* packet data */ union wtap_pseudo_header pseudo_header; /* Packet pseudo_header */ guint8 pd[WTAP_MAX_PACKET_SIZE]; /* Packet data */ /* frames */ frame_data_sequence *frames; /* Sequence of frames, if we're keeping that information */ guint32 first_displayed; /* Frame number of first frame displayed */ guint32 last_displayed; /* Frame number of last frame displayed */ column_info cinfo; /* Column formatting information */ frame_data *current_frame; /* Frame data for current frame */ gint current_row; /* Row number for current frame */ epan_dissect_t *edt; /* Protocol dissection for currently selected packet */ field_info *finfo_selected; /* Field info for currently selected field */ #ifdef WANT_PACKET_EDITOR GTree *edited_frames; /* BST with modified frames */ #endif } capture_file; extern void cap_file_init(capture_file *cf); #endif /* cfile.h */