setibmopt() — Set IBM® TCP/IP image

Standards

Standards / Extensions C or C++ Dependencies
z/OS® UNIX both  

Format

#define _OPEN_SYS_SOCK_EXT
#include <sys/socket.h>

int setibmopt(int cmd, struct ibm_tcpimage *bfrp);

General description

The setibmopt() function call is used to set TCP/IP options. Currently, the only supported command is IBMTCP_IMAGE which allows the setibmopt() to choose the active TCP/IP image stack the application will connect to.

To reset ibm_tcpimage to nothing chosen, set the name to all blanks.

The chosen transport is inherited over fork() and preserved over exec(). If this is not desired, the child process should call setibmopt() with a blank name to reset the TCP/IP image for the child.
Parameter
Description
cmd
The value in cmd must be set to the command to be performed. Currently, only IBMTCP_IMAGE is supported and must be paired with the bfrp parameter as described.
bfrp
The pointer to a ibm_tcpimage structure.
To set the TCP/IP image for a socket, the application should set values in the ibm_tpcimage structure as follows:
Element
Description
status
0 means is not known and need not be checked. Currently, this is the only value with meaning.
version
0 means the version is to be set on return if known.
name
The name must be left justified, uppercase, padded with blanks, and be the name of an active TCP stack.

Returned value

If successful, setibmopt() returns 0.

If unsuccessful, setibmopt() returns -1 and sets errno to one of the following values:
Error Code
Description
EFAULT
Using the bfrp supplied would result in access of a storage location that is inaccessible.
EIBMBADTCPNAME
A name of a PFS was specified that either is not configured or is not a Sockets PFS.
EOPNOTSUPP
The cmd is a function that is not supported.
ENXIO
The name that was specified did not match an AF_INET socket stack, but Common Inet is not configured on this system. Because this system does not have multiple AF_INET socket transports configured, there is already a natural affinity to one single stack, and this failure may not be a problem for the application.

Related information