sctp_opt_info Subroutine

Purpose

Passes information both into and out of SCTP stack.

Library

Standard C Library (libc.a)

Syntax

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

int sctp_opt_info(sd, id, opt, *arg_size, *size);
int sd;
sctp_assoc_t id;
int opt;
void *arg_size;
size_t *size;

Description

Applications use the sctp_opt_info subroutine to get information about various SCTP socket options from the stack. For the sockets with multiple associations, the association ID can be specified to apply the operation on any particular association of a socket. Because an SCTP association supports multihoming, this operation can be used to specify any particular peer address using a sockaddr_storage structure. In this case, the result of the operation will be applied to only that particular peer address.

Implementation Specifics

The sctp_opt_info subroutine is part of Base Operating System (BOS) Runtime.

Parameters

Item Description
sd Specifies the UDP style socket descriptor returned from the socket system call.
id Specifies the identifier of the association to query.
opt Specifies the socket option to get.
arg_size Specifies an option specific structure buffer provided by the caller.
size Specifies the size of the option returned.

Return Values

Upon successful completion, the sctp_opt_info subroutine returns 0.

If the sctp_opt_info subroutine is unsuccessful, the subroutine handler returns a value of -1 to the calling program and sets errno to the appropriate error code.

Error Codes

The sctp_opt_info subroutine is unsuccessful if any of the following errors occurs:

Item Description
EFAULT Indicates that the user has insufficient authority to access the data, or the address specified in the uaddr parameter is not valid.
EIO Indicates that a permanent I/O error occurred while referencing data.
ENOMEM Indicates insufficient memory for the required paging operation.
ENOSPC Indicates insufficient file system or paging space.
ENOBUFS Insufficient resources were available in the system to complete the call.
ENOPROTOOPT Protocol not available.
ENOTSOCK Indicates that the user has tried to do a socket operation on a non-socket.