SCTP_GETASSOCID(3) Library Functions Manual SCTP_GETASSOCID(3)

sctp_getassocid
return an association id for a specified socket address

Standard C Library (libc, -lc)

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

sctp_assoc_t
sctp_getassocid(int s, struct sockaddr *addr);

The sctp_getassocid() call attempts to look up the specified socket address addr and find the respective association identification.

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

The sctp_getassocid() function can return the following errors:
[]
The argument s is not a valid descriptor.
[]
The address does not have an association setup to it.
[]
The argument s is not a socket.

sctp(4)

Sockets API Extensions for the Stream Control Transmission Protocol (SCTP), RFC, 6458, December 2011.

This function first appeared in NetBSD 9.0.
August 1, 2018 NetBSD 9.2