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

# sctp\_getassocid(3)

return an association id for a specified socket address

## NAME

**sctp\_getassocid** – return an association id for a specified socket address

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

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

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

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

*sctp\_assoc\_t*\

**sctp\_getassocid**(*int s*, *struct sockaddr \*addr*);

## DESCRIPTION

The **sctp\_getassocid**() call attempts to look up the specified socket address *addr* and find the respective association identification.

## RETURN VALUES

The call returns the association id upon success and 0 is returned upon failure.

## ERRORS

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

- \[ENOENT\]

  The address does not have an association setup to it.

- \[EBADF\]

  The argument *s* is not a valid descriptor.

- \[ENOTSOCK\]

  The argument *s* is not a socket.

## SEE ALSO

[sctp(4)](/sctp/4.md)
