aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/dct3trace.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-05-09 05:18:49 +0000
committerGuy Harris <guy@alum.mit.edu>2014-05-09 05:21:01 +0000
commita1b1c8bed54b1576e4f0e9e7f583844a12d142bf (patch)
treefcadd72c61f9d936451163e83cc1be843073f3b4 /wiretap/dct3trace.c
parenta651f3e5edb2f148a0e5f495b5cba0e7fa43e002 (diff)
Revert "Refactor Wiretap"
This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a. This isn't building, and looks as if it requires significant work to fix. Change-Id: I622b1bb243e353e874883a302ab419532b7601f2 Reviewed-on: https://code.wireshark.org/review/1568 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/dct3trace.c')
-rw-r--r--wiretap/dct3trace.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/wiretap/dct3trace.c b/wiretap/dct3trace.c
index 36df2ab822..2a0eb9103a 100644
--- a/wiretap/dct3trace.c
+++ b/wiretap/dct3trace.c
@@ -25,7 +25,6 @@
*/
#include "config.h"
-#include "wftap-int.h"
#include "wtap-int.h"
#include "buffer.h"
#include "dct3trace.h"
@@ -74,10 +73,10 @@ static const char dct3trace_magic_end[] = "</dump>";
#define MAX_PACKET_LEN 23
-static gboolean dct3trace_read(wftap *wfth, int *err, gchar **err_info,
+static gboolean dct3trace_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset);
-static gboolean dct3trace_seek_read(wftap *wfth, gint64 seek_off,
- void* header, Buffer *buf, int *err, gchar **err_info);
+static gboolean dct3trace_seek_read(wtap *wth, gint64 seek_off,
+ struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info);
/*
* Following 3 functions taken from gsmdecode-0.7bis, with permission - http://wiki.thc.org/gsm
@@ -156,15 +155,15 @@ xml_get_int(int *val, const char *str, const char *pattern)
}
-int dct3trace_open(wftap *wfth, int *err, gchar **err_info)
+int dct3trace_open(wtap *wth, int *err, gchar **err_info)
{
char line1[64], line2[64];
/* Look for Gammu DCT3 trace header */
- if (file_gets(line1, sizeof(line1), wfth->fh) == NULL ||
- file_gets(line2, sizeof(line2), wfth->fh) == NULL)
+ if (file_gets(line1, sizeof(line1), wth->fh) == NULL ||
+ file_gets(line2, sizeof(line2), wth->fh) == NULL)
{
- *err = file_error(wfth->fh, err_info);
+ *err = file_error(wth->fh, err_info);
if (*err != 0 && *err != WTAP_ERR_SHORT_READ)
return -1;
return 0;
@@ -177,12 +176,12 @@ int dct3trace_open(wftap *wfth, int *err, gchar **err_info)
return 0;
}
- wfth->file_encap = WTAP_ENCAP_GSM_UM;
- wfth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_DCT3TRACE;
- wfth->snapshot_length = 0; /* not known */
- wfth->subtype_read = dct3trace_read;
- wfth->subtype_seek_read = dct3trace_seek_read;
- wfth->tsprecision = WTAP_FILE_TSPREC_SEC;
+ wth->file_encap = WTAP_ENCAP_GSM_UM;
+ wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_DCT3TRACE;
+ wth->snapshot_length = 0; /* not known */
+ wth->subtype_read = dct3trace_read;
+ wth->subtype_seek_read = dct3trace_seek_read;
+ wth->tsprecision = WTAP_FILE_TSPREC_SEC;
return 1;
}
@@ -347,26 +346,24 @@ baddata:
/* Find the next packet and parse it; called from wtap_read(). */
-static gboolean dct3trace_read(wftap *wfth, int *err, gchar **err_info,
+static gboolean dct3trace_read(wtap *wth, int *err, gchar **err_info,
gint64 *data_offset)
{
- wtap* wth = (wtap*)wfth->tap_specific_data;
- *data_offset = file_tell(wfth->fh);
+ *data_offset = file_tell(wth->fh);
- return dct3trace_get_packet(wfth->fh, &wth->phdr, wfth->frame_buffer,
+ return dct3trace_get_packet(wth->fh, &wth->phdr, wth->frame_buffer,
err, err_info);
}
/* Used to read packets in random-access fashion */
-static gboolean dct3trace_seek_read(wftap *wfth, gint64 seek_off,
- void* header, Buffer *buf, int *err, gchar **err_info)
+static gboolean dct3trace_seek_read(wtap *wth, gint64 seek_off,
+ struct wtap_pkthdr *phdr, Buffer *buf, int *err, gchar **err_info)
{
- struct wtap_pkthdr *phdr = (struct wtap_pkthdr*)header;
- if (file_seek(wfth->random_fh, seek_off, SEEK_SET, err) == -1)
+ if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
{
return FALSE;
}
- return dct3trace_get_packet(wfth->random_fh, phdr, buf, err, err_info);
+ return dct3trace_get_packet(wth->random_fh, phdr, buf, err, err_info);
}