ipv4

Porting getifaddrs to Win XP

Hi all, I'm trying to port a MacOSX app to windows and I've come up against a problem around getifaddrs. Basically windows does not support it. I'm trying to figure a way to re-implement it (for AF_INET and AF_INET6) but the "equivalent" functionality on windows appears to be nothing like the MacOSX support. Has someone done this sor...

Java regex for accepting a valid hostname,IPv4, or IPv6 address.

Anyone have a good (preferably tested) regex for accpeting only a valid DNS hostname, IPv4 or IPv6 address? ...

Why request.getRemoteAddr() returns ipv4 or ipv6 depending on context (post query or ajax query)

Hello, I've donne a web app with Spring/GWT that uses Flash to upload files. When I send an ajax request with GWT and try to get the user ip address, I get an ipv4 address like: 127.0.0.1 but when I upload my files with flash (and so a post request on the same webapp) I get an ipv6 address 0:0:0:0:0:0:0:1 I use the same code to get ...

TCP connection basics

Hi, This a basic doubt, but I wanted to know that if establish two TCP connections between the same two machines, will the packets in both the connection follow the same path(same link and nodes). The reason why I am asking this is because I want to measure the bandwidth between the two machines for both IPv4 and Ipv6 TCP connection and...

What changes needed to support IPv6

What changes website needed to support IPv6 and IPv4? Also using socket service in java what changes i require to accept both type of connection ? Environment OS - Linux Webserver - Tomcat 5.5 ...

PHP Convert IPv6 to binary(/memory) representation

Title says it all. I already "did" this for IPv4; $ip = '127.0.0.1'; // example $ip = explode('.',$ip); if( count($ip) != 4 ) $ip = array(0,0,0,0); // wrong ip format, default to 0.0.0.0 return chr($ip[0]) . chr($ip[1]) . chr($ip[2]) . chr($ip[3]); I need to do the above for IPv6 as well. Reading through the IPv6 spec, (I admit I didn...

When will IPv4 addresses run out ?

From years I am hearing that soon IPv4 address will run out. When will it happen? When will we see IPv6 only application? ...

getaddrinfo inconsistent behavior

I'm using getaddrinfo to start a local server accepting connections only on the localhost: struct addrinfo *res; struct addrinfo hints = {0}; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; getaddrinfo(NULL, portbuf, &hints, &res); This seems to work fine, giving me the IPv6 address ::1 w...

How to ensure that a server listens on IPv6 if possible and IPv4 otherwise?

I am trying to write a server application that listens to both IPv6 and IPv4 connections. The proper way to accomplish this seems to be listening on IPv6 address, which will also accept IPv4 connections. The relevant piece of code is: memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints....

How to store both IPv4 or IPv6 in single column in SQL Server?

shall I use binary(16)? or varbinary(16)? I know I can use getAddress() in java.net.InetAddress (Java) or System.Net.IPAddress (C#) to get a byte[] representation of both IPv4 and IPv6, but if I need to insert IPv4 i.e. binary(4) into a binary(16) field in SQL Server, do I need to worry about padding or anything? Thanks ...

IPv6 to IPv4 inter-conversion in C#

I have a list of IP's in IPv4 format that i have collected from previous HttpRequest objects that my web-server received. I have a java applet which gives IP addresses in Ipv6 format(java applet returns a bunch of data along with the IP address). I need to check if the IP returned by the applet matches any item from list. How do inter-...

trying to pass from hex(base 16) to dec to ip6 /proc/net/tcp6

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_IN...

Java application wanting to use both Inet4Address and Inet6Address at the same time

I have a Java application that needs to connect via sockets to two different servers on two separate machines. One server has been configured to listen on IPv4 connections, while the other has been configured to listen on IPv6 connections. Now, assuming "host1" is the machine name of the server listening on IPv4 connections, while "hos...

IPv6 lookup data structure

A patricia trie is the well-know, recommended data structure for storing IPv4 allocations/assignments and performing lookup. Is this true for IPv6 adddresses too? Just a deeper/taller trie to accommodate the extra 96 bits? Is the trie still patricia, or a different radix trie? ...

Java: URL.openStream() - use IPv4

By default url.openStream(); uses IPv6. My schools server silently blocks IPv6. This causes url.openStream(); to hang for 3 minutes and 15 seconds. Is there a way that I can get url.openStream() to use IPv4 by default? ...

PHP: Proper way to store IP in MySql and quickest way to search for IP throughout millions of rows.

I'm storing IPv4 addresses in a "int unsigned" column type with inet_aton. [Am I doing this right? And is using "unsigned" necessary?] This particular column is indexed as well. Since there will be millions of rows and multiple rows containing the same IP throughout the entire table what will be the fastest way to search for these rows? ...