summaryrefslogtreecommitdiff
path: root/mergecap.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-05-08 22:59:19 -0400
committerMichael Mann <mmann78@netscape.net>2014-05-09 03:04:39 +0000
commit1abeb277f5e6bd27fbaebfecc8184e37ba9d008a (patch)
tree8cc6eaa5a6982454a00adc600fa4aab02bec3d73 /mergecap.c
parentaa3a968eb6e85c47014a4cec4a2b955357b0e77f (diff)
downloadwireshark-1abeb277f5e6bd27fbaebfecc8184e37ba9d008a.tar.gz
Refactor Wiretap
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality. The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes. bug:9607 Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae Reviewed-on: https://code.wireshark.org/review/1485 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'mergecap.c')
-rw-r--r--mergecap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mergecap.c b/mergecap.c
index a9c1ef9e08..14ecca8e22 100644
--- a/mergecap.c
+++ b/mergecap.c
@@ -225,7 +225,7 @@ main(int argc, char *argv[])
merge_in_file_t *in_files = NULL, *in_file;
int i;
struct wtap_pkthdr *phdr, snap_phdr;
- wtap_dumper *pdh;
+ wftap_dumper *pdh;
int open_err, read_err = 0, write_err, close_err;
gchar *err_info;
int err_fileno;
@@ -333,7 +333,7 @@ main(int argc, char *argv[])
if (verbose) {
for (i = 0; i < in_file_count; i++)
fprintf(stderr, "mergecap: %s is type %s.\n", argv[optind + i],
- wtap_file_type_subtype_string(wtap_file_type_subtype(in_files[i].wth)));
+ wtap_file_type_subtype_string(wftap_file_type_subtype(in_files[i].wfth)));
}
if (snaplen == 0) {
@@ -357,9 +357,9 @@ main(int argc, char *argv[])
*/
int first_frame_type, this_frame_type;
- first_frame_type = wtap_file_encap(in_files[0].wth);
+ first_frame_type = wftap_file_encap(in_files[0].wfth);
for (i = 1; i < in_file_count; i++) {
- this_frame_type = wtap_file_encap(in_files[i].wth);
+ this_frame_type = wftap_file_encap(in_files[i].wfth);
if (first_frame_type != this_frame_type) {
fprintf(stderr, "mergecap: multiple frame encapsulation types detected\n");
fprintf(stderr, " defaulting to WTAP_ENCAP_PER_PACKET\n");
@@ -452,14 +452,14 @@ main(int argc, char *argv[])
/* We simply write it, perhaps after truncating it; we could do other
* things, like modify it. */
- phdr = wtap_phdr(in_file->wth);
+ phdr = wtap_phdr(in_file->wfth);
if (snaplen != 0 && phdr->caplen > snaplen) {
snap_phdr = *phdr;
snap_phdr.caplen = snaplen;
phdr = &snap_phdr;
}
- if (!wtap_dump(pdh, phdr, wtap_buf_ptr(in_file->wth), &write_err)) {
+ if (!wtap_dump(pdh, phdr, wftap_buf_ptr(in_file->wfth), &write_err)) {
got_write_error = TRUE;
break;
}
@@ -467,7 +467,7 @@ main(int argc, char *argv[])
merge_close_in_files(in_file_count, in_files);
if (!got_write_error) {
- if (!wtap_dump_close(pdh, &write_err))
+ if (!wftap_dump_close(pdh, &write_err))
got_write_error = TRUE;
} else {
/*
@@ -476,7 +476,7 @@ main(int argc, char *argv[])
*
* Don't overwrite the earlier write error.
*/
- (void)wtap_dump_close(pdh, &close_err);
+ (void)wftap_dump_close(pdh, &close_err);
}
if (got_read_error) {