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 /frame_tvbuff.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 'frame_tvbuff.c')
-rw-r--r-- | frame_tvbuff.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/frame_tvbuff.c b/frame_tvbuff.c index b47d206f07..2358af2a7e 100644 --- a/frame_tvbuff.c +++ b/frame_tvbuff.c @@ -31,14 +31,14 @@ #include "frame_tvbuff.h" #include "globals.h" -#include "wtap-int.h" /* for ->random_fh */ +#include "wftap-int.h" /* for ->random_fh */ struct tvb_frame { struct tvbuff tvb; Buffer *buf; /* Packet data */ - wtap *wth; /**< Wiretap session */ + wftap *wth; /**< Wiretap session */ gint64 file_off; /**< File offset */ guint offset; @@ -51,13 +51,13 @@ frame_read(struct tvb_frame *frame_tvb, struct wtap_pkthdr *phdr, Buffer *buf) gchar *err_info; /* sanity check, capture file was closed? */ - if (cfile.wth != frame_tvb->wth) + if (cfile.wfth != frame_tvb->wth) return FALSE; /* XXX, what if phdr->caplen isn't equal to * frame_tvb->tvb.length + frame_tvb->offset? */ - if (!wtap_seek_read(frame_tvb->wth, frame_tvb->file_off, phdr, buf, &err, &err_info)) { + if (!wftap_seek_read(frame_tvb->wth, frame_tvb->file_off, phdr, buf, &err, &err_info)) { switch (err) { case WTAP_ERR_UNSUPPORTED_ENCAP: case WTAP_ERR_BAD_FILE: @@ -212,12 +212,12 @@ frame_tvbuff_new(const frame_data *fd, const guint8 *buf) frame_tvb = (struct tvb_frame *) tvb; /* XXX, wtap_can_seek() */ - if (cfile.wth && cfile.wth->random_fh + if (cfile.wfth && cfile.wfth->random_fh #ifdef WANT_PACKET_EDITOR && fd->file_off != -1 /* generic clone for modified packets */ #endif ) { - frame_tvb->wth = cfile.wth; + frame_tvb->wth = cfile.wfth; frame_tvb->file_off = fd->file_off; frame_tvb->offset = 0; } else @@ -317,12 +317,12 @@ file_tvbuff_new(const frame_data *fd, const guint8 *buf) frame_tvb = (struct tvb_frame *) tvb; /* XXX, wtap_can_seek() */ - if (cfile.wth && cfile.wth->random_fh + if (cfile.wfth && cfile.wfth->random_fh #ifdef WANT_PACKET_EDITOR && fd->file_off != -1 /* generic clone for modified packets */ #endif ) { - frame_tvb->wth = cfile.wth; + frame_tvb->wth = cfile.wfth; frame_tvb->file_off = fd->file_off; frame_tvb->offset = 0; } else |