The getibmopt() call returns the number of TCP/IP images installed on a given MVS™ system, and their status, version, and name.
#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];
}
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.
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.