diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-03-22 07:06:59 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-03-22 07:06:59 +0000 |
commit | 005588b8b94d679cc461ddd290bc9399b3d16f1b (patch) | |
tree | 900b9afc981b65ab61b957599a56dc60cf034b7b /wiretap/radcom.c | |
parent | 8d47efa6f9bcd6422011379f4b5ccb27df8c12c4 (diff) |
In a Network Monitor capture file, get the starting offsets of frames
from the frame table - Network Monitor 2.x, at least, doesn't always
write frame N+1 right after frame N.
To do that, we need to mallocate a big array to hold the frame table,
and free it when we close the capture file; this requires that we have
capture-file-type-specific close routines as well as
capture-file-type-specific read routines - we let it the pointer to that
routine be null if it's not needed. Given that, we might as well get
rid of the switch statement in "wtap_close()", in favor of using
capture-file-type-specific close routines, as per the comment before
that switch statement.
svn path=/trunk/; revision=1740
Diffstat (limited to 'wiretap/radcom.c')
-rw-r--r-- | wiretap/radcom.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wiretap/radcom.c b/wiretap/radcom.c index 63d4d44aa0..69dc70a7d4 100644 --- a/wiretap/radcom.c +++ b/wiretap/radcom.c @@ -1,6 +1,6 @@ /* radcom.c * - * $Id: radcom.c,v 1.18 2000/02/19 08:00:04 guy Exp $ + * $Id: radcom.c,v 1.19 2000/03/22 07:06:56 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -68,6 +68,7 @@ struct radcomrec_hdr { }; static int radcom_read(wtap *wth, int *err); +static void radcom_close(wtap *wth); int radcom_open(wtap *wth, int *err) { @@ -135,6 +136,7 @@ int radcom_open(wtap *wth, int *err) wth->file_type = WTAP_FILE_RADCOM; wth->capture.radcom = g_malloc(sizeof(radcom_t)); wth->subtype_read = radcom_read; + wth->subtype_close = radcom_close; wth->snapshot_length = 16384; /* not available in header, only in frame */ tm.tm_year = pletohs(&start_date.year)-1900; @@ -301,3 +303,9 @@ static int radcom_read(wtap *wth, int *err) return data_offset; } + +static void +radcom_close(wtap *wth) +{ + g_free(wth->capture.radcom); +} |