inet_netof()--Separate Network Portion of IP Address


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

 int inet_netof(struct in_addr internet_address)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes




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

 in_addr_t inet_netof(struct in_addr internet_address)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes



The inet_netof() function is used to extract the network portion of an IP address.

There are two versions of the API, as shown above. The base i5/OS 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

internet_address
(Input) The 32-bit IP address from which the network portion of the address is to be extracted.

Authorities

No authorization is required.


Return Value

inet_netof() returns an integer. Possible values are:


Usage Notes

  1. 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_netof() API is mapped to qso_inet_netof98().

Related Information



API introduced: V3R1
Top | UNIX-Type APIs | APIs by category