Interface indexes are more precise (i.e. constrained) than zone ids.
That is, a zone id may identify a set of equivalent interfaces, whereas an 
ifindex identifies exactly one.
A zone id is sufficient to uniquely identify an address.
If you want to constrain which interface among an equivalent set, then you need 
an ifindex.
For most purposes zoneid is what you want.
Ifindex is generally only used when doing multicast, since the multicast APIs 
allow apps to specify which interface to join/send on.

> -----Original Message-----
> From: Thiago Macieira [mailto:thiago.macieira at intel.com]
> Sent: Tuesday, July 26, 2016 7:19 PM
> To: Dave Thaler <dthaler at microsoft.com>
> Cc: ???(Uze Choi) <uzchoi at samsung.com>; iotivity-dev at lists.iotivity.org
> Subject: Re: [dev] OcResource->getHost() api gives a tricky host address in
> Android
> 
> On quarta-feira, 27 de julho de 2016 02:00:35 PDT Dave Thaler wrote:
> > BTW, the ZoneID is *not* an ifindex, it is a zone id.  (See RFC 4007.)
> > On some platforms, the zone id of a link local address might happen to
> > be an ifindex, but any code that blindly assumes for all OS's is
> > inherently broken.
> 
> True, but that can mean one of two things, mutually exclusive:
> 
> a) an ifindex suffices to uniquely identify the interface/link that the packet
> should be sent on and replies are expected to come in from, in which case all
> we need is a way to convert any extra information that may appear on the
> ZoneID to that ifindex. It may be an interface name (if_nametoindex) or the
> interface's link-local address, its UUID, whatever.
> 
> or
> 
> b) an ifindex does not suffice, in which case we need to review our API and
> internals, which relies extensively on ifindex. The front-end API should
> accept something that is larger than a simple 32-bit integer.
> 
> Either way, it seems to me that ZoneIDs are superior than interface indexes.
> 
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center

Reply via email to