int ascend_open(wtap *wth, int *err, gchar **err_info)
{
gint64 offset;
- struct stat statbuf;
+ ws_statb64 statbuf;
guint8 buf[ASCEND_MAX_PKT_LEN];
ascend_pkthdr header;
gint64 dummy_seek_start;
packet's timestamp from the capture file's ctime, which gives us an
offset that we can apply to each packet.
*/
- if (fstat(wth->fd, &statbuf) == -1) {
- *err = errno;
+ if (wtap_fstat(wth, &statbuf, err) == -1) {
g_free(ascend);
return -1;
}
return FALSE;
if (parse_ascend(wth->fh, buf, &wth->pseudo_header.ascend, &header,
&(ascend->next_packet_seek_start)) != PARSED_RECORD) {
- *err = WTAP_ERR_BAD_RECORD;
+ *err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup((ascend_parse_error != NULL) ? ascend_parse_error : "parse error");
return FALSE;
}
if (ascend->inittime > header.secs)
ascend->inittime -= header.secs;
}
+ wth->phdr.presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN;
wth->phdr.ts.secs = header.secs + ascend->inittime;
wth->phdr.ts.nsecs = header.usecs * 1000;
wth->phdr.caplen = header.caplen;
return FALSE;
if (parse_ascend(wth->random_fh, pd, &pseudo_head->ascend, NULL,
&(ascend->next_packet_seek_start)) != PARSED_RECORD) {
- *err = WTAP_ERR_BAD_RECORD;
+ *err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup((ascend_parse_error != NULL) ? ascend_parse_error : "parse error");
return FALSE;
}