1SCTP_RECVV(3)                        Linux                       SCTP_RECVV(3)
2
3
4

NAME

6       sctp_recvv  -  Receive  a message from a SCTP socket with an extensible
7       way.
8

SYNOPSIS

10       #include <sys/types.h>
11       #include <sys/socket.h>
12       #include <netinet/sctp.h>
13
14       int sctp_recvv(int sd, const struct iovec * iov, int iovlen,
15                      struct sockaddr * from, socklen_t * fromlen, void * info,
16                      socklen_t * infolen, unsigned int * infotype, int * flags);
17

DESCRIPTION

19       sctp_recvv provides an extensible way for the SCTP  stack  to  pass  up
20       different  SCTP  attributes  associated  with  a received message to an
21       application.  There are two types of attributes that can be returned by
22       this  call:  the attribute of the received message and the attribute of
23       the next message  in  the  receive  buffer.   The  caller  enables  the
24       SCTP_RECVRCVINFO  and SCTP_RECVNXTINFO socket options, respectively, to
25       receive these attributes.   Attributes  of  the  received  message  are
26       returned in struct sctp_rcvinfo, and attributes of the next message are
27       returned in struct sctp_nxtinfo.  If both  options  are  enabled,  both
28       attributes are returned using the following structure.
29
30          struct sctp_recvv_rn {
31            struct sctp_rcvinfo recvv_rcvinfo;
32            struct sctp_nxtinfo recvv_nxtinfo;
33          };
34
35       sd  is  the socket descriptor.  iov is the scatter buffer, and only one
36       user message is returned in this buffer.  iovlen is the number of  ele‐
37       ments  in  iov.   from  is  a pointer to a buffer to be filled with the
38       sender of the received message's address.  fromlen is an in/out parame‐
39       ter  describing  the  from  length.  info is a pointer to the buffer to
40       hold the attributes of the received message, the structure type of info
41       is determined by the info_type parameter.  infolen is an in/out parame‐
42       ter describing the size of the info buffer.  On return, infotype is set
43       to  the  type of the info buffer, and the current defined values are as
44       follows:
45
46       SCTP_RECVV_NOINFO
47              If neither SCTP_RECVRCVINFO  nor  SCTP_RECVNXTINFO  options  are
48              enabled,   no   attribute   will   be  returned.   If  only  the
49              SCTP_RECVNXTINFO option is enabled but there is no next  message
50              in  the  buffer, no attribute will be returned.  In these cases,
51              *info_type will be set to SCTP_RECVV_NOINFO.
52
53       SCTP_RECVV_RCVINFO
54              The type of info  is  struct  sctp_rcvinfo,  and  the  attribute
55              relates to the received message.
56
57       SCTP_RECVV_NXTINFO
58              The  type  of  info  is  struct  sctp_nxtinfo, and the attribute
59              relates to the next message in the receive buffer.  This is  the
60              case  when only the SCTP_RECVNXTINFO option is enabled and there
61              is a next message in the buffer.
62
63       SCTP_RECVV_RN
64              The type of info is  struct  sctp_recvv_rn.   The  recvv_rcvinfo
65              field  is  the  attribute  of  the  received  message,  and  the
66              recvv_nxtinfo field is the attribute of the next message in  the
67              buffer.   This  is  the  case  when  both  SCTP_RECVRCVINFO  and
68              SCTP_RECVNXTINFO options are enabled and there is a next message
69              in the receive buffer.
70
71       flags  is  pointer  to  an  integer to be filled with any message flags
72       (e.g., MSG_NOTIFICATION).
73

RETURN VALUE

75       On success, sctp_recvv returns the number of bytes received or -1 if an
76       error occurred.
77

SEE ALSO

79       sctp(7)      sctp_bindx(3),      sctp_connectx(3),     sctp_sendmsg(3),
80       sctp_sendv(3),   sctp_send(3),   sctp_peeloff(3),    sctp_getpaddrs(3),
81       sctp_getladdrs(3), sctp_opt_info(3)
82
83
84
85Linux 4.16                        2018-04-29                     SCTP_RECVV(3)
Impressum