ipv6

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

ActiveMQ - Connect time out on IPV6 address

Problem:- ActiveMQ is installed on a linux machine which can be reachable by ping6. When broker URL is given as hostname, the messages are consumed. However, as soon as I specify broker URL in IPV6 format, I get connection timeout error. Broker URL:- tcp://[fe80::XXX:XXXX:XXXX:XXXX]:61616?wireFormat.maxInactivityDuration=1000 Error:- ...

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

What is the IPv6 alternative to socket.getfqdn in Python?

socket.getfqdn() works fine with IPv4 addresses, for example: >>> import socket >>> socket.getfqdn("8.8.8.8") 'google-public-dns-a.google.com' However, it doesn't work for IPv6 addresses. >>> socket.getfqdn("2404:6800:8004::68") '2404:6800:8004::68' >>> socket.has_ipv6 True How can I do this with IPv6? Ideally with only modules in...

any ipv6 idea, how to get the RTP streams with the ipv6. vlan apparently doesnot support .

Hello, Can you please help me with any ideas on generating the RTP streams with the ipv6 ? I have tried with vlan , no success/ even i donot mind, getting raw dump of this stream, i just need to test ... thankyou, Any help will be very much appreciated. Priya ...

MySQL BETWEEN on unsigned bigint

I'm working on a rails app that has an IPv6 model. I'm storing the IPv6 address in 2 32-bit ints and a 64-bit int: +-----------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------------+---------------------+...

Is IP address on the same subnet as the local machine (with IPv6 support)

Does anyone have some code that will determine if an IP address (IPv4 or IPv6) is on the same subnet as the machine running the application? I've seen numerous examples of code that does this with IPv4 but I can't find any that support IPv6. ...

Getting all IPv6 addresses on a Linux server

I'd like to find all IPv6 addresses on all interfaces on a Linux server in a C++ program. I'm looking for the equivalent to GetAdaptersAddresses() on Windows. I want to do the same as "ip -6 addr show" does. How "ip" do this ? strace didn't really enlighten me. ...

expand an IPv6 address so I can print it to stdout

I am using getifaddrs() and inet_ntop() to get the ip addresses on the system. When the system is set to IPv6 the address returned is in the shortened version (using :: for zeros). Is there any way to expand that address to a full one? This is the code I am using: struct ifaddrs *myaddrs, *ifa; void *in_addr; char buf[64]; if(getifadd...

Java Library for converting a long IPv6 adress into its compressed form

hello everyone, i would like to know, whether there is a library which I can use to convert a represenation of a long IPv6 adress (such as 2002:9876:57AB:0000:0000:0000:0000:0001) into the compressed IPv6 form (in this case: 2002:9876:57AB::1). I was not able to find such a library. This library should not use any IP Api, a network con...

Socket.Connect with a IPv6 address throws a "Address Family Not supported" Error

I am trying to do a Socket.Connect() and when the IP address that i specify is in ipv6 format, the Socket.Connect() fails with the error message : Address family not supported by protocol family. An address incompatible with the requested protocol was used. All sockets are created with an associated address family (that is, AF_INET for ...

How to create IPv6 socket at python? Why got the socket.error: (22, 'Invalid argument') ?

I want to ceate Ipv6 socket at python, I do it like this: #!/usr/bin/env python import sys import struct import socket host = 'fe80::225:b3ff:fe26:576' sa = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) sa.bind((host , 50000)) But it failed: socket.error: (22, 'Invalid argument') ? Can anyone help me? thanks! I redo it like t...

Simple IPV6 Address Question

Hello, I have a /96 block of IPV6 addresses and i'm wondering how i could some how find the next address (Since ipv6 addresses can contain numbers and letters). I know the first address could be in numbers but i've yet to find out how i could really find in some kind of order for that amount of addresses E.G: What technique could i use...

Finding matching IPv6 addresses based on an input string.

Hi, I need some help with finding network interfaces based on a provided IP address. I need a cross-platform way to reliably find the local interface that has the given address in both IPv4 and IPv6 formats. I created the attached program to take an IP address as a string and search through the results of getifaddrs. The reason is th...

Listening for IPv6 multicasts on Linux

I'm trying to get a simple multicasting example to work on Linux (I've tried both RHEL 4 2.6.9 and Ubuntu 8.04 2.6.24). The general idea is that I would like the server to bind to a unicast address and then add itself to the group ff02::1. I would then like it to receive multicasts sent to ff02::1. The code below works on Mac OS X 10.5 (...

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 raw socket libraries? Any language...

Does anyone know of IPv6 raw socket libraries, and the associated languages? Specifically I am looking to be able to craft any arbitrary IPv6 package and put it on the wire. Does this exist yet? ...

Why the connect failed for ipv6 at python?

Why the connect failed for ipv6 ?? # python >>> import socket >>> s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) >>> sa = ('2000::1',2000,0,0) >>> s.connect(sa) >>> sa = ('fe80::21b:78ff:fe30:7c6', 2000, 0, 0) >>> s.connect(sa) Traceback (most recent call last): File "<stdin>", l...