diff options
author | Michael Mann <mmann78@netscape.net> | 2014-05-08 22:59:19 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-05-09 03:04:39 +0000 |
commit | 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a (patch) | |
tree | 8cc6eaa5a6982454a00adc600fa4aab02bec3d73 /reordercap.c | |
parent | aa3a968eb6e85c47014a4cec4a2b955357b0e77f (diff) |
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 'reordercap.c')
-rw-r--r-- | reordercap.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/reordercap.c b/reordercap.c index 4b363b84b1..09b5df1f8f 100644 --- a/reordercap.c +++ b/reordercap.c @@ -89,7 +89,7 @@ typedef struct FrameRecord_t { static void -frame_write(FrameRecord_t *frame, wtap *wth, wtap_dumper *pdh, Buffer *buf, +frame_write(FrameRecord_t *frame, wftap *wth, wftap_dumper *pdh, Buffer *buf, const char *infile) { int err; @@ -103,7 +103,7 @@ frame_write(FrameRecord_t *frame, wtap *wth, wtap_dumper *pdh, Buffer *buf, /* Re-read the first frame from the stored location */ - if (!wtap_seek_read(wth, frame->offset, &phdr, buf, &err, &err_info)) { + if (!wftap_seek_read(wth, frame->offset, &phdr, buf, &err, &err_info)) { if (err != 0) { /* Print a message noting that the read failed somewhere along the line. */ fprintf(stderr, @@ -174,8 +174,8 @@ frames_compare(gconstpointer a, gconstpointer b) /********************************************************************/ int main(int argc, char *argv[]) { - wtap *wth = NULL; - wtap_dumper *pdh = NULL; + wftap *wth = NULL; + wftap_dumper *pdh = NULL; Buffer buf; int err; gchar *err_info; @@ -241,13 +241,13 @@ int main(int argc, char *argv[]) } exit(1); } - DEBUG_PRINT("file_type_subtype is %u\n", wtap_file_type_subtype(wth)); + DEBUG_PRINT("file_type_subtype is %u\n", wftap_file_type_subtype(wth)); shb_hdr = wtap_file_get_shb_info(wth); idb_inf = wtap_file_get_idb_info(wth); /* Open outfile (same filetype/encap as input file) */ - pdh = wtap_dump_open_ng(outfile, wtap_file_type_subtype(wth), wtap_file_encap(wth), + pdh = wtap_dump_open_ng(outfile, wftap_file_type_subtype(wth), wftap_file_encap(wth), 65535, FALSE, shb_hdr, idb_inf, &err); g_free(idb_inf); if (pdh == NULL) { @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) g_ptr_array_free(frames, TRUE); /* Close outfile */ - if (!wtap_dump_close(pdh, &err)) { + if (!wftap_dump_close(pdh, &err)) { fprintf(stderr, "reordercap: Error closing %s: %s\n", outfile, wtap_strerror(err)); g_free(shb_hdr); @@ -331,7 +331,7 @@ int main(int argc, char *argv[]) g_free(shb_hdr); /* Finally, close infile */ - wtap_fdclose(wth); + wftap_fdclose(wth); return 0; } |