From 84cf7ce7675b450311dcec0b34b785974b2e85d0 Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Wed, 14 Sep 2005 21:57:30 +0000 Subject: added compression support for capture file output. The Save/As dialog now has a checkbox "Compress with gzip" currently limited to Ethereal and all the variants of libpcap filetypes only. We might want to add output compression support to the other tools as well (tethereal, mergecap, ...). We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek. One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ... svn path=/trunk/; revision=15804 --- file.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'file.h') diff --git a/file.h b/file.h index fd7ff33301..3eadec354d 100644 --- a/file.h +++ b/file.h @@ -157,9 +157,10 @@ cf_read_status_t cf_finish_tail(capture_file *cf, int *err); * @param fname the filename to save to * @param range the range of packets to save * @param save_format the format of the file to save (libpcap, ...) + * @param compressed wether to gzip compress the file * @return one of cf_status_t */ -cf_status_t cf_save(capture_file * cf, const char *fname, packet_range_t *range, guint save_format); +cf_status_t cf_save(capture_file * cf, const char *fname, packet_range_t *range, guint save_format, gboolean compressed); /** * Get a displayable name of the capture file. -- cgit v1.2.1