Converts an Internet address into an ASCII string.
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h>
char *inet_ntoa (InternetAddr) struct in_addr InternetAddr;
The inet_ntoa subroutine takes an Internet address and returns an ASCII string representing the Internet address in dot notation. All Internet addresses are returned in network order, with the first byte being the high-order byte.
Use C language integers when specifying each part of a dot notation.
InternetAddr | Contains the Internet address to be converted to ASCII. |
Upon successful completion, the inet_ntoa subroutine returns an Internet address.
If the inet_ntoa subroutine is unsuccessful, the subroutine returns a -1.
The inet_ntoa subroutine is part of Base Operating System (BOS) Runtime.
All applications containing the inet_ntoa subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
/etc/hosts | |
Contains host names. | |
/etc/networks | |
Contains network names. |
The endhostent subroutine, endnetent subroutine, gethostbyaddr subroutine, gethostbyname subroutine, getnetbyaddr subroutine, getnetbyname subroutine, getnetent subroutine, inet_addr subroutine, inet_lnaof subroutine, inet_makeaddr subroutine, inet_network subroutine, sethostent subroutine, setnetent subroutine.
Sockets Overview and Understanding Network Address Translation in AIX Version 4.3 Communications Programming Concepts.