inet_makeaddr()--Combine Network Portion and Host Portion to Make IP Address


  BSD 4.3 Syntax
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <arpa/inet.h>

 struct in_addr inet_makeaddr(int network_address,
                             int host_address)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes



  UNIX® 98 Compatible Syntax
  #define _XOPEN_SOURCE 520
  #include <arpa/inet.h>

  struct in_addr inet_makeaddr(in_addr_t network_address,
                             in_addr_t host_address)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes


The inet_makeaddr() function is used to generate a 32-bit IP address from the 32-bit network IP address and the local address of the host.

There are two versions of the API, as shown above. The base IBM® i API uses BSD 4.3 structures and syntax. The other uses syntax and structures compatible with the UNIX 98 programming interface specifications. You can select the UNIX 98 compatible interface with the _XOPEN_SOURCE macro.


Parameters

network_address
(Input) The 32-bit network IP address.

host_address
(Input) The local host address.

Authorities

No authorization is required.


Return Value

inet_makeaddr() returns an integer. Possible values are:

When you develop in C-based languages and an application is compiled with the _XOPEN_SOURCE macro defined to the value 520 or greater, the inet_makeaddress() API is mapped to qso_inet_makeaddress98().


Related Information



API introduced: V3R1

[ Back to top | UNIX-Type APIs | APIs by category ]