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.
> -----Original Message----- > From: iotivity-dev-bounces at lists.iotivity.org [mailto:iotivity-dev- > bounces at lists.iotivity.org] On Behalf Of Thiago Macieira > Sent: Tuesday, July 26, 2016 6:50 PM > To: ???(Uze Choi) <uzchoi at samsung.com> > Cc: 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 10:12:05 PDT ???(Uze Choi) wrote: > > [UZ] constructResourceObject(String host, String uri, > > connectivityTypeSet > > ...) --> constructResourceObject(<List> Endpoints { > > addr[MAX_ADDR_STR_SIZE], ifindex...} , ...) will resolve your concern. > > I don't like this. This makes the API worse. If the ifindex can be stored in > the > URI in the form of ZoneID, why would we keep it outside? Passing a struct > instead of a string also makes the API more cumbersome to use. > > > So, > > We can exclude interface name from OCDecAddr->addr[]. > > typedef struct{ > > OCTransportAdapter adapter; /** adapter type.*/ > > OCTransportFlags flags; /** transport > > modifiers.*/ > > uint16_t port; /** for IP.*/ > > char addr[MAX_ADDR_STR_SIZE]; /** address > > for all adapters.*/ > > uint32_t ifindex; /** usually zero for > > default interface.*/ > > } OCDevAddr; > > I'm also ok with passing a list of OCDevAddr in the API instead of a list of > URIs. > > -- > Thiago Macieira - thiago.macieira (AT) intel.com > Software Architect - Intel Open Source Technology Center > > _______________________________________________ > iotivity-dev mailing list > iotivity-dev at lists.iotivity.org > https://lists.iotivity.org/mailman/listinfo/iotivity-dev
