blob: a41cb33f7ae332aa3d54f7cba0aa9da757a7e1c6 [file] [log] [blame]
Austin Schuh8d0a2852019-12-28 22:54:28 -08001.\" (C) Copyright Xin Long REDHAT Corp. 2018.
2.\"
3.\" Permission is granted to distribute possibly modified copies
4.\" of this manual provided the header is included verbatim,
5.\" and in case of nontrivial modification author and date
6.\" of the modification is added to the header.
7.\"
8.TH SCTP_RECVV 3 2018-04-29 "Linux 4.16 "Linux Programmer's Manual"
9.SH NAME
10sctp_recvv \- Receive a message from a SCTP socket with an extensible way.
11.SH SYNOPSIS
12.nf
13.B #include <sys/types.h>
14.B #include <sys/socket.h>
15.B #include <netinet/sctp.h>
16.sp
17.BI "int sctp_recvv(int " sd ", const struct iovec * " iov ", int " iovlen ,
18.BI " struct sockaddr * " from ", socklen_t * " fromlen ", void * " info ,
19.BI " socklen_t * " infolen ", unsigned int * " infotype ", int * " flags );
20.fi
21.SH DESCRIPTION
22.BR sctp_recvv
23provides an extensible way for the SCTP stack to pass up different SCTP
24attributes associated with a received message to an application.
25There are two types of attributes that can be returned by this call: the
26attribute of the received message and the attribute of the next message
27in the receive buffer. The caller enables the SCTP_RECVRCVINFO and
28SCTP_RECVNXTINFO socket options, respectively, to receive these attributes.
29Attributes of the received message are returned in struct sctp_rcvinfo,
30and attributes of the next message are returned in struct sctp_nxtinfo.
31If both options are enabled, both attributes are returned using the
32following structure.
33
34 struct sctp_recvv_rn {
35 struct sctp_rcvinfo recvv_rcvinfo;
36 struct sctp_nxtinfo recvv_nxtinfo;
37 };
38
39.I sd
40is the socket descriptor.
41.I iov
42is the scatter buffer, and only one user message is returned in this buffer.
43.I iovlen
44is the number of elements in iov.
45.I from
46is a pointer to a buffer to be filled with the sender of the received message's
47address.
48.I fromlen
49is an in/out parameter describing the from length.
50.I info
51is a pointer to the buffer to hold the attributes of the received message, the
52structure type of info is determined by the info_type parameter.
53.I infolen
54is an in/out parameter describing the size of the info buffer.
55On return,
56.I infotype
57is set to the type of the info buffer, and the current defined
58values are as follows:
59.TP
60.B SCTP_RECVV_NOINFO
61If neither SCTP_RECVRCVINFO nor SCTP_RECVNXTINFO options are enabled, no
62attribute will be returned. If only the SCTP_RECVNXTINFO option is enabled
63but there is no next message in the buffer, no attribute will be returned.
64In these cases, *info_type will be set to SCTP_RECVV_NOINFO.
65.TP
66.B SCTP_RECVV_RCVINFO
67The type of info is struct sctp_rcvinfo, and the attribute relates to the
68received message.
69.TP
70.B SCTP_RECVV_NXTINFO
71The type of info is struct sctp_nxtinfo, and the attribute relates to the
72next message in the receive buffer. This is the case when only the
73SCTP_RECVNXTINFO option is enabled and there is a next message in the buffer.
74.TP
75.B SCTP_RECVV_RN
76The type of info is struct sctp_recvv_rn. The recvv_rcvinfo field is the
77attribute of the received message, and the recvv_nxtinfo field is the attribute
78of the next message in the buffer. This is the case when both SCTP_RECVRCVINFO
79and SCTP_RECVNXTINFO options are enabled and there is a next message in the
80receive buffer.
81.PP
82.I flags
83is pointer to an integer to be filled with any message flags (e.g.,
84MSG_NOTIFICATION).
85.SH "RETURN VALUE"
86On success,
87.BR sctp_recvv
88returns the number of bytes received or -1 if an error occurred.
89.SH "SEE ALSO"
90.BR sctp (7)
91.BR sctp_bindx (3),
92.BR sctp_connectx (3),
93.BR sctp_sendmsg (3),
94.BR sctp_sendv (3),
95.BR sctp_send (3),
96.BR sctp_peeloff (3),
97.BR sctp_getpaddrs (3),
98.BR sctp_getladdrs (3),
99.BR sctp_opt_info (3)