Hi,
im reading the content of the file /proc/net/tcp6
and trying to transform that notation of ip6 into a '0::1' like
previously with ipv4 y use the next method.
struct sockaddr_in tmp_ip;
char ip_str[30];
char ipex[]='00000AF0'; /*read from the file /proc/net/tcp */
tmp_ip.sin_addr.s_addr=(int)strtoll(ipex,NULL,16);
inet_ntop(AF_INET,&tmp_ip.sin_addr,ip_str,60);
printf("ip=%s \n",ip_str);
but with ipv6 the content of /proc/net/tcp6 its bigger(33 hex chars) and maybe i need to use sockaddr_in6, but the variable sin6_addr.s6_addr is a array, not a single log unsigned int (like sin_addr.s_addr)
so in resume. i trying to pass this
0000000000000000FFFF00001F00C80A
to something like
::ffff:10.200.0.31
edit..
mmm maybe if i decompose that ex into 16 ex digits and feed the array in sin6_addr.s_addr. Because 1F00C80A = 10.200.0.31(passing throught ntop function)