inet_ntoa()--Translate IP Address to Dotted Decimal Format
Syntax
#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> char *inet_ntoa(struct in_addr internet_address)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: No; see Usage Notes.
The inet_ntoa() function is used to translate an Internet address from a 32-bit IP address to dotted decimal format.
Authorities and Locks
None.
Parameters
- internet_address
- (Input) The 32-bit IP address that is to be converted to dotted decimal format.
Return Value
inet_ntoa() returns one of the following values:
- NULL (unsuccessful)
- s (where s is the pointer to the Internet address in dotted decimal format)
Usage Notes
- The pointer returned by inet_ntoa() points to static storage that
is overridden on subsequent inet_ntoa() functions.
- Do not use the inet_ntoa() function in a multithreaded environment. See the multithread alternative inet_ntoa_r function.
API introduced: V4R2