dag_tx_stream_commit_bytes(3)

NAME
dag_tx_stream_commit_bytes - commit data to be sent on a transmit stream for an Endace DAG card

SYNOPSIS
#include "dagapi.h "

uint8_t*
dag_tx_stream_commit_bytes(int dagfd, int stream_num, uint32_t size);

DESCRIPTION
dag_tx_get_stream_commit_bytes provides a pointer to size bytes of available space for the stream referred to by stream_num. In order to transmit data the first step for the user is to get a pointer to write to using dag_tx_get_stream_space(3), then write their data at that location, and finally call dag_tx_stream_commit_bytes(3) to indicate that the data can be sent. No pointer to the bytes to be sent is required, as the API holds this internally. The parameter size is the number of bytes that can be sent, this may be less than or equal to the size requested in the previous call to dag_tx_get_stream_space(3), but must not be greater.

dag_tx_get_stream_commit_bytes returns a pointer to the end of the transmitted block, but no data can be written at this location until dag_tx_get_stream_space(3) has been called again to ensure buffer space is available.

RETURN VALUE
On success dag_tx_stream_commit_bytes returns a pointer to the end of the transmitted data, otherwise it returns NULL with errno set appropriately.

ERRORS

EBADF
    dagfd is an invalid file descriptor.

EINVAL
    stream_num refers to a stream that has not been attached or size is larger than the size of the stream's memory buffer.

ENOMEM
    stream_num refers to a stream that has no memory allocated to its buffer.

ENOTTY
    stream_num does not refer to a transmit stream.

EXAMPLE
FIXME Sample code.

SEE ALSO
dag_tx_get_stream_count(3), dag_tx_get_stream_space(3), dag_tx_stream_copy_bytes(3).

BUGS
Report bugs to <support@endace.com>.

LAST UPDATED
$Author: koryn $
$Revision: 2474 $
$Date: 2005-11-10 11:13:19 +1300 (Thu, 10 Nov 2005) $

COPYRIGHT
(c) 2004-2005 Endace Technology, Hamilton, New Zealand. All Rights Reserved.