Using common INET

With Common INET (CINET), you have the capability to define up to 32 AF_INET or dual AF_INET/AF_INET6 transport providers or stacks. The stacks can all be active at the same time. The information for modifying BPXPRMxx and bringing up Common INET is in z/OS UNIX System Services Planning.

For a server that you want to be able to listen to all of the available stacks at the same time, specify INADDR_ANY and it will be listening to all at once. Note that for an IPv6 server, IN6ADDR_ANY can be specified allowing the server to listen for IPv4 and IPv6 connections from all stacks.

The z/OS® UNIX Common INET layer performs a multiplexing/demultiplexing function when more than one stack is activated under z/OS UNIX. Each stack has its own home IP addresses and when a program binds to a specific IP address that socket becomes associated with the one stack that is that IP address. When a program binds to NADDR_ANY (0.0.0.0) or IN6ADDR_ANY (::), the socket remains available to all the stacks.

There are three ways that an INADDR_ANY or IN6ADDR_ANY program can associate itself with a single stack:

Also, you should be able to set up things so gethostbyname() or getaddrinfo() returns the home IP address of the local TCP/IP you are interested. With that, you can issue a specific bind() to that IP address. This may not be useful though, if that stack has multiple IP addresses and you really want to use INADDR_ANY to service all of them. Applications can bind to IN6ADDR_ANY to service both Ipv4 and IPv6 clients when TCP/IP is enabled for IPv6.