#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdlib.h>

int main (void) {

  struct in_addr *myaddress;
  char *ipaddr, *ipaddr2;
  int res;

  myaddress = (struct in_addr *) malloc (sizeof (struct in_addr));
  ipaddr = (char *) malloc (50);
  ipaddr2 = (char *) malloc (50);

  res = inet_pton (AF_INET, "195.227.115.163", (void*) myaddress);

  printf ("\ninet_pton: %d", res);

  ipaddr2 = inet_ntop (AF_INET, myaddress, ipaddr, INET_ADDRSTRLEN);

  printf ("\ninet_ntop: %s", ipaddr2);
}

