/* i4btrace.c
*
- * $Id: i4btrace.c,v 1.3 2000/01/13 07:09:16 guy Exp $
+ * $Id: i4btrace.c,v 1.4 2000/04/15 21:12:37 guy Exp $
*
* Wiretap Library
* Copyright (c) 1999 by Bert Driehuis <driehuis@playbeing.org>
wth->subtype_read = i4btrace_read;
wth->snapshot_length = 2048; /* actual length set per packet */
- wth->capture.i4btrace->start = hdr.time.tv_sec;
wth->capture.i4btrace->bchannel_prot[0] = -1;
wth->capture.i4btrace->bchannel_prot[1] = -1;
wth->capture.i4btrace->byte_swapped = byte_swapped;
/* nettl.c
*
- * $Id: nettl.c,v 1.9 2000/03/22 07:06:56 guy Exp $
+ * $Id: nettl.c,v 1.10 2000/04/15 21:12:37 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
0x54, 0x52, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80
};
-static gboolean is_hpux_11;
-
/* HP nettl record header for the SX25L2 subsystem - The FCS is not included in the file. */
struct nettlrec_sx25l2_hdr {
guint8 xxa[8];
return -1;
return 0;
}
- if (os_vers[0] == '1' && os_vers[1] == '1')
- is_hpux_11 = TRUE;
- else
- is_hpux_11 = FALSE;
file_seek(wth->fh, 0x80, SEEK_SET);
wth->data_offset = 0x80;
/* This is an nettl file */
wth->file_type = WTAP_FILE_NETTL;
wth->capture.nettl = g_malloc(sizeof(nettl_t));
+ if (os_vers[0] == '1' && os_vers[1] == '1')
+ wth->capture.nettl->is_hpux_11 = TRUE;
+ else
+ wth->capture.nettl->is_hpux_11 = FALSE;
wth->subtype_read = nettl_read;
wth->subtype_close = nettl_close;
wth->snapshot_length = 16384; /* not available in header, only in frame */
- wth->capture.nettl->start = 0;
-
return 1;
}
/* The packet header in HP-UX 11 nettl traces is 4 octets longer than
* HP-UX 9 and 10 */
- if (is_hpux_11) {
+ if (wth->capture.nettl->is_hpux_11) {
bytes_read = file_read(dummy, 1, 4, wth->fh);
if (bytes_read != 4) {
*err = file_error(wth->fh);
wth->phdr.ts.tv_sec = pntohl(&ip_hdr.sec);
wth->phdr.ts.tv_usec = pntohl(&ip_hdr.usec);
- if (wth->capture.nettl->start == 0)
- wth->capture.nettl->start = wth->phdr.ts.tv_sec;
/*
* Read the packet data.
}
wth->data_offset += sizeof lapb_hdr;
- if (is_hpux_11) {
+ if (wth->capture.nettl->is_hpux_11) {
bytes_read = file_read(dummy, 1, 4, wth->fh);
if (bytes_read != 4) {
*err = file_error(wth->fh);
wth->phdr.ts.tv_sec = pntohl(&lapb_hdr.sec);
wth->phdr.ts.tv_usec = pntohl(&lapb_hdr.usec);
- if (wth->capture.nettl->start == 0)
- wth->capture.nettl->start = wth->phdr.ts.tv_sec;
wth->phdr.pseudo_header.x25.flags = (lapb_hdr.from_dce & 0x20 ? 0x80 : 0x00);
/*
/* radcom.c
*
- * $Id: radcom.c,v 1.19 2000/03/22 07:06:56 guy Exp $
+ * $Id: radcom.c,v 1.20 2000/04/15 21:12:37 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
};
static int radcom_read(wtap *wth, int *err);
-static void radcom_close(wtap *wth);
int radcom_open(wtap *wth, int *err)
{
/* This is a radcom file */
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;
tm.tm_min = (sec%3600)/60;
tm.tm_sec = sec%60;
tm.tm_isdst = -1;
- wth->capture.radcom->start = mktime(&tm);
file_seek(wth->fh, sizeof(struct frame_date), SEEK_CUR);
wth->data_offset += sizeof(struct frame_date);
read_error:
*err = file_error(wth->fh);
- if (*err != 0) {
- g_free(wth->capture.radcom);
+ if (*err != 0)
return -1;
- }
- g_free(wth->capture.radcom);
return 0;
}
return data_offset;
}
-
-static void
-radcom_close(wtap *wth)
-{
- g_free(wth->capture.radcom);
-}