Example #1
0
/* Find the next packet and parse it; called from wtap_read(). */
static gboolean dbs_etherwatch_read(wtap *wth, int *err, gchar **err_info,
    gint64 *data_offset)
{
	gint64	offset;
	guint8	*buf;
	int	pkt_len;

	/* Find the next packet */
	offset = dbs_etherwatch_seek_next_packet(wth, err, err_info);
	if (offset < 1)
		return FALSE;

	/* Make sure we have enough room for the packet */
	buffer_assure_space(wth->frame_buffer, DBS_ETHERWATCH_MAX_PACKET_LEN);
	buf = buffer_start_ptr(wth->frame_buffer);

	/* Parse the packet */
	pkt_len = parse_dbs_etherwatch_packet(wth, wth->fh, buf, err, err_info);
	if (pkt_len == -1)
		return FALSE;

	/*
	 * We don't have an FCS in this frame.
	 */
	wth->phdr.pseudo_header.eth.fcs_len = 0;

	*data_offset = offset;
	return TRUE;
}
Example #2
0
/* Find the next packet and parse it; called from wtap_read(). */
static gboolean dbs_etherwatch_read(wtap *wth, int *err, gchar **err_info,
    gint64 *data_offset)
{
    gint64  offset;

    /* Find the next packet */
    offset = dbs_etherwatch_seek_next_packet(wth, err, err_info);
    if (offset < 1)
        return FALSE;
    *data_offset = offset;

    /* Parse the packet */
    return parse_dbs_etherwatch_packet(&wth->rec, wth->fh,
         wth->rec_data, err, err_info);
}