Convert a string into an Internet address stored in a structure
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> int inet_aton( const char * cp, struct in_addr * addr );
- A pointer to the character string.
- A pointer to a in_addr structure where the function can store the converted address.
Use the -l socket option to qcc to link against this library.
The inet_aton() routine interprets the specified character string as an IPv4 Internet address, placing the address into the structure provided.
All Internet addresses are returned in network byte order (bytes are ordered from left to right). All network numbers and local address parts are returned as machine-format integer values.
For more information on Internet addresses, see inet_net_ntop().
- Success; the string was successfully interpreted.
- Failure; the string is invalid.