---
name: "sctp_opt_info"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/sctp_opt_info"
---

# sctp\_opt\_info(3)

get SCTP socket information

## NAME

**sctp\_opt\_info** – get SCTP socket information

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<sys/socket.h\>**

**#include \<netinet/sctp.h\>**

*int*\

**sctp\_opt\_info**(*int sd*, *sctp\_assoc\_t id*, *int opt*, *void \*arg*, *socklen\_t \*size*);

## DESCRIPTION

The **sctp\_opt\_info**() call provides a multi-os compatible method for getting specific **getsockopt**() data where an association identification needs to be passed into the operating system. For FreeBSD a direct **getsockopt**() may be used, since FreeBSD has the ability to pass information into the operating system on a **getsockopt**() call. Other operating systems may not have this ability. For those who wish to write portable code amongst multiple operating systems this call should be used for the following SCTP socket options.

SCTP\_RTOINFO

SCTP\_ASSOCINFO

SCTP\_PRIMARY\_ADDR

SCTP\_PEER\_ADDR\_PARAMS

SCTP\_DEFAULT\_SEND\_PARAM

SCTP\_MAX\_SEG

SCTP\_AUTH\_ACTIVE\_KEY

SCTP\_DELAYED\_SACK

SCTP\_MAX\_BURST

SCTP\_CONTEXT

SCTP\_EVENT

SCTP\_DEFAULT\_SNDINFO

SCTP\_DEFAULT\_PRINFO

SCTP\_STATUS

SCTP\_GET\_PEER\_ADDR\_INFO

SCTP\_PEER\_AUTH\_CHUNKS

SCTP\_LOCAL\_AUTH\_CHUNKS

## RETURN VALUES

The call returns 0 on success and -1 upon error.

## ERRORS

The **sctp\_opt\_info**() function can return the following errors:

- \[EINVAL\]

  The argument *arg* value was invalid.

- \[EOPNOTSUPP\]

  The argument *opt* was not one of the above listed SCTP socket options.

- \[EBADF\]

  The argument *s* is not a valid descriptor.

- \[ENOTSOCK\]

  The argument *s* is not a socket.

## SEE ALSO

[getsockopt(2)](/getsockopt/2.md), [sctp(4)](/sctp/4.md)

## BUGS

Because the structure used for *arg* of the SCTP\_MAX\_BURST socket option has changed in FreeBSD 9.0 and higher, using SCTP\_MAX\_BURST as *opt* is only supported in FreeBSD 9.0 and higher.
