#include <arpa/inet.h>
int inet_pton(int af, const char *src, void *dst);
inet_pton - convert IPv4 and IPv6 addresses from text to binary form
#include <arpa/inet.h>
const char *inet_ntop(int af, const void *src,
char *dst, socklen_t size);
inet_ntop - convert IPv4 and IPv6 addresses from binary to text form
htonl(),htons(),ntohl(),ntohs()
htonl, htons, ntohl, ntohs - convert values between host and network byte order
The htonl() function converts the unsigned integer hostlong from host byte order to network byte order.