SCTP Programmer's Guide
In the case of the one-to-many style APIs, the socket options are applied to all
associations that belong to a socket. For a one-to-one API, the socket options apply to
all peer addresses of the association controlled by the socket.
In the SCTP stack, the getsockopt() is read-only. This means that applications cannot
specify any information in the getsockopt() call. As a result, applications must use
the sctp_opt_info() API to pass information both into and out of the SCTP stack.
Following is the syntax for the sctp_opt_info() API:
int sctp_opt_info(int sd,
sctp_assoc_t id,
int opt,
void *arg,
socklen_t *size);
where:
id Specifies the association ID. For a one-to-many style socket, id specifies the
association to query. For a one-to-one style socket, SCTP ignores the ID.
opt Specifies the SCTP socket option. The sctp_opt_info() API retrieves socket
options, specified as follows:
• SCTP_RTOINFO
• SCTP_ASSOCINFO
• SCTP_DEFAULT_SEND_PARAM
• SCTP_GET_PEER_ADDR_INFO
• SCTP_PRIMARY_ADDR
• SCTP_PEER_ADDR_PARAMS
• SCTP_STATUS
sctp_opt_info() does not support the authentication related-options
SCTP_AUTH_CHUNKS, SCTP_AUTH_SECRET, and SCTP_PEER_AUTH_CHUNKS.
arg
Specifies an option-specific structure buffer that is provided by an application.
The sctp_opt_info() API returns 0 on success, and returns -1 on failure. It sets
errno to the appropriate error code.
The sctp_opt_info() call is a replacement for getsockopt(), and
sctp_opt_info() does not set any option associated with the specified socket. You
must use the setsockopt() call to set any writeable option, such as SO_LINGER and
SCTP_NODELAY.
Common Socket Calls
This section discusses socket calls that are common to both one-to-one and one-to-many
style APIs.
54 SCTP Socket APIs