Put the structure of a capture_file back in cfile.h.

The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2017-12-03 21:33:59 -08:00
parent 1834dca365
commit ccc55bc80c
59 changed files with 68 additions and 152 deletions

View File

@ -698,7 +698,6 @@ dumpcap_LDADD = \
pkginclude_HEADERS = \
cfile.h \
cfile-int.h \
file.h \
globals.h \
log.h \

View File

@ -11,80 +11,10 @@
#ifndef __CFILE_INT_H__
#define __CFILE_INT_H__
#include <epan/epan.h>
#include <epan/column-info.h>
#include <epan/dfilter/dfilter.h>
#include <epan/frame_data.h>
#include <epan/frame_data_sequence.h>
#include <epan/frame_set.h>
#include <wiretap/wtap.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct _capture_file {
epan_t *epan;
file_state state; /* Current state of capture file */
gchar *filename; /* Name of capture file */
gchar *source; /* Temp file source, e.g. "Pipe from elsewhere" */
gboolean is_tempfile; /* Is capture file a temporary file? */
gboolean unsaved_changes; /* Does the capture file have changes that have not been saved? */
gboolean stop_flag; /* Stop current processing (loading, searching, etc.) */
gint64 f_datalen; /* Size of capture file data (uncompressed) */
guint16 cd_t; /* File type of capture file */
unsigned int open_type; /* open_routine index+1 used, if selected, or WTAP_TYPE_AUTO */
gboolean iscompressed; /* TRUE if the file is compressed */
int lnk_t; /* File link-layer type; could be WTAP_ENCAP_PER_PACKET */
GArray *linktypes; /* Array of packet link-layer types */
guint32 count; /* Total number of frames */
guint64 packet_comment_count; /* Number of comments in frames (could be >1 per frame... */
guint32 displayed_count; /* Number of displayed frames */
guint32 marked_count; /* Number of marked frames */
guint32 ignored_count; /* Number of ignored frames */
guint32 ref_time_count; /* Number of time referenced frames */
gboolean drops_known; /* TRUE if we know how many packets were dropped */
guint32 drops; /* Dropped packets */
nstime_t elapsed_time; /* Elapsed time */
int snap; /* Maximum captured packet length; 0 if unknown */
dfilter_t *rfcode; /* Compiled read filter program */
dfilter_t *dfcode; /* Compiled display filter program */
gchar *dfilter; /* Display filter string */
gboolean redissecting; /* TRUE if currently redissecting (cf_redissect_packets) */
/* search */
gchar *sfilter; /* Filter, hex value, or string being searched */
gboolean hex; /* TRUE if "Hex value" search was last selected */
gboolean string; /* TRUE if "String" search was last selected */
gboolean summary_data; /* TRUE if "String" search in "Packet list" (Info column) was last selected */
gboolean decode_data; /* TRUE if "String" search in "Packet details" was last selected */
gboolean packet_data; /* TRUE if "String" search in "Packet data" was last selected */
guint32 search_pos; /* Byte position of last byte found in a hex search */
guint32 search_len; /* Length of bytes matching the search */
gboolean case_type; /* TRUE if case-insensitive text search */
GRegex *regex; /* Set if regular expression search */
search_charset_t scs_type; /* Character set for text search */
search_direction dir; /* Direction in which to do searches */
gboolean search_in_progress; /* TRUE if user just clicked OK in the Find dialog or hit <control>N/B */
/* packet data */
struct wtap_pkthdr phdr; /* Packet header */
Buffer buf; /* Packet data */
/* frames */
frame_set frame_set_info; /* fjfff */
guint32 first_displayed; /* Frame number of first frame displayed */
guint32 last_displayed; /* Frame number of last frame displayed */
column_info cinfo; /* Column formatting information */
gboolean columns_changed; /**< Have the columns been changed in the prefs? (GTK+ only) */
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 */
gpointer window; /* Top-level window associated with file */
gulong computed_elapsed; /* Elapsed time to load the file (in msec). */
guint32 cum_bytes;
};
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -17,7 +17,6 @@
#include <wiretap/pcapng.h>
#include "cfile.h"
#include "cfile-int.h"
void
cap_file_init(capture_file *cf)

71
cfile.h
View File

@ -11,7 +11,13 @@
#ifndef __CFILE_H__
#define __CFILE_H__
#include <glib.h>
#include <epan/epan.h>
#include <epan/column-info.h>
#include <epan/dfilter/dfilter.h>
#include <epan/frame_data.h>
#include <epan/frame_data_sequence.h>
#include <epan/frame_set.h>
#include <wiretap/wtap.h>
#ifdef __cplusplus
extern "C" {
@ -38,8 +44,67 @@ typedef enum {
SD_BACKWARD
} search_direction;
struct _capture_file;
typedef struct _capture_file capture_file;
typedef struct _capture_file {
epan_t *epan;
file_state state; /* Current state of capture file */
gchar *filename; /* Name of capture file */
gchar *source; /* Temp file source, e.g. "Pipe from elsewhere" */
gboolean is_tempfile; /* Is capture file a temporary file? */
gboolean unsaved_changes; /* Does the capture file have changes that have not been saved? */
gboolean stop_flag; /* Stop current processing (loading, searching, etc.) */
gint64 f_datalen; /* Size of capture file data (uncompressed) */
guint16 cd_t; /* File type of capture file */
unsigned int open_type; /* open_routine index+1 used, if selected, or WTAP_TYPE_AUTO */
gboolean iscompressed; /* TRUE if the file is compressed */
int lnk_t; /* File link-layer type; could be WTAP_ENCAP_PER_PACKET */
GArray *linktypes; /* Array of packet link-layer types */
guint32 count; /* Total number of frames */
guint64 packet_comment_count; /* Number of comments in frames (could be >1 per frame... */
guint32 displayed_count; /* Number of displayed frames */
guint32 marked_count; /* Number of marked frames */
guint32 ignored_count; /* Number of ignored frames */
guint32 ref_time_count; /* Number of time referenced frames */
gboolean drops_known; /* TRUE if we know how many packets were dropped */
guint32 drops; /* Dropped packets */
nstime_t elapsed_time; /* Elapsed time */
int snap; /* Maximum captured packet length; 0 if unknown */
dfilter_t *rfcode; /* Compiled read filter program */
dfilter_t *dfcode; /* Compiled display filter program */
gchar *dfilter; /* Display filter string */
gboolean redissecting; /* TRUE if currently redissecting (cf_redissect_packets) */
/* search */
gchar *sfilter; /* Filter, hex value, or string being searched */
gboolean hex; /* TRUE if "Hex value" search was last selected */
gboolean string; /* TRUE if "String" search was last selected */
gboolean summary_data; /* TRUE if "String" search in "Packet list" (Info column) was last selected */
gboolean decode_data; /* TRUE if "String" search in "Packet details" was last selected */
gboolean packet_data; /* TRUE if "String" search in "Packet data" was last selected */
guint32 search_pos; /* Byte position of last byte found in a hex search */
guint32 search_len; /* Length of bytes matching the search */
gboolean case_type; /* TRUE if case-insensitive text search */
GRegex *regex; /* Set if regular expression search */
search_charset_t scs_type; /* Character set for text search */
search_direction dir; /* Direction in which to do searches */
gboolean search_in_progress; /* TRUE if user just clicked OK in the Find dialog or hit <control>N/B */
/* packet data */
struct wtap_pkthdr phdr; /* Packet header */
Buffer buf; /* Packet data */
/* frames */
frame_set frame_set_info; /* fjfff */
guint32 first_displayed; /* Frame number of first frame displayed */
guint32 last_displayed; /* Frame number of last frame displayed */
column_info cinfo; /* Column formatting information */
gboolean columns_changed; /**< Have the columns been changed in the prefs? (GTK+ only) */
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 */
gpointer window; /* Top-level window associated with file */
gulong computed_elapsed; /* Elapsed time to load the file (in msec). */
guint32 cum_bytes;
} capture_file;
extern void cap_file_init(capture_file *cf);

View File

@ -24,7 +24,6 @@
#define __TAP_H__
#include <epan/epan.h>
#include <epan/packet_info.h>
#include "ws_symbol_export.h"
#ifdef __cplusplus

1
file.c
View File

@ -44,7 +44,6 @@
#include <epan/color_filters.h>
#include "cfile.h"
#include "cfile-int.h"
#include "file.h"
#include "fileset.h"
#include "frame_tvbuff.h"

1
file.h
View File

@ -15,7 +15,6 @@
#include <wiretap/wtap.h>
#include <epan/epan.h>
#include <epan/dfilter/dfilter.h>
#include <epan/print.h>
#include <ui/packet_range.h>

View File

@ -12,7 +12,6 @@
#define __GLOBALS_H__
#include "file.h"
#include "cfile-int.h"
#include <epan/timestamp.h>
#ifdef __cplusplus

View File

@ -16,7 +16,6 @@
#include <epan/packet.h>
#include "cfile.h"
#include "cfile-int.h"
#include "summary.h"
static void

View File

@ -21,8 +21,6 @@
#include <epan/packet.h>
#include <epan/dfilter/dfilter.h>
#include "file.h"
#include "cfile.h"
#include "cfile-int.h"
#include "ui/capture.h"
#include "caputils/capture_ifinfo.h"
#include <capchild/capture_sync.h>

View File

@ -40,7 +40,6 @@
#include "ui/alert_box.h"
#include "ui/simple_dialog.h"
#include "tap_export_pdu.h"
#include "cfile-int.h"
#include "export_pdu_ui_utils.h"
static void

View File

@ -27,7 +27,6 @@
#include <gtk/gtk.h>
#include "file.h"
#include "cfile-int.h"
#include "gtkglobals.h"
#include "gui_utils.h"

View File

@ -27,7 +27,6 @@
#include "packet_list_utils.h"
#include <epan/column.h>
#include "cfile-int.h"
gboolean
right_justify_column (gint col, capture_file *cf)

View File

@ -33,8 +33,6 @@
#include "packet_range.h"
#include "cfile-int.h"
/* (re-)calculate the packet counts (except the user specified range) */
static void packet_range_calc(packet_range_t *range) {
guint32 framenum;

View File

@ -18,7 +18,6 @@
#include "ui/progress_dlg.h"
#include "epan/epan_dissect.h"
#include "epan/proto.h"
#include "cfile-int.h"
/* Update the progress bar this many times when scanning the packet list. */
#define N_PROGBAR_UPDATES 100

View File

@ -30,8 +30,6 @@
#include "epan/epan_dissect.h"
#include "epan/frame_data.h"
#include "cfile-int.h"
#include "address_editor_frame.h"
#include <ui_address_editor_frame.h>

View File

@ -28,7 +28,6 @@
#include <QTreeWidgetItem>
#include "cfile.h"
#include "cfile-int.h"
#include "epan/epan_dissect.h"
#include "epan/tvbuff-int.h"

View File

@ -32,7 +32,6 @@
#include <errno.h>
#include "file.h"
#include "cfile-int.h"
#include "wsutil/filesystem.h"
#include "wsutil/nstime.h"
#include "wsutil/str_util.h"

View File

@ -33,8 +33,6 @@
#include <ui/qt/utils/qt_ui_utils.h>
#include "wireshark_application.h"
#include "cfile-int.h"
#include <QPushButton>
#include <QScrollBar>
#include <QTextStream>

View File

@ -24,8 +24,6 @@
#include <epan/prefs.h>
#include <epan/dissectors/packet-tcp.h>
#include "cfile-int.h"
#include "ui/recent.h"
#include "ui/tap-tcp-stream.h"
#include "ui/traffic_table_ui.h"

View File

@ -29,8 +29,6 @@
#include <epan/prefs.h>
#include "cfile-int.h"
#include "ui/recent.h"
#include "ui/traffic_table_ui.h"

View File

@ -23,7 +23,6 @@
#include <ui_expert_info_dialog.h>
#include "file.h"
#include "cfile-int.h"
#include <epan/epan_dissect.h>
#include <epan/expert.h>

View File

@ -25,7 +25,6 @@
#include "file.h"
#include "fileset.h"
#include "cfile-int.h"
#include "ui/help_url.h"

View File

@ -34,8 +34,6 @@
#include "epan/epan_dissect.h"
#include "epan/tap.h"
#include "cfile-int.h"
#include "ui/alert_box.h"
#include "ui/simple_dialog.h"
#include <wsutil/utf8_entities.h>

View File

@ -23,7 +23,6 @@
#include <ui_iax2_analysis_dialog.h>
#include "file.h"
#include "cfile-int.h"
#include "frame_tvbuff.h"
#include <epan/epan_dissect.h>

View File

@ -23,7 +23,6 @@
#include <ui_io_graph_dialog.h>
#include "file.h"
#include "cfile-int.h"
#include <epan/stat_tap_ui.h>
#include "epan/stats_tree_priv.h"

View File

@ -29,7 +29,6 @@
#include <glib.h>
#include "cfile.h"
#include <epan/epan.h>
#include <epan/packet_info.h>
#include <QDialog>

View File

@ -29,7 +29,6 @@
#include <glib.h>
#include "cfile.h"
#include <epan/epan.h>
#include <epan/packet_info.h>
#include <QDialog>

View File

@ -29,7 +29,6 @@
#include <glib.h>
#include "cfile.h"
#include <epan/epan.h>
#include <epan/packet_info.h>
#include <QDialog>

View File

@ -41,8 +41,6 @@
#include <ui/qt/utils/stock_icon.h>
#include <ui/qt/utils/tango_colors.h>
#include "cfile-int.h"
#include <QAction>
#include <QHBoxLayout>
#include <QSplitter>

View File

@ -39,8 +39,6 @@ DIAG_ON(frame-larger-than=)
#include <epan/plugin_if.h>
#include <epan/export_object.h>
#include "cfile-int.h"
#include "ui/iface_toolbar.h"
#ifdef HAVE_LIBPCAP

View File

@ -71,8 +71,6 @@ DIAG_ON(frame-larger-than=)
#include <epan/wslua/init_wslua.h>
#endif
#include "cfile-int.h"
#include "ui/alert_box.h"
#ifdef HAVE_LIBPCAP
#include "ui/capture_ui_utils.h"

View File

@ -25,8 +25,6 @@
#include "epan/decode_as.h"
#include "epan/epan_dissect.h"
#include "cfile-int.h"
#include <ui/qt/utils/variant_pointer.h>
#include <QComboBox>

View File

@ -29,8 +29,6 @@
#include <epan/prefs-int.h>
#include <epan/dissectors/packet-dcerpc.h>
#include "cfile-int.h"
#include <ui/qt/utils/qt_ui_utils.h>
static const char *DEFAULT_TABLE = "tcp.port"; // Arbitrary

View File

@ -24,7 +24,6 @@
#include "packet_list_model.h"
#include "file.h"
#include "cfile-int.h"
#include <wsutil/nstime.h>
#include <epan/column.h>

View File

@ -22,7 +22,6 @@
#include "packet_list_record.h"
#include <file.h>
#include <cfile-int.h>
#include <epan/epan_dissect.h>
#include <epan/column-info.h>

View File

@ -35,8 +35,6 @@
#include "proto_tree.h"
#include "wireshark_application.h"
#include "cfile-int.h"
#include <ui/qt/utils/field_information.h>
#include <QTreeWidgetItemIterator>

View File

@ -26,7 +26,6 @@
#include <glib.h>
#include "file.h"
#include "cfile-int.h"
#include <epan/epan.h>
#include <epan/epan_dissect.h>

View File

@ -21,7 +21,6 @@
#include "packet_range_group_box.h"
#include <ui_packet_range_group_box.h>
#include "cfile-int.h"
PacketRangeGroupBox::PacketRangeGroupBox(QWidget *parent) :
QGroupBox(parent),

View File

@ -22,8 +22,6 @@
#include "print_dialog.h"
#include <ui_print_dialog.h>
#include "cfile-int.h"
#include <wsutil/utf8_entities.h>
#include <QPrintDialog>

View File

@ -26,8 +26,6 @@
#include <epan/ftypes/ftypes.h>
#include <epan/prefs.h>
#include "cfile-int.h"
#include <ui/qt/utils/color_utils.h>
#include <ui/qt/utils/variant_pointer.h>
#include <ui/qt/utils/wireshark_mime_data.h>

View File

@ -23,7 +23,6 @@
#include <ui_protocol_hierarchy_dialog.h>
#include "cfile.h"
#include "cfile-int.h"
#include "ui/proto_hier_stats.h"

View File

@ -27,7 +27,6 @@
#include <glib.h>
#include "file.h"
#include "cfile-int.h"
#include "epan/addr_resolv.h"
#include <wiretap/wtap.h>

View File

@ -23,7 +23,6 @@
#include <ui_rtp_analysis_dialog.h>
#include "file.h"
#include "cfile-int.h"
#include "frame_tvbuff.h"
#include "epan/epan_dissect.h"

View File

@ -27,7 +27,6 @@
#include <glib.h>
#include "epan/address.h"
#include "epan/proto.h"
#include "ui/rtp_stream.h"
#include "ui/tap-rtp-analysis.h"

View File

@ -30,8 +30,6 @@
#include "sctp_graph_byte_dialog.h"
#include "sctp_chunk_statistics_dialog.h"
#include "cfile-int.h"
SCTPAssocAnalyseDialog::SCTPAssocAnalyseDialog(QWidget *parent, sctp_assoc_info_t *assoc, capture_file *cf, SCTPAllAssocsDialog* caller) :
QDialog(parent),
ui(new Ui::SCTPAssocAnalyseDialog),

View File

@ -23,7 +23,6 @@
#include <ui_search_frame.h>
#include "file.h"
#include "cfile-int.h"
#include <epan/proto.h>
#include <epan/strutil.h>

View File

@ -25,7 +25,6 @@
#include "epan/addr_resolv.h"
#include "file.h"
#include "cfile-int.h"
#include "wsutil/nstime.h"
#include "wsutil/utf8_entities.h"

View File

@ -27,8 +27,6 @@
#include "epan/charsets.h"
#include "cfile-int.h"
#include "wsutil/base64.h"
#include "wsutil/utf8_entities.h"

View File

@ -24,8 +24,6 @@
#include "wireshark_application.h"
#include "cfile-int.h"
#include <ui/time_shift.h>
#include <ui/qt/utils/tango_colors.h>

View File

@ -26,8 +26,6 @@
#include <epan/addr_resolv.h>
#include <epan/prefs.h>
#include "cfile-int.h"
#include "ui/recent.h"
#include "progress_frame.h"

View File

@ -27,7 +27,6 @@
#include "wiretap/wtap.h"
#include "cfile.h"
#include "cfile-int.h"
#include "file.h"
#include <ui/qt/capture_file.h>

View File

@ -23,7 +23,6 @@
#include <ui_voip_calls_dialog.h>
#include "file.h"
#include "cfile-int.h"
#include "epan/addr_resolv.h"
#include "epan/dissectors/packet-h225.h"

View File

@ -37,8 +37,6 @@
#include <epan/packet.h>
#include <epan/tap.h>
#include "cfile-int.h"
/* Return TRUE if the 2 sets of parameters refer to the same channel. */
int compare_rlc_headers(guint16 ueid1, guint16 channelType1, guint16 channelId1, guint8 rlcMode1, guint8 direction1,
guint16 ueid2, guint16 channelType2, guint16 channelId2, guint8 rlcMode2, guint8 direction2,

View File

@ -38,8 +38,6 @@
#include "ui/simple_dialog.h"
#include "cfile-int.h"
#include "tap-tcp-stream.h"
typedef struct _tcp_scan_t {

View File

@ -31,8 +31,6 @@
#include "ui/ws_ui_util.h"
#include "cfile-int.h"
#ifndef HAVE_FLOORL
#define floorl(x) floor((double)x)
#endif

View File

@ -37,7 +37,6 @@
#include <string.h>
#include "epan/epan_dissect.h"
#include "epan/column-info.h"
#include "epan/packet.h"
#include "epan/proto_data.h"
#include "epan/to_str.h"

View File

@ -20,7 +20,6 @@
#include <strsafe.h>
#include "file.h"
#include "cfile-int.h"
#include "wsutil/file_util.h"
#include "wsutil/str_util.h"

View File

@ -63,7 +63,6 @@
/* general (not Qt specific) */
#include "file.h"
#include "cfile-int.h"
#include "epan/color_filters.h"
#include "log.h"