zkInet_addr, zkInet_ntoa, zkInet_aton - Internet address manipulation
#include "zkArpaInet.h"
in_addr_t
zkInet_addr
(const char *cp);
char*
zkInet_ntoa(struct in_addr in);
int
zkInet_aton(const char* cp, struct in_addr* inp);
The zkInet_addr() function converts the string pointed to by cp, in the Internet standard dot notation, to an integer value suitable for use as an Internet address.
The inet_ntoa() function converts the Internet host address specified by in to a string in the Internet standard dot notation.
The zkInet_aton() function converts the string pointed to by cp, in the Internet standard dot notation, into binary data and stores it in the structure that inp points to.
All Internet addresses are returned in network order (bytes ordered from left to right).
Values specified using dot notation must take the following form:
- a.b.c.d
- Each part is interpreted as a byte of data and assigned, from left to right, to the four bytes of an Internet address.
All numbers supplied as parts in dot notation must be decimal.
Upon successful completion, zkInet_addr() returns the Internet address. Otherwise, it returns (in_addr_t)(-1).
The zkInet_ntoa() function returns a pointer to the network address in Internet-standard dot notation.
Upon successful completion, zkInet_aton() returns a non-zero value. Otherwise, it returns zero.
No errors are defined.
The return value of inet_ntoa() may point to static data that may be overwritten by subsequent calls to inet_ntoa().