Example #1
0
wtap_open_return_val dbs_etherwatch_open(wtap *wth, int *err, gchar **err_info)
{
    /* Look for DBS ETHERWATCH header */
    if (!dbs_etherwatch_check_file_type(wth, err, err_info)) {
        if (*err != 0 && *err != WTAP_ERR_SHORT_READ)
            return WTAP_OPEN_ERROR;
        return WTAP_OPEN_NOT_MINE;
    }

    wth->file_encap = WTAP_ENCAP_ETHERNET;
    wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_DBS_ETHERWATCH;
    wth->snapshot_length = 0;   /* not known */
    wth->subtype_read = dbs_etherwatch_read;
    wth->subtype_seek_read = dbs_etherwatch_seek_read;
    wth->file_tsprec = WTAP_TSPREC_CSEC;

    return WTAP_OPEN_MINE;
}
Example #2
0
int dbs_etherwatch_open(wtap *wth, int *err, gchar **err_info)
{
	/* Look for DBS ETHERWATCH header */
	if (!dbs_etherwatch_check_file_type(wth, err, err_info)) {
		if (*err != 0 && *err != WTAP_ERR_SHORT_READ)
			return -1;
		return 0;
	}

	wth->file_encap = WTAP_ENCAP_ETHERNET;
	wth->file_type = WTAP_FILE_DBS_ETHERWATCH;
	wth->snapshot_length = 0;	/* not known */
	wth->subtype_read = dbs_etherwatch_read;
	wth->subtype_seek_read = dbs_etherwatch_seek_read;
	wth->tsprecision = WTAP_FILE_TSPREC_CSEC;

	return 1;
}