hg: jdk7/jsn/jdk: 6717876: Make java.net.NetworkInterface.getIndex() public
Alan.Bateman at Sun.COM
Thu Aug 28 04:16:21 PDT 2008
Mark Wielaard wrote:
> This seems to introduce a new public API in the java.net package.
> I was wondering how that works for someone that wants to introduce
> such things in openjdk.
There is still some infrastructure and process that isn't externalized
yet. The change approval process for API additions and behavior changes
is one of them. In the interim, this means finding a buddy or sponsor to
work with when proposing updates to APIs. I'm happy to act as a proxy in
the interim and I'm sure others are too.
> I do see the bug report that mentions making
> this public should be done for JDK7. But there seems to missing a real
> justification for adding these new interfaces. Is there any policy for
> introducing such new public interfaces?
> I might be reading this wrongly but it seems the only thing this API
> does is expose some random internal "index" numbers for an
> NetworkInterface. Seeing that there are no guarantees on whether there
> are index numbers in the first place for any or all interfaces it seems
> not that useful imho. An example of how an application would use this
> new interface would be nice to get a better idea in what situations
> this would be used.
Jessie is the best person to answer this but if my memory is correct,
exposing the index was first discussed back in 1.4 as part of the API
changes required to support IPv6. The index is mostly used to identify
the interface when doing IPv6 multicasting and the getByIndex/getIndex
methods were to be the approximate equivalent of RFC 2133's
if_nametoindex and if_indextoname. In jdk5 the IPv6 support was updated
to support IPv6 scoped addresses. This is important to disambiguate the
destination when there are multiple interfaces and hosts with non-global
addresses. Typically the scope identifier is the interface index so it
has been exposed since jdk5. Jessie's updates, while niche, go further
to completing this API.
More information about the net-dev