dag_tx_stream_copy_bytes(3)

NAME
dag_tx_stream_copy_bytes - copy data to be sent on a transmit stream for an Endace DAG card

SYNOPSIS
#include "dagapi.h "

int
dag_tx_stream_copy_bytes(int dagfd, int stream_num, uint8_t* orig, uint32_t size);

DESCRIPTION
dag_tx_get_stream_copy_bytes is used to transmit packets where the packet records are already present in a user buffer. The records are copied from the user buffer into the stream buffer when space is available, and committed for transmission. No other functions need be called when using this method, but it is less efficient as the packet records must be copied by the CPU. The pointer orig indicates the location of the user buffer to be copies, while size contains the number of bytes to be copied and sent. The buffer to be sent does not have to be record aligned, but if the buffer contains only the start of a packet record, that packet will not be transmitted from the DAG until the remainder of the record is supplied. dag_tx_get_stream_copy_bytes will block until space is available in the transmit stream buffer for all of the supplied data to be sent.

RETURN VALUE
On success dag_tx_stream_copy_bytes returns the number of bytes successfully written (a positive integer), otherwise it returns -1 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_commit_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.