[avahi] AXIS Cameras, Again

Lennart Poettering lennart at poettering.net
Thu Jun 28 11:33:27 PDT 2007


On Tue, 26.06.07 08:58, Mark Gollahon (mgollahon at exacq.com) wrote:

> Hello,
> 
> I've read the AXIS camera thread posted on this forum from over a year 
> ago and I would like some help on getting my code working with Avahi.
> 
> Some background - I've written my own AXIS camera "finder" utility using 
> Apple's daemon since I needed it on Windows first (no Avahi on Windows 
> yet).  I've subsequently ported it to Linux.  Now I need it to work with 
> Avahi since the newer distros are including Avahi by default.
> 
> Furthermore, this utility sends the resulting list of cameras and IP 
> addresses to a recipient that is *not* link-local, so the routeable IP 
> addresses are really what I am after.  However, I can't figure out how 
> to get Avahi to report all addresses it has so that I can do the 
> filtering - I've already got the filtering in place.
> 
> I've noticed that PING can get the routeable addresses through NSS, but 
> my utility cannot (it uses getaddrinfo() to get all addresses instead of 
> gethostbyname() like PING does).
> 
> Can someone tell me what parameters I need to use with getaddrinfo() to 
> get the routeable addresses through Avahi?

Internally there is no difference between the implementation of
getaddrinfo() and gethostbyname() when it comes to nss-mdns. If there
are multiple IP adresses defined for a single host name the IP address
that is returned by either of these functions depends on the order
the the ip addresses were send to us. Only a single IP address is
returned at max. 

When Avahi is used on the machine that registered the host name we
currently make sure only to publish the public IP address if there are
multiple defined, and fall back to IPv4ll addresses only if no public
address is defined. Also, avahi registers only a single IP addres per
interface at max. This behaviour is the right thing to do, btw,
because that way we guarantee best interoperability with clients that
do not set up IPv4ll-routes when a public address is configured. 

In short, what you try to do doesn't work with Avahi. Sorry for that.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4


More information about the avahi mailing list