Natanael Copa wrote:
> On Wed, 2007-11-07 at 19:39 +0100, Jason Curl wrote:
>   
>> Natanael Copa wrote:
>>     
>>> Hi,
>>>
>>> Does anyone know a susv3/POSIX compliant way to list all ipv6
>>> interfaces? I bet there are no. ioctl(SIOCGIFCONF) ignores ipv6
>>> interfaces, I just tested.
>>>       
Reading through UNP (Stevens, et. al.) suggests it will work. I notice 
the socket is opened as AF_INET. Do you open AF_INET or AF_INET6?

Granted, I haven't tested and I'm only working with IPv4 at the moment 
with uClibc.

Then "sysctl()" is supposed to be the successor of "ioctl()". UNP talks 
about using the routing sockets to get the information for each 
interface (sounds similar to netlink, but different enough).
>>>   
>>>       
>> What does ifconfig do in BusyBox? Does that do what you want?
>>     
>
> talks directly to netlink, with is even more non portable.
>   
Yeah, Solaris has they're own device node to talk to that makes things 
even more interesting.
>   
>> When I implemented something across multiple platforms only for IPv4 
>> that was a real nightmare (Solaris, Linux, uClibc, FreeBSD, Cygwin).
>>     
>>> I suggest implementing a getifaddrs in uclibc, even if its not
>>> susv3/POSIX.
>>>       
>
> I checked around. if_nameindex will list all your network interfaces,
> which gets me half the way. but I still havent found out how to get a
> list of ipv6 addresses from a given device name.
>
> -nc
>   
Personally, I found it almost easier to write code for each intended 
target and wrap it with a common API. At least then it was usable for a 
bunch of different targets. FreeBSD behaves even more different to 
SIOCGIFCONF in that it reports all kinds of connections (AF_LINK also as 
well as IPv6) with duplicates.

Cheers,
Jason.
_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to