fccntl - control commands for flows and FRCT connections
#include <ouroboros/fccntl.h>
int fccntl(int fd, int cmd, ...);
Compile and link with -louroboros-dev.
fccntl() is used to control the configuration of flows and connections.
Supported commands are:
FLOWSSNDTIMEO - set the sender timeout. Takes a struct timespec * timeo as third argument. Passing NULL for timeo disables the timeout.
FLOWGSNDTIMEO - retrieve the current sender timeout. Takes a struct timespec * timeo as third argument.
FLOWSRCVTIMEO - set the receiver timeout. Takes a struct timespec * timeo as third argument. Passing NULL for timeo disables the timeout.
FLOWGRCVTIMEO - retrieve the current receiver timeout. Takes a struct timespec * timeo as third argument.
FLOWGQOSSPEC - retrieve the current QoS specification of the flow. Takes a qosspec_t * qs as third argument.
FLOWSFLAGS - set flow flags. Takes flow uint32_t flags as third argument. Supported flags are:
FLOWFWRONLY - set flow_to write-only.
FLOWFRDWR - set flow to read-write.
FLOWFDOWN - mark flow as down.
FLOWFRNOBLOCK - set read to non-blocking.
FLOWFWNOBLOCK - set write to non-blocking.
FLOWFNONBLOCK - set I/O to non-blocking read/write.
FLOWFRNOPART - disable partial reading.
FLOWFWNOPART - disable partial writing.
FLOWFDEFAULT - set flow defaults (blocking, read-write, no partial writes).
FLOWGFLAGS - get the current flow flags. Takes an uint32_t * flags as third argument.
FLOWGRXQLEN - get the current number of packets in the receive buffer. Takes a size_t qlen * as third argument.
FLOWGTXQLEN - get the current number of packets in the transmit buffer. Takes a size_t qlen * as third argument.
FLOWSTXQDLY - set the target queueing delay for the transmit occupancy limiter. Takes a struct timespec * timeo as third argument. A zero delay leaves the ring unlimited, bounded only by its slot count. The build-time default is applied when the flow is created. The delay must be a normalised, non-negative timespec no longer than the maximum the limiter accepts.
FLOWGTXQDLY - retrieve the current target queueing delay for the transmit occupancy limiter. Takes a struct timespec * timeo as third argument.
FRCTSFLAGS - set the current flow flags. Takes an uint16_t flags as third argument. Supported flags are:
FRCTFRTX - retransmission enabled. Cannot be modified and will be ignored on set.
FRCTFLINGER - finish connection on flow deallocation.
FRCTGFLAGS - get the current flow flags. Takes an uint16_t * flags as third argument.
On success, fccntl() returns 0.
fccntl() can return
-EINVAL An invalid argument was passed. This is also returned when the delay passed to FLOWSTXQDLY is negative, is not normalised, or exceeds the maximum the transmit occupancy limiter accepts.
-EPERM Operation not permitted. This is returned when requesting the value of a timeout (FLOWGSNDTIMEO or FLOWGRCVTIMEO) when no such timeout was set, or when FLOWSTXQDLY/FLOWGTXQDLY is used on a flow with no transmit occupancy ring.
-EBADF Invalid flow descriptor passed.
-ENOTALLOC Flow is not allocated.
-ENOTSUP The specified command is not supported.
For an explanation of the terms used in this section, see attributes(7).
| |||||||||
flow_alloc(3), flow_read(3), fqueue(3), fset(3), ouroboros(8)
These man pages are licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/