ipv6

What was the motivation for adding the IPV6_V6ONLY flag?

In IPv6 networking, the IPV6_V6ONLY flag is used to ensure that a socket will only use IPv6, and in particular that IPv4-to-IPv6 mapping won't be used for that socket. On many OS's, the IPV6_V6ONLY is not set by default, but on some OS's (e.g. Windows 7), it is set by default. My question is: What was the motivation for introducing th...

Gethostname and IPv6

Microsoft recommends not to use 'gethostname' on IPv6 and instead use 'getaddrinfo' or 'getnameinfo'. http://msdn.microsoft.com/en-us/library/ms899604.aspx But 'gethostname' doesn't seem to have any problem working on IPv6. Does anyone know any reason why 'gethostname' is not recommended on IPv6? ...

How can I calculate an optimal UDP packet size for a datastream?

Short radio link with a data source attached with a needed throughput of 1280 Kbps over IPv6 with a UDP Stop-and-wait protocol, no other clients or noticeable noise sources in the area. How on earth can I calculate what the best packet size is to minimise overhead? UPDATE I thought it would be an idea to show my working so far: IPv6 ha...

Comparing a peer's IPv6 address with localhost

I have called getpeername on my connected socket and now have an IPv6 address of the connected peer. How do I tell whether my peer's IP address is localhost? Edit: To clarify, I mean specifically localhost, as in the loopback IP address. ...

what does "dead beef" mean?

Hi there: What does the word "dead beef" mean? I read it from a interview question. It has something to do with ipv6. I figured it could be a random hex number used for examples, like "The quick brown fox jumps over the lazy dog". Is my understanding correct? Or it has more significant meaning? Thanks! ...

Passing a hostname of over 255 characters to getaddrinfo causes a getaddrinfo failed: memory allocation failure why?

I am currently upgrading our software to support ipv6 and in the meantime I'm expanding hostname/ip fields to the max hostname size. In sun documentation it seems like this can be up to 1025 (netdb.h:#define NI_MAXHOST 1025 - this is the recommended hostname allocation define), but when I pass a hostname of over 255 to getaddrinfo I get ...

API for configuring static IP addresses in an android application

Is it possible to set the IP address of an interface in Android within an application? I can query the available interfaces and their current addresses using java.net.NetworkInterface, but this doesn't provide a facility to change these. Did I just miss something somewhere or is it not allowed? I was hoping to be able to make my applica...

Converting an IP address to a number:

Question: When I convert the IP address 192.168.115.67 to a number, is it done like this: 192*256^3 + 168*256^2+115*256^1+67*256^0 = 3232265027 or like this: 192*256^0 + 168*256^1+115*256^2+67*256^3 = 1131653312 I find both variants online, and frankly it doesn't matter as long as I do all the internal IP-range comparison using the sam...

IPv6 parsing in C

I wanted to know how i can parse an IPv6 address in 'C' and convert it to a 128 bit value? So a hex address like 1:22:333:aaaa:b:c:d:e:f needs to be converted to its 128 bit equivalent binary. The problem is the IP address could be of the type ::2 and its variant since they are valid IPv6 address. The input is from the keyboard and henc...

Saving an IP adddress to DB

I want to save a user's IP address to my database just in case any legal issues come up and we need to track down who performed what action. Since I highly doubt I will ever actually need to use this data (well, maybe for counting unique hits or something) do you think I can just dump the REMOTE_ADDR into a field? If so, what should the ...

IPV6 link local multicasting.

I'm trying to figure out how to do the equivalent of an IPV4 broadcast using IPV6. I'm creating a non-blocking IPV6 UDP socket. From the side broadcasting i'm literally just doing a sendto "FF02::1" on port 12346. On the listen side I discovered I need to join the group so I did the following: ipv6_mreq membership; memset( ...

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

Programmatically check if IPv6 is enabled on windows

Is there a way to programmatically check if IPv6 is installed/enabled on windows using c++? Either at an interface level, or system wide. ...

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

setting IPV6 in command line, Win PE

Hi Team, Can i set the IPv6 ip address in command line? if possible please suggest me the command to use. I am using I am using WinPE environment which is equalant to VISTA but with out GUI features installed. Thank you. ...

IPv6 Zone index and scope_id

How does the zone index relate to the scope_id in the sockaddr_in6 structure? The functionality appears to differ between platforms and I'd love to know how they relate. Windows for example has a SCOPE_ID structure (as well as just a 32-bit value). Mac OSX only has a 32-bit value. Obviously the 32-bit value is the way to go but how e...

Send and receive IPv6 link-local multicast UDP datagrams in Python?

This following is a straightforward IPv4 UDP broadcast, followed by listening on all interfaces. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, True) sock.bind(("", 1337)) sock.sendto("hello world", ("255.255.255.255", 1337)) while True: data, addr = sock.recvfrom(0x10...

How to read TENTATIVE flag of IPv6 Address ?

I am assigning ipv6 address using ioctl() system call prgramtically. I want to know if there is a way, i can find the assigned ip is tentative/duplicate ? Thanks. ...

Get all IPv6 addresses on all interfaces (Windows)

I have a solution using WMI, unfortunately only on Windows Vista and above. On WinXP/2003 WMI will only return IPv4 adresses. Is there any way to get all assigned addresses including IPv6 ones on WinXP? Adt: No .NET, just WMI or WinAPI please. ...