FCCNTL

Section: Ouroboros Programmer's Manual (3)
Updated: 2018-10-04
Index Return to wiki

 

NAME

fccntl - control commands for flows and FRCT connections

 

SYNOPSIS

#include <ouroboros/fccntl.h>

int fccntl(int fd, int cmd, ...);

Compile and link with -louroboros-dev.

 

DESCRIPTION

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:

FLOWFRDONLY - set flow to read-only.

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.

FRCTSFLAGS - set the current flow flags. Takes an uint16_t flags as third argument. Supported flags are:

FRCTFRESCNTL - resource control enabled.

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.

 

RETURN VALUE

On success, fccntl() returns 0.

 

ERRORS

fccntl() can return

-EINVAL An invalid argument was passed.

-EPERM Operation not permitted. This is returned when requesting the value of a timeout (FLOWGSNDTIMEO or FLOWGRCVTIMEO) when no such timeout was set.

-EBADF Invalid flow descriptor passed.

-ENOTALLOC Flow is not allocated.

-ENOTSUP The specified command is not supported.

 

ATTRIBUTES

For an explanation of the terms used in this section, see attributes(7).

Interface Attribute Value

fccntl() Thread safety MT-Safe

 

TERMINOLOGY

Please see ouroboros-glossary(7).

 

SEE ALSO

flow_alloc(3), flow_read(3), fqueue(3), fset(3), ouroboros(8)

 

COLOPHON

This page is part of the Ouroboros project, found at http://ouroboros.rocks

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/


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
ATTRIBUTES
TERMINOLOGY
SEE ALSO
COLOPHON

This document was created by man2html, using the manual pages.
Time: 07:32:42 GMT, March 01, 2024