[ Team LiB ] Previous Section Next Section

9.11 sctp_opt_info Function

The sctp_opt_info function is provided for implementations that cannot use the getsockopt functions for SCTP. This inability to use the getsockopt function is because some of the SCTP socket options, for example, SCTP_STATUS, need an in-out variable to pass the association identification. For systems that cannot provide an in-out variable to the getsockopt function, the user will need to use sctp_opt_info. For systems like FreeBSD that do allow in-out variables in the socket option call, the sctp_opt_info call is a library call that repackages the arguments into the appropriate getsockopt call. For portability's sake, applications should use sctp_opt_info for all the options that require in-out variables (Section 7.10).

The call has the following format:

int sctp_opt_info(int sockfd, sctp_assoc_t assoc_id, int opt void *arg, socklen_t *siz);

Returns: 0 for success, –1 on error

sockfd is the socket descriptor that the user would like the socket option to affect. assoc_id is the identification of the association (if any) on which the user is performing the option. opt is the socket option (as defined in Section 7.10) for SCTP. arg is the socket option argument, and siz is a pointer to a socklen_t which holds the size of the argument.

    [ Team LiB ] Previous Section Next Section