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 */
+ long f_datalen; /* Size of capture file data (uncompressed) */
+ long f_len; /* Length of capture file (compressed if file is) */
guint16 cd_t; /* File type of capture file */
int lnk_t; /* Link-layer type with which to save capture */
guint32 vers; /* Version. For tcpdump minor is appended to major */
cf->wth = wth;
cf->filed = fd;
+ cf->f_datalen = 0;
cf->f_len = cf_stat.st_size;
/* Set the file name because we need it to set the follow stream filter.
packet_list_clear();
packet_list_thaw();
+ cf->f_datalen = 0;
cf->f_len = 0;
cf->count = 0;
cf->esec = 0;
cf->plist_end = fdata;
cf->count++;
- cf->f_len = offset + phdr->caplen;
+ cf->f_datalen = offset + phdr->caplen;
fdata->num = cf->count;
add_packet_to_packet_list(fdata, cf, pseudo_header, buf, TRUE);
} else {
}
/* convert file size */
- if (cf->f_len/1024/1024 > 10) {
- size_str = g_strdup_printf("%ld MB", cf->f_len/1024/1024);
- } else if (cf->f_len/1024 > 10) {
- size_str = g_strdup_printf("%ld KB", cf->f_len/1024);
+ if (cf->f_datalen/1024/1024 > 10) {
+ size_str = g_strdup_printf("%ld MB", cf->f_datalen/1024/1024);
+ } else if (cf->f_datalen/1024 > 10) {
+ size_str = g_strdup_printf("%ld KB", cf->f_datalen/1024);
} else {
- size_str = g_strdup_printf("%ld Bytes", cf->f_len);
+ size_str = g_strdup_printf("%ld Bytes", cf->f_datalen);
}
/* statusbar */
statusbar_pop_file_msg();
- if (cf->f_len/1024/1024 > 10) {
+ if (cf->f_datalen/1024/1024 > 10) {
capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %ld MB",
get_interface_descriptive_name(capture_opts->iface),
capture_opts->save_file,
- cf->f_len/1024/1024);
- } else if (cf->f_len/1024 > 10) {
+ cf->f_datalen/1024/1024);
+ } else if (cf->f_datalen/1024 > 10) {
capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %ld KB",
get_interface_descriptive_name(capture_opts->iface),
capture_opts->save_file,
- cf->f_len/1024);
+ cf->f_datalen/1024);
} else {
capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %ld Bytes",
get_interface_descriptive_name(capture_opts->iface),
capture_opts->save_file,
- cf->f_len);
+ cf->f_datalen);
}
statusbar_push_file_msg(capture_msg);
}
st->filename = cf->filename;
- st->file_length = cf->f_len;
+ st->file_length = cf->f_datalen;
st->encap_type = cf->cd_t;
st->has_snap = cf->has_snap;
st->snap = cf->snap;
cf->wth = wth;
cf->filed = -1; /* not used, but set it anyway */
+ cf->f_datalen = 0; /* not used, but set it anyway */
cf->f_len = 0; /* not used, but set it anyway */
/* Set the file name because we need it to set the follow stream filter.