summaryrefslogtreecommitdiff
path: root/wiretap/pppdump.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-02-26 07:59:54 +0000
committerGuy Harris <guy@alum.mit.edu>2010-02-26 07:59:54 +0000
commit17392a865ac79a9f631e63652dff45b6bb1c64d2 (patch)
tree42c7ec409a0e898eea7c0ebf4ba34f2f633797b6 /wiretap/pppdump.c
parentc4dd5ca6f3bb794c9f1736adf8a8f02c641a76e6 (diff)
downloadwireshark-17392a865ac79a9f631e63652dff45b6bb1c64d2.tar.gz
Move the definitions of all the private data structures out of
wtap-int.h, and change the unions of pointers to those private data structures into just void *'s. Have the generic wtap close routine free up the private data, rather than the type-specific close routine, just as the wtap_dumper close routine does for its private data. Get rid of close routines that don't do anything any more. svn path=/trunk/; revision=32015
Diffstat (limited to 'wiretap/pppdump.c')
-rw-r--r--wiretap/pppdump.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c
index e889065b0b..a0d51ebc1e 100644
--- a/wiretap/pppdump.c
+++ b/wiretap/pppdump.c
@@ -281,7 +281,8 @@ pppdump_open(wtap *wth, int *err, gchar **err_info _U_)
if (file_seek(wth->fh, 5, SEEK_SET, err) == -1)
return -1;
- state = wth->capture.generic = g_malloc(sizeof(pppdump_t));
+ state = (pppdump_t *)g_malloc(sizeof(pppdump_t));
+ wth->priv = (void *)state;
state->timestamp = pntohl(&buffer[1]);
state->tenths = 0;
@@ -324,7 +325,7 @@ pppdump_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
buffer_assure_space(wth->frame_buffer, PPPD_BUF_SIZE);
buf = buffer_start_ptr(wth->frame_buffer);
- state = wth->capture.generic;
+ state = wth->priv;
/* If we have a random stream open, allocate a structure to hold
the information needed to read this packet's data again. */
@@ -718,7 +719,7 @@ pppdump_seek_read(wtap *wth,
pkt_id *pid;
gint64 num_bytes_to_skip;
- state = wth->capture.generic;
+ state = wth->priv;
pid = g_ptr_array_index(state->pids, seek_off);
if (!pid) {
@@ -769,7 +770,7 @@ pppdump_close(wtap *wth)
{
pppdump_t *state;
- state = wth->capture.generic;
+ state = (pppdump_t *)wth->priv;
if (state->seek_state) { /* should always be TRUE */
g_free(state->seek_state);
@@ -782,7 +783,4 @@ pppdump_close(wtap *wth)
}
g_ptr_array_free(state->pids, TRUE);
}
-
- g_free(state);
-
}