man atoa () - convert a string to an address

NAME

atoa - convert a string to an address

LIBRARIES

Abz Library (-labz), Debug Library (-ldebug)

SYNOPSIS

#include <abz/atop.h>

int atoa(in_addr_t *addr, const char *str);

DESCRIPTION

The atoa() function converts a string to an address. The string may either be a hostname or an ip address.

The address is stored in network byte order.

RETURN VALUE

The atoa() function returns 0 if successful or -1 if some error occurred. Check errno to see what error occurred.

NOTES

None of the libabz routines are thread-safe. I'm not planning to change this either! For more information, please see http://threading.2038bug.com/

If the library was compiled without the GETHOSTBYNAME flag, only ip addresses may be specified.

At the time of writing, the glibc library gethostbyname() function had a bug which caused it to resolve some invalid hostnames. In order to detect those cases, the atoa() function also does a reverse lookup using gethostbyaddr() to see if the domain really exist.

SEE ALSO

AUTHOR

Written by Abraham vd Merwe <abz@blio.com>