Subject: SIOCGIFaaa ioctls and IPv6 interfaces

From: Kristine Adamson <[email-masked]>
Date: Wed, 4 Feb 2004 07:28:13 -0500

Hello,
   Are there any interface ioctl() function calls, similar to the 
SIOCGIFaaa calls, that we could use to retrieve data about IPv6 
interfaces?  Thanks!

Kristine Adamson
IBM Communications Server for MVS: TCP/IP Development
Internet e-mail:[email-masked]

---

From: [email-masked]
Date: Thu, 05 Feb 2004 00:01:36 +1100

> Internet e-mail:[email-masked]

	There are heaps.  Every vendor has their own set which
	make life fun for anyone that need to actually do it.

	Note there are duplicate MACRO names that take different
	arguements.  There are duplicate structure names with
	different contents.

	None of it is well documented.

	Mark
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: [email-masked]

--------------------------------------------------------------------
IETF IPv6 working group mailing list
[email-masked]
Administrative Requests: https://www1.ietf.org/mailman/listinfo/ipv6
--------------------------------------------------------------------

---

From: Kristine Adamson <[email-masked]>
Date: Wed, 4 Feb 2004 09:59:37 -0500

Thanks for the feedback.  Was there ever any discussion in the IPv6 
working group in regards to creating a standard set of ioctl() function 
calls, similar to the SIOCGIFaaa ioctls, the could either be used wit IPv6 
interfaces, or which could be used with both IPv4 and IPv6 interfaces 
(i.e., version-neutral)?

Kristine Adamson

---

From: [email-masked]
Date: Thu, 05 Feb 2004 09:33:38 +1100

> This is a multipart message in MIME format.
> --=_alternative 005269DC85256E30_=
> Content-Type: text/plain; charset="US-ASCII"
> 

	Not that I can remember.  Some have getifaddrs(3).  Which is
	a little higher.

---

From: JINMEI Tatuya / 神明達哉 <[email-masked]>
Date: Thu, 05 Feb 2004 13:04:33 +0900

>>>>> On Thu, 05 Feb 2004 09:33:38 +1100, 
>>>>> [email-masked] said:

> 	Not that I can remember.  Some have getifaddrs(3).  Which is

I've always been hoping that getifaddrs(3) is officially standardized
and deployed.  Aside from the portability issue, SIOCGIFxxx ioctl has
many pitfalls for application programmers.  To name a few:

- buffer size estimation and try-and-error
- OS/architecture dependent alignment
- consideration for the existence (or non-existence) of the sa_len
  member (to advance the pointer in the buffer correctly)

Many applications I've seen have fallen into some of the pits.  Other
OS-dependent low-layer interfaces like SIOCGIFxxx have similar
pitfalls.

getifaddrs(3) solves all the problems.  If we can widely deploy a
high-level interface like this one, it would help application
programmers very much and make applications more accurate and robust.
(Of course, OS vendors will still need to deal with low-level
interfaces to implement the library)

I know the IETF isn't the most appropriate place to discuss this type
of thing, but does it help to write a short informational I-D
describing the specification with some recommendation?

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					[email-masked]

---

From: Kristine Adamson <[email-masked]>
Date: Thu, 5 Feb 2004 09:43:00 -0500

> describing the specification with some recommendation?

We have received many questions from vendors about what APIs can provide 
the same information as the SIOCGIFaaa ioctls, for IPv6 
addresses/interfaces.  I thought that this subject may have been discussed 
as part of the IPv6 API discussions that produced the basic/advanced 
socket RFCs.  So, if getifaddrs(3) seems to be the de facto standard for 
retrieving this information, then I think it would be great if the IPv6 
working group published something to try to recommend it as the standard 
for this function, in order to ensure greater portability of applications.

In regards to getifaddrs(3), for IPv6 I assume that the netmask field 
contain a 16-octet mask in the sockaddr_in6 structure, correct?  There 
doesn't appear to be a returned field that contains the prefix length. 

> [email-masked]

Thanks,

Kristine Adamson

---

From: JINMEI Tatuya / 神明達哉 <[email-masked]>
Date: Mon, 01 Mar 2004 10:01:44 +0900

Sorry for not responding sooner...

>>>>> On Thu, 5 Feb 2004 09:43:00 -0500, 
>>>>> Kristine Adamson <[email-masked]> said:

> for this function, in order to ensure greater portability of applications.

I don't think getifaddrs(3) is a defact standard for now (only a few
platforms support it), but I believe we need this kind of high level
interface and getifaddrs(3) can be a good candidate for this purpose.

> doesn't appear to be a returned field that contains the prefix length. 

Yes, that's correct.  getifaddrs(3) is designed as a generic,
AF-independent library, so it returns a netmask even for an IPv6
address.  Applications need to convert the netmask to a prefix length
if necessary.

					JINMEI, Tatuya