---
name: "sctp_recvv"
section: "3"
platform: "linux"
package: "lksctp-tools"
version: "1.0.21-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/sctp_recvv"
---

# sctp\_recvv(3)

Receive a message from a SCTP socket with an extensible way.

## NAME

sctp\_recvv - Receive a message from a SCTP socket with an extensible way.

## SYNOPSIS

```
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/sctp.h>

int sctp_recvv(int sd, const struct iovec * iov, int iovlen,
               struct sockaddr * from, socklen_t * fromlen, void * info,
               socklen_t * infolen, unsigned int * infotype, int * flags);
```

## DESCRIPTION

**sctp\_recvv** provides an extensible way for the SCTP stack to pass up different SCTP attributes associated with a received message to an application. There are two types of attributes that can be returned by this call: the attribute of the received message and the attribute of the next message in the receive buffer.  The caller enables the SCTP\_RECVRCVINFO and SCTP\_RECVNXTINFO socket options, respectively, to receive these attributes. Attributes of the received message are returned in struct sctp\_rcvinfo, and attributes of the next message are returned in struct sctp\_nxtinfo. If both options are enabled, both attributes are returned using the following structure.

   struct sctp\_recvv\_rn {\
      struct sctp\_rcvinfo recvv\_rcvinfo;\
      struct sctp\_nxtinfo recvv\_nxtinfo;\
    };

*sd* is the socket descriptor. *iov* is the scatter buffer, and only one user message is returned in this buffer. *iovlen* is the number of elements in iov. *from* is a pointer to a buffer to be filled with the sender of the received message's address. *fromlen* is an in/out parameter describing the from length. *info* is a pointer to the buffer to hold the attributes of the received message, the structure type of info is determined by the info\_type parameter. *infolen* is an in/out parameter describing the size of the info buffer. On return, *infotype* is set to the type of the info buffer, and the current defined values are as follows:

- **SCTP\_RECVV\_NOINFO**

  If neither SCTP\_RECVRCVINFO nor SCTP\_RECVNXTINFO options are enabled, no attribute will be returned.  If only the SCTP\_RECVNXTINFO option is enabled but there is no next message in the buffer, no attribute will be returned. In these cases, \*info\_type will be set to SCTP\_RECVV\_NOINFO.

- **SCTP\_RECVV\_RCVINFO**

  The type of info is struct sctp\_rcvinfo, and the attribute relates to the received message.

- **SCTP\_RECVV\_NXTINFO**

  The type of info is struct sctp\_nxtinfo, and the attribute relates to the next message in the receive buffer.  This is the case when only the SCTP\_RECVNXTINFO option is enabled and there is a next message in the buffer.

- **SCTP\_RECVV\_RN**

  The type of info is struct sctp\_recvv\_rn.  The recvv\_rcvinfo field is the attribute of the received message, and the recvv\_nxtinfo field is the attribute of the next message in the buffer.  This is the case when both SCTP\_RECVRCVINFO and SCTP\_RECVNXTINFO options are enabled and there is a next message in the receive buffer.

*flags* is pointer to an integer to be filled with any message flags (e.g., MSG\_NOTIFICATION).

## RETURN VALUE

On success, **sctp\_recvv** returns the number of bytes received or -1 if an error occurred.

## SEE ALSO

[**sctp**(7)](/sctp/7.md) [**sctp\_bindx**(3)](/sctp_bindx/3.md), [**sctp\_connectx**(3)](/sctp_connectx/3.md), [**sctp\_sendmsg**(3)](/sctp_sendmsg/3.md), [**sctp\_sendv**(3)](/sctp_sendv/3.md), [**sctp\_send**(3)](/sctp_send/3.md), [**sctp\_peeloff**(3)](/sctp_peeloff/3.md), [**sctp\_getpaddrs**(3)](/sctp_getpaddrs/3.md), [**sctp\_getladdrs**(3)](/sctp_getladdrs/3.md), [**sctp\_opt\_info**(3)](/sctp_opt_info/3.md)
