SCTP Programmer's Guide
You can use the getsockopt() and setsockopt() system calls to modify the socket
options. These system calls set or retrieve socket interface options, or lower-level
protocol options.
Following is the syntax for the getsockopt() system call:
int getsockopt(
int s,
int level,
int optname,
void *optval,
int *optlen
);
where:
s
Indicates the file descriptor.
level Specifies the type of protocol. You must set the level to IPPROTO_SCTP
for all the SCTP options.
optname
Specifies the option name.
optval
Specifies the buffer to store the value of the option.
optlen
Specifies the size of the buffer (or the length of the option returned).
Following is the syntax for the setsockopt() API:
int setsockopt(
int s,
int level,
int optname,
const void *optval,
int optlen
);
where:
s
Indicates the file descriptor.
level Specifies the type of protocol. You must set the level to IPPROTO_SCTP
for all SCTP options.
optname
Specifies the option name.
optval
Specifies the buffer to store the value of the option.
optlen
Specifies the size of the buffer (or the length of the option returned).
SCTP associations being multihomed, certain option parameters include the
sockaddr_storage structure to select the peer address to which the option must be
applied. For a one-to-many style socket, applications can use an association ID
(sctp_assoc_t structure) to identify the association instance that is affected by the
option. Applications must set this association ID while using a one-to-many API style
socket. In the case of one-to-one style socket APIs and the branched off one-to-many
style sockets, SCTP ignores this association ID parameter.
API Options to Modify Socket Behavior 53