aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-11-30 20:50:15 +0000
committerGuy Harris <guy@alum.mit.edu>1999-11-30 20:50:15 +0000
commitdc548e7458fc945d9f2bc1287756bc71faf5a1e1 (patch)
tree358ed3eb613d9d44f5d1dad5c794bcba850ce431 /file.h
parent191f4cd4676d55182d3820627544d968d759de2b (diff)
Allow the user to save either all of the current capture, or only the
packets that are currently being displayed from that capture. Centralize the code to control whether "File:Save" and "File:Save As" are enabled (and *always* have "File:Save As" enabled if you have a capture; "File:Save" is enabled only if you have a live capture you've not yet saved, although it does the same thing as "File:Save As"). Have the "save_file" member of a "capture_file" structure represent *only* the file currently being *written* to by a capture, and, if there is no capture currently in progress, have it be NULL; the name of the file currently being *displayed" is in the "filename" member, and an "is_tempfile" member indicates whether it's a temporary file for a live capture or not. Have "close_cap_file()" delete the current capture file if it's a temporary capture file that hasn't been saved (in its entirety - saving selected frames doesn't count). Do the same (if there *is* a current capture file) when exiting. The "Ready to load or capture" message is the only statusbar message in the "main" context; "close_cap_file()" should never pop it, it should only pop whatever message exists in the "file" context, and thus has no need to take, as an argument, the context for the message it should pop. Update the man page to reflect the new behavior of "File:Save" and "File:Save As", and to reflect recent changes to "Display:Match Selected". svn path=/trunk/; revision=1170
Diffstat (limited to 'file.h')
-rw-r--r--file.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/file.h b/file.h
index 518948887a..ee64e644ae 100644
--- a/file.h
+++ b/file.h
@@ -1,7 +1,7 @@
/* file.h
* Definitions for file structures and routines
*
- * $Id: file.h,v 1.57 1999/11/30 07:27:37 guy Exp $
+ * $Id: file.h,v 1.58 1999/11/30 20:49:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -77,9 +77,13 @@ typedef struct _capture_file {
FILE_T fh; /* File handle for capture file */
int filed; /* File descriptor of capture file */
gchar *filename; /* Name of capture file */
+ gboolean is_tempfile; /* Is capture file a temporary file? */
+ gboolean user_saved;/* If capture file is temporary, has it been saved by user yet? */
long f_len; /* Length of capture file */
guint16 cd_t; /* File type of capture file */
const gchar *cd_t_desc; /* Description of that file type */
+ gboolean first_packet; /* TRUE if we're looking at the first packet */
+ int lnk_t; /* Link-layer type with which to save capture */
guint32 vers; /* Version. For tcpdump minor is appended to major */
guint32 count; /* Packet count */
gfloat unfiltered_count; /* used for dfilter progress bar */
@@ -93,7 +97,6 @@ typedef struct _capture_file {
gchar *iface; /* Interface */
gchar *save_file; /* File that user saved capture to */
int save_file_fd; /* File descriptor for saved file */
- gint user_saved;/* Was capture file saved by user yet? */
wtap *wth; /* Wiretap session */
dfilter *rfcode; /* Compiled read filter program */
gchar *dfilter; /* Display filter string */
@@ -118,13 +121,14 @@ typedef struct _capture_file {
FILE *print_fh; /* File we're printing to */
} capture_file;
-int open_cap_file(char *, capture_file *);
-void close_cap_file(capture_file *, void *, guint);
+int open_cap_file(char *, gboolean, capture_file *);
+void close_cap_file(capture_file *, void *);
int read_cap_file(capture_file *);
-int start_tail_cap_file(char *, capture_file *);
+int start_tail_cap_file(char *, gboolean, capture_file *);
int continue_tail_cap_file(capture_file *, int);
int finish_tail_cap_file(capture_file *);
/* size_t read_frame_header(capture_file *); */
+int save_cap_file(char *, capture_file *, gboolean, guint);
int filter_packets(capture_file *cf, gchar *dfilter);
void colorize_packets(capture_file *);