The function is called inet_aton .
int inet_aton(const char *cp, struct in_addr *inp);
The in_addr structure is defined in <netinet/in.h> as:
typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; };
Of course, you can also use the newer inet_pton function.
source share