The sctp_opt_info() function returns the SCTP level options that are associated with the socket described in the sock parameter. If the socket is a one-to-many style SCTP socket the value of the id parameter refers to a specific association. The id parameter is ignored for one-to-one style SCTP sockets. The value of the opt parameter specifies the SCTP socket option to get. The value of the arg parameter is an option-specific structure buffer that is allocated by the calling program. The value of the *len parameter is the length of the option.
The opt parameter can take on the following values:
Returns the protocol parameters that are used to initialize and bind the retransmission timeout (RTO) tunable. The protocol parameters use the following structure:
struct sctp_rtoinfo { sctp_assoc_t srto_assoc_id; uint32_t srto_initial; uint32_t srto_max; uint32_t srto_min; };
The calling program provides this value, which specifies the association of interest.
This value is the initial RTO value.
This value is the maximum RTO value.
This value is the minimum RTO value.
Returns the association-specific parameters. The parameters use the following structure:
struct sctp_assocparams { sctp_assoc_t sasoc_assoc_id; uint16_t sasoc_asocmaxrxt; uint16_t sasoc_number_peer_destinations; uint32_t sasoc_peer_rwnd; uint32_t sasoc_local_rwnd; uint32_t sasoc_cookie_life; };
The calling program provides this value, which specifies the association of interest.
This value specifies the maximum retransmission count for the association.
This value specifies the number of addresses that the peer has.
This value specifies the current value of the peer's receive window.
This value specifies the last reported receive window that the peer transmitted to.
The value specifies the lifetime of the association's cookie. The value is used when issuing cookies.
All parameters that use time values are measured in milliseconds.
Returns the default set of parameters that a call to the sendto(3SOCKET) function uses on this association. The parameters use the following structure:
struct sctp_sndrcvinfo { uint16_t sinfo_stream; uint16_t sinfo_ssn; uint16_t sinfo_flags; uint32_t sinfo_ppid; uint32_t sinfo_context; uint32_t sinfo_timetolive; uint32_t sinfo_tsn; uint32_t sinfo_cumtsn; sctp_assoc_t sinfo_assoc_id; };
This value specifies the default stream for the sendmsg() call.
This value is always zero.
This value contains the default flags for the sendmsg() call. This flag can take on the following values:
MSG_UNORDERED
MSG_ADDR_OVER
MSG_ABORT
MSG_EOF
MSG_PR_SCTP
This value is the default payload protocol identifier for the sendmsg() call.
This value is the default context for the sendmsg() call.
This value specifies a time period in milliseconds. After this time period has passed, the message expires if its transmission has not begun. A value of zero indicates that the message does not expire. If the MSG_PR_SCTP flag is set, the message expires when its transmission has not successfully completed within the time period specified in sinfo_timetolive.
This value is always zero.
This value is always zero.
This value is filled in by the calling application. This value specifies the association of interest.
Returns the parameters for a specified peer address. The parameters use the following structure:
struct sctp_paddrparams { sctp_assoc_t spp_assoc_id; struct sockaddr_storage spp_address; uint32_t spp_hbinterval; uint16_t spp_pathmaxrxt; };
The calling program provides this value, which specifies the association of interest.
This value specifies the peer's address of interest.
This value specifies the heartbeat interval in milliseconds.
This value specifies the maximum number of retransmissions to attempt on an address before considering the address unreachable.
Returns the current status information about the association. The parameters use the following structure:
struct sctp_status { sctp_assoc_t sstat_assoc_id; int32_t sstat_state; uint32_t sstat_rwnd; uint16_t sstat_unackdata; uint16_t sstat_penddata; uint16_t sstat_instrms; uint16_t sstat_outstrms; uint32_t sstat_fragmentation_point; struct sctp_paddrinfo sstat_primary; };
The calling program provides this value, which specifies the association of interest.
This value is the association's current state. The association can take on the following states:
The SCTP endpoint does not have any association associated with it. Immediately after the call to the socket() function opens an endpoint, or after the endpoint closes, the endpoint is in this state.
An SCTP endpoint is bound to one or more local addresses after calling the bind().
This endpoint is waiting for an association request from any remote SCTP endpoint.
This SCTP endpoint has sent an INIT chunk and is waiting for an INIT-ACK chunk.
This SCTP endpoint has echoed the cookie that it received from its peer's INIT-ACK chunk back to the peer.
This SCTP endpoint can exchange data with its peer.
This SCTP endpoint has received a SHUTDOWN primitive from its upper layer. This endpoint no longer accepts data from its upper layer.
An SCTP endpoint that was in the SCTP_SHUTDOWN_PENDING state has sent a SHUTDOWN chunk to its peer. The SHUTDOWN chunk is sent only after all outstanding data from this endpoint to its peer is acknowledged. When this endpoint's peer sends a SHUTDOWN ACK chunk, this endpoint sends a SHUTDOWN COMPLETE chunk and the association is considered closed.
An SCTP endpoint has received a SHUTDOWN chunk from its peer. This endpoint no longer accepts new data from its user.
An SCTP endpoint in the SCTP_SHUTDOWN_RECEIVED state has sent the SHUTDOWN ACK chunk to its peer. The endpoint only sends the SHUTDOWN ACK chunk after the peer acknowledges all outstanding data from this endpoint. When this endpoint's peer sends a SHUTDOWN COMPLETE chunk, the association is closed.
This value is the association peer's current receive window.
This value is the number of unacknowledged DATA chunks.
This value is the number of DATA chunks that are awaiting receipt.
This value is the number of inbound streams.
This value is the number of outbound streams.
If the combined size of the message, the SCTP headers, and the IP headers exceeds the value of sstat_fragmentation_point, the message fragments. This value is equal to the Path Maximum Transmission Unit (P-MTU) for the packet's destination address
This value contains information about the primary peer address. This information uses the following structure:
struct sctp_paddrinfo { sctp_assoc_t spinfo_assoc_id; struct sockaddr_storage spinfo_address; int32_t spinfo_state; uint32_t spinfo_cwnd; uint32_t spinfo_srtt; uint32_t spinfo_rto; uint32_t spinfo_mtu; };
The calling program provides this value, which specifies the association of interest.
This value is the primary peer's address.
This value can take on either of the two values SCTP_ACTIVE or SCTP_INACTIVE.
This value is the congestion window of the peer address.
This value is the current smoothed round-trip time calculation for the peer address. This value is expressed in milliseconds.
This value is the current retransmission timeout value for the peer address. This value is expressed in milliseconds.
This value is the P-MTU for the peer address.
The sctp_opt_info() function returns 0 on success. The sctp_opt_info() function returns -1 on failure and sets the value of errno to the appropriate error code. If the file descriptor passed to the sctp_opt_info() in the sock parameter is invalid, the sctp_opt_info() function fails and returns EBADF. If the file descriptor passed to the sctp_opt_info() function in the sock parameter does not describe a socket, the sctp_opt_info() function fails and returns ENOTSOCK. If the association ID is invalid for a one-to-many style SCTP socket, the sctp_opt_info() function fails and sets the value of errno to EINVAL. If the input buffer length is too short for the option specified, the sctp_opt_info() function fails and sets the value of errno to EINVAL. If the address family for the peer's address is not AF_INET or AF_INET6, the sctp_opt_info() function fails and sets the value of errno to EAFNOSUPPORT.