summaryrefslogtreecommitdiff
path: root/doc/man/fccntl.3
blob: 87e230780b4670d0b8869c4f9b98d8265f1f6f0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
.\" Ouroboros man pages CC-BY 2017 - 2020
.\" Dimitri Staessens <dimitri.staessens@ugent.be>
.\" Sander Vrijders <sander.vrijders@ugent.be>

.TH FCCNTL 3 2018-10-04 Ouroboros "Ouroboros Programmer's Manual"

.SH NAME

fccntl \- control commands for flows and FRCT connections

.SH SYNOPSIS

.B #include <ouroboros/fccntl.h>

\fBint fccntl(int \fIfd\fB, int \fIcmd\fB, ...);

Compile and link with \fI-louroboros-dev\fR.

.SH DESCRIPTION

\fBfccntl\fR() is used to control the configuration of flows and
connections.

Supported commands are:

\fBFLOWSSNDTIMEO\fR - set the sender timeout. Takes a \fBstruct
timespec * \fItimeo\fR as third argument. Passing NULL for \fItimeo\fR
disables the timeout.

\fBFLOWGSNDTIMEO\fR - retrieve the current sender timeout. Takes a
\fBstruct timespec * \fItimeo\fR as third argument.

\fBFLOWSRCVTIMEO\fR - set the receiver timeout. Takes a \fBstruct
timespec * \fItimeo\fR as third argument. Passing NULL for \fItimeo\fR
disables the timeout.

\fBFLOWGRCVTIMEO\fR - retrieve the current receiver timeout. Takes a
\fBstruct timespec * \fItimeo\fR as third argument.

\fBFLOWGQOSSPEC\fR  - retrieve the current QoS specification of the
flow. Takes a \fBqosspec_t * \fIqs\fR as third argument.

\fBFLOWSFLAGS\fR    - set flow flags. Takes flow flags as third
argument. Supported flags are:

.RS 8
\fIFLOWFRDONLY\fR   - set flow to read-only.

\fIFLOWFWRONLY\fR   - set flow_to write-only.

\fIFLOWFRDWR\fR     - set flow to read-write.

\fIFLOWFDOWN\fR     - mark flow as down.

\fIFLOWFRNOBLOCK\fR - set read to non-blocking.

\fIFLOWFWNOBLOCK\fR - set write to non-blocking.

\fIFLOWFNONBLOCK\fR - set I/O to non-blocking read/write.

\fIFLOWFRNOPART\fR  - disable partial reading.

\fIFLOWFWNOPART\fR  - disable partial writing.

\fIFLOWFDEFAULT\fR  - set flow defaults (blocking, read-write,
no partial writes).

.RE

\fBFLOWGFLAGS\fR    - get the current flow flags. Takes an \fBuint32_t
\fIflags\fR as third argument.

\fBFLOWGRXQLEN\fR   - get the current number of packets in the receive
buffer. Takes a \fBsize_t \fIqlen\fR as third argument.

\fBFLOWGTXQLEN\fR   - get the current number of packets in the transmit
buffer. Takes a \fBsize_t \fIqlen\fR as third argument.

\fBFRCTGFLAGS\fR    - get the current flow flags. Takes an \fBuint16_t
\fIflags\fR as third argument. Supported flags are:

.RS 8
\fIFRCTFRESCNTRL\fR - resource control enabled.

\fIFRCTFRTX\fR      - retransmission enabled.

.RE


.SH RETURN VALUE

On success, \fBfccntl\fR() returns 0.

.SH ERRORS

\fBfccntl\fR() can return

.B -EINVAL
An invalid argument was passed.

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

.B -EBADF
Invalid flow descriptor passed.

.B -ENOTALLOC
Flow is not allocated.

.B -ENOTSUP
The specified command is not supported.

.SH ATTRIBUTES

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

.TS
box, tab(&);
LB|LB|LB
L|L|L.
Interface & Attribute & Value
_
\fBfccntl\fR() & Thread safety & MT-Safe
.TE

.SH TERMINOLOGY
Please see \fBouroboros-glossary\fR(7).

.SH SEE ALSO

.BR flow_alloc "(3), " flow_read "(3), " fqueue "(3), " fset "(3), " \
ouroboros (8)

.SH 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/