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


getibmopt()

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

The getibmopt() call returns the number of TCP/IP images installed on a given MVS™ system, and their status, version, and name.

Note: Images from pre-V3R2 releases of TCP/IP for MVS are excluded. The getibmopt() call is not meaningful to pre-V3R2 releases.
Using this information, the caller can dynamically choose the TCP/IP image with which to connect through the setibmopt() call. The getibmopt() call is optional. If it is not used, determine the connecting TCP/IP image as follows:
#include <manifest.h>
#include <socket.h>
int getibmopt(int cmd, struct ibm_gettcpinfo *buf)
struct ibm_tcpimage {
    unsigned short status;
    unsigned short version;
    char name[8];
}
struct ibm_gettcpinfo {
    int tcpcnt;
    struct ibm_tcpimage image[8];
}
Parameter
Description
cmd
The command to perform. For TCP/IP V3R2 for MVS, IBMTCP_IMAGE is supported.
buf
Points to the structure that the call specifies.

The buf parameter is a pointer to the (struct ibm_gettcpinfo) buffer into which the TCP/IP image status, version, and name are placed.

On successful return, the struct ibm_tcpimage buffer contains the status, version, and name of up to eight active TCP/IP images.

The status field can contain the following information:
Status Field
Meaning
X'8xxx'
Active
X'4xxx'
Terminating
X'2xxx'
Down
X'1xxx'
Stopped or stopping
Note: In the above status fields, xxx is reserved for IBM® use and can contain any value.

When this field returns with a combination of Down and Stopped, TCP/IP was abended. Value stopped, when returned alone, indicates that TCP/IP has been stopped only.

The version field for z/OS® V1R7 is X'0617'.

The TCP/IP character name field is the PROC name, left-justified, and padded with blanks.

The tcpcnt field of struct ibm_gettcpinfo is a count field into which the TCP/IP image count is placed. The caller uses this value to determine how many entries in the ibm_tcpimage structure of buf have been filled. If the tcpcnt returned is 0, there are no TCP/IP images present.

Return values

Zero indicates success; the value -1 indicates an error. Errno identifies the specific error.
Errno
Description
EOPNOTSUPP
This is returned for command that is not valid.
EFAULT
The name parameter specified an address outside of the caller address space.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014