z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


setibmopt()

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

The setibmopt() call chooses the TCP/IP image with which to connect. It is used in conjunction with getibmopt(), which returns the number of TCP/IP images installed on a given MVS™ system and their names, versions, and states. With this information, the caller can dynamically choose the TCP/IP image with which to connect through the setibmopt() call.

Note: Images from pre-V3R2 releases of TCP/IP for MVS are excluded. The setibmopt() call is not meaningful for pre-V3R2 releases.

The setibmopt() call is optional. If setibmopt is not used, the standard method for determining the connecting TCP/IP image is followed. If setibmopt is used, it must be issued before any other socket calls that establish the connection to TCP/IP.

#include <manifest.h>
#include <socket.h>
 
int setibmopt(int cmd, struct ibm_tcpimage *buf)
 
struct ibm_tcpimage {
    unsigned short status;
    unsigned short version;
    char name[8];
}
 
Parameter
Description
cmd
The command to perform. For TCP/IP V3R2 for MVS, IBMTCP_IMAGE is supported.
buf
The address of the buffer to be used.

Parameter buf is the address of the struct ibm_tcpimage buffer containing the name and version of the TCP/IP image to which the caller wants to connect. The name must be left-justified and padded with blanks. The TCP/IP name is always the PROC name, left-justified and padded with blanks. The TCP/IP version and status are ignored. The caller is responsible to specify name before issuing the call. If setibmopt is not one of the active TCP/IP supported images on the system, subsequent socket calls will fail. This call checks the validity of the contents of the name field in the structure pointed to by buf. It checks the validity by verifying that the TCP/IP name is in the list generated by a getibmopt () call. It does not check the status or version fields. This call sets the image of the connection to be created on another call.

Typically, the caller issues getibmopt() to verify the choice for the TCP/IP image. On successful return, the caller's choice will be honored when attempting the connection to TCP/IP.

Return values

A 0 indicates success; the value -1 indicates an error. Errno identifies the specific error.
Errno
Description
EOPNOTSUPP
This is not supported in this release of TCP/IP.
EALREADY
Your program is already connected to a TCP/IP image.
EFAULT
Using buf would result in an attempt to copy the address into a portion of the caller address space into which information cannot be written.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014