]> git.meshlink.io Git - catta/commitdiff
Merge remote branch 'origin/master-tx'
authorLennart Poettering <lennart@poettering.net>
Mon, 28 Jun 2010 15:56:15 +0000 (17:56 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 28 Jun 2010 15:56:15 +0000 (17:56 +0200)
389 files changed:
Makefile.am
autogen.sh
avahi-autoipd/Makefile.am
avahi-autoipd/avahi-autoipd.action.bsd
avahi-autoipd/avahi-autoipd.action.linux
avahi-autoipd/dhclient-enter-hook.in
avahi-autoipd/dhclient-exit-hook.in
avahi-autoipd/iface-linux.c
avahi-autoipd/iface.h
avahi-autoipd/main.c
avahi-autoipd/main.h
avahi-client/Makefile.am
avahi-client/browser.c
avahi-client/check-nss-test.c
avahi-client/check-nss.c
avahi-client/client-test.c
avahi-client/client.c
avahi-client/client.h
avahi-client/entrygroup.c
avahi-client/internal.h
avahi-client/lookup.h
avahi-client/publish.h
avahi-client/resolver.c
avahi-client/rr-test.c
avahi-client/srv-test.c
avahi-client/xdg-config-test.c
avahi-client/xdg-config.c
avahi-client/xdg-config.h
avahi-common/Makefile.am
avahi-common/address.c
avahi-common/address.h
avahi-common/alternative-test.c
avahi-common/alternative.c
avahi-common/alternative.h
avahi-common/cdecl.h
avahi-common/dbus-watch-glue.c
avahi-common/dbus-watch-glue.h
avahi-common/dbus.c
avahi-common/dbus.h
avahi-common/defs.h
avahi-common/domain-test.c
avahi-common/domain.c
avahi-common/domain.h
avahi-common/error.c
avahi-common/error.h
avahi-common/gccmacro.h
avahi-common/i18n.c
avahi-common/i18n.h
avahi-common/llist.h
avahi-common/malloc.c
avahi-common/malloc.h
avahi-common/rlist.c
avahi-common/rlist.h
avahi-common/simple-watch.c
avahi-common/simple-watch.h
avahi-common/strlst-test.c
avahi-common/strlst.c
avahi-common/strlst.h
avahi-common/thread-watch.c
avahi-common/thread-watch.h
avahi-common/timeval-test.c
avahi-common/timeval.c
avahi-common/timeval.h
avahi-common/utf8-test.c
avahi-common/utf8.c
avahi-common/utf8.h
avahi-common/watch-test.c
avahi-common/watch.h
avahi-compat-howl/Makefile.am
avahi-compat-howl/address-test.c
avahi-compat-howl/address.c
avahi-compat-howl/browse-domain-test.c
avahi-compat-howl/compat.c
avahi-compat-howl/funcs.txt
avahi-compat-howl/include/corby/buffer.h
avahi-compat-howl/include/corby/channel.h
avahi-compat-howl/include/corby/corby.h
avahi-compat-howl/include/corby/message.h
avahi-compat-howl/include/corby/object.h
avahi-compat-howl/include/corby/orb.h
avahi-compat-howl/include/discovery/discovery.h
avahi-compat-howl/include/discovery/text_record.h
avahi-compat-howl/include/howl.h
avahi-compat-howl/include/rendezvous/rendezvous.h
avahi-compat-howl/include/rendezvous/text_record.h
avahi-compat-howl/include/salt/address.h
avahi-compat-howl/include/salt/debug.h
avahi-compat-howl/include/salt/interface.h
avahi-compat-howl/include/salt/platform.h
avahi-compat-howl/include/salt/salt.h
avahi-compat-howl/include/salt/signal.h
avahi-compat-howl/include/salt/socket.h
avahi-compat-howl/include/salt/time.h
avahi-compat-howl/samples/Makefile.am
avahi-compat-howl/samples/browse.c
avahi-compat-howl/samples/publish.c
avahi-compat-howl/samples/query.c
avahi-compat-howl/samples/resolve.c
avahi-compat-howl/text-test.c
avahi-compat-howl/text.c
avahi-compat-howl/unsupported.c
avahi-compat-howl/warn.c
avahi-compat-howl/warn.h
avahi-compat-libdns_sd/Makefile.am
avahi-compat-libdns_sd/compat.c
avahi-compat-libdns_sd/dns_sd.h
avahi-compat-libdns_sd/funcs.txt
avahi-compat-libdns_sd/null-test.c
avahi-compat-libdns_sd/txt-test.c
avahi-compat-libdns_sd/txt.c
avahi-compat-libdns_sd/unsupported.c
avahi-compat-libdns_sd/warn.c
avahi-compat-libdns_sd/warn.h
avahi-core/Makefile.am
avahi-core/addr-util.c
avahi-core/addr-util.h
avahi-core/announce.c
avahi-core/announce.h
avahi-core/avahi-reflector.c
avahi-core/avahi-test.c
avahi-core/browse-dns-server.c
avahi-core/browse-domain.c
avahi-core/browse-service-type.c
avahi-core/browse-service.c
avahi-core/browse.c
avahi-core/browse.h
avahi-core/cache.c
avahi-core/cache.h
avahi-core/conformance-test.c
avahi-core/core.h
avahi-core/dns-spin-test.c
avahi-core/dns-srv-rr.h
avahi-core/dns-test.c
avahi-core/dns.c
avahi-core/dns.h
avahi-core/domain-util.c
avahi-core/domain-util.h
avahi-core/entry.c
avahi-core/fdutil.c
avahi-core/fdutil.h
avahi-core/hashmap-test.c
avahi-core/hashmap.c
avahi-core/hashmap.h
avahi-core/iface-linux.c
avahi-core/iface-linux.h
avahi-core/iface-pfroute.c
avahi-core/iface-pfroute.h
avahi-core/iface.c
avahi-core/iface.h
avahi-core/internal.h
avahi-core/log.c
avahi-core/log.h
avahi-core/lookup.h
avahi-core/multicast-lookup.c
avahi-core/multicast-lookup.h
avahi-core/netlink.c
avahi-core/netlink.h
avahi-core/prioq-test.c
avahi-core/prioq.c
avahi-core/prioq.h
avahi-core/probe-sched.c
avahi-core/probe-sched.h
avahi-core/publish.h
avahi-core/querier-test.c
avahi-core/querier.c
avahi-core/querier.h
avahi-core/query-sched.c
avahi-core/query-sched.h
avahi-core/resolve-address.c
avahi-core/resolve-host-name.c
avahi-core/resolve-service.c
avahi-core/response-sched.c
avahi-core/response-sched.h
avahi-core/rr-util.h
avahi-core/rr.c
avahi-core/rr.h
avahi-core/rrlist.c
avahi-core/rrlist.h
avahi-core/server.c
avahi-core/socket.c
avahi-core/socket.h
avahi-core/timeeventq-test.c
avahi-core/timeeventq.c
avahi-core/timeeventq.h
avahi-core/update-test.c
avahi-core/util.c
avahi-core/util.h
avahi-core/wide-area.c
avahi-core/wide-area.h
avahi-daemon/.gitignore
avahi-daemon/AddressResolver.introspect [deleted file]
avahi-daemon/DomainBrowser.introspect [deleted file]
avahi-daemon/EntryGroup.introspect [deleted file]
avahi-daemon/HostNameResolver.introspect [deleted file]
avahi-daemon/Makefile.am
avahi-daemon/RecordBrowser.introspect [deleted file]
avahi-daemon/Server.introspect [deleted file]
avahi-daemon/ServiceBrowser.introspect [deleted file]
avahi-daemon/ServiceResolver.introspect [deleted file]
avahi-daemon/ServiceTypeBrowser.introspect [deleted file]
avahi-daemon/avahi-daemon.conf
avahi-daemon/avahi-daemon.service.in [new file with mode: 0644]
avahi-daemon/avahi-daemon.socket.in [new file with mode: 0644]
avahi-daemon/avahi-service.dtd
avahi-daemon/caps.c
avahi-daemon/caps.h
avahi-daemon/chroot.c
avahi-daemon/chroot.h
avahi-daemon/dbus-async-address-resolver.c
avahi-daemon/dbus-async-host-name-resolver.c
avahi-daemon/dbus-async-service-resolver.c
avahi-daemon/dbus-domain-browser.c
avahi-daemon/dbus-entry-group.c
avahi-daemon/dbus-internal.h
avahi-daemon/dbus-protocol.c
avahi-daemon/dbus-protocol.h
avahi-daemon/dbus-record-browser.c
avahi-daemon/dbus-service-browser.c
avahi-daemon/dbus-service-type-browser.c
avahi-daemon/dbus-sync-address-resolver.c
avahi-daemon/dbus-sync-host-name-resolver.c
avahi-daemon/dbus-sync-service-resolver.c
avahi-daemon/dbus-util.c
avahi-daemon/dbus-util.h
avahi-daemon/example.service
avahi-daemon/hosts
avahi-daemon/ini-file-parser-test.c
avahi-daemon/ini-file-parser.c
avahi-daemon/ini-file-parser.h
avahi-daemon/introspect.xsl
avahi-daemon/main.c
avahi-daemon/main.h
avahi-daemon/org.freedesktop.Avahi.AddressResolver.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.DomainBrowser.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.EntryGroup.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.HostNameResolver.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.RecordBrowser.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.Server.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.ServiceBrowser.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.ServiceResolver.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.ServiceTypeBrowser.xml [new file with mode: 0644]
avahi-daemon/org.freedesktop.Avahi.service [new file with mode: 0644]
avahi-daemon/sd-daemon.c [new file with mode: 0644]
avahi-daemon/sd-daemon.h [new file with mode: 0644]
avahi-daemon/setproctitle.c
avahi-daemon/setproctitle.h
avahi-daemon/sftp-ssh.service
avahi-daemon/simple-protocol.c
avahi-daemon/simple-protocol.h
avahi-daemon/ssh.service
avahi-daemon/static-hosts.c
avahi-daemon/static-hosts.h
avahi-daemon/static-services.c
avahi-daemon/static-services.h
avahi-discover-standalone/Makefile.am
avahi-discover-standalone/avahi-discover.glade [deleted file]
avahi-discover-standalone/avahi-discover.gladep [deleted file]
avahi-discover-standalone/avahi-discover.ui [new file with mode: 0644]
avahi-discover-standalone/main.c
avahi-dnsconfd/.gitignore
avahi-dnsconfd/Makefile.am
avahi-dnsconfd/avahi-dnsconfd.action
avahi-dnsconfd/avahi-dnsconfd.service.in [new file with mode: 0644]
avahi-dnsconfd/main.c
avahi-glib/Makefile.am
avahi-glib/glib-malloc.c
avahi-glib/glib-malloc.h
avahi-glib/glib-watch-test.c
avahi-glib/glib-watch.c
avahi-glib/glib-watch.h
avahi-gobject/.gitignore
avahi-gobject/AvahiCore-0.6.gir [new file with mode: 0644]
avahi-gobject/Makefile.am
avahi-gobject/ga-entry-group.c
avahi-python/Makefile.am
avahi-python/avahi-bookmarks.in
avahi-python/avahi-discover/Makefile.am
avahi-python/avahi-discover/SimpleGladeApp.py [deleted file]
avahi-python/avahi-discover/__init__.py
avahi-python/avahi-discover/avahi-discover.in
avahi-python/avahi/Makefile.am
avahi-python/avahi/ServiceTypeDatabase.py.in
avahi-python/avahi/__init__.py
avahi-qt/Makefile.am
avahi-qt/qt-watch.cpp
avahi-qt/qt-watch.h
avahi-sharp/AddressResolver.cs
avahi-sharp/AssemblyInfo.cs
avahi-sharp/AvahiTest.cs
avahi-sharp/BrowserBase.cs
avahi-sharp/Client.cs
avahi-sharp/ClientException.cs
avahi-sharp/DomainBrowser.cs
avahi-sharp/EntryGroup.cs
avahi-sharp/HostNameResolver.cs
avahi-sharp/Makefile.am
avahi-sharp/RecordBrowser.cs
avahi-sharp/ResolverBase.cs
avahi-sharp/ServiceBrowser.cs
avahi-sharp/ServiceResolver.cs
avahi-sharp/ServiceTypeBrowser.cs
avahi-sharp/Utility.cs
avahi-ui-gtk3.pc.in [new file with mode: 0644]
avahi-ui-sharp/Makefile.am
avahi-ui-sharp/ServiceDialog.cs
avahi-ui-sharp/bssh.cs
avahi-ui.pc.in
avahi-ui/Makefile.am
avahi-ui/avahi-ui.c
avahi-ui/avahi-ui.h
avahi-ui/bssh.c
avahi-utils/Makefile.am
avahi-utils/avahi-browse.c
avahi-utils/avahi-publish.c
avahi-utils/avahi-resolve.c
avahi-utils/avahi-set-host-name.c
avahi-utils/sigint.c
avahi-utils/sigint.h
avahi-utils/stdb.c
avahi-utils/stdb.h
bootstrap.sh
common/.gitignore
common/Makefile.am
common/introspection.m4 [new file with mode: 0644]
configure.ac
docs/API-CHANGES-0.6
docs/COMPAT-LAYERS
docs/DBUS-API
docs/HACKING
docs/INSTALL
docs/MALLOC
docs/NEWS
docs/socket-auto-port.c
examples/Makefile.am
examples/client-browse-services.c
examples/client-publish-service.c
examples/core-browse-services.c
examples/core-publish-service.c
examples/glib-integration.c
initscript/Makefile.am
initscript/archlinux/Makefile.am
initscript/archlinux/avahi-daemon.in
initscript/archlinux/avahi-dnsconfd.in
initscript/darwin/Makefile.am
initscript/debian/Makefile.am
initscript/debian/avahi-daemon.in
initscript/debian/avahi-dnsconfd.in
initscript/fedora/Makefile.am
initscript/fedora/avahi-daemon.in
initscript/fedora/avahi-dnsconfd.in
initscript/freebsd/Makefile.am
initscript/gentoo/Makefile.am
initscript/gentoo/avahi-daemon.in
initscript/gentoo/avahi-dnsconfd.in
initscript/lfs/Makefile.am
initscript/mandriva/Makefile.am
initscript/mandriva/avahi-daemon.in
initscript/slackware/Makefile.am
initscript/slackware/avahi-daemon.in
initscript/slackware/avahi-dnsconfd.in
initscript/suse/Makefile.am
initscript/suse/avahi-daemon.in
man/Makefile.am
man/avahi-autoipd.8.xml.in
man/avahi-autoipd.action.8.xml.in
man/avahi-bookmarks.1.xml.in
man/avahi-browse.1.xml.in
man/avahi-daemon.8.xml.in
man/avahi-daemon.conf.5.xml.in
man/avahi-discover.1.xml.in
man/avahi-dnsconfd.8.xml.in
man/avahi-dnsconfd.action.8.xml.in
man/avahi-publish.1.xml.in
man/avahi-resolve.1.xml.in
man/avahi-set-host-name.1.xml.in
man/avahi.hosts.5.xml.in
man/avahi.service.5.xml.in
man/bssh.1.xml.in
man/xmltoman.css
man/xmltoman.dtd
man/xmltoman.xsl
po/POTFILES.in
po/POTFILES.skip
service-type-database/Makefile.am
service-type-database/build-db.in
service-type-database/service-types
tests/Makefile.am
tests/c-plus-plus-test-gen.py
tests/c-plus-plus-test.cc

index c19e72cea5248c6bee9df524fa10ff53bdfbd015..a800687b1eb4d12f883e756f5a033c3743112287 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -50,7 +48,9 @@ EXTRA_DIST = \
        avahi-compat-libdns_sd.pc.in \
        avahi-compat-howl.pc.in \
        avahi-ui.pc.in \
-       doxygen_to_devhelp.xsl
+       avahi-ui-gtk3.pc.in \
+       doxygen_to_devhelp.xsl \
+        common/introspection.m4
 
 SUBDIRS = \
        common \
@@ -151,136 +151,68 @@ DX_INPUT += \
 endif
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = avahi-core.pc
 
-avahi-core.pc: avahi-core.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
+%.pc: %.pc.in
+       $(AM_V_GEN)sed -e 's,@prefix\@,$(prefix),g' \
            -e 's,@libdir\@,$(libdir),g' \
            -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
 
+pkgconfig_DATA = avahi-core.pc
 CLEANFILES = avahi-core.pc
 
 if HAVE_DBUS
-
 pkgconfig_DATA += avahi-client.pc
-
-avahi-client.pc: avahi-client.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
-
 CLEANFILES += avahi-client.pc
 
 if ENABLE_COMPAT_HOWL
-
 pkgconfig_DATA += avahi-compat-howl.pc
-
-avahi-compat-howl.pc: avahi-compat-howl.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@HOWL_COMPAT_VERSION\@,$(HOWL_COMPAT_VERSION),g' $< > $@
-
 CLEANFILES += avahi-compat-howl.pc
-
 endif
 
 if ENABLE_COMPAT_LIBDNS_SD
-
 pkgconfig_DATA += avahi-compat-libdns_sd.pc
-
-avahi-compat-libdns_sd.pc: avahi-compat-libdns_sd.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
-
 CLEANFILES += avahi-compat-libdns_sd.pc
-
 endif
 
 if HAVE_MONO
-
 pkgconfig_DATA += avahi-sharp.pc avahi-ui-sharp.pc
-
-avahi-sharp.pc: avahi-sharp.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-           -e 's,@libdir\@,$(libdir),g' $< > $@
-
-avahi-ui-sharp.pc: avahi-ui-sharp.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-           -e 's,@libdir\@,$(libdir),g' $< > $@
-
 CLEANFILES += avahi-sharp.pc avahi-ui-sharp.pc
-
 endif
 
 endif
 
 if HAVE_GLIB
-
 pkgconfig_DATA += avahi-glib.pc
-
-avahi-glib.pc: avahi-glib.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
-
 CLEANFILES += avahi-glib.pc
 
 if HAVE_GOBJECT
-
 pkgconfig_DATA += avahi-gobject.pc
-
-avahi-gobject.pc: avahi-gobject.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
-
 CLEANFILES += avahi-gobject.pc
-
 endif
 endif
 
 if HAVE_GTK
 if HAVE_DBUS
-
 pkgconfig_DATA += avahi-ui.pc
-
-avahi-ui.pc: avahi-ui.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
-
 CLEANFILES += avahi-ui.pc
+endif
+endif
 
+if HAVE_GTK3
+if HAVE_DBUS
+pkgconfig_DATA += avahi-ui-gtk3.pc
+CLEANFILES += avahi-ui-gtk3.pc
 endif
 endif
 
 if HAVE_QT3
-
 pkgconfig_DATA += avahi-qt3.pc
-
-avahi-qt3.pc: avahi-qt3.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
-
 CLEANFILES += avahi-qt3.pc
-
 endif
 
 if HAVE_QT4
-
 pkgconfig_DATA += avahi-qt4.pc
-
-avahi-qt4.pc: avahi-qt4.pc.in
-       sed -e 's,@prefix\@,$(prefix),g' \
-           -e 's,@libdir\@,$(libdir),g' \
-           -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' $< > $@
-
 CLEANFILES += avahi-qt4.pc
-
 endif
 
 CLEANFILES += avahi.devhelp
@@ -291,7 +223,9 @@ avahi.devhelp: doxygen-run
 MOSTLYCLEANFILES = $(DX_CLEANFILES)
 
 DISTCHECK_CONFIGURE_FLAGS = \
-       --disable-monodoc
+       --disable-monodoc \
+       --enable-introspection \
+       --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
 
 homepage:
        $(MAKE) -C man
@@ -304,12 +238,5 @@ homepage:
        ssh tango rm -rf www/avahi.org/tree/download/doxygen
        scp -r doxygen/html tango:www/avahi.org/tree/download/doxygen
 
-dist-hook:
-       if test -d .svn ; then \
-               svn update ; \
-               chmod u+w ${distdir}/ChangeLog || true ; \
-               svn2cl -o ${distdir}/ChangeLog ; \
-       fi
-
 DISTCLEANFILES = \
        po/.intltool-merge-cache
index 78f26c9d632c0cdc5a5e17d9712d31d47add7b2b..2c68a6c3ec59bb712e669efcae03e39104b58010 100755 (executable)
@@ -1,5 +1,4 @@
-#!/bin/sh
-# $Id$
+#!/bin/bash
 
 # This file is part of avahi.
 #
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
-VERSION=1.9
+AM_VERSION=1.11
+AC_VERSION=2.63
 
 run_versioned() {
     local P
     local V
 
     V=$(echo "$2" | sed -e 's,\.,,g')
-    
-    if [ -e "`which $1$V`" ] ; then
-       P="$1$V" 
+
+    if [ -e "`which $1$V 2> /dev/null`" ] ; then
+        P="$1$V"
     else
-       if [ -e "`which $1-$2`" ] ; then
-           P="$1-$2" 
-       else
-           P="$1"
-       fi
+        if [ -e "`which $1-$2 2> /dev/null`" ] ; then
+            P="$1-$2"
+        else
+            P="$1"
+        fi
     fi
 
     shift 2
@@ -42,8 +42,14 @@ run_versioned() {
 
 set -ex
 
+if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
+    cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
+    chmod +x .git/hooks/pre-commit && \
+    echo "Activated pre-commit hook."
+fi
+
 if [ "x$1" = "xam" ] ; then
-    run_versioned automake "$VERSION" -a -c --foreign
+    run_versioned automake "$AM_VERSION" -a -c --foreign
     ./config.status
 else 
     rm -rf autom4te.cache
@@ -59,10 +65,10 @@ else
 
     intltoolize --copy --force --automake
     "$LIBTOOLIZE" -c --force
-    run_versioned aclocal "$VERSION" -I common
-    run_versioned autoconf 2.59 -Wall
-    run_versioned autoheader 2.59
-    run_versioned automake "$VERSION" -a -c --foreign
+    run_versioned aclocal "$AM_VERSION" -I common
+    run_versioned autoconf "$AC_VERSION" -Wall
+    run_versioned autoheader "$AC_VERSION"
+    run_versioned automake "$AM_VERSION" -a -c --foreign
 
     if test "x$NOCONFIGURE" = "x"; then
         ./configure "$@"
index 2f99592ae36e9fe045af90cae1432f3dcb46b82b..dc43b54cf8f3cd5d886b0fd16add1befa26c879b 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -54,10 +52,10 @@ nodist_pkgsysconf_SCRIPTS = avahi-autoipd.action
 
 if TARGET_FREEBSD
 avahi-autoipd.action: avahi-autoipd.action.bsd
-       cp $< $@
+       $(AM_V_GEN)cp $< $@
 else
 avahi-autoipd.action: avahi-autoipd.action.linux
-       cp $< $@
+       $(AM_V_GEN)cp $< $@
 endif
 
 if TARGET_DEBIAN
@@ -65,11 +63,11 @@ if TARGET_DEBIAN
 noinst_SCRIPTS = dhclient-enter-hook dhclient-exit-hook
 
 dhclient-enter-hook: dhclient-enter-hook.in
-       sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+       $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@ && \
        chmod +x $@
 
 dhclient-exit-hook: dhclient-exit-hook.in
-       sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+       $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@ && \
        chmod +x $@
 
 BUILD = dhclient-exit-hook dhclient-enter-hook
index db39c4e295776f22aadbb37f50ccb4e9c6b4b9b4..06084fb463ad478e5f8179f7f8ad64d61f26b132 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/sh
 
-# $Id$
-#
 # This file is part of avahi.
 # 
 # avahi is free software; you can redistribute it and/or modify it
index 27f00bb08c3102ebbfb549678c76065d07881a3e..c2db9942c32c191c665c6e7c7d0be287ea0a0967 100755 (executable)
@@ -1,9 +1,7 @@
 #!/bin/sh
 
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -30,17 +28,26 @@ set -e
 #   $2 interface name
 #   $3 IP adddress
 
+PATH="$PATH:/usr/bin:/usr/sbin:/bin:/sbin"
+
+# Use a different metric for each interface, so that we can set
+# identical routes to multiple interfaces.
+
+METRIC=$((1000 + `cat "/sys/class/net/$2/ifindex" 2>/dev/null || echo 0`))
+
 if [ -x /bin/ip -o -x /sbin/ip ] ; then
 
     # We have the Linux ip tool from the iproute package
 
     case "$1" in
         BIND)
-            ip addr add "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2" 
+            ip addr add "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2"
+            ip route add default dev "$2" metric "$METRIC" scope link ||:
             ;;
 
         CONFLICT|UNBIND|STOP)
-            ip addr del "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2" 
+            ip route del default dev "$2" metric "$METRIC" scope link ||:
+            ip addr del "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2"
             ;;
 
         *)
@@ -55,11 +62,13 @@ elif [ -x /bin/ifconfig -o -x /sbin/ifconfig ] ; then
 
     case "$1" in
         BIND)
-            ifconfig "$2:3" inet "$3" netmask 255.255.0.0 broadcast 169.254.255.255 up
+            ifconfig "$2:avahi" inet "$3" netmask 255.255.0.0 broadcast 169.254.255.255 up
+            route add default dev "$2:avahi" metric "$METRIC" ||:
             ;;
 
         CONFLICT|STOP|UNBIND)
-            ifconfig "$2:3" down
+            route del default dev "$2:avahi" metric "$METRIC" ||:
+            ifconfig "$2:avahi" down
             ;;
 
         *)
index 10449f14a5103737e45e25fd77798a10bf547a39..a746856ea4e640f0d36b3c366818dd329528a551 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/sh
 
-# $Id$
-#
 # This file is part of avahi.
 # 
 # avahi is free software; you can redistribute it and/or modify it
index 3dcb7df2d98b6764cc8c782feb67dd8294bb01f6..379cb4647eb73f2bd6b380051a4b8cbef4c20ea9 100755 (executable)
@@ -1,9 +1,7 @@
 #!/bin/sh
 
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -26,7 +24,7 @@ case "$reason" in
     PREINIT|BOUND|RENEW|REBIND|REBOOT|STOP|RELEASE)
         # Stopping avahi-autoipd is left for the enter hook
         ;;
-    
+
     EXPIRE|FAIL|TIMEOUT)
         @sbindir@/avahi-autoipd -wD $interface 2> /dev/null
         ;;
index 5bc0300427db168a1f6082e5ec229b7f3cf6232b..fc27829d43c9fbd989f7142d27fa90b9b12292a0 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -67,7 +65,7 @@ AVAHI_LLIST_HEAD(Address, addresses) = NULL;
 int iface_init(int i) {
     struct sockaddr_nl addr;
     int on = 1;
-    
+
     if ((fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE)) < 0) {
         daemon_log(LOG_ERR, "socket(PF_NETLINK): %s", strerror(errno));
         goto fail;
@@ -82,22 +80,22 @@ int iface_init(int i) {
         daemon_log(LOG_ERR, "bind(): %s", strerror(errno));
         goto fail;
     }
-    
+
     if (setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
         daemon_log(LOG_ERR, "SO_PASSCRED: %s", strerror(errno));
         goto fail;
     }
 
     ifindex = i;
-    
+
     return fd;
-    
+
 fail:
     if (fd >= 0) {
         close(fd);
         fd = -1;
     }
-    
+
     return -1;
 }
 
@@ -112,14 +110,14 @@ static int process_nlmsg(struct nlmsghdr *n) {
 
         if (ifi->ifi_family != AF_UNSPEC || (int) ifi->ifi_index != ifindex)
             return 0;
-        
+
         if (n->nlmsg_type == RTM_DELLINK) {
             daemon_log(LOG_ERR, "Interface vanished.");
             return -1;
         }
 
         assert(n->nlmsg_type == RTM_NEWLINK);
-        
+
         if ((ifi->ifi_flags & IFF_LOOPBACK) ||
             (ifi->ifi_flags & IFF_NOARP) ||
             ifi->ifi_type != ARPHRD_ETHER) {
@@ -136,7 +134,7 @@ static int process_nlmsg(struct nlmsghdr *n) {
         int l;
         uint32_t address = 0;
         Address *i;
-        
+
         ifa = NLMSG_DATA(n);
 
         if (ifa->ifa_family != AF_INET || (int) ifa->ifa_index != ifindex)
@@ -154,7 +152,7 @@ static int process_nlmsg(struct nlmsghdr *n) {
                     memcpy(&address, RTA_DATA(a), sizeof(uint32_t));
                     break;
             }
-            
+
             a = RTA_NEXT(a, l);
         }
 
@@ -180,7 +178,7 @@ static int process_nlmsg(struct nlmsghdr *n) {
 
 static int process_response(int wait_for_done, unsigned seq) {
     assert(fd >= 0);
-    
+
     do {
         size_t bytes;
         ssize_t r;
@@ -189,39 +187,39 @@ static int process_response(int wait_for_done, unsigned seq) {
         struct msghdr msghdr;
         struct cmsghdr *cmsghdr;
         struct ucred *ucred;
-        struct iovec iov; 
+        struct iovec iov;
         struct nlmsghdr *p = (struct nlmsghdr *) replybuf;
-        
+
         memset(&iov, 0, sizeof(iov));
-        iov.iov_base = replybuf; 
+        iov.iov_base = replybuf;
        iov.iov_len = sizeof(replybuf);
 
         memset(&msghdr, 0, sizeof(msghdr));
         msghdr.msg_name = (void*) NULL;
-        msghdr.msg_namelen = 0; 
-        msghdr.msg_iov = &iov; 
-        msghdr.msg_iovlen = 1; 
-        msghdr.msg_control = cred_msg; 
-        msghdr.msg_controllen = sizeof(cred_msg); 
+        msghdr.msg_namelen = 0;
+        msghdr.msg_iov = &iov;
+        msghdr.msg_iovlen = 1;
+        msghdr.msg_control = cred_msg;
+        msghdr.msg_controllen = sizeof(cred_msg);
        msghdr.msg_flags = 0;
-        
+
         if ((r = recvmsg(fd, &msghdr, 0)) < 0) {
             daemon_log(LOG_ERR, "recvmsg() failed: %s", strerror(errno));
             return -1;
         }
 
         if (!(cmsghdr = CMSG_FIRSTHDR(&msghdr)) || cmsghdr->cmsg_type != SCM_CREDENTIALS) {
-            daemon_log(LOG_WARNING, "No sender credentials received, ignoring data."); 
+            daemon_log(LOG_WARNING, "No sender credentials received, ignoring data.");
             return -1;
         }
 
         ucred = (struct ucred*) CMSG_DATA(cmsghdr);
-        
+
         if (ucred->uid != 0)
             return -1;
 
         bytes = (size_t) r;
-        
+
         for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
 
             if (!NLMSG_OK(p, bytes) || bytes < sizeof(struct nlmsghdr) || bytes < p->nlmsg_len) {
@@ -258,7 +256,7 @@ int iface_get_initial_state(State *state) {
 
     assert(fd >= 0);
     assert(state);
-    
+
     memset(&req, 0, sizeof(req));
     n = (struct nlmsghdr*) req;
     n->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
@@ -278,7 +276,7 @@ int iface_get_initial_state(State *state) {
 
     if (process_response(1, 0) < 0)
         return -1;
-    
+
     n->nlmsg_type = RTM_GETADDR;
     n->nlmsg_len = NLMSG_LENGTH(sizeof(*ifa));
     n->nlmsg_seq = ++seq;
@@ -286,7 +284,7 @@ int iface_get_initial_state(State *state) {
     ifa = NLMSG_DATA(n);
     ifa->ifa_family = AF_INET;
     ifa->ifa_index = ifindex;
-    
+
     if (send(fd, n, n->nlmsg_len, 0) < 0) {
         daemon_log(LOG_ERR, "send(): %s", strerror(errno));
         return -1;
@@ -296,7 +294,7 @@ int iface_get_initial_state(State *state) {
         return -1;
 
     *state = addresses ? STATE_SLEEPING : STATE_START;
-    
+
     return 0;
 }
 
@@ -305,7 +303,7 @@ int iface_process(Event *event) {
     assert(fd >= 0);
 
     b = !!addresses;
-    
+
     if (process_response(0, 0) < 0)
         return -1;
 
@@ -313,13 +311,13 @@ int iface_process(Event *event) {
         *event = EVENT_ROUTABLE_ADDR_UNCONFIGURED;
     else if (!b && addresses)
         *event = EVENT_ROUTABLE_ADDR_CONFIGURED;
-    
+
     return 0;
 }
 
 void iface_done(void) {
     Address *a;
-    
+
     if (fd >= 0) {
         close(fd);
         fd = -1;
index e3f913ed3b670707263b1819d882c27157a01992..95c97fde96dab3c6e8aa5b0949be70fd0665618a 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooavahiifacehfoo
 #define fooavahiifacehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index eb71c3b97a14e22e6793565a0f1d2388924bf251..4b35f7c747a4bc29842024b2ea4ea70eb4ffc357 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
     This file is part of avahi.
 
@@ -566,8 +564,7 @@ fail:
     return -1;
 }
 
-static void
-close_socket(int fd) {
+static void close_socket(int fd) {
     close(fd);
 }
 
@@ -582,16 +579,14 @@ static uint8_t __lladdr[ETHER_ADDRLEN];
 #define elementsof(array)       (sizeof(array)/sizeof(array[0]))
 #endif
 
-static int
-__get_ether_addr(int ifindex, u_char *lladdr)
-{
-    int                      mib[6];
-    char                    *buf;
-    struct if_msghdr        *ifm;
-    char                    *lim;
-    char                    *next;
-    struct sockaddr_dl      *sdl;
-    size_t                   len;
+static int __get_ether_addr(int ifindex, u_char *lladdr) {
+    int mib[6];
+    char *buf;
+    struct if_msghdr *ifm;
+    char *lim;
+    char *next;
+    struct sockaddr_dl *sdl;
+    size_t len;
 
     mib[0] = CTL_NET;
     mib[1] = PF_ROUTE;
@@ -603,20 +598,15 @@ __get_ether_addr(int ifindex, u_char *lladdr)
     if (sysctl(mib, elementsof(mib), NULL, &len, NULL, 0) != 0) {
         daemon_log(LOG_ERR, "sysctl(NET_RT_IFLIST): %s",
                    strerror(errno));
-        return (-1);
-    }
-
-    buf = malloc(len);
-    if (buf == NULL) {
-        daemon_log(LOG_ERR, "malloc(%d): %s", len, strerror(errno));
-        return (-1);
+        return -1;
     }
 
+    buf = avahi_malloc(len);
     if (sysctl(mib, elementsof(mib), buf, &len, NULL, 0) != 0) {
         daemon_log(LOG_ERR, "sysctl(NET_RT_IFLIST): %s",
                    strerror(errno));
         free(buf);
-        return (-1);
+        return -1;
     }
 
     lim = buf + len;
@@ -627,34 +617,31 @@ __get_ether_addr(int ifindex, u_char *lladdr)
             memcpy(lladdr, LLADDR(sdl), ETHER_ADDRLEN);
         }
     }
-    free(buf);
+    avahi_free(buf);
 
-    return (0);
+    return 0;
 }
 
 #define PCAP_TIMEOUT 500 /* 0.5s */
 
-static int
-open_socket(int iface, uint8_t *hw_address)
-{
-    struct bpf_program       bpf;
-    char                     *filter;
-    char                     ifname[IFNAMSIZ];
-    pcap_t                  *pp;
-    int                      err;
-    int                      fd;
+static int open_socket(int iface, uint8_t *hw_address) {
+    struct bpf_program bpf;
+    char *filter;
+    char ifname[IFNAMSIZ];
+    pcap_t *pp;
+    int err;
+    int fd;
 
     assert(__pp == NULL);
 
-    if (interface_up(iface) < 0) {
-        return (-1);
-    }
-    if (__get_ether_addr(iface, __lladdr) == -1) {
-        return (-1);
-    }
-    if (if_indextoname(iface, ifname) == NULL) {
-        return (-1);
-    }
+    if (interface_up(iface) < 0)
+        return -1;
+
+    if (__get_ether_addr(iface, __lladdr) == -1)
+        return -1;
+
+    if (if_indextoname(iface, ifname) == NULL)
+        return -1;
 
     /*
      * Using a timeout for BPF is fairly portable across BSDs. On most
@@ -728,10 +715,7 @@ open_socket(int iface, uint8_t *hw_address)
     return (fd);
 }
 
-static void
-close_socket(int fd __unused)
-{
-
+static void close_socket(int fd AVAHI_GCC_UNUSED) {
     assert(__pp != NULL);
     pcap_close(__pp);
     __pp = NULL;
@@ -741,10 +725,7 @@ close_socket(int fd __unused)
  * We trick avahi into allocating sizeof(packet) + sizeof(ether_header),
  * and prepend the required ethernet header information before sending.
  */
-static int
-send_packet(int fd __unused, int iface __unused, ArpPacket *packet,
-            size_t packet_len)
-{
+static int send_packet(int fd AVAHI_GCC_UNUSED, int iface AVAHI_GCC_UNUSED, ArpPacket *packet, size_t packet_len) {
     struct ether_header *eh;
 
     assert(__pp != NULL);
@@ -758,14 +739,12 @@ send_packet(int fd __unused, int iface __unused, ArpPacket *packet,
     return (pcap_inject(__pp, (void *)eh, packet_len + sizeof(*eh)));
 }
 
-static int
-recv_packet(int fd __unused, ArpPacket **packet, size_t *packet_len)
-{
-    struct pcap_pkthdr      *ph;
-    u_char                  *pd;
-    ArpPacket               *ap;
-    int                      err;
-    int                      retval;
+static int recv_packet(int fd AVAHI_GCC_UNUSED, ArpPacket **packet, size_t *packet_len) {
+    struct pcap_pkthdr *ph;
+    u_char *pd;
+    ArpPacket *ap;
+    int err;
+    int retval;
 
     assert(__pp != NULL);
     assert(packet != NULL);
@@ -791,10 +770,9 @@ recv_packet(int fd __unused, ArpPacket **packet, size_t *packet_len)
          * didn't match the filter, in which case we'll get 0 packets.
          */
         retval = 0;
-    } else {
+    } else
         daemon_log(LOG_ERR, "pcap_next_ex(%d): %s",
                    err, pcap_geterr(__pp));
-    }
 
     return (retval);
 }
@@ -843,8 +821,6 @@ static FILE* fork_dispatcher(void) {
 
         daemon_retval_done();
 
-        setsid();
-
         avahi_set_proc_title(argv0, "%s: [%s] callout dispatcher", argv0, interface_name);
 
         close(fds[1]);
@@ -1097,7 +1073,7 @@ static int loop(int iface, uint32_t addr) {
     char *address_fn = NULL;
     const char *p;
 
-    daemon_signal_init(SIGINT, SIGTERM, SIGCHLD, SIGHUP,0);
+    daemon_signal_init(SIGINT, SIGTERM, SIGCHLD, SIGHUP, 0);
 
     if (!(dispatcher = fork_dispatcher()))
         goto fail;
@@ -1244,9 +1220,14 @@ static int loop(int iface, uint32_t addr) {
                 int conflict = 0;
 
                 if (info.sender_ip_address == addr) {
-                    /* Normal conflict */
-                    conflict = 1;
-                    daemon_log(LOG_INFO, "Received conflicting normal ARP packet.");
+
+                    if (memcmp(hw_address, info.sender_hw_address, ETHER_ADDRLEN)) {
+                        /* Normal conflict */
+                        conflict = 1;
+                        daemon_log(LOG_INFO, "Received conflicting normal ARP packet.");
+                    } else
+                        daemon_log(LOG_DEBUG, "Received ARP packet back on source interface. Ignoring.");
+
                 } else if (state == STATE_WAITING_PROBE || state == STATE_PROBING || state == STATE_WAITING_ANNOUNCE) {
                     /* Probe conflict */
                     conflict = info.target_ip_address == addr && memcmp(hw_address, info.sender_hw_address, ETHER_ADDRLEN);
index adadc99690c90a5503cdd54d34f58fc3f196cd37..cc02df73c9daf8e9c4238773c44c0326df5ba66d 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooavahimainhfoo
 #define fooavahimainhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index cd62e3243b627f8c1ac447b630595deadcd8d862..f11b11d7da59f5dbeae4dd25756811fdadb12e32 100644 (file)
@@ -1,7 +1,5 @@
-# $Id: Makefile.am 90 2005-05-23 16:15:12Z lennart $
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -40,7 +38,7 @@ noinst_PROGRAMS = \
 
 endif
 
-lib_LTLIBRARIES = libavahi-client.la 
+lib_LTLIBRARIES = libavahi-client.la
 
 libavahi_client_la_SOURCES = \
        client.c client.h \
@@ -58,23 +56,23 @@ libavahi_client_la_LIBADD = $(AM_LDADD) $(DBUS_LIBS) ../avahi-common/libavahi-co
 libavahi_client_la_LDFLAGS = $(AM_LDFLAGS)  -version-info $(LIBAVAHI_CLIENT_VERSION_INFO)
 
 client_test_SOURCES = client-test.c
-client_test_CFLAGS = $(AM_CFLAGS) 
-client_test_LDADD = $(AM_LDADD) libavahi-client.la ../avahi-common/libavahi-common.la 
+client_test_CFLAGS = $(AM_CFLAGS)
+client_test_LDADD = $(AM_LDADD) libavahi-client.la ../avahi-common/libavahi-common.la
 
 srv_test_SOURCES = srv-test.c
-srv_test_CFLAGS = $(AM_CFLAGS) 
-srv_test_LDADD = $(AM_LDADD) libavahi-client.la ../avahi-common/libavahi-common.la 
+srv_test_CFLAGS = $(AM_CFLAGS)
+srv_test_LDADD = $(AM_LDADD) libavahi-client.la ../avahi-common/libavahi-common.la
 
 rr_test_SOURCES = rr-test.c
-rr_test_CFLAGS = $(AM_CFLAGS) 
-rr_test_LDADD = $(AM_LDADD) libavahi-client.la ../avahi-common/libavahi-common.la 
+rr_test_CFLAGS = $(AM_CFLAGS)
+rr_test_LDADD = $(AM_LDADD) libavahi-client.la ../avahi-common/libavahi-common.la
 
 xdg_config_test_SOURCES = xdg-config-test.c xdg-config.c xdg-config.h
-xdg_config_test_CFLAGS = $(AM_CFLAGS) 
+xdg_config_test_CFLAGS = $(AM_CFLAGS)
 xdg_config_test_LDADD = $(AM_LDADD)
 
 check_nss_test_SOURCES = check-nss.c check-nss-test.c client.h
-check_nss_test_CFLAGS = $(AM_CFLAGS) 
+check_nss_test_CFLAGS = $(AM_CFLAGS)
 check_nss_test_LDADD = $(AM_LDADD)
 
 if HAVE_DLOPEN
index 24393b8b6837f53ad921b360e97fa01d3e646d6e..f92ed0d8b65c76a19c9b70671453f97a0a2493d5 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -44,7 +42,7 @@ static void parse_environment(AvahiDomainBrowser *b) {
     char buf[AVAHI_DOMAIN_NAME_MAX*3], *e, *t, *p;
 
     assert(b);
-    
+
     if (!(e = getenv("AVAHI_BROWSE_DOMAINS")))
         return;
 
@@ -60,17 +58,17 @@ static void parse_environment(AvahiDomainBrowser *b) {
 static void parse_domain_file(AvahiDomainBrowser *b) {
     FILE *f;
     char buf[AVAHI_DOMAIN_NAME_MAX];
-    
+
     assert(b);
 
     if (!(f = avahi_xdg_config_open("avahi/browse-domains")))
         return;
-    
-    
+
+
     while (fgets(buf, sizeof(buf)-1, f)) {
         char domain[AVAHI_DOMAIN_NAME_MAX];
         buf[strcspn(buf, "\n\r")] = 0;
-        
+
         if (avahi_normalize_name(buf, domain, sizeof(domain)))
             b->static_browse_domains = avahi_string_list_add(b->static_browse_domains, domain);
     }
@@ -112,7 +110,7 @@ AvahiDomainBrowser* avahi_domain_browser_new(
     AvahiLookupFlags flags,
     AvahiDomainBrowserCallback callback,
     void *userdata) {
-    
+
     AvahiDomainBrowser *db = NULL;
     DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
@@ -156,7 +154,7 @@ AvahiDomainBrowser* avahi_domain_browser_new(
     }
 
     db->static_browse_domains = avahi_string_list_reverse(db->static_browse_domains);
-    
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "DomainBrowserNew"))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -208,10 +206,10 @@ AvahiDomainBrowser* avahi_domain_browser_new(
             goto fail;
         }
     }
-    
+
     dbus_message_unref(message);
     dbus_message_unref(reply);
-    
+
     return db;
 
 fail:
@@ -223,7 +221,7 @@ fail:
 
     if (db)
         avahi_domain_browser_free(db);
-    
+
     if (message)
         dbus_message_unref(message);
 
@@ -241,13 +239,13 @@ AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *b) {
 int avahi_domain_browser_free (AvahiDomainBrowser *b) {
     AvahiClient *client;
     int r = AVAHI_OK;
-    
+
     assert(b);
     assert(b->ref >= 1);
 
     if (--(b->ref) >= 1)
         return AVAHI_OK;
-    
+
     client = b->client;
 
     if (b->path && avahi_client_is_connected(b->client))
@@ -257,7 +255,7 @@ int avahi_domain_browser_free (AvahiDomainBrowser *b) {
 
     if (b->defer_timeout)
         b->client->poll_api->timeout_free(b->defer_timeout);
-    
+
     avahi_string_list_free(b->static_browse_domains);
     avahi_free(b->path);
     avahi_free(b);
@@ -276,7 +274,7 @@ DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserE
 
     assert(client);
     assert(message);
-    
+
     dbus_error_init (&error);
 
     if (!(path = dbus_message_get_path(message)))
@@ -295,7 +293,7 @@ DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserE
     switch (event) {
         case AVAHI_BROWSER_NEW:
         case AVAHI_BROWSER_REMOVE:
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_INT32, &interface,
@@ -309,14 +307,14 @@ DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserE
             }
 
             break;
-            
+
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
         case AVAHI_BROWSER_ALL_FOR_NOW:
             break;
 
         case AVAHI_BROWSER_FAILURE: {
             char *etxt;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_STRING, &etxt,
@@ -325,7 +323,7 @@ DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserE
                 fprintf(stderr, "Failed to parse browser event.\n");
                 goto fail;
             }
-            
+
             avahi_client_set_errno(db->client, avahi_error_dbus_to_number(etxt));
             break;
         }
@@ -337,7 +335,7 @@ DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserE
                 /* We had this entry already in the static entries */
                 return DBUS_HANDLER_RESULT_HANDLED;
             }
-    
+
     db->callback(db, (AvahiIfIndex) interface, (AvahiProtocol) protocol, event, domain, (AvahiLookupResultFlags) flags, db->userdata);
 
     return DBUS_HANDLER_RESULT_HANDLED;
@@ -354,10 +352,10 @@ AvahiServiceTypeBrowser* avahi_service_type_browser_new(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     const char *domain,
-    AvahiLookupFlags flags, 
+    AvahiLookupFlags flags,
     AvahiServiceTypeBrowserCallback callback,
     void *userdata) {
-        
+
     AvahiServiceTypeBrowser *b = NULL;
     DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
@@ -398,12 +396,12 @@ AvahiServiceTypeBrowser* avahi_service_type_browser_new(
             avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
             goto fail;
         }
-          
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "ServiceTypeBrowserNew"))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
     u_flags = (uint32_t) flags;
@@ -446,7 +444,7 @@ AvahiServiceTypeBrowser* avahi_service_type_browser_new(
     return b;
 
 fail:
-    
+
     if (dbus_error_is_set(&error)) {
         avahi_client_set_dbus_error(client, &error);
         dbus_error_free(&error);
@@ -454,7 +452,7 @@ fail:
 
     if (b)
         avahi_service_type_browser_free(b);
-    
+
     if (message)
         dbus_message_unref(message);
 
@@ -497,7 +495,7 @@ DBusHandlerResult avahi_service_type_browser_event (AvahiClient *client, AvahiBr
 
     assert(client);
     assert(message);
-    
+
     dbus_error_init (&error);
 
     if (!(path = dbus_message_get_path(message)))
@@ -513,7 +511,7 @@ DBusHandlerResult avahi_service_type_browser_event (AvahiClient *client, AvahiBr
     domain = b->domain;
     interface = b->interface;
     protocol = b->protocol;
-    
+
     switch (event) {
         case AVAHI_BROWSER_NEW:
         case AVAHI_BROWSER_REMOVE:
@@ -530,14 +528,14 @@ DBusHandlerResult avahi_service_type_browser_event (AvahiClient *client, AvahiBr
                 goto fail;
             }
             break;
-            
+
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
         case AVAHI_BROWSER_ALL_FOR_NOW:
             break;
 
         case AVAHI_BROWSER_FAILURE: {
             char *etxt;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_STRING, &etxt,
@@ -546,7 +544,7 @@ DBusHandlerResult avahi_service_type_browser_event (AvahiClient *client, AvahiBr
                 fprintf(stderr, "Failed to parse browser event.\n");
                 goto fail;
             }
-            
+
             avahi_client_set_errno(b->client, avahi_error_dbus_to_number(etxt));
             break;
         }
@@ -569,10 +567,10 @@ AvahiServiceBrowser* avahi_service_browser_new(
     AvahiProtocol protocol,
     const char *type,
     const char *domain,
-    AvahiLookupFlags flags, 
+    AvahiLookupFlags flags,
     AvahiServiceBrowserCallback callback,
     void *userdata) {
-    
+
     AvahiServiceBrowser *b = NULL;
     DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
@@ -598,7 +596,7 @@ AvahiServiceBrowser* avahi_service_browser_new(
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     b->client = client;
     b->callback = callback;
     b->userdata = userdata;
@@ -613,13 +611,13 @@ AvahiServiceBrowser* avahi_service_browser_new(
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (domain && domain[0])
         if (!(b->domain = avahi_strdup(domain))) {
             avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
             goto fail;
         }
-    
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "ServiceBrowserNew"))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -664,7 +662,7 @@ AvahiServiceBrowser* avahi_service_browser_new(
 
     dbus_message_unref(message);
     dbus_message_unref(reply);
-    
+
     return b;
 
 fail:
@@ -675,7 +673,7 @@ fail:
 
     if (b)
         avahi_service_browser_free(b);
-    
+
     if (message)
         dbus_message_unref(message);
 
@@ -737,7 +735,7 @@ DBusHandlerResult avahi_service_browser_event(AvahiClient *client, AvahiBrowserE
     switch (event) {
         case AVAHI_BROWSER_NEW:
         case AVAHI_BROWSER_REMOVE:
-            
+
             if (!dbus_message_get_args (
                     message, &error,
                     DBUS_TYPE_INT32, &interface,
@@ -759,7 +757,7 @@ DBusHandlerResult avahi_service_browser_event(AvahiClient *client, AvahiBrowserE
 
         case AVAHI_BROWSER_FAILURE: {
             char *etxt;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_STRING, &etxt,
@@ -768,7 +766,7 @@ DBusHandlerResult avahi_service_browser_event(AvahiClient *client, AvahiBrowserE
                 fprintf(stderr, "Failed to parse browser event.\n");
                 goto fail;
             }
-            
+
             avahi_client_set_errno(b->client, avahi_error_dbus_to_number(etxt));
             break;
         }
@@ -795,7 +793,7 @@ AvahiRecordBrowser* avahi_record_browser_new(
     AvahiLookupFlags flags,
     AvahiRecordBrowserCallback callback,
     void *userdata) {
-    
+
     AvahiRecordBrowser *b = NULL;
     DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
@@ -818,7 +816,7 @@ AvahiRecordBrowser* avahi_record_browser_new(
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     b->client = client;
     b->callback = callback;
     b->userdata = userdata;
@@ -835,7 +833,7 @@ AvahiRecordBrowser* avahi_record_browser_new(
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(message = dbus_message_new_method_call(AVAHI_DBUS_NAME, AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "RecordBrowserNew"))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -881,7 +879,7 @@ AvahiRecordBrowser* avahi_record_browser_new(
 
     dbus_message_unref(message);
     dbus_message_unref(reply);
-    
+
     return b;
 
 fail:
@@ -892,7 +890,7 @@ fail:
 
     if (b)
         avahi_record_browser_free(b);
-    
+
     if (message)
         dbus_message_unref(message);
 
@@ -978,7 +976,7 @@ DBusHandlerResult avahi_record_browser_event(AvahiClient *client, AvahiBrowserEv
 
             for (j = 0; j < 5; j++)
                 dbus_message_iter_next(&iter);
-    
+
             if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
                 dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_BYTE)
                 goto fail;
@@ -987,12 +985,12 @@ DBusHandlerResult avahi_record_browser_event(AvahiClient *client, AvahiBrowserEv
             dbus_message_iter_get_fixed_array(&sub, &rdata, &rdata_size);
 
             dbus_message_iter_next(&iter);
-            
+
             if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
                 goto fail;
 
             dbus_message_iter_get_basic(&iter, &flags);
-            
+
             break;
         }
 
@@ -1002,7 +1000,7 @@ DBusHandlerResult avahi_record_browser_event(AvahiClient *client, AvahiBrowserEv
 
         case AVAHI_BROWSER_FAILURE: {
             char *etxt;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_STRING, &etxt,
@@ -1011,7 +1009,7 @@ DBusHandlerResult avahi_record_browser_event(AvahiClient *client, AvahiBrowserEv
                 fprintf(stderr, "Failed to parse browser event.\n");
                 goto fail;
             }
-            
+
             avahi_client_set_errno(b->client, avahi_error_dbus_to_number(etxt));
             break;
         }
index 52aa81e2c52305c752c26cad20a5444530225619..7c1550020a934de09e6beb80a55eca03d3af21ff 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 0a933fa7c3c5d7f78aff77efb676283e3322faf0..ea266c4df47cc0c928aaf7e2fff88ddc2b379dff 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
 int avahi_nss_support(void) {
     int b = 0;
-    
+
 #ifdef HAVE_DLOPEN
     static const char * const libs[] = {
         "libnss_mdns.so.2",
         "libnss_mdns4.so.2",
         "libnss_mdns6.so.2",
         NULL };
-    
+
     const char * const *l;
-    
+
     for (l = libs; *l; l++) {
         void *dl;
-        
+
         if ((dl = dlopen(*l, RTLD_LAZY))) {
             b = 1;
             dlclose(dl);
index 7d306515fb32deab5a1746783985bdc96999d556..7d04a6a217bd5c297b6c9d1797283043a86ac94a 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -58,7 +56,7 @@ static void avahi_domain_browser_callback(
     const char *domain,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void *userdata) {
-    
+
     printf ("DOMAIN-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, domain ? domain : "NULL", (char*)userdata);
 }
 
@@ -76,7 +74,7 @@ static void avahi_service_resolver_callback(
     AvahiStringList *txt,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void *userdata) {
-    
+
     char addr[64];
     char *txtr;
     if (event == AVAHI_RESOLVER_FAILURE) {
@@ -99,14 +97,14 @@ static void avahi_service_browser_callback (
     const char *domain,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void *userdata) {
-    
+
     AvahiServiceResolver *sr;
 
     printf ("SERVICE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), name (%s), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, name ? name : "NULL", type, domain ? domain : "NULL", (char*)userdata);
 
     if (b && name)
     {
-        sr = avahi_service_resolver_new (avahi_service_browser_get_client (b), interface, protocol, name, type, domain, AVAHI_PROTO_UNSPEC, 0, avahi_service_resolver_callback, "xxXXxx");
+        sr = avahi_service_resolver_new (avahi_service_browser_get_client (b), interface, protocol, name, type, domain, AVAHI_PROTO_UNSPEC, 0, avahi_service_resolver_callback, (char*) "xxXXxx");
         printf("New service resolver %p\n", (void*) sr);
     }
 }
@@ -120,7 +118,7 @@ static void avahi_service_type_browser_callback (
     const char *domain,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void *userdata) {
-    
+
     printf ("SERVICE-TYPE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, type ? type : "NULL", domain ? domain : "NULL", (char*)userdata);
 }
 
@@ -133,7 +131,7 @@ static void avahi_address_resolver_callback (
     const char *name,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void *userdata) {
-    
+
     char addr[64];
     if (event == AVAHI_RESOLVER_FAILURE) {
         printf ("ADDRESS-RESOLVER: Callback on AddressResolver, timed out.\n");
@@ -152,17 +150,17 @@ static void avahi_host_name_resolver_callback (
     const AvahiAddress *a,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void *userdata) {
-    
+
     AvahiClient *client;
     AvahiAddressResolver *ar;
     char addr[64];
-    
+
     if (event == AVAHI_RESOLVER_FAILURE) {
         printf ("HOST-NAME-RESOLVER: Callback on HostNameResolver, timed out.\n");
         return;
     }
     client = avahi_host_name_resolver_get_client (r);
-    ar = avahi_address_resolver_new(client, interface, protocol, a, 0, avahi_address_resolver_callback, "omghai6u");
+ar = avahi_address_resolver_new(client, interface, protocol, a, 0, avahi_address_resolver_callback, (char*) "omghai6u");
     if (ar)
     {
         printf ("Succesfully created address resolver object\n");
@@ -227,8 +225,8 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     simple_poll = avahi_simple_poll_new();
     poll_api = avahi_simple_poll_get(simple_poll);
-    
-    if (!(avahi = avahi_client_new(poll_api, 0, avahi_client_callback, "omghai2u", &error))) {
+
+    if (!(avahi = avahi_client_new(poll_api, 0, avahi_client_callback, (char*) "omghai2u", &error))) {
         fprintf(stderr, "Client failed: %s\n", avahi_strerror(error));
         goto fail;
     }
@@ -246,15 +244,15 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     ret = avahi_client_get_host_name_fqdn (avahi);
     printf("FQDN: %s (Error Return: %s)\n", ret, ret ? "OK" : avahi_strerror(avahi_client_errno(avahi)));
-    
+
     cookie = avahi_client_get_local_service_cookie(avahi);
     printf("Local service cookie: %u (Error Return: %s)\n", cookie, cookie != AVAHI_SERVICE_COOKIE_INVALID ? "OK" : avahi_strerror(avahi_client_errno(avahi)));
 
-    group = avahi_entry_group_new(avahi, avahi_entry_group_callback, "omghai");
+    group = avahi_entry_group_new(avahi, avahi_entry_group_callback, (char*) "omghai");
     printf("Creating entry group: %s\n", group ? "OK" : avahi_strerror(avahi_client_errno (avahi)));
 
     assert(group);
-    
+
     printf("Sucessfully created entry group %p\n", (void*) group);
 
     printf("%s\n", avahi_strerror(avahi_entry_group_add_service (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar", NULL)));
@@ -262,26 +260,26 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     avahi_entry_group_commit (group);
 
-    domain = avahi_domain_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_BROWSE, 0, avahi_domain_browser_callback, "omghai3u");
-    
+    domain = avahi_domain_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_BROWSE, 0, avahi_domain_browser_callback, (char*) "omghai3u");
+
     if (domain == NULL)
         printf ("Failed to create domain browser object\n");
     else
         printf ("Sucessfully created domain browser %p\n", (void*) domain);
 
-    st = avahi_service_type_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, 0, avahi_service_type_browser_callback, "omghai3u");
+    st = avahi_service_type_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, 0, avahi_service_type_browser_callback, (char*) "omghai3u");
     if (st == NULL)
         printf ("Failed to create service type browser object\n");
     else
         printf ("Sucessfully created service type browser %p\n", (void*) st);
 
-    sb = avahi_service_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_http._tcp", NULL, 0, avahi_service_browser_callback, "omghai3u");
+    sb = avahi_service_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_http._tcp", NULL, 0, avahi_service_browser_callback, (char*) "omghai3u");
     if (sb == NULL)
         printf ("Failed to create service browser object\n");
     else
         printf ("Sucessfully created service browser %p\n", (void*) sb);
 
-    hnr = avahi_host_name_resolver_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "ecstasy.local", AVAHI_PROTO_UNSPEC, 0, avahi_host_name_resolver_callback, "omghai4u");
+    hnr = avahi_host_name_resolver_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "ecstasy.local", AVAHI_PROTO_UNSPEC, 0, avahi_host_name_resolver_callback, (char*) "omghai4u");
     if (hnr == NULL)
         printf ("Failed to create hostname resolver object\n");
     else
@@ -291,7 +289,7 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     if (aar == NULL) {
         printf ("failed to create address object\n");
     } else {
-        group2 = avahi_entry_group_new (avahi, avahi_entry_group2_callback, "omghai222");
+        group2 = avahi_entry_group_new (avahi, avahi_entry_group2_callback, (char*) "omghai222");
         if ((error = avahi_entry_group_add_address (group2, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "test-mdns.local.", aar)) < 0)
         {
             printf ("*** failed to add address to entry group: %s\n", avahi_strerror (error));
@@ -317,7 +315,7 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     avahi_simple_poll_loop(simple_poll);
 
     printf("terminating...\n");
-    
+
 fail:
 
     if (avahi)
index 389a3d11ce0bedcc17b2dfdd79cb1a41ba90b963..643572309530d674fe48614bff8fbd254b5f7b42 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -35,6 +33,7 @@
 #include <avahi-common/dbus.h>
 #include <avahi-common/malloc.h>
 #include <avahi-common/dbus-watch-glue.h>
+#include <avahi-common/i18n.h>
 
 #include "client.h"
 #include "internal.h"
index 2f86d020678c3b361dfa9df9c257d0e57889b0a4..1039da57af14b2daed3a809cbf3ed56912aa2415 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooclienthfoo
 #define fooclienthfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -44,7 +42,7 @@ typedef enum {
     AVAHI_CLIENT_S_RUNNING = AVAHI_SERVER_RUNNING,          /**< Server state: RUNNING */
     AVAHI_CLIENT_S_COLLISION = AVAHI_SERVER_COLLISION,      /**< Server state: COLLISION */
     AVAHI_CLIENT_FAILURE = 100,                             /**< Some kind of error happened on the client side */
-    AVAHI_CLIENT_CONNECTING = 101                           /**< We're still connecting. This state is only entered when AVAHI_CLIENT_NO_FAIL has been passed to avahi_client_new() and the daemon is not yet available. */  
+    AVAHI_CLIENT_CONNECTING = 101                           /**< We're still connecting. This state is only entered when AVAHI_CLIENT_NO_FAIL has been passed to avahi_client_new() and the daemon is not yet available. */
 } AvahiClientState;
 
 typedef enum {
@@ -93,7 +91,7 @@ const char* avahi_client_get_domain_name (AvahiClient*);
 const char* avahi_client_get_host_name_fqdn (AvahiClient*);
 
 /** Get state */
-AvahiClientState avahi_client_get_state(AvahiClient *client); 
+AvahiClientState avahi_client_get_state(AvahiClient *client);
 
 /** @{ \name Error Handling */
 
index e2fc3b9298e146e431f9f080f399b4f0fb7cf438..d809d6044d5719d50a80c806e06dd51890154ef4 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -57,23 +55,23 @@ static int retrieve_state(AvahiEntryGroup *group) {
     int r = AVAHI_OK;
     int32_t state;
     AvahiClient *client;
-    
+
     dbus_error_init(&error);
 
     assert(group);
     client = group->client;
-    
+
     if (!(message = dbus_message_new_method_call(AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "GetState"))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-        
+
     if (!(reply = dbus_connection_send_with_reply_and_block(client->bus, message, -1, &error)) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &state, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -84,7 +82,7 @@ static int retrieve_state(AvahiEntryGroup *group) {
     dbus_message_unref(reply);
 
     return state;
-    
+
 fail:
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
@@ -120,14 +118,14 @@ AvahiEntryGroup* avahi_entry_group_new (AvahiClient *client, AvahiEntryGroupCall
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     group->client = client;
     group->callback = callback;
     group->userdata = userdata;
     group->state_valid = 0;
     group->path = NULL;
     AVAHI_LLIST_PREPEND(AvahiEntryGroup, groups, client->groups, group);
-    
+
     if (!(message = dbus_message_new_method_call(
               AVAHI_DBUS_NAME,
               AVAHI_DBUS_PATH_SERVER,
@@ -148,7 +146,7 @@ AvahiEntryGroup* avahi_entry_group_new (AvahiClient *client, AvahiEntryGroupCall
         avahi_client_set_errno (client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!(group->path = avahi_strdup (path))) {
 
         /* FIXME: We don't remove the object on the server side */
@@ -161,7 +159,7 @@ AvahiEntryGroup* avahi_entry_group_new (AvahiClient *client, AvahiEntryGroupCall
         avahi_client_set_errno(client, state);
         goto fail;
     }
-    
+
     avahi_entry_group_set_state(group, (AvahiEntryGroupState) state);
 
     dbus_message_unref(message);
@@ -177,13 +175,13 @@ fail:
 
     if (group)
         avahi_entry_group_free(group);
-    
+
     if (message)
         dbus_message_unref(message);
 
     if (reply)
         dbus_message_unref(reply);
-    
+
     return NULL;
 }
 
@@ -192,23 +190,23 @@ static int entry_group_simple_method_call(AvahiEntryGroup *group, const char *me
     DBusError error;
     int r = AVAHI_OK;
     AvahiClient *client;
-    
+
     dbus_error_init(&error);
 
     assert(group);
     client = group->client;
-    
+
     if (!(message = dbus_message_new_method_call(AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, method))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-        
+
     if (!(reply = dbus_connection_send_with_reply_and_block(client->bus, message, -1, &error)) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -219,7 +217,7 @@ static int entry_group_simple_method_call(AvahiEntryGroup *group, const char *me
     dbus_message_unref(reply);
 
     return AVAHI_OK;
-    
+
 fail:
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
@@ -238,12 +236,12 @@ fail:
 int avahi_entry_group_free(AvahiEntryGroup *group) {
     AvahiClient *client = group->client;
     int r = AVAHI_OK;
-        
+
     assert(group);
-    
+
     if (group->path && avahi_client_is_connected(client))
         r = entry_group_simple_method_call(group, "Free");
-    
+
     AVAHI_LLIST_REMOVE(AvahiEntryGroup, groups, client->groups, group);
 
     avahi_free(group->path);
@@ -255,7 +253,7 @@ int avahi_entry_group_free(AvahiEntryGroup *group) {
 int avahi_entry_group_commit(AvahiEntryGroup *group) {
     int ret;
     assert(group);
-    
+
     if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
@@ -269,13 +267,13 @@ int avahi_entry_group_commit(AvahiEntryGroup *group) {
 int avahi_entry_group_reset(AvahiEntryGroup *group) {
     int ret;
     assert(group);
-    
+
     if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     if ((ret = entry_group_simple_method_call(group, "Reset")) < 0)
         return ret;
-    
+
     group->state_valid = 0;
     return ret;
 }
@@ -285,13 +283,13 @@ int avahi_entry_group_get_state (AvahiEntryGroup *group) {
 
     if (group->state_valid)
         return group->state;
-    
+
     return retrieve_state(group);
 }
 
 AvahiClient* avahi_entry_group_get_client (AvahiEntryGroup *group) {
     assert(group);
-    
+
     return group->client;
 }
 
@@ -301,7 +299,7 @@ int avahi_entry_group_is_empty (AvahiEntryGroup *group) {
     int r = AVAHI_OK;
     int b;
     AvahiClient *client;
-    
+
     assert(group);
     client = group->client;
 
@@ -309,18 +307,18 @@ int avahi_entry_group_is_empty (AvahiEntryGroup *group) {
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     dbus_error_init(&error);
-    
+
     if (!(message = dbus_message_new_method_call(AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "IsEmpty"))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-        
+
     if (!(reply = dbus_connection_send_with_reply_and_block(client->bus, message, -1, &error)) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_BOOLEAN, &b, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -331,7 +329,7 @@ int avahi_entry_group_is_empty (AvahiEntryGroup *group) {
     dbus_message_unref(reply);
 
     return !!b;
-    
+
 fail:
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
@@ -349,16 +347,16 @@ fail:
 
 static int append_rdata(DBusMessage *message, const void *rdata, size_t size) {
     DBusMessageIter iter, sub;
+
     assert(message);
+
     dbus_message_iter_init_append(message, &iter);
+
     if (!(dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING, &sub)) ||
         !(dbus_message_iter_append_fixed_array(&sub, DBUS_TYPE_BYTE, &rdata, size)) ||
         !(dbus_message_iter_close_container(&iter, &sub)))
         return -1;
-    
+
     return 0;
 }
 
@@ -373,7 +371,7 @@ static int append_string_list(DBusMessage *message, AvahiStringList *txt) {
 
     /* Reverse the string list, so that we can pass it in-order to the server */
     txt = avahi_string_list_reverse(txt);
-    
+
     if (!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "ay", &sub))
         goto fail;
 
@@ -381,7 +379,7 @@ static int append_string_list(DBusMessage *message, AvahiStringList *txt) {
     for (p = txt; p != NULL; p = p->next) {
         DBusMessageIter sub2;
         const uint8_t *data = p->text;
-        
+
         if (!(dbus_message_iter_open_container(&sub, DBUS_TYPE_ARRAY, "y", &sub2)) ||
             !(dbus_message_iter_append_fixed_array(&sub2, DBUS_TYPE_BYTE, &data, p->size)) ||
             !(dbus_message_iter_close_container(&sub, &sub2)))
@@ -412,7 +410,7 @@ int avahi_entry_group_add_service_strlst(
     const char *host,
     uint16_t port,
     AvahiStringList *txt) {
-    
+
     DBusMessage *message = NULL, *reply = NULL;
     int r = AVAHI_OK;
     DBusError error;
@@ -434,9 +432,9 @@ int avahi_entry_group_add_service_strlst(
 
     if (!host)
         host = "";
-    
+
     dbus_error_init(&error);
-    
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService"))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -461,13 +459,13 @@ int avahi_entry_group_add_service_strlst(
         r = avahi_client_set_errno(group->client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(reply = dbus_connection_send_with_reply_and_block(client->bus, message, -1, &error)) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -480,7 +478,7 @@ int avahi_entry_group_add_service_strlst(
     return AVAHI_OK;
 
 fail:
-    
+
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
         dbus_error_free(&error);
@@ -506,7 +504,7 @@ int avahi_entry_group_add_service(
     const char *host,
     uint16_t port,
     ...) {
-    
+
     va_list va;
     int r;
     AvahiStringList *txt;
@@ -552,7 +550,7 @@ int avahi_entry_group_add_service_subtype(
         domain = "";
 
     dbus_error_init(&error);
-    
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddServiceSubtype"))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -575,13 +573,13 @@ int avahi_entry_group_add_service_subtype(
         r = avahi_client_set_errno(group->client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(reply = dbus_connection_send_with_reply_and_block(client->bus, message, -1, &error)) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -594,7 +592,7 @@ int avahi_entry_group_add_service_subtype(
     return AVAHI_OK;
 
 fail:
-    
+
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
         dbus_error_free(&error);
@@ -615,9 +613,9 @@ int avahi_entry_group_update_service_txt(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     ...) {
 
     va_list va;
@@ -637,9 +635,9 @@ int avahi_entry_group_update_service_txt_strlst(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     AvahiStringList *txt) {
 
     DBusMessage *message = NULL, *reply = NULL;
@@ -660,9 +658,9 @@ int avahi_entry_group_update_service_txt_strlst(
 
     if (!domain)
         domain = "";
-    
+
     dbus_error_init(&error);
-    
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "UpdateServiceTxt"))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -691,7 +689,7 @@ int avahi_entry_group_update_service_txt_strlst(
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -704,7 +702,7 @@ int avahi_entry_group_update_service_txt_strlst(
     return AVAHI_OK;
 
 fail:
-    
+
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
         dbus_error_free(&error);
@@ -745,7 +743,7 @@ int avahi_entry_group_add_address(
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     dbus_error_init(&error);
-    
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddAddress"))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -754,7 +752,7 @@ int avahi_entry_group_add_address(
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
     u_flags = (uint32_t) flags;
-        
+
     if (!avahi_address_snprint (s_address, sizeof (s_address), a))
     {
         r = avahi_client_set_errno(client, AVAHI_ERR_INVALID_ADDRESS);
@@ -772,13 +770,13 @@ int avahi_entry_group_add_address(
         r = avahi_client_set_errno(group->client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(reply = dbus_connection_send_with_reply_and_block(client->bus, message, -1, &error)) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -791,7 +789,7 @@ int avahi_entry_group_add_address(
     return AVAHI_OK;
 
 fail:
-    
+
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
         dbus_error_free(&error);
@@ -834,7 +832,7 @@ int avahi_entry_group_add_record(
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     dbus_error_init(&error);
-    
+
     if (!(message = dbus_message_new_method_call (AVAHI_DBUS_NAME, group->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddRecord"))) {
         r = avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -843,7 +841,7 @@ int avahi_entry_group_add_record(
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
     u_flags = (uint32_t) flags;
-        
+
     if (!dbus_message_append_args(
             message,
             DBUS_TYPE_INT32, &i_interface,
@@ -857,13 +855,13 @@ int avahi_entry_group_add_record(
         r = avahi_client_set_errno(group->client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(reply = dbus_connection_send_with_reply_and_block(client->bus, message, -1, &error)) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INVALID) ||
         dbus_error_is_set (&error)) {
         r = avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
@@ -876,7 +874,7 @@ int avahi_entry_group_add_record(
     return AVAHI_OK;
 
 fail:
-    
+
     if (dbus_error_is_set(&error)) {
         r = avahi_client_set_dbus_error(client, &error);
         dbus_error_free(&error);
index e49dd15cb41d3e5e6bbb7ca6c214c5acabaaef69..e5f3beb30112ff81ef7f4c764aead391c6707eba 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foointernalhfoo
 #define foointernalhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -39,10 +37,10 @@ struct AvahiClient {
     char *version_string, *host_name, *host_name_fqdn, *domain_name;
     uint32_t local_service_cookie;
     int local_service_cookie_valid;
-    
+
     AvahiClientCallback callback;
     void *userdata;
-    
+
     AVAHI_LLIST_HEAD(AvahiEntryGroup, groups);
     AVAHI_LLIST_HEAD(AvahiDomainBrowser, domain_browsers);
     AVAHI_LLIST_HEAD(AvahiServiceBrowser, service_browsers);
@@ -65,7 +63,7 @@ struct AvahiEntryGroup {
 
 struct AvahiDomainBrowser {
     int ref;
-    
+
     char *path;
     AvahiClient *client;
     AvahiDomainBrowserCallback callback;
index 79224a0b3f8d5f232fd55f828221b4fc988aef40..52407f4aa56680b298bfdf3ed7dd6819ad9d580a 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef fooclientlookuphfoo
 #define fooclientlookuphfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -190,11 +188,11 @@ typedef void (*AvahiServiceResolverCallback) (
  * resp. AAAA resource record. */
 AvahiServiceResolver * avahi_service_resolver_new(
     AvahiClient *client,
-    AvahiIfIndex interface,   /**< Pass the interface argument you recieved in AvahiServiceBrowserCallback here. */
-    AvahiProtocol protocol,   /**< Pass the protocol argument you recieved in AvahiServiceBrowserCallback here. */
-    const char *name,         /**< Pass the name argument you recieved in AvahiServiceBrowserCallback here. */
-    const char *type,         /**< Pass the type argument you recieved in AvahiServiceBrowserCallback here. */
-    const char *domain,       /**< Pass the domain argument you recieved in AvahiServiceBrowserCallback here. */
+    AvahiIfIndex interface,   /**< Pass the interface argument you received in AvahiServiceBrowserCallback here. */
+    AvahiProtocol protocol,   /**< Pass the protocol argument you received in AvahiServiceBrowserCallback here. */
+    const char *name,         /**< Pass the name argument you received in AvahiServiceBrowserCallback here. */
+    const char *type,         /**< Pass the type argument you received in AvahiServiceBrowserCallback here. */
+    const char *domain,       /**< Pass the domain argument you received in AvahiServiceBrowserCallback here. */
     AvahiProtocol aprotocol,  /**< The desired address family of the service address to resolve. AVAHI_PROTO_UNSPEC if your application can deal with both IPv4 and IPv6 */
     AvahiLookupFlags flags,
     AvahiServiceResolverCallback callback,
index 1efc85fa40e7588992969865746b471f2a17a7cd..ea731f2cdc0f660a6463e2ad3f2e97f2f1164057 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooclientpublishhfoo
 #define fooclientpublishhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -92,7 +90,7 @@ int avahi_entry_group_add_service(
     AvahiPublishFlags flags /**< Usually 0, unless you know what you do */,
     const char *name        /**< The name for the new service. Must be valid service name. i.e. a string shorter than 63 characters and valid UTF-8. May not be NULL. */,
     const char *type        /**< The service type for the new service, such as _http._tcp. May not be NULL. */,
-    const char *domain      /**< The domain to register this domain in. We recommend to pass NULL here, to let the daemon decide */,   
+    const char *domain      /**< The domain to register this domain in. We recommend to pass NULL here, to let the daemon decide */,
     const char *host        /**< The host this services is residing on. We recommend to pass NULL here, the daemon will than automatically insert the local host name in that case */,
     uint16_t port           /**< The IP port number of this service */,
     ...) AVAHI_GCC_SENTINEL;
@@ -127,9 +125,9 @@ int avahi_entry_group_update_service_txt(
     AvahiIfIndex interface   /**< The interface this service is announced on. This should match the value passed to the original avahi_entry_group_add_service() call. */,
     AvahiProtocol protocol   /**< The protocol this service is announced with. This should match the value passed to the original avahi_entry_group_add_service() call. */,
     AvahiPublishFlags flags  /**< Only != 0 if you really know what you do */,
-    const char *name         /**< The name of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,    
-    const char *type         /**< The type of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,     
-    const char *domain       /**< The domain this service resides is, as passed to avahi_entry_group_add_service(). May be NULL. */,   
+    const char *name         /**< The name of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,
+    const char *type         /**< The type of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,
+    const char *domain       /**< The domain this service resides is, as passed to avahi_entry_group_add_service(). May be NULL. */,
     ...) AVAHI_GCC_SENTINEL;
 
 /** Update a TXT record for an existing service. Similar to avahi_entry_group_update_service_txt() but takes an AvahiStringList for the TXT strings, instead of a NULL terminated list of arguments. */
@@ -138,9 +136,9 @@ int avahi_entry_group_update_service_txt_strlst(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     AvahiStringList *strlst);
 
 /** \cond fulldocs */
index 4403a12713cabc33b9c07519b40b76ae1a7861d6..6ee15e93f2434516734c05a86eab11ec255c62e7 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -48,7 +46,7 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
 
     assert(client);
     assert(message);
-    
+
     dbus_error_init (&error);
 
     if (!(path = dbus_message_get_path(message)))
@@ -70,7 +68,7 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
             uint16_t port;
             DBusMessageIter iter, sub;
             AvahiAddress a;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_INT32, &interface,
@@ -84,48 +82,48 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
                     DBUS_TYPE_UINT16, &port,
                     DBUS_TYPE_INVALID) ||
                 dbus_error_is_set (&error)) {
-            
+
                 fprintf(stderr, "Failed to parse resolver event.\n");
                 goto fail;
             }
-        
+
             dbus_message_iter_init(message, &iter);
-        
+
             for (j = 0; j < 9; j++)
                 dbus_message_iter_next(&iter);
-        
+
             if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
                 dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_ARRAY) {
                 fprintf(stderr, "Error parsing service resolving message\n");
                 goto fail;
             }
-        
+
             strlst = NULL;
             dbus_message_iter_recurse(&iter, &sub);
-        
+
             for (;;) {
                 DBusMessageIter sub2;
                 int at;
                 const uint8_t *k;
                 int n;
-            
+
                 if ((at = dbus_message_iter_get_arg_type(&sub)) == DBUS_TYPE_INVALID)
                     break;
-            
+
                 assert(at == DBUS_TYPE_ARRAY);
-            
+
                 if (dbus_message_iter_get_element_type(&sub) != DBUS_TYPE_BYTE) {
                     fprintf(stderr, "Error parsing service resolving message\n");
                     goto fail;
                 }
-            
+
                 dbus_message_iter_recurse(&sub, &sub2);
 
                 k = NULL; n = 0;
                 dbus_message_iter_get_fixed_array(&sub2, &k, &n);
                 if (k && n > 0)
                     strlst = avahi_string_list_add_arbitrary(strlst, k, n);
-            
+
                 dbus_message_iter_next(&sub);
             }
 
@@ -137,23 +135,23 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
             }
 
             dbus_message_iter_get_basic(&iter, &flags);
-                                    
+
             assert(address);
 
             if (address[0] == 0)
                 address = NULL;
            else
                avahi_address_parse(address, (AvahiProtocol) aprotocol, &a);
-    
+
             r->callback(r, (AvahiIfIndex) interface, (AvahiProtocol) protocol, AVAHI_RESOLVER_FOUND, name, type, domain, host, address ? &a : NULL, port, strlst, (AvahiLookupResultFlags) flags, r->userdata);
-        
+
             avahi_string_list_free(strlst);
             break;
         }
-            
+
         case AVAHI_RESOLVER_FAILURE: {
             char *etxt;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_STRING, &etxt,
@@ -162,7 +160,7 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
                 fprintf(stderr, "Failed to parse resolver event.\n");
                 goto fail;
             }
-            
+
             avahi_client_set_errno(r->client, avahi_error_dbus_to_number(etxt));
             r->callback(r, r->interface, r->protocol, event, r->name, r->type, r->domain, NULL, NULL, 0, NULL, 0, r->userdata);
             break;
@@ -171,7 +169,7 @@ DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolv
 
     return DBUS_HANDLER_RESULT_HANDLED;
 
-    
+
 fail:
     dbus_error_free (&error);
     avahi_string_list_free(strlst);
@@ -196,7 +194,7 @@ AvahiServiceResolver * avahi_service_resolver_new(
     int32_t i_interface, i_protocol, i_aprotocol;
     uint32_t u_flags;
     char *path;
-    
+
     assert(client);
     assert(type);
 
@@ -205,7 +203,7 @@ AvahiServiceResolver * avahi_service_resolver_new(
 
     if (!name)
         name = "";
-    
+
     dbus_error_init (&error);
 
     if (!avahi_client_is_connected(client)) {
@@ -225,7 +223,7 @@ AvahiServiceResolver * avahi_service_resolver_new(
     r->name = r->type = r->domain = NULL;
     r->interface = interface;
     r->protocol = protocol;
-    
+
     AVAHI_LLIST_PREPEND(AvahiServiceResolver, service_resolvers, client->service_resolvers, r);
 
     if (name && name[0])
@@ -244,8 +242,8 @@ AvahiServiceResolver * avahi_service_resolver_new(
             avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
             goto fail;
         }
-    
-    
+
+
     if (!(message = dbus_message_new_method_call(AVAHI_DBUS_NAME, AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "ServiceResolverNew"))) {
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -290,13 +288,13 @@ AvahiServiceResolver * avahi_service_resolver_new(
         avahi_client_set_errno(client, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-        
+
 
     dbus_message_unref(message);
     dbus_message_unref(reply);
 
     return r;
-    
+
 fail:
 
     if (dbus_error_is_set(&error)) {
@@ -306,13 +304,13 @@ fail:
 
     if (r)
         avahi_service_resolver_free(r);
-    
+
     if (message)
         dbus_message_unref(message);
 
     if (reply)
         dbus_message_unref(reply);
-    
+
     return NULL;
 
 }
@@ -353,7 +351,7 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
 
     assert(client);
     assert(message);
-    
+
     dbus_error_init (&error);
 
     if (!(path = dbus_message_get_path(message)))
@@ -372,7 +370,7 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
             uint32_t flags;
             char *name, *address;
             AvahiAddress a;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_INT32, &interface,
@@ -386,20 +384,20 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
                 fprintf(stderr, "Failed to parse resolver event.\n");
                 goto fail;
             }
-            
+
             assert(address);
             if (!avahi_address_parse(address, (AvahiProtocol) aprotocol, &a)) {
                 fprintf(stderr, "Failed to parse address\n");
                 goto fail;
             }
-            
+
             r->callback(r, (AvahiIfIndex) interface, (AvahiProtocol) protocol, AVAHI_RESOLVER_FOUND, name, &a, (AvahiLookupResultFlags) flags, r->userdata);
             break;
         }
-            
+
         case AVAHI_RESOLVER_FAILURE: {
             char *etxt;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_STRING, &etxt,
@@ -408,7 +406,7 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
                 fprintf(stderr, "Failed to parse resolver event.\n");
                 goto fail;
             }
-            
+
             avahi_client_set_errno(r->client, avahi_error_dbus_to_number(etxt));
             r->callback(r, r->interface, r->protocol, event, r->host_name, NULL, 0, r->userdata);
             break;
@@ -416,7 +414,7 @@ DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiReso
     }
 
     return DBUS_HANDLER_RESULT_HANDLED;
-    
+
 fail:
     dbus_error_free (&error);
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -439,7 +437,7 @@ AvahiHostNameResolver * avahi_host_name_resolver_new(
     int32_t i_interface, i_protocol, i_aprotocol;
     uint32_t u_flags;
     char *path;
-    
+
     assert(client);
     assert(name);
 
@@ -462,7 +460,7 @@ AvahiHostNameResolver * avahi_host_name_resolver_new(
     r->interface = interface;
     r->protocol = protocol;
     r->host_name = NULL;
-    
+
     AVAHI_LLIST_PREPEND(AvahiHostNameResolver, host_name_resolvers, client->host_name_resolvers, r);
 
     if (!(r->host_name = avahi_strdup(name))) {
@@ -517,7 +515,7 @@ AvahiHostNameResolver * avahi_host_name_resolver_new(
     dbus_message_unref(reply);
 
     return r;
-    
+
 fail:
 
     if (dbus_error_is_set(&error)) {
@@ -527,7 +525,7 @@ fail:
 
     if (r)
         avahi_host_name_resolver_free(r);
-    
+
     if (message)
         dbus_message_unref(message);
 
@@ -572,7 +570,7 @@ DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolv
 
     assert(client);
     assert(message);
-    
+
     dbus_error_init (&error);
 
     if (!(path = dbus_message_get_path(message)))
@@ -591,7 +589,7 @@ DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolv
             uint32_t flags;
             char *name, *address;
             AvahiAddress a;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_INT32, &interface,
@@ -605,20 +603,20 @@ DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolv
                 fprintf(stderr, "Failed to parse resolver event.\n");
                 goto fail;
             }
-            
+
             assert(address);
             if (!avahi_address_parse(address, (AvahiProtocol) aprotocol, &a)) {
                 fprintf(stderr, "Failed to parse address\n");
                 goto fail;
             }
-            
+
             r->callback(r, (AvahiIfIndex) interface, (AvahiProtocol) protocol, AVAHI_RESOLVER_FOUND, &a, name, (AvahiLookupResultFlags) flags, r->userdata);
             break;
         }
 
         case AVAHI_RESOLVER_FAILURE: {
             char *etxt;
-            
+
             if (!dbus_message_get_args(
                     message, &error,
                     DBUS_TYPE_STRING, &etxt,
@@ -627,7 +625,7 @@ DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolv
                 fprintf(stderr, "Failed to parse resolver event.\n");
                 goto fail;
             }
-            
+
             avahi_client_set_errno(r->client, avahi_error_dbus_to_number(etxt));
             r->callback(r, r->interface, r->protocol, event, &r->address, NULL, 0, r->userdata);
             break;
@@ -635,7 +633,7 @@ DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolv
     }
 
     return DBUS_HANDLER_RESULT_HANDLED;
-    
+
 fail:
     dbus_error_free (&error);
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -646,7 +644,7 @@ AvahiAddressResolver * avahi_address_resolver_new(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     const AvahiAddress *a,
-    AvahiLookupFlags flags, 
+    AvahiLookupFlags flags,
     AvahiAddressResolverCallback callback,
     void *userdata) {
 
@@ -685,7 +683,7 @@ AvahiAddressResolver * avahi_address_resolver_new(
     r->interface = interface;
     r->protocol = protocol;
     r->address = *a;
-    
+
     AVAHI_LLIST_PREPEND(AvahiAddressResolver, address_resolvers, client->address_resolvers, r);
 
     if (!(message = dbus_message_new_method_call(AVAHI_DBUS_NAME, AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "AddressResolverNew"))) {
@@ -720,7 +718,7 @@ AvahiAddressResolver * avahi_address_resolver_new(
         avahi_client_set_errno(client, AVAHI_ERR_DBUS_ERROR);
         goto fail;
     }
-    
+
     if (!(r->path = avahi_strdup(path))) {
 
         /* FIXME: We don't remove the object on the server side */
@@ -733,7 +731,7 @@ AvahiAddressResolver * avahi_address_resolver_new(
     dbus_message_unref(reply);
 
     return r;
-    
+
 fail:
 
     if (dbus_error_is_set(&error)) {
@@ -743,7 +741,7 @@ fail:
 
     if (r)
         avahi_address_resolver_free(r);
-    
+
     if (message)
         dbus_message_unref(message);
 
index 9fffa5dc003f7674ecbeb85e53ca119ceea00433..0402585a088aba0bf601d164d150dd11c92b5415 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -37,11 +35,11 @@ static void hexdump(const void* p, size_t size) {
     assert(p);
 
     printf("Dumping %lu bytes from %p:\n", (unsigned long) size, p);
-    
+
     while (size > 0) {
         unsigned i;
 
-        for (i = 0; i < 16; i++) { 
+        for (i = 0; i < 16; i++) {
             if (i < size)
                 printf("%02x ", c[i]);
             else
@@ -54,14 +52,14 @@ static void hexdump(const void* p, size_t size) {
             else
                 printf(" ");
         }
-        
+
         printf("\n");
 
         c += 16;
 
         if (size <= 16)
             break;
-        
+
         size -= 16;
     }
 }
@@ -91,13 +89,13 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     const AvahiPoll *poll_api;
     AvahiClient *client;
     AvahiRecordBrowser *r;
-    
+
     simple_poll = avahi_simple_poll_new();
     assert(simple_poll);
-    
+
     poll_api = avahi_simple_poll_get(simple_poll);
     assert(poll_api);
-    
+
     client = avahi_client_new(poll_api, 0, NULL, NULL, NULL);
     assert(client);
 
index 5242947135b639962a24d67da7dacc25c2e9095a..650bd7758e807c5ad050fc28e0364d9e00dd0fe8 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -56,13 +54,13 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     const AvahiPoll *poll_api;
     AvahiClient *client;
     AvahiServiceResolver *r;
-    
+
     simple_poll = avahi_simple_poll_new();
     assert(simple_poll);
-    
+
     poll_api = avahi_simple_poll_get(simple_poll);
     assert(poll_api);
-    
+
     client = avahi_client_new(poll_api, 0, NULL, NULL, NULL);
     assert(client);
 
index 2e1c88f757b9f359bbdce4b10b6a6c695b154a63..a7ee63e473f269d246c29efb070c34360194a6d5 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -32,7 +30,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     FILE *f;
 
     f = avahi_xdg_config_open("foo");
-    
+
     if (f)
         fclose(f);
 
index e333f90cb5a2f76b4f4992f1787dbdcb7eb3385e..fc6501688332a8b5835d47ecd1134cdbab165cef 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 88f66a88689bf2a779f11c9ee5cac5ea68bc6659..6c855abef2178641b35ed12ef71bde8fd1a19ac7 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooxdgconfighfoo
 #define fooxdgconfighfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index b4bc917eb2cc08fc72adaabe9522283a1f578338..79d062f6895d483848ff0a6cc5e209edfdf04b89 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: Makefile.am 90 2005-05-23 16:15:12Z lennart $
-#
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -71,7 +69,7 @@ libavahi_common_la_SOURCES = \
        i18n.c i18n.h
 
 libavahi_common_la_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -DAVAHI_LOCALEDIR=\"$(avahilocaledir)\"
-libavahi_common_la_LIBADD = $(AM_LDADD) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(LIBINTL)
+libavahi_common_la_LIBADD = $(AM_LDADD) $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) $(INTLLIBS)
 libavahi_common_la_LDFLAGS = $(AM_LDFLAGS)  -version-info $(LIBAVAHI_COMMON_VERSION_INFO)
 
 strlst_test_SOURCES = \
index 270292c60794a4b995c758e09c01e63a23e5d79a..e8f61489f702570915a8e4ab9a438444651264f2 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 6023a0303a888427aa51d94917bf426f2534a408..a14104fad658a6d72603d6210a13a48e4f3c0fc2 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooaddresshfoo
 #define fooaddresshfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 28ae7892a00ab6399f6ccc8d55b121a00475359d..9255435ec48f38dfbe3bd8722ebe19119aa84cfc 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -60,19 +58,19 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
         "gurke ###",
         NULL
     };
-        
+
     char *r = NULL;
     int i, j, k;
 
     for (k = 0; test_strings[k]; k++) {
 
         printf(">>>>>%s<<<<\n", test_strings[k]);
-        
+
         for (j = 0; j < 2; j++) {
-        
+
             for (i = 0; i <= 100; i++) {
                 char *n;
-                
+
                 n = i == 0 ? avahi_strdup(test_strings[k]) : (j ? avahi_alternative_service_name(r) : avahi_alternative_host_name(r));
                 avahi_free(r);
                 r = n;
@@ -81,7 +79,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
                     assert(avahi_is_valid_service_name(n));
                 else
                     assert(avahi_is_valid_host_name(n));
-                
+
                 printf("%s\n", r);
             }
         }
index 6ff9c355f09ebb8f57c2cb0ff621ca2276264d87..b3d39f0ed90484d23c9fd8a41ce48ec83fefa1c2 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -37,12 +35,12 @@ static void drop_incomplete_utf8(char *c) {
     char *e;
 
     e = strchr(c, 0) - 1;
-    
+
     while (e >= c) {
 
         if (avahi_utf8_valid(c))
             break;
-        
+
         assert(*e & 128);
         *e = 0;
 
@@ -58,12 +56,12 @@ char *avahi_alternative_host_name(const char *s) {
 
     if (!avahi_is_valid_host_name(s))
         return NULL;
-    
+
     if ((e = strrchr(s, '-'))) {
         const char *p;
 
         e++;
-        
+
         for (p = e; *p; p++)
             if (!isdigit(*p)) {
                 e = NULL;
@@ -94,11 +92,11 @@ char *avahi_alternative_host_name(const char *s) {
         }
 
         drop_incomplete_utf8(c);
-        
+
         r = avahi_strdup_printf("%s-%s", c, m);
         avahi_free(c);
         avahi_free(m);
-        
+
     } else {
         char *c;
 
@@ -106,7 +104,7 @@ char *avahi_alternative_host_name(const char *s) {
             return NULL;
 
         drop_incomplete_utf8(c);
-        
+
         r = avahi_strdup_printf("%s-2", c);
         avahi_free(c);
     }
@@ -124,11 +122,11 @@ char *avahi_alternative_service_name(const char *s) {
 
     if (!avahi_is_valid_service_name(s))
         return NULL;
-    
+
     if ((e = strstr(s, " #"))) {
         const char *n, *p;
         e += 2;
-    
+
         while ((n = strstr(e, " #")))
             e = n + 2;
 
@@ -141,7 +139,7 @@ char *avahi_alternative_service_name(const char *s) {
         if (e && (*e == '0' || *e == 0))
             e = NULL;
     }
-    
+
     if (e) {
         char *c, *m;
         size_t l;
@@ -162,7 +160,7 @@ char *avahi_alternative_service_name(const char *s) {
         }
 
         drop_incomplete_utf8(c);
-        
+
         r = avahi_strdup_printf("%s #%s", c, m);
         avahi_free(c);
         avahi_free(m);
@@ -171,14 +169,14 @@ char *avahi_alternative_service_name(const char *s) {
 
         if (!(c = avahi_strndup(s, AVAHI_LABEL_MAX-1-3)))
             return NULL;
-        
+
         drop_incomplete_utf8(c);
-        
+
         r = avahi_strdup_printf("%s #2", c);
         avahi_free(c);
     }
 
     assert(avahi_is_valid_service_name(r));
-    
+
     return r;
 }
index f4216f6cff6543dd89902453d9aa11314a98d83e..9b044de58190034d6d66b9441ea81011ed728645 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooalternativehfoo
 #define fooalternativehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index fc89197b9280ad24b0a6ff4f095650c54f38bab7..aef6aba0e9b5fab95a0031e11131e51bfc643765 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foocdeclhfoo
 #define foocdeclhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 35e2b455c8202193d887943f4d43d86aa9b02419..b18f555c191c5fbb31f1c62598f17644eb615199 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -116,7 +114,7 @@ static void dispatch_timeout_callback(AvahiTimeout *t, void *userdata) {
 
 static void watch_callback(AvahiWatch *avahi_watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEvent events, void *userdata) {
     DBusWatch *dbus_watch = userdata;
-    
+
     assert(avahi_watch);
     assert(dbus_watch);
 
@@ -127,13 +125,13 @@ static void watch_callback(AvahiWatch *avahi_watch, AVAHI_GCC_UNUSED int fd, Ava
 static dbus_bool_t update_watch(const AvahiPoll *poll_api, DBusWatch *dbus_watch) {
     AvahiWatch *avahi_watch;
     dbus_bool_t b;
-    
+
     assert(dbus_watch);
 
     avahi_watch = dbus_watch_get_data(dbus_watch);
 
     b = dbus_watch_get_enabled(dbus_watch);
-    
+
     if (b && !avahi_watch) {
 
         if (!(avahi_watch = poll_api->watch_new(
@@ -149,14 +147,14 @@ static dbus_bool_t update_watch(const AvahiPoll *poll_api, DBusWatch *dbus_watch
             return FALSE;
 
         dbus_watch_set_data(dbus_watch, avahi_watch, NULL);
-        
+
     } else if (!b && avahi_watch) {
-        
+
         poll_api->watch_free(avahi_watch);
         dbus_watch_set_data(dbus_watch, NULL, NULL);
 
     } else if (avahi_watch) {
-        
+
         /* Update flags */
         poll_api->watch_update(avahi_watch, dbus_watch_get_flags(dbus_watch));
     }
@@ -166,7 +164,7 @@ static dbus_bool_t update_watch(const AvahiPoll *poll_api, DBusWatch *dbus_watch
 
 static dbus_bool_t add_watch(DBusWatch *dbus_watch, void *userdata) {
     ConnectionData *d = userdata;
-    
+
     assert(dbus_watch);
     assert(d);
 
@@ -176,7 +174,7 @@ static dbus_bool_t add_watch(DBusWatch *dbus_watch, void *userdata) {
 static void remove_watch(DBusWatch *dbus_watch, void *userdata) {
     ConnectionData *d = userdata;
     AvahiWatch *avahi_watch;
-    
+
     assert(dbus_watch);
     assert(d);
 
@@ -188,7 +186,7 @@ static void remove_watch(DBusWatch *dbus_watch, void *userdata) {
 
 static void watch_toggled(DBusWatch *dbus_watch, void *userdata) {
     ConnectionData *d = userdata;
-    
+
     assert(dbus_watch);
     assert(d);
 
@@ -217,7 +215,7 @@ static void timeout_data_unref(TimeoutData *t) {
     if (--t->ref <= 0) {
         if (t->avahi_timeout)
             t->poll_api->timeout_free(t->avahi_timeout);
-        
+
         avahi_free(t);
     }
 }
@@ -225,7 +223,7 @@ static void timeout_data_unref(TimeoutData *t) {
 static void update_timeout(TimeoutData *timeout) {
     assert(timeout);
     assert(timeout->ref >= 1);
-    
+
     if (dbus_timeout_get_enabled(timeout->dbus_timeout)) {
         struct timeval tv;
         avahi_elapse_time(&tv, dbus_timeout_get_interval(timeout->dbus_timeout), 0);
@@ -238,7 +236,7 @@ static void update_timeout(TimeoutData *timeout) {
 
 static void timeout_callback(AvahiTimeout *avahi_timeout, void *userdata) {
     TimeoutData *timeout = userdata;
-    
+
     assert(avahi_timeout);
     assert(timeout);
 
@@ -249,7 +247,7 @@ static void timeout_callback(AvahiTimeout *avahi_timeout, void *userdata) {
 
     if (timeout->avahi_timeout)
         update_timeout(timeout);
-    
+
     timeout_data_unref(timeout);
 }
 
@@ -271,7 +269,7 @@ static dbus_bool_t add_timeout(DBusTimeout *dbus_timeout, void *userdata) {
 
     if ((b = dbus_timeout_get_enabled(dbus_timeout)))
         avahi_elapse_time(&tv, dbus_timeout_get_interval(dbus_timeout), 0);
-    
+
     if (!(timeout->avahi_timeout = d->poll_api->timeout_new(
               d->poll_api,
               b ? &tv : NULL,
@@ -311,14 +309,14 @@ static void timeout_toggled(DBusTimeout *dbus_timeout, AVAHI_GCC_UNUSED void *us
 
 static void dispatch_status(AVAHI_GCC_UNUSED DBusConnection *connection, DBusDispatchStatus new_status, void *userdata) {
     ConnectionData *d = userdata;
-    
+
     if (new_status == DBUS_DISPATCH_DATA_REMAINS)
         request_dispatch(d, 1);
  }
 
 int avahi_dbus_connection_glue(DBusConnection *c, const AvahiPoll *poll_api) {
     ConnectionData *d = NULL;
-    
+
     assert(c);
     assert(poll_api);
 
@@ -328,10 +326,10 @@ int avahi_dbus_connection_glue(DBusConnection *c, const AvahiPoll *poll_api) {
     d->poll_api = poll_api;
     d->connection = c;
     d->ref = 1;
-    
+
     if (!(d->dispatch_timeout = poll_api->timeout_new(poll_api, NULL, dispatch_timeout_callback, d)))
         goto fail;
-    
+
     if (!(dbus_connection_set_watch_functions(c, add_watch, remove_watch, watch_toggled, connection_data_ref(d), (DBusFreeFunction)connection_data_unref)))
         goto fail;
 
@@ -344,7 +342,7 @@ int avahi_dbus_connection_glue(DBusConnection *c, const AvahiPoll *poll_api) {
         request_dispatch(d, 1);
 
     connection_data_unref(d);
-    
+
     return 0;
 
 fail:
index 101fa3f1b183193842f6045acb82fdfa756351b2..138ea97a25881f09e33d4b3668989ea768c9a328 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodbuswatchgluehfoo
 #define foodbuswatchgluehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index ac54848772d0f36b1eb9f55b19b0f44b6eac0e57..f19c77c55921c0a87b8c45930548218e115036e5 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -41,7 +39,7 @@ static const char * const table[- AVAHI_ERR_MAX] = {
     AVAHI_DBUS_ERR_IS_PATTERN,
     AVAHI_DBUS_ERR_COLLISION,
     AVAHI_DBUS_ERR_INVALID_RECORD,
-    
+
     AVAHI_DBUS_ERR_INVALID_SERVICE_NAME,
     AVAHI_DBUS_ERR_INVALID_SERVICE_TYPE,
     AVAHI_DBUS_ERR_INVALID_PORT,
@@ -52,7 +50,7 @@ static const char * const table[- AVAHI_ERR_MAX] = {
     AVAHI_DBUS_ERR_TOO_MANY_OBJECTS,
     AVAHI_DBUS_ERR_TOO_MANY_ENTRIES,
     AVAHI_DBUS_ERR_OS,
-    
+
     AVAHI_DBUS_ERR_ACCESS_DENIED,
     AVAHI_DBUS_ERR_INVALID_OPERATION,
     AVAHI_DBUS_ERR_DBUS_ERROR,
@@ -63,7 +61,7 @@ static const char * const table[- AVAHI_ERR_MAX] = {
     AVAHI_DBUS_ERR_INVALID_INTERFACE,
     AVAHI_DBUS_ERR_INVALID_PROTOCOL,
     AVAHI_DBUS_ERR_INVALID_FLAGS,
-    
+
     AVAHI_DBUS_ERR_NOT_FOUND,
     AVAHI_DBUS_ERR_INVALID_CONFIG,
     AVAHI_DBUS_ERR_VERSION_MISMATCH,
@@ -74,7 +72,7 @@ static const char * const table[- AVAHI_ERR_MAX] = {
     AVAHI_DBUS_ERR_DNS_SERVFAIL,
     AVAHI_DBUS_ERR_DNS_NXDOMAIN,
     AVAHI_DBUS_ERR_DNS_NOTIMP,
-    
+
     AVAHI_DBUS_ERR_DNS_REFUSED,
     AVAHI_DBUS_ERR_DNS_YXDOMAIN,
     AVAHI_DBUS_ERR_DNS_YXRRSET,
@@ -128,7 +126,7 @@ int avahi_error_dbus_to_number(const char *s) {
     for (m = error_map; m->dbus_error; m++)
         if (strcmp(m->dbus_error, s) == 0)
             return m->avahi_error;
-    
+
     return AVAHI_ERR_DBUS_ERROR;
 }
 
index a93988d1b63814a60f0e573ace4c9734f9ee1ecf..ea3e8a2a62edc9f99986a491f9de0a7539c8d67f 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodbushfoo
 #define foodbushfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index ddeaf9e24dde72a361fc1cb1cd043856d87b788d..bb73a9dfdb703104ef65f31a4fa60a19a29f866f 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef foodefshfoo
 #define foodefshfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
  * avahi_client_new(). If the client is forced to disconnect from the
  * server it will enter AVAHI_CLIENT_FAILURE state with
  * avahi_client_errno() == AVAHI_ERR_DISCONNECTED. Free the
- * AvahiClient object in that case and reconnect to the server anew -
- * again with passing AVAHI_CLIENT_NO_FAIL to avahi_client_new().
+ * AvahiClient object in that case (and all its associated objects
+ * such as entry groups and browser objects prior to that) and
+ * reconnect to the server anew - again with passing
+ * AVAHI_CLIENT_NO_FAIL to avahi_client_new().
  *
  * We encourage implementing this in all software where service
  * discovery is not an integral part of application. e.g. use it in
- * all kinds of background daemons, but not in software like iChat
- * compatible IM software.
+ * all kinds of background daemons, but not necessarily in software
+ * like iChat compatible IM software.
  *
  * For now AVAHI_CLIENT_NO_FAIL cannot deal with D-Bus daemon restarts.
  *
index 0f7d851ecab791775f358381f4e32d93a2cfddda..cf763eca6ee6462c578238b26f4adeb098b2af1f 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -36,14 +34,14 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     const char *p;
     size_t size;
     char name[64], type[AVAHI_DOMAIN_NAME_MAX], domain[AVAHI_DOMAIN_NAME_MAX];
-    
+
     printf("%s\n", s = avahi_normalize_name_strdup("foo.foo\\046."));
     avahi_free(s);
 
     printf("%s\n", s = avahi_normalize_name_strdup("foo.foo\\.foo."));
     avahi_free(s);
 
-    
+
     printf("%s\n", s = avahi_normalize_name_strdup("fo\\\\o\\..f oo."));
     avahi_free(s);
 
@@ -60,7 +58,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     avahi_service_name_split(t, name, sizeof(name), type, sizeof(type), domain, sizeof(domain));
     printf("name: <%s>; type: <%s>; domain <%s>\n", name, type, domain);
-    
+
     avahi_service_name_join(t, sizeof(t), NULL, "_http._tcp", "one.two\\. .local");
     printf("<%s>\n", t);
 
@@ -73,7 +71,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     size = sizeof(r);
     s = r;
-    
+
     printf("escaped: <%s>\n", avahi_escape_label(t, strlen(t), &s, &size));
 
     p = r;
@@ -90,7 +88,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     assert(!avahi_is_valid_service_type_generic("_foo._bar.waldo"));
     assert(!avahi_is_valid_service_type_strict("_foo._bar.waldo"));
     assert(!avahi_is_valid_service_subtype("_foo._bar.waldo"));
-    
+
     assert(!avahi_is_valid_service_type_generic(""));
     assert(!avahi_is_valid_service_type_strict(""));
     assert(!avahi_is_valid_service_subtype(""));
@@ -120,6 +118,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     assert(!avahi_is_valid_fqdn("192.168.50.1"));
     assert(!avahi_is_valid_fqdn("::1"));
     assert(!avahi_is_valid_fqdn(".192.168.50.1."));
-    
+
     return 0;
 }
index 8d339c7a487b2a6ddecb9103f7038f10f2f7131b..3b1ab683494e9e5caf6094944bd4e2e41ae96bdd 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 char *avahi_unescape_label(const char **name, char *dest, size_t size) {
     unsigned i = 0;
     char *d;
-    
+
     assert(dest);
     assert(size > 0);
     assert(name);
 
     d = dest;
-    
+
     for (;;) {
         if (i >= size)
             return NULL;
@@ -58,10 +56,10 @@ char *avahi_unescape_label(const char **name, char *dest, size_t size) {
             (*name)++;
             break;
         }
-        
+
         if (**name == 0)
             break;
-        
+
         if (**name == '\\') {
             /* Escaped character */
 
@@ -70,7 +68,7 @@ char *avahi_unescape_label(const char **name, char *dest, size_t size) {
             if (**name == 0)
                 /* Ending NUL */
                 return NULL;
-            
+
             else if (**name == '\\' || **name == '.') {
                 /* Escaped backslash or dot */
                 *(d++) = *((*name) ++);
@@ -79,7 +77,7 @@ char *avahi_unescape_label(const char **name, char *dest, size_t size) {
                 int n;
 
                 /* Escaped literal ASCII character */
-                
+
                 if (!isdigit(*(*name+1)) || !isdigit(*(*name+2)))
                     return NULL;
 
@@ -87,18 +85,18 @@ char *avahi_unescape_label(const char **name, char *dest, size_t size) {
 
                 if (n > 255 || n == 0)
                     return NULL;
-                
+
                 *(d++) = (char) n;
                 i++;
 
                 (*name) += 3;
             } else
                 return NULL;
-            
+
         } else {
 
             /* Normal character */
-            
+
             *(d++) = *((*name) ++);
             i++;
         }
@@ -130,14 +128,14 @@ char *avahi_escape_label(const char* src, size_t src_length, char **ret_name, si
         if (*src == '.' || *src == '\\') {
 
             /* Dot or backslash */
-            
+
             if (*ret_size < 3)
                 return NULL;
-            
+
             *((*ret_name) ++) = '\\';
             *((*ret_name) ++) = *src;
             (*ret_size) -= 2;
-            
+
         } else if (
             *src == '_' ||
             *src == '-' ||
@@ -146,13 +144,13 @@ char *avahi_escape_label(const char* src, size_t src_length, char **ret_name, si
             (*src >= 'A' && *src <= 'Z')) {
 
             /* Proper character */
-            
+
             if (*ret_size < 2)
                 return NULL;
-        
+
             *((*ret_name)++) = *src;
             (*ret_size) --;
-            
+
         } else {
 
             /* Everything else */
@@ -164,7 +162,7 @@ char *avahi_escape_label(const char* src, size_t src_length, char **ret_name, si
             *((*ret_name) ++) = '0' + (char)  ((uint8_t) *src / 100);
             *((*ret_name) ++) = '0' + (char) (((uint8_t) *src / 10) % 10);
             *((*ret_name) ++) = '0' + (char)  ((uint8_t) *src % 10);
-            
+
             (*ret_size) -= 4;
         }
 
@@ -180,7 +178,7 @@ char *avahi_escape_label(const char* src, size_t src_length, char **ret_name, si
 char *avahi_normalize_name(const char *s, char *ret_s, size_t size) {
     int empty = 1;
     char *r;
-    
+
     assert(s);
     assert(ret_s);
     assert(size > 0);
@@ -201,17 +199,17 @@ char *avahi_normalize_name(const char *s, char *ret_s, size_t size) {
 
             return NULL;
         }
-        
+
         if (!empty) {
             if (size < 1)
                 return NULL;
-            
+
             *(r++) = '.';
             size--;
-            
+
         } else
             empty = 0;
-            
+
         avahi_escape_label(label, strlen(label), &r, &size);
     }
 
@@ -234,7 +232,7 @@ int avahi_domain_equal(const char *a, const char *b) {
 
     if (a == b)
         return 1;
-    
+
     for (;;) {
         char ca[AVAHI_LABEL_MAX], cb[AVAHI_LABEL_MAX], *r;
 
@@ -245,7 +243,7 @@ int avahi_domain_equal(const char *a, const char *b) {
 
         if (strcasecmp(ca, cb))
             return 0;
-        
+
         if (!*a && !*b)
             return 1;
     }
@@ -267,7 +265,7 @@ int avahi_is_valid_service_type_generic(const char *t) {
 
         if (strlen(label) <= 2 || label[0] != '_')
             return 0;
-        
+
     } while (*t);
 
     return 1;
@@ -281,7 +279,7 @@ int avahi_is_valid_service_type_strict(const char *t) {
         return 0;
 
     /* Application name */
-    
+
     if (!(avahi_unescape_label(&t, label, sizeof(label))))
         return 0;
 
@@ -292,7 +290,7 @@ int avahi_is_valid_service_type_strict(const char *t) {
         return 0;
 
     /* _tcp or _udp boilerplate */
-    
+
     if (!(avahi_unescape_label(&t, label, sizeof(label))))
         return 0;
 
@@ -301,7 +299,7 @@ int avahi_is_valid_service_type_strict(const char *t) {
 
     if (*t)
         return 0;
-    
+
     return 1;
 }
 
@@ -314,7 +312,7 @@ const char *avahi_get_type_from_subtype(const char *t) {
         return NULL;
 
     /* Subtype name */
-    
+
     if (!(avahi_unescape_label(&t, label, sizeof(label))))
         return NULL;
 
@@ -325,7 +323,7 @@ const char *avahi_get_type_from_subtype(const char *t) {
         return NULL;
 
     /* String "_sub" */
-    
+
     if (!(avahi_unescape_label(&t, label, sizeof(label))))
         return NULL;
 
@@ -336,7 +334,7 @@ const char *avahi_get_type_from_subtype(const char *t) {
         return NULL;
 
     ret = t;
-    
+
     /* Application name */
 
     if (!(avahi_unescape_label(&t, label, sizeof(label))))
@@ -347,9 +345,9 @@ const char *avahi_get_type_from_subtype(const char *t) {
 
     if (!*t)
         return NULL;
-    
+
     /* _tcp or _udp boilerplate */
-    
+
     if (!(avahi_unescape_label(&t, label, sizeof(label))))
         return NULL;
 
@@ -384,12 +382,12 @@ int avahi_is_valid_domain_name(const char *t) {
         /* Explicitly allow the root domain name */
         if (is_first && label[0] == 0 && *t == 0)
             return 1;
-        
+
         is_first = 0;
-        
+
         if (label[0] == 0)
             return 0;
-        
+
     } while (*t);
 
     return 1;
@@ -400,7 +398,7 @@ int avahi_is_valid_service_name(const char *t) {
 
     if (strlen(t) >= AVAHI_LABEL_MAX || !*t)
         return 0;
-        
+
     return 1;
 }
 
@@ -425,7 +423,7 @@ int avahi_is_valid_host_name(const char *t) {
 
 unsigned avahi_domain_hash(const char *s) {
     unsigned hash = 0;
-    
+
     while (*s) {
         char c[AVAHI_LABEL_MAX], *p, *r;
 
@@ -443,22 +441,22 @@ int avahi_service_name_join(char *p, size_t size, const char *name, const char *
     char escaped_name[AVAHI_LABEL_MAX*4];
     char normalized_type[AVAHI_DOMAIN_NAME_MAX];
     char normalized_domain[AVAHI_DOMAIN_NAME_MAX];
-    
+
     assert(p);
 
     /* Validity checks */
-    
+
     if ((name && !avahi_is_valid_service_name(name)))
         return AVAHI_ERR_INVALID_SERVICE_NAME;
 
     if (!avahi_is_valid_service_type_generic(type))
         return AVAHI_ERR_INVALID_SERVICE_TYPE;
-        
+
     if (!avahi_is_valid_domain_name(domain))
         return AVAHI_ERR_INVALID_DOMAIN_NAME;
 
     /* Preparation */
-    
+
     if (name) {
         size_t l = sizeof(escaped_name);
         char *e = escaped_name, *r;
@@ -473,7 +471,7 @@ int avahi_service_name_join(char *p, size_t size, const char *name, const char *
         return AVAHI_ERR_INVALID_DOMAIN_NAME;
 
     /* Concatenation */
-    
+
     snprintf(p, size, "%s%s%s.%s", name ? escaped_name : "", name ? "." : "", normalized_type, normalized_domain);
 
     return AVAHI_OK;
@@ -484,12 +482,12 @@ int avahi_service_name_join(char *p, size_t size, const char *name, const char *
 static size_t strlcpy(char *dest, const char *src, size_t n) {
     assert(dest);
     assert(src);
-    
+
     if (n > 0) {
         strncpy(dest, src, n-1);
         dest[n-1] = 0;
     }
-    
+
     return strlen(src);
 }
 
@@ -502,7 +500,7 @@ int avahi_service_name_split(const char *p, char *name, size_t name_size, char *
         DOMAIN
     } state;
     int type_empty = 1, domain_empty = 1;
-    
+
     assert(p);
     assert(type);
     assert(type_size > 0);
@@ -515,12 +513,12 @@ int avahi_service_name_split(const char *p, char *name, size_t name_size, char *
         state = NAME;
     } else
         state = TYPE;
-    
+
     *type = *domain = 0;
-    
+
     while (*p) {
         char buf[64];
-        
+
         if (!(avahi_unescape_label(&p, buf, sizeof(buf))))
             return -1;
 
@@ -537,18 +535,18 @@ int avahi_service_name_split(const char *p, char *name, size_t name_size, char *
                     if (!type_empty) {
                         if (!type_size)
                             return AVAHI_ERR_NO_MEMORY;
-                        
+
                         *(type++) = '.';
                         type_size --;
 
                     } else
                         type_empty = 0;
-                    
+
                     if (!(avahi_escape_label(buf, strlen(buf), &type, &type_size)))
                         return AVAHI_ERR_NO_MEMORY;
 
                     break;
-                } 
+                }
 
                 state = DOMAIN;
                 /* fall through */
@@ -558,7 +556,7 @@ int avahi_service_name_split(const char *p, char *name, size_t name_size, char *
                 if (!domain_empty) {
                     if (!domain_size)
                         return AVAHI_ERR_NO_MEMORY;
-                    
+
                     *(domain++) = '.';
                     domain_size --;
                 } else
@@ -603,7 +601,7 @@ int avahi_is_valid_fqdn(const char *t) {
     /* Make sure that the name is not an IP address */
     if (!(avahi_normalize_name(t, normalized, sizeof(normalized))))
         return 0;
-    
+
     if (avahi_address_parse(normalized, AVAHI_PROTO_UNSPEC, &a))
         return 0;
 
index 14d069d8ac438014cb6fd825aa509892808a0e73..a0dcd0fa16dcb373a5e18936f2b1deadf02ba1e1 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodomainhfoo
 #define foodomainhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index fb9bd389a661387975c1284fc1ed04e3cecabc86..b0b66eab19a5ef0128d4d087121be0f160d45da4 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 3e4d25f498f64a2cb376573c806733836a2579d3..392aaf53bd0ebcb79d6b35684e32d32f26117cce 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooerrorhfoo
 #define fooerrorhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -29,7 +27,7 @@
 AVAHI_C_DECL_BEGIN
 
 /** Error codes used by avahi */
-enum { 
+enum {
     AVAHI_OK = 0,                            /**< OK */
     AVAHI_ERR_FAILURE = -1,                  /**< Generic error code */
     AVAHI_ERR_BAD_STATE = -2,                /**< Object was in a bad state */
@@ -79,17 +77,17 @@ enum {
     AVAHI_ERR_DNS_YXRRSET = -42,
     AVAHI_ERR_DNS_NXRRSET = -43,
     AVAHI_ERR_DNS_NOTAUTH = -44,             /**< DNS Error: Not authorized */
-    AVAHI_ERR_DNS_NOTZONE = -45,             
+    AVAHI_ERR_DNS_NOTZONE = -45,
     AVAHI_ERR_INVALID_RDATA = -46,           /**< Invalid RDATA */
     AVAHI_ERR_INVALID_DNS_CLASS = -47,       /**< Invalid DNS class */
     AVAHI_ERR_INVALID_DNS_TYPE = -48,        /**< Invalid DNS type */
     AVAHI_ERR_NOT_SUPPORTED = -49,           /**< Not supported */
-    
+
     AVAHI_ERR_NOT_PERMITTED = -50,           /**< Operation not permitted */
     AVAHI_ERR_INVALID_ARGUMENT = -51,        /**< Invalid argument */
     AVAHI_ERR_IS_EMPTY = -52,                /**< Is empty */
     AVAHI_ERR_NO_CHANGE = -53,               /**< The requested operation is invalid because it is redundant */
-    
+
     /****
      ****    IF YOU ADD A NEW ERROR CODE HERE, PLEASE DON'T FORGET TO ADD
      ****    IT TO THE STRING ARRAY IN avahi_strerror() IN error.c AND
@@ -97,7 +95,7 @@ enum {
      ****
      ****    Also remember to update the MAX value below.
      ****/
-    
+
     AVAHI_ERR_MAX = -54
 };
 
index dd495022929840c112991161c24d76560f5162a9..4c97111aaffd44484698ea76950b9882a3ba7039 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foogccmacrohfoo
 #define foogccmacrohfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 20f3b3aaded92107163bfcd7ad219878e3f892eb..51c93e4e6bbfa65ef4eb5f22783ef610c587366a 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index e246736adbe45054b662b496cd1b35f758859a41..2a613e58feccce3130698cbfb48ed28cb05eafde 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef fooi18nhfoo
 #define fooi18nhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 37474e1883868fedb86ffb3319760ce71cfd6890..e37056d9892c962207c94b7fc6dcf4e3c174bacc 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foollistfoo
 #define foollistfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 51b8ff6aecf93e7015b08ed2c13cf9d653d91122..23b13a939d0fb536d3a377677b00e81edb47ad48 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -44,13 +42,13 @@ static const AvahiAllocator *allocator = NULL;
 static void oom(void) AVAHI_GCC_NORETURN;
 
 static void oom(void) {
-    
+
     static const char msg[] = "Out of memory, aborting ...\n";
     const char *n = msg;
 
     while (strlen(n) > 0) {
         ssize_t r;
-        
+
         if ((r = write(2, n, strlen(n))) < 0)
             break;
 
@@ -90,7 +88,7 @@ static void *xrealloc(void *p, size_t size) {
 /* Default implementation for avahi_calloc() */
 static void *xcalloc(size_t nmemb, size_t size) {
     void *p;
-    
+
     if (size == 0 || nmemb == 0)
         return NULL;
 
@@ -104,7 +102,7 @@ void *avahi_malloc(size_t size) {
 
     if (size <= 0)
         return NULL;
-    
+
     if (!allocator)
         return xmalloc(size);
 
@@ -135,7 +133,7 @@ void avahi_free(void *p) {
 
     if (!p)
         return;
-    
+
     if (!allocator) {
         free(p);
         return;
@@ -162,7 +160,7 @@ void *avahi_realloc(void *p, size_t size) {
 char *avahi_strdup(const char *s) {
     char *r;
     size_t size;
-    
+
     if (!s)
         return NULL;
 
@@ -178,14 +176,14 @@ char *avahi_strndup(const char *s, size_t max) {
     char *r;
     size_t size;
     const char *p;
-    
+
     if (!s)
         return NULL;
 
     for (p = s, size = 0;
          size < max && *p;
          p++, size++);
-    
+
     if (!(r = avahi_new(char, size+1)))
         return NULL;
 
@@ -202,7 +200,7 @@ void avahi_set_allocator(const AvahiAllocator *a) {
 char *avahi_strdup_vprintf(const char *fmt, va_list ap) {
     size_t len = 80;
     char *buf;
-    
+
     assert(fmt);
 
     if (!(buf = avahi_malloc(len)))
@@ -239,7 +237,7 @@ char *avahi_strdup_printf(const char *fmt, ... ) {
     va_list ap;
 
     assert(fmt);
-    
+
     va_start(ap, fmt);
     s = avahi_strdup_vprintf(fmt, ap);
     va_end(ap);
index 511b51c0328bce73ff8a75064096476cafc10c1b..ffaac3f3c72bd874c6e3d7a16ada772688f6f99b 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foomallochfoo
 #define foomallochfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index f24ab039644031b4e2893d1484ddc57742da6e45..17dcb24a4507bc341c49915c792a456e15770065 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -35,7 +33,7 @@ AvahiRList* avahi_rlist_prepend(AvahiRList *r, void *data) {
         return NULL;
 
     n->data = data;
-    
+
     AVAHI_LLIST_PREPEND(AvahiRList, rlist, r, n);
     return r;
 }
@@ -56,7 +54,7 @@ AvahiRList* avahi_rlist_remove(AvahiRList *r, void *data) {
 
 AvahiRList* avahi_rlist_remove_by_link(AvahiRList *r, AvahiRList *n) {
     assert(n);
-    
+
     AVAHI_LLIST_REMOVE(AvahiRList, rlist, r, n);
     avahi_free(n);
 
index 0b88955f8d51e80f1d071d6428027189dc55b4c3..9bcc1d589b18a963c1b5dfaee981fbe1cc3d6738 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foorlistfoo
 #define foorlistfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index c970c3c4afdb5fedd9d2f1d5aaa9f17889bb5d70..8df18dd7737236b2f3fa0956d025d912cfcd90c1 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -42,7 +40,7 @@ struct AvahiWatch {
 
     int idx;
     struct pollfd pollfd;
-    
+
     AvahiWatchCallback callback;
     void *userdata;
 
@@ -55,10 +53,10 @@ struct AvahiTimeout {
 
     int enabled;
     struct timeval expiry;
-    
+
     AvahiTimeoutCallback callback;
     void  *userdata;
-    
+
     AVAHI_LLIST_FIELDS(AvahiTimeout, timeouts);
 };
 
@@ -111,7 +109,7 @@ static void clear_wakeup(AvahiSimplePoll *s) {
         return;
 
     s->wakeup_issued = 0;
-    
+
     for(;;)
         if (read(s->wakeup_pipe[0], &c, sizeof(c)) != sizeof(c))
             break;
@@ -119,7 +117,7 @@ static void clear_wakeup(AvahiSimplePoll *s) {
 
 static int set_nonblock(int fd) {
     int n;
-    
+
     assert(fd >= 0);
 
     if ((n = fcntl(fd, F_GETFL)) < 0)
@@ -134,7 +132,7 @@ static int set_nonblock(int fd) {
 static AvahiWatch* watch_new(const AvahiPoll *api, int fd, AvahiWatchEvent event, AvahiWatchCallback callback, void *userdata) {
     AvahiWatch *w;
     AvahiSimplePoll *s;
-    
+
     assert(api);
     assert(fd >= 0);
     assert(callback);
@@ -147,7 +145,7 @@ static AvahiWatch* watch_new(const AvahiPoll *api, int fd, AvahiWatchEvent event
 
     /* If there is a background thread running the poll() for us, tell it to exit the poll() */
     avahi_simple_poll_wakeup(s);
-    
+
     w->simple_poll = s;
     w->dead = 0;
 
@@ -198,7 +196,7 @@ static void remove_pollfd(AvahiWatch *w) {
 
     if (w->idx == -1)
         return;
-    
+
     w->simple_poll->rebuild_pollfds = 1;
 }
 
@@ -209,9 +207,9 @@ static void watch_free(AvahiWatch *w) {
 
     /* If there is a background thread running the poll() for us, tell it to exit the poll() */
     avahi_simple_poll_wakeup(w->simple_poll);
-    
+
     remove_pollfd(w);
-    
+
     w->dead = 1;
     w->simple_poll->n_watches --;
     w->simple_poll->watch_req_cleanup = 1;
@@ -225,7 +223,7 @@ static void destroy_watch(AvahiWatch *w) {
 
     if (!w->dead)
         w->simple_poll->n_watches --;
-    
+
     avahi_free(w);
 }
 
@@ -246,7 +244,7 @@ static void cleanup_watches(AvahiSimplePoll *s, int all) {
 static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata) {
     AvahiTimeout *t;
     AvahiSimplePoll *s;
-    
+
     assert(api);
     assert(callback);
 
@@ -258,13 +256,13 @@ static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv,
 
     /* If there is a background thread running the poll() for us, tell it to exit the poll() */
     avahi_simple_poll_wakeup(s);
-    
+
     t->simple_poll = s;
     t->dead = 0;
 
     if ((t->enabled = !!tv))
         t->expiry = *tv;
-        
+
     t->callback = callback;
     t->userdata = userdata;
 
@@ -278,7 +276,7 @@ static void timeout_update(AvahiTimeout *t, const struct timeval *tv) {
 
     /* If there is a background thread running the poll() for us, tell it to exit the poll() */
     avahi_simple_poll_wakeup(t->simple_poll);
-    
+
     if ((t->enabled = !!tv))
         t->expiry = *tv;
 }
@@ -330,7 +328,7 @@ AvahiSimplePoll *avahi_simple_poll_new(void) {
 
     set_nonblock(s->wakeup_pipe[0]);
     set_nonblock(s->wakeup_pipe[1]);
-    
+
     s->api.userdata = s;
 
     s->api.watch_new = watch_new;
@@ -341,14 +339,14 @@ AvahiSimplePoll *avahi_simple_poll_new(void) {
     s->api.timeout_new = timeout_new;
     s->api.timeout_free = timeout_free;
     s->api.timeout_update = timeout_update;
-    
+
     s->pollfds = NULL;
     s->max_pollfds = s->n_pollfds = 0;
     s->rebuild_pollfds = 1;
     s->quit = 0;
     s->n_watches = 0;
     s->events_valid = 0;
-    
+
     s->watch_req_cleanup = 0;
     s->timeout_req_cleanup = 0;
 
@@ -357,7 +355,7 @@ AvahiSimplePoll *avahi_simple_poll_new(void) {
     s->state = STATE_INIT;
 
     s->wakeup_issued = 0;
-    
+
     avahi_simple_poll_set_func(s, NULL, NULL);
 
     AVAHI_LLIST_HEAD_INIT(AvahiWatch, s->watches);
@@ -372,7 +370,7 @@ void avahi_simple_poll_free(AvahiSimplePoll *s) {
     cleanup_timeouts(s, 1);
     cleanup_watches(s, 1);
     assert(s->n_watches == 0);
-    
+
     avahi_free(s->pollfds);
 
     if (s->wakeup_pipe[0] >= 0)
@@ -380,34 +378,34 @@ void avahi_simple_poll_free(AvahiSimplePoll *s) {
 
     if (s->wakeup_pipe[1] >= 0)
         close(s->wakeup_pipe[1]);
-        
+
     avahi_free(s);
 }
 
 static int rebuild(AvahiSimplePoll *s) {
     AvahiWatch *w;
     int idx;
-    
+
     assert(s);
 
     if (s->n_watches+1 > s->max_pollfds) {
         struct pollfd *n;
 
         s->max_pollfds = s->n_watches + 10;
-        
+
         if (!(n = avahi_realloc(s->pollfds, sizeof(struct pollfd) * s->max_pollfds)))
             return -1;
 
         s->pollfds = n;
     }
 
-    
+
     s->pollfds[0].fd = s->wakeup_pipe[0];
     s->pollfds[0].events = POLLIN;
     s->pollfds[0].revents = 0;
 
     idx = 1;
-    
+
     for (w = s->watches; w; w = w->watches_next) {
 
         if(w->dead)
@@ -429,10 +427,10 @@ static AvahiTimeout* find_next_timeout(AvahiSimplePoll *s) {
     assert(s);
 
     for (t = s->timeouts; t; t = t->timeouts_next) {
-        
+
         if (t->dead || !t->enabled)
             continue;
-        
+
         if (!n || avahi_timeval_compare(&t->expiry, &n->expiry) < 0)
             n = t;
     }
@@ -451,11 +449,11 @@ static void timeout_callback(AvahiTimeout *t) {
 
 int avahi_simple_poll_prepare(AvahiSimplePoll *s, int timeout) {
     AvahiTimeout *next_timeout;
-    
+
     assert(s);
     assert(s->state == STATE_INIT || s->state == STATE_DISPATCHED || s->state == STATE_FAILURE);
     s->state = STATE_PREPARING;
-    
+
     /* Clear pending wakeup requests */
     clear_wakeup(s);
 
@@ -492,7 +490,7 @@ int avahi_simple_poll_prepare(AvahiSimplePoll *s, int timeout) {
             timeout = 0;
             goto finish;
         }
-            
+
         gettimeofday(&now, NULL);
         usec = avahi_timeval_diff(&next_timeout->expiry, &now);
 
@@ -520,17 +518,27 @@ finish:
 int avahi_simple_poll_run(AvahiSimplePoll *s) {
     assert(s);
     assert(s->state == STATE_PREPARED || s->state == STATE_FAILURE);
-    
+
     s->state = STATE_RUNNING;
 
-    if (s->poll_func(s->pollfds, s->n_pollfds, s->prepared_timeout, s->poll_func_userdata) < 0) {
-        s->state = STATE_FAILURE;
-        return -1;
+    for (;;) {
+        errno = 0;
+
+        if (s->poll_func(s->pollfds, s->n_pollfds, s->prepared_timeout, s->poll_func_userdata) < 0) {
+
+            if (errno == EINTR)
+                continue;
+
+            s->state = STATE_FAILURE;
+            return -1;
+        }
+
+        break;
     }
-        
+
     /* The poll events are now valid again */
     s->events_valid = 1;
-        
+
     /* Update state */
     s->state = STATE_RAN;
     return 0;
@@ -545,17 +553,17 @@ int avahi_simple_poll_dispatch(AvahiSimplePoll *s) {
     s->state = STATE_DISPATCHING;
 
     /* We execute only on callback in every iteration */
-    
+
     /* Check whether the wakeup time has been reached now */
     if ((next_timeout = find_next_timeout(s))) {
-        
+
         if (next_timeout->expiry.tv_sec == 0 && next_timeout->expiry.tv_usec == 0) {
 
             /* Just a shortcut so that we don't need to call gettimeofday() */
             timeout_callback(next_timeout);
             goto finish;
         }
-        
+
         if (avahi_age(&next_timeout->expiry) >= 0) {
 
             /* Timeout elapsed */
@@ -566,13 +574,13 @@ int avahi_simple_poll_dispatch(AvahiSimplePoll *s) {
 
     /* Look for some kind of I/O event */
     for (w = s->watches; w; w = w->watches_next) {
-        
+
         if (w->dead)
             continue;
-        
+
         assert(w->idx >= 0);
         assert(w->idx < s->n_pollfds);
-        
+
         if (s->pollfds[w->idx].revents != 0) {
             w->callback(w, w->pollfd.fd, s->pollfds[w->idx].revents, w->userdata);
             goto finish;
@@ -596,7 +604,7 @@ int avahi_simple_poll_iterate(AvahiSimplePoll *s, int timeout) {
 
     if ((r = avahi_simple_poll_dispatch(s)) != 0)
         return r;
-    
+
     return 0;
 }
 
@@ -611,7 +619,7 @@ void avahi_simple_poll_quit(AvahiSimplePoll *s) {
 
 const AvahiPoll* avahi_simple_poll_get(AvahiSimplePoll *s) {
     assert(s);
-    
+
     return &s->api;
 }
 
@@ -633,7 +641,7 @@ int avahi_simple_poll_loop(AvahiSimplePoll *s) {
     int r;
 
     assert(s);
-    
+
     for (;;)
         if ((r = avahi_simple_poll_iterate(s, -1)) != 0)
             if (r >= 0 || errno != EINTR)
index 7c83db39f50c424285199ddcccd9728ed39ca267..72c1905bcb4f02b746587a6f487b517265f44c5a 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foosimplewatchhfoo
 #define foosimplewatchhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 71f748d4a40e36999f0980d32a33c7df27757857..0945b3756ec0efdd3f82550214124de50dc994f8 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -37,7 +35,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     int r;
 
     a = avahi_string_list_new("prefix", "a", "b", NULL);
-    
+
     a = avahi_string_list_add(a, "start");
     a = avahi_string_list_add(a, "foo=99");
     a = avahi_string_list_add(a, "bar");
@@ -50,18 +48,18 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     a = avahi_string_list_add_pair(a, "blubb", "blaa");
     a = avahi_string_list_add_pair(a, "uxknurz", NULL);
     a = avahi_string_list_add_pair_arbitrary(a, "uxknurz2", (const uint8_t*) "blafasel\0oerks", 14);
-    
+
     a = avahi_string_list_add(a, "end");
 
     t = avahi_string_list_to_string(a);
     printf("--%s--\n", t);
     avahi_free(t);
-    
+
     n = avahi_string_list_serialize(a, NULL, 0);
     size = avahi_string_list_serialize(a, data, sizeof(data));
     assert(size == n);
 
-    printf("%u\n", size);
+    printf("%zu\n", size);
 
     for (t = (char*) data, n = 0; n < size; n++, t++) {
         if (*t <= 32)
@@ -71,11 +69,11 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     }
 
     printf("\n");
-    
+
     assert(avahi_string_list_parse(data, size, &b) == 0);
 
     printf("equal: %i\n", avahi_string_list_equal(a, b));
-    
+
     t = avahi_string_list_to_string(b);
     printf("--%s--\n", t);
     avahi_free(t);
@@ -92,12 +90,12 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     p = avahi_string_list_find(a, "seven");
     assert(p);
-    
-    r = avahi_string_list_get_pair(p, &t, &v, NULL);  
+
+    r = avahi_string_list_get_pair(p, &t, &v, NULL);
     assert(r >= 0);
     assert(t);
     assert(v);
-    
+
     printf("<%s>=<%s>\n", t, v);
     avahi_free(t);
     avahi_free(v);
@@ -113,7 +111,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     printf("<%s>=<%s>\n", t, v);
     avahi_free(t);
     avahi_free(v);
-    
+
     avahi_string_list_free(a);
     avahi_string_list_free(b);
 
@@ -124,6 +122,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     assert(avahi_string_list_parse(data, size, &a) == 0);
     assert(!a);
-    
+
     return 0;
 }
index f8be27312bfc1756ae1de8acc2152f6d2faaaa77..b861cf82eaad58bb823c5fdbea0f1db44ed70cba 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -38,7 +36,7 @@ AvahiStringList*avahi_string_list_add_anonymous(AvahiStringList *l, size_t size)
 
     if (!(n = avahi_malloc(sizeof(AvahiStringList) + size)))
         return NULL;
-    
+
     n->next = l;
     n->size = size;
 
@@ -71,14 +69,14 @@ AvahiStringList *avahi_string_list_add(AvahiStringList *l, const char *text) {
 int avahi_string_list_parse(const void* data, size_t size, AvahiStringList **ret) {
     const uint8_t *c;
     AvahiStringList *r = NULL;
-    
+
     assert(data);
     assert(ret);
 
     c = data;
     while (size > 0) {
         size_t k;
-        
+
         k = *(c++);
         size--;
 
@@ -88,18 +86,18 @@ int avahi_string_list_parse(const void* data, size_t size, AvahiStringList **ret
         if (k > 0) { /* Ignore empty strings */
             AvahiStringList *n;
 
-            if (!(n = avahi_string_list_add_arbitrary(r, c, k)))  
+            if (!(n = avahi_string_list_add_arbitrary(r, c, k)))
                 goto fail; /* OOM */
 
             r = n;
         }
-            
+
         c += k;
         size -= k;
     }
 
     *ret = r;
-    
+
     return 0;
 
 fail:
@@ -146,7 +144,7 @@ char* avahi_string_list_to_string(AvahiStringList *l) {
         return NULL;
 
     l = avahi_string_list_reverse(l);
-    
+
     for (n = l; n; n = n->next) {
         if (n != l)
             *(e++) = ' ';
@@ -161,7 +159,7 @@ char* avahi_string_list_to_string(AvahiStringList *l) {
     }
 
     l = avahi_string_list_reverse(l);
-    
+
     *e = 0;
 
     return t;
@@ -176,18 +174,18 @@ size_t avahi_string_list_serialize(AvahiStringList *l, void *data, size_t size)
 
         l = avahi_string_list_reverse(l);
         c = data;
-        
+
         for (n = l; size > 1 && n; n = n->next) {
             size_t k;
 
             if ((k = n->size) == 0)
                 /* Skip empty strings */
                 continue;
-            
+
             if (k > 255)
                 /* Truncate strings at 255 characters */
                 k = 255;
-            
+
             if (k > size-1)
                 /* Make sure this string fits in */
                 k = size-1;
@@ -195,15 +193,15 @@ size_t avahi_string_list_serialize(AvahiStringList *l, void *data, size_t size)
             *(c++) = (uint8_t) k;
             memcpy(c, n->text, k);
             c += k;
-            
+
             used += 1 + k;
             size -= 1 + k;
         }
-        
+
         l = avahi_string_list_reverse(l);
 
         if (used == 0 && size > 0) {
-        
+
             /* Empty lists are treated specially. To comply with
              * section 6.1 of the DNS-SD spec, we return a single
              * empty string (i.e. a NUL byte)*/
@@ -211,19 +209,19 @@ size_t avahi_string_list_serialize(AvahiStringList *l, void *data, size_t size)
             *(uint8_t*) data = 0;
             used = 1;
         }
-            
+
     } else {
         AvahiStringList *n;
 
         for (n = l; n; n = n->next) {
             size_t k;
-            
+
             if ((k = n->size) == 0)
                 continue;
-            
+
             if (k > 255)
                 k = 255;
-            
+
             used += 1+k;
         }
 
@@ -260,7 +258,7 @@ AvahiStringList *avahi_string_list_add_many(AvahiStringList *r, ...) {
     va_start(va, r);
     r = avahi_string_list_add_many_va(r, va);
     va_end(va);
-    
+
     return r;
 }
 
@@ -328,7 +326,7 @@ unsigned avahi_string_list_length(const AvahiStringList *l) {
 AvahiStringList *avahi_string_list_add_vprintf(AvahiStringList *l, const char *format, va_list va) {
     size_t len = 80;
     AvahiStringList *r;
-    
+
     assert(format);
 
     if (!(r = avahi_malloc(sizeof(AvahiStringList) + len)))
@@ -338,7 +336,7 @@ AvahiStringList *avahi_string_list_add_vprintf(AvahiStringList *l, const char *f
         int n;
         AvahiStringList *nr;
         va_list va2;
-        
+
         va_copy(va2, va);
         n = vsnprintf((char*) r->text, len, format, va2);
         va_end(va2);
@@ -358,28 +356,28 @@ AvahiStringList *avahi_string_list_add_vprintf(AvahiStringList *l, const char *f
 
         r = nr;
     }
-    
+
     r->next = l;
-    r->size = strlen((char*) r->text); 
+    r->size = strlen((char*) r->text);
 
     return r;
 }
 
 AvahiStringList *avahi_string_list_add_printf(AvahiStringList *l, const char *format, ...) {
     va_list va;
-    
+
     assert(format);
 
     va_start(va, format);
     l  = avahi_string_list_add_vprintf(l, format, va);
     va_end(va);
 
-    return l;    
+    return l;
 }
 
 AvahiStringList *avahi_string_list_find(AvahiStringList *l, const char *key) {
     size_t n;
-    
+
     assert(key);
     n = strlen(key);
 
@@ -411,7 +409,7 @@ AvahiStringList *avahi_string_list_add_pair_arbitrary(AvahiStringList *l, const
         return avahi_string_list_add(l, key);
 
     n = strlen(key);
-    
+
     if (!(l = avahi_string_list_add_anonymous(l, n + 1 + size)))
         return NULL;
 
@@ -424,12 +422,12 @@ AvahiStringList *avahi_string_list_add_pair_arbitrary(AvahiStringList *l, const
 
 int avahi_string_list_get_pair(AvahiStringList *l, char **key, char **value, size_t *size) {
     char *e;
-    
+
     assert(l);
 
     if (!(e = memchr(l->text, '=', l->size))) {
 
-        if (key) 
+        if (key)
             if (!(*key = avahi_strdup((char*) l->text)))
                 return -1;
 
@@ -447,9 +445,9 @@ int avahi_string_list_get_pair(AvahiStringList *l, char **key, char **value, siz
                 return -1;
 
         e++; /* Advance after '=' */
-        
+
         n = l->size - (e - (char*) l->text);
-        
+
         if (value) {
 
             if (!(*value = avahi_memdup(e, n+1))) {
@@ -487,7 +485,7 @@ uint32_t avahi_string_list_get_service_cookie(AvahiStringList *l) {
     AvahiStringList *f;
     char *value = NULL, *end = NULL;
     uint32_t ret;
-    
+
     if (!(f = avahi_string_list_find(l, AVAHI_SERVICE_COOKIE)))
         return AVAHI_SERVICE_COOKIE_INVALID;
 
@@ -502,6 +500,6 @@ uint32_t avahi_string_list_get_service_cookie(AvahiStringList *l) {
     }
 
     avahi_free(value);
-    
+
     return ret;
 }
index 8d827d64cc5a6cf992bf7ddea17ab247c2c08aae..94adcea8afe1ca81100437c045f67ab307418eca 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef footxtlisthfoo
 #define footxtlisthfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 4f236081d9c55f2cdfa52ca9cce5bffead6683a7..c0cadeb2fe48f552e75429d4b64ce54130d269de 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 92b5dfcf75ee35c3aa1d19664cb86e55cef2fcba..dec0cf356f7f60d9f50c960a5ff3f3f2c531a056 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foothreadedwatchhfoo
 #define foothreadedwatchhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 92fcab2469872b73795cc8a76d81bbb2c34735fc..387c180cc08ecd31417d891a73d824cad21460fc 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -39,7 +37,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     printf("%li.%li\n", a.tv_sec, a.tv_usec);
 
-    printf("%lli\n", avahi_timeval_diff(&a, &b));
+    printf("%lli\n", (long long) avahi_timeval_diff(&a, &b));
 
     return 0;
 }
index edab24166b55d988d7ffdc79e01f66ad2635c018..cdb0f099ec10cd40c1f634e935b1fc8ff0d64a9d 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -77,7 +75,7 @@ struct timeval* avahi_timeval_add(struct timeval *a, AvahiUsec usec) {
 
 AvahiUsec avahi_age(const struct timeval *a) {
     struct timeval now;
-    
+
     assert(a);
 
     gettimeofday(&now, NULL);
@@ -100,7 +98,7 @@ struct timeval *avahi_elapse_time(struct timeval *tv, unsigned msec, unsigned ji
 
         time_t now;
         int r;
-        
+
         now = time(NULL);
 
         pthread_mutex_lock(&mutex);
@@ -108,18 +106,18 @@ struct timeval *avahi_elapse_time(struct timeval *tv, unsigned msec, unsigned ji
             timestamp = now;
             last_rand = rand();
         }
-        
+
         r = last_rand;
-        
+
         pthread_mutex_unlock(&mutex);
 
         /* We use the same jitter for 10 seconds. That way our
          * time events elapse in bursts which has the advantage that
          * packet data can be aggregated better */
-        
+
         avahi_timeval_add(tv, (AvahiUsec) (jitter*1000.0*r/(RAND_MAX+1.0)));
     }
-        
+
     return tv;
 }
 
index a441c0891a6dae4ccd51b0b5f12f1b40af22ae1b..6470f015b1ef1c1253cfb82be6cc007c8a1bb08e 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef footimevalhfoo
 #define footimevalhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index d8ffc1b3953b0aaab97d95dbb10776c650557e6e..d12ed58ec3961648b1edecc4672d3fe348463a91 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -34,6 +32,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     assert(avahi_utf8_valid("hallo"));
     assert(!avahi_utf8_valid("üxknürz"));
     assert(avahi_utf8_valid("üxknürz"));
-    
+
     return 0;
 }
index f52ce552ac62d747c54caf2529f793b71cefe4e1..fa6a31859bce4d863a5b89bc34a21fbd93119a22 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id */
-
 /* This file is based on the GLIB utf8 validation functions. The
  * original license text follows. */
 
@@ -37,8 +35,8 @@
      (((Char) & 0xFFFFF800) != 0xD800) &&     \
      ((Char) < 0xFDD0 || (Char) > 0xFDEF) &&  \
      ((Char) & 0xFFFE) != 0xFFFE)
-   
-     
+
+
 #define CONTINUATION_CHAR                           \
  do {                                     \
   if ((*(const unsigned char *)p & 0xc0) != 0x80) /* 10xxxxxx */ \
@@ -60,10 +58,10 @@ avahi_utf8_valid (const char *str)
     {
       if (*(const unsigned char *)p < 128)
        /* done */;
-      else 
+      else
        {
          const char *last;
-         
+
          last = p;
          if ((*(const unsigned char *)p & 0xe0) == 0xc0) /* 110xxxxx */
            {
@@ -88,7 +86,7 @@ avahi_utf8_valid (const char *str)
                }
              else
                goto error;
-             
+
              p++;
              CONTINUATION_CHAR;
            TWO_REMAINING:
@@ -96,16 +94,16 @@ avahi_utf8_valid (const char *str)
              CONTINUATION_CHAR;
              p++;
              CONTINUATION_CHAR;
-             
+
              if ( (val < min))
                goto error;
 
              if ( (!UNICODE_VALID(val)))
                goto error;
-           } 
-         
+           }
+
          continue;
-         
+
        error:
          return NULL;
        }
index 93c9b596c3c9693c84b0263051d9479869072818..dc1ce4bc939eee1054cffdb979d2c0c9e8b27d4e 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooutf8hfoo
 #define fooutf8hfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 870045dd88c9c523c9a23a911b85a213b77fd2c4..6c178ba670081511b26b9d227d14001950a98287 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -48,7 +46,7 @@ static void callback(AvahiWatch *w, int fd, AvahiWatchEvent event, AVAHI_GCC_UNU
     if (event & AVAHI_WATCH_IN) {
         ssize_t r;
         char c;
-        
+
         if ((r = read(fd, &c, 1)) <= 0) {
             fprintf(stderr, "read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
             api->watch_free(w);
@@ -91,7 +89,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     api = avahi_threaded_poll_get(threaded_poll);
     assert(api);
 #endif
-    
+
     api->watch_new(api, 0, AVAHI_WATCH_IN, callback, NULL);
 
     avahi_elapse_time(&tv, 1000, 0);
@@ -110,8 +108,8 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     fprintf(stderr, "... stupid stuff is done.\n");
 
     avahi_threaded_poll_free(threaded_poll);
-    
+
 #endif
-    
+
     return 0;
 }
index 31adad7e51e55a23c92cdde04b59a9d279c78253..86e63d3bf59f6afc15692dd56a293f87944e532d 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foowatchhfoo
 #define foowatchhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -62,7 +60,7 @@ typedef void (*AvahiTimeoutCallback)(AvahiTimeout *t, void *userdata);
 struct AvahiPoll {
 
     /** Some abstract user data usable by the provider of the API */
-    void* userdata; 
+    void* userdata;
 
     /** Create a new watch for the specified file descriptor and for
      * the specified events. The API will call the callback function
@@ -88,7 +86,7 @@ struct AvahiPoll {
     /** Update the absolute expiration time for a timeout, If tv is
      * NULL, the timeout is disabled. It is safe to call this function from an AvahiTimeoutCallback */
     void (*timeout_update)(AvahiTimeout *, const struct timeval *tv);
-    
+
     /** Free a timeout. It is safe to call this function from an AvahiTimeoutCallback */
     void (*timeout_free)(AvahiTimeout *t);
 };
index 0940daf2e68a39ea3c72e9d88f2189491fb63042..bc6714241c892f8e54502b1fc091901095a51a4e 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -89,7 +87,7 @@ address_test_SOURCES = \
        $(HOWLHEADERS) \
        address.c \
        address-test.c \
-       warn.c warn.h 
+       warn.c warn.h
 address_test_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I $(srcdir)/include
 address_test_LDADD = $(AM_LDADD) $(PTHREAD_LIBS) $(PTHREAD_CFLAGS) ../avahi-common/libavahi-common.la
 
@@ -97,7 +95,7 @@ text_test_SOURCES = \
        $(HOWLHEADERS) \
        text.c \
        text-test.c \
-       warn.c warn.h 
+       warn.c warn.h
 text_test_CFLAGS = $(AM_CFLAGS)  $(PTHREAD_CFLAGS) -I $(srcdir)/include
 text_test_LDADD = $(AM_LDADD) $(PTHREAD_LIBS) $(PTHREAD_CFLAGS) ../avahi-common/libavahi-common.la
 
index 05276aae1a0be77eacca2f0e8ed638f57d9d86b7..d9e152f25f0e71198735084b0be0ba2315290709 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -41,13 +39,13 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     ASSERT_SW_OKAY(sw_ipv4_address_init_from_name(&a, "heise.de"));
     ASSERT_NOT_NULL(sw_ipv4_address_name(a, t, sizeof(t)));
     printf("%s\n", t);
-    
+
     ASSERT_SW_OKAY(sw_ipv4_address_init_from_this_host(&a));
     ASSERT_NOT_NULL(sw_ipv4_address_name(a, t, sizeof(t)));
     printf("%s\n", t);
 
     ASSERT_SW_OKAY(sw_ipv4_address_decompose(a, &a1, &a2, &a3, &a4));
     printf("%i.%i.%i.%i\n", a1, a2, a3, a4);
-    
+
     return 0;
 }
index 1d9fbbe3724d2b78120cab28ea8786081a98d7a8..81b6e6bd4ef1076024790699e8a2f1e659bb9541 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -85,10 +83,10 @@ sw_result sw_ipv4_address_init_from_name(
     assert(name);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!(he = gethostbyname(name)))
         return SW_E_UNKNOWN;
-    
+
     self->m_addr = *(uint32_t*) he->h_addr;
     return SW_OKAY;
 }
@@ -113,7 +111,7 @@ sw_result sw_ipv4_address_init_from_this_host(sw_ipv4_address *self) {
     assert(self);
 
     AVAHI_WARN_LINKAGE;
-    
+
     /* This is so fucked up ... */
 
     memset(&sa, 0, sizeof(sa));
@@ -135,7 +133,7 @@ sw_result sw_ipv4_address_init_from_this_host(sw_ipv4_address *self) {
     close(fd);
 
     self->m_addr = sa.sin_addr.s_addr;
-    
+
     return SW_OKAY;
 }
 
@@ -144,7 +142,7 @@ sw_result sw_ipv4_address_fina(AVAHI_GCC_UNUSED sw_ipv4_address self) {
     AVAHI_WARN_LINKAGE;
 
     /* This is ridiculous ... */
-    
+
     return SW_OKAY;
 }
 
@@ -170,10 +168,10 @@ sw_string sw_ipv4_address_name(
 
     if (len < INET_ADDRSTRLEN)
         return NULL;
-    
+
     if (!(inet_ntop(AF_INET, &self.m_addr, name, len)))
         return NULL;
-            
+
     return name;
 }
 
@@ -187,9 +185,9 @@ sw_result sw_ipv4_address_decompose(
     uint32_t a;
 
     AVAHI_WARN_LINKAGE;
-    
+
     a = ntohl(self.m_addr);
-    
+
     assert(a1);
     assert(a2);
     assert(a3);
@@ -199,7 +197,7 @@ sw_result sw_ipv4_address_decompose(
     *a2 = (uint8_t) (a >> 16);
     *a3 = (uint8_t) (a >> 8);
     *a4 = (uint8_t) (a);
-        
+
     return SW_OKAY;
 }
 
index be99d9241ab524b4c552ca62482b74fe5415d5d9..b5a4a01aaa65ca9825d9d8a686e9ee9c8777f843 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -54,7 +52,7 @@ static sw_result reply(
         case SW_DISCOVERY_BROWSE_INVALID:
             fprintf(stderr, "some kind of failure happened: %s\n", domain);
             break;
-            
+
         default:
             abort();
     }
@@ -65,12 +63,12 @@ static sw_result reply(
 int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     sw_discovery discovery;
     sw_discovery_oid oid;
-    
+
     ASSERT_SW_OKAY(sw_discovery_init(&discovery));
 
     ASSERT_SW_OKAY(sw_discovery_browse_domains(discovery, 0, reply, NULL, &oid));
-    
+
     ASSERT_SW_OKAY(sw_discovery_run(discovery));
-                   
+
     return 0;
 }
index e4362081ca5a8740e0e1a9d3595493001ebcaa34..9b8b18c5b5246495643c08f494a756bf265dd8e6 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -87,7 +85,7 @@ struct _sw_discovery {
     sw_discovery_oid oid_index;
 
     int thread_fd, main_fd;
-    
+
     pthread_t thread;
     int thread_running;
 
@@ -121,7 +119,7 @@ static sw_result map_error(int error) {
     switch (error) {
         case AVAHI_OK:
             return SW_OKAY;
-            
+
         case AVAHI_ERR_NO_MEMORY:
             return SW_E_MEM;
     }
@@ -134,7 +132,7 @@ static int read_command(int fd) {
     char command;
 
     assert(fd >= 0);
-    
+
     if ((r = read(fd, &command, 1)) != 1) {
         fprintf(stderr, __FILE__": read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
         return -1;
@@ -157,9 +155,9 @@ static int write_command(int fd, char reply) {
 static int poll_func(struct pollfd *ufds, unsigned int nfds, int timeout, void *userdata) {
     sw_discovery self = userdata;
     int ret;
-    
+
     assert(self);
-    
+
     ASSERT_SUCCESS(pthread_mutex_unlock(&self->mutex));
     ret = poll(ufds, nfds, timeout);
     ASSERT_SUCCESS(pthread_mutex_lock(&self->mutex));
@@ -173,7 +171,7 @@ static void * thread_func(void *data) {
 
     sigfillset(&mask);
     pthread_sigmask(SIG_BLOCK, &mask, NULL);
-    
+
     self->thread = pthread_self();
     self->thread_running = 1;
 
@@ -184,7 +182,7 @@ static void * thread_func(void *data) {
             break;
 
 /*         fprintf(stderr, "Command: %c\n", command); */
-        
+
         switch (command) {
 
             case COMMAND_POLL: {
@@ -194,30 +192,30 @@ static void * thread_func(void *data) {
 
                 for (;;) {
                     errno = 0;
-                
+
                     if ((ret = avahi_simple_poll_run(self->simple_poll)) < 0) {
-                        
+
                         if (errno == EINTR)
                             continue;
-                        
+
                         fprintf(stderr, __FILE__": avahi_simple_poll_run() failed: %s\n", strerror(errno));
                     }
 
                     break;
                 }
-                    
+
                 ASSERT_SUCCESS(pthread_mutex_unlock(&self->mutex));
-                
+
                 if (write_command(self->thread_fd, ret < 0 ? COMMAND_POLL_FAILED : COMMAND_POLL_DONE) < 0)
                     break;
-                
+
                 break;
             }
 
             case COMMAND_QUIT:
                 return NULL;
         }
-        
+
     }
 
     return NULL;
@@ -231,13 +229,13 @@ static int oid_alloc(sw_discovery self, oid_type type) {
 
         while (self->oid_index >= OID_MAX)
             self->oid_index -= OID_MAX;
-        
+
         if (self->oid_table[self->oid_index].type == OID_UNUSED) {
             self->oid_table[self->oid_index].type = type;
             self->oid_table[self->oid_index].discovery = self;
 
             assert(OID_GET_INDEX(&self->oid_table[self->oid_index]) == self->oid_index);
-            
+
             return self->oid_index ++;
         }
 
@@ -245,7 +243,7 @@ static int oid_alloc(sw_discovery self, oid_type type) {
     }
 
     /* No free entry found */
-    
+
     return (sw_discovery_oid) -1;
 }
 
@@ -271,22 +269,22 @@ static oid_data* oid_get(sw_discovery self, sw_discovery_oid oid) {
 
     if (self->oid_table[oid].type == OID_UNUSED)
         return NULL;
-    
+
     return &self->oid_table[oid];
 }
 
 static service_data* service_data_new(sw_discovery self) {
     service_data *sdata;
-    
+
     assert(self);
 
     if (!(sdata = avahi_new0(service_data, 1)))
         return NULL;
 
     AVAHI_LLIST_PREPEND(service_data, services, self->services, sdata);
-    
+
     return sdata;
-    
+
 }
 
 static void service_data_free(sw_discovery self, service_data* sdata) {
@@ -294,7 +292,7 @@ static void service_data_free(sw_discovery self, service_data* sdata) {
     assert(sdata);
 
     AVAHI_LLIST_REMOVE(service_data, services, self->services, sdata);
-    
+
     avahi_free(sdata->name);
     avahi_free(sdata->regtype);
     avahi_free(sdata->domain);
@@ -308,12 +306,12 @@ static void reg_client_callback(oid_data *data, AvahiClientState state);
 static void client_callback(AvahiClient *s, AvahiClientState state, void* userdata) {
     sw_discovery self = userdata;
     sw_discovery_oid oid;
-    
+
     assert(s);
     assert(self);
 
     discovery_ref(self);
-    
+
     for (oid = 0; oid < OID_MAX; oid++) {
 
         switch (self->oid_table[oid].type) {
@@ -341,16 +339,16 @@ sw_result sw_discovery_init(sw_discovery * self) {
     sw_result result = SW_E_UNKNOWN;
     pthread_mutexattr_t mutex_attr;
     int error;
-    
+
     assert(self);
-    
+
     AVAHI_WARN_LINKAGE;
 
     *self = NULL;
 
     if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) < 0)
         goto fail;
-    
+
     if (!(*self = avahi_new(struct _sw_discovery, 1))) {
         result = SW_E_MEM;
         goto fail;
@@ -365,7 +363,7 @@ sw_result sw_discovery_init(sw_discovery * self) {
 
     memset((*self)->oid_table, 0, sizeof((*self)->oid_table));
     (*self)->oid_index = 0;
-    
+
     (*self)->thread_running = 0;
 
     AVAHI_LLIST_HEAD_INIT(service_info, (*self)->services);
@@ -384,7 +382,7 @@ sw_result sw_discovery_init(sw_discovery * self) {
         result = map_error(error);
         goto fail;
     }
-    
+
     /* Start simple poll */
     if (avahi_simple_poll_prepare((*self)->simple_poll, -1) < 0)
         goto fail;
@@ -392,12 +390,12 @@ sw_result sw_discovery_init(sw_discovery * self) {
     /* Queue an initial POLL command for the thread */
     if (write_command((*self)->main_fd, COMMAND_POLL) < 0)
         goto fail;
-    
+
     if (pthread_create(&(*self)->thread, NULL, thread_func, *self) != 0)
         goto fail;
 
     (*self)->thread_running = 1;
-    
+
     return SW_OKAY;
 
 fail:
@@ -416,9 +414,9 @@ static int stop_thread(sw_discovery self) {
 
     if (write_command(self->main_fd, COMMAND_QUIT) < 0)
         return -1;
-    
+
     avahi_simple_poll_wakeup(self->simple_poll);
-    
+
     ASSERT_SUCCESS(pthread_join(self->thread, NULL));
     self->thread_running = 0;
     return 0;
@@ -459,24 +457,24 @@ static void discovery_unref(sw_discovery self) {
 
     while (self->services)
         service_data_free(self, self->services);
-    
+
     avahi_free(self);
 }
 
 sw_result sw_discovery_fina(sw_discovery self) {
     assert(self);
-    
+
     AVAHI_WARN_LINKAGE;
 
     stop_thread(self);
     discovery_unref(self);
-    
+
     return SW_OKAY;
 }
 
 sw_result sw_discovery_run(sw_discovery self) {
     assert(self);
-    
+
     AVAHI_WARN_LINKAGE;
 
     return sw_salt_run((sw_salt) self);
@@ -484,7 +482,7 @@ sw_result sw_discovery_run(sw_discovery self) {
 
 sw_result sw_discovery_stop_run(sw_discovery self) {
     assert(self);
-    
+
     AVAHI_WARN_LINKAGE;
 
     return sw_salt_stop_run((sw_salt) self);
@@ -492,7 +490,7 @@ sw_result sw_discovery_stop_run(sw_discovery self) {
 
 int sw_discovery_socket(sw_discovery self) {
     assert(self);
-    
+
     AVAHI_WARN_LINKAGE;
 
     return self->main_fd;
@@ -500,17 +498,17 @@ int sw_discovery_socket(sw_discovery self) {
 
 sw_result sw_discovery_read_socket(sw_discovery self) {
     sw_result result = SW_E_UNKNOWN;
-    
+
     assert(self);
 
     discovery_ref(self);
 
     ASSERT_SUCCESS(pthread_mutex_lock(&self->mutex));
-    
+
     /* Cleanup notification socket */
     if (read_command(self->main_fd) != COMMAND_POLL_DONE)
         goto finish;
-    
+
     if (avahi_simple_poll_dispatch(self->simple_poll) < 0)
         goto finish;
 
@@ -525,26 +523,26 @@ sw_result sw_discovery_read_socket(sw_discovery self) {
         /* Request the poll */
         if (write_command(self->main_fd, COMMAND_POLL) < 0)
             goto finish;
-    
+
     result = SW_OKAY;
-    
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&self->mutex));
 
     discovery_unref(self);
-    
+
     return result;
 }
 
 sw_result sw_discovery_salt(sw_discovery self, sw_salt *salt) {
     assert(self);
     assert(salt);
-    
+
     AVAHI_WARN_LINKAGE;
 
     *salt = (sw_salt) self;
-    
+
     return SW_OKAY;
 }
 
@@ -557,34 +555,34 @@ sw_result sw_salt_step(sw_salt self, sw_uint32 * msec) {
 
     if (!((sw_discovery) self)->thread_running)
         return SW_E_UNKNOWN;
-    
+
     memset(&p, 0, sizeof(p));
     p.fd = ((sw_discovery) self)->main_fd;
     p.events = POLLIN;
 
     if ((r = poll(&p, 1, msec ? (int) *msec : -1)) < 0) {
-        
+
         /* Don't treat EINTR as error */
         if (errno == EINTR)
             return SW_OKAY;
-        
+
         return SW_E_UNKNOWN;
-        
+
     } else if (r == 0) {
-        
+
         /* Timeoout */
         return SW_OKAY;
 
     } else {
         /* Success */
-    
+
         if (p.revents != POLLIN)
             return SW_E_UNKNOWN;
 
         if ((result = sw_discovery_read_socket((sw_discovery) self)) != SW_OKAY)
             return result;
     }
-    
+
     return SW_OKAY;
 }
 
@@ -594,7 +592,7 @@ sw_result sw_salt_run(sw_salt self) {
     AVAHI_WARN_LINKAGE;
 
     assert(self);
-    
+
     for (;;)
         if ((ret = sw_salt_step(self, NULL)) != SW_OKAY)
             return ret;
@@ -622,7 +620,7 @@ sw_result sw_salt_lock(sw_salt self) {
 
 sw_result sw_salt_unlock(sw_salt self) {
     assert(self);
-    
+
     AVAHI_WARN_LINKAGE;
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&((sw_discovery) self)->salt_mutex));
@@ -634,9 +632,9 @@ static void reg_report_status(oid_data *data, sw_discovery_publish_status status
     sw_discovery_publish_reply reply;
 
     assert(data);
-    
+
     reply = (sw_discovery_publish_reply) data->reply;
-    
+
     reply(data->discovery,
           OID_GET_INDEX(data),
           status,
@@ -646,11 +644,11 @@ static void reg_report_status(oid_data *data, sw_discovery_publish_status status
 static int reg_create_service(oid_data *data) {
     int ret;
     const char *real_type;
-    
+
     assert(data);
 
     real_type = avahi_get_type_from_subtype(data->service_data->regtype);
-    
+
     if ((ret = avahi_entry_group_add_service_strlst(
              data->object,
              data->service_data->interface,
@@ -663,7 +661,7 @@ static int reg_create_service(oid_data *data) {
              data->service_data->port,
              data->service_data->txt)) < 0)
         return ret;
-    
+
     if (real_type) {
         /* Create a subtype entry */
 
@@ -692,12 +690,12 @@ static void reg_client_callback(oid_data *data, AvahiClientState state) {
     /* We've not been setup completely */
     if (!data->object)
         return;
-    
+
     switch (state) {
         case AVAHI_CLIENT_FAILURE:
             reg_report_status(data, SW_DISCOVERY_PUBLISH_INVALID);
             break;
-        
+
         case AVAHI_CLIENT_S_RUNNING: {
             int ret;
 
@@ -706,10 +704,10 @@ static void reg_client_callback(oid_data *data, AvahiClientState state) {
                 reg_report_status(data, SW_DISCOVERY_PUBLISH_INVALID);
                 return;
             }
-            
+
             break;
         }
-            
+
         case AVAHI_CLIENT_S_COLLISION:
         case AVAHI_CLIENT_S_REGISTERING:
 
@@ -749,7 +747,7 @@ static void reg_entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState st
         case AVAHI_ENTRY_GROUP_FAILURE:
             reg_report_status(data, SW_DISCOVERY_PUBLISH_INVALID);
             break;
-            
+
     }
 }
 
@@ -771,13 +769,13 @@ sw_result sw_discovery_publish(
     sw_result result = SW_E_UNKNOWN;
     service_data *sdata;
     AvahiStringList *txt = NULL;
-    
+
     assert(self);
     assert(name);
     assert(type);
     assert(reply);
     assert(oid);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (text_record && text_record_len > 0)
@@ -820,7 +818,7 @@ sw_result sw_discovery_publish(
 
     if (avahi_client_get_state(self->client) == AVAHI_CLIENT_S_RUNNING) {
         int error;
-        
+
         if ((error = reg_create_service(data)) < 0) {
             result = map_error(error);
             goto finish;
@@ -832,8 +830,8 @@ sw_result sw_discovery_publish(
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&self->mutex));
-    
-    if (result != SW_OKAY) 
+
+    if (result != SW_OKAY)
         if (*oid != (sw_discovery_oid) -1)
             sw_discovery_cancel(self, *oid);
 
@@ -872,7 +870,7 @@ static void domain_browser_callback(
         case AVAHI_BROWSER_FAILURE:
             reply(data->discovery, OID_GET_INDEX(data), SW_DISCOVERY_BROWSE_INVALID, interface, NULL, NULL, domain, data->extra);
             break;
-            
+
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
         case AVAHI_BROWSER_ALL_FOR_NOW:
             break;
@@ -885,15 +883,15 @@ sw_result sw_discovery_browse_domains(
     sw_discovery_browse_reply reply,
     sw_opaque extra,
     sw_discovery_oid * oid) {
-    
+
     oid_data *data;
     AvahiIfIndex ifindex;
     sw_result result = SW_E_UNKNOWN;
-    
+
     assert(self);
     assert(reply);
     assert(oid);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if ((*oid = oid_alloc(self, OID_DOMAIN_BROWSER)) == (sw_discovery_oid) -1)
@@ -903,11 +901,11 @@ sw_result sw_discovery_browse_domains(
     assert(data);
     data->reply = (sw_result (*)(void)) reply;
     data->extra = extra;
-    
+
     ifindex = interface_index == 0 ? AVAHI_IF_UNSPEC : (AvahiIfIndex) interface_index;
 
     ASSERT_SUCCESS(pthread_mutex_lock(&self->mutex));
-    
+
     if (!(data->object = avahi_domain_browser_new(self->client, ifindex, AVAHI_PROTO_INET, NULL, AVAHI_DOMAIN_BROWSER_BROWSE, 0, domain_browser_callback, data))) {
         result = map_error(avahi_client_errno(self->client));
         goto finish;
@@ -918,7 +916,7 @@ sw_result sw_discovery_browse_domains(
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&self->mutex));
-    
+
     if (result != SW_OKAY)
         if (*oid != (sw_discovery_oid) -1)
             sw_discovery_cancel(self, *oid);
@@ -943,7 +941,7 @@ static void service_resolver_callback(
 
     oid_data* data = userdata;
     sw_discovery_resolve_reply reply;
-    
+
     assert(r);
     assert(data);
 
@@ -960,7 +958,7 @@ static void service_resolver_callback(
             sw_ipv4_address_init_from_saddr(&addr, a->data.ipv4.address);
 
             host_name = add_trailing_dot(host_name, host_name_fixed, sizeof(host_name_fixed));
-            
+
             if ((p = avahi_new0(uint8_t, (l = avahi_string_list_serialize(txt, NULL, 0))+1)))
                 avahi_string_list_serialize(txt, p, l);
 
@@ -973,7 +971,7 @@ static void service_resolver_callback(
         case AVAHI_RESOLVER_FAILURE:
 
             /* Apparently there is no way in HOWL to inform about failed resolvings ... */
-            
+
             avahi_warn("A service failed to resolve in the HOWL compatiblity layer of Avahi which is used by '%s'. "
                        "Since the HOWL API doesn't offer any means to inform the application about this, we have to ignore the failure. "
                        "Please fix your application to use the native API of Avahi!",
@@ -996,13 +994,13 @@ sw_result sw_discovery_resolve(
     oid_data *data;
     AvahiIfIndex ifindex;
     sw_result result = SW_E_UNKNOWN;
-    
+
     assert(self);
     assert(name);
     assert(type);
     assert(reply);
     assert(oid);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if ((*oid = oid_alloc(self, OID_SERVICE_RESOLVER)) == (sw_discovery_oid) -1)
@@ -1012,22 +1010,22 @@ sw_result sw_discovery_resolve(
     assert(data);
     data->reply = (sw_result (*)(void)) reply;
     data->extra = extra;
-    
+
     ifindex = interface_index == 0 ? AVAHI_IF_UNSPEC : (AvahiIfIndex) interface_index;
 
     ASSERT_SUCCESS(pthread_mutex_lock(&self->mutex));
-    
+
     if (!(data->object = avahi_service_resolver_new(self->client, ifindex, AVAHI_PROTO_INET, name, type, domain, AVAHI_PROTO_INET, 0, service_resolver_callback, data))) {
         result = map_error(avahi_client_errno(self->client));
         goto finish;
     }
 
     result = SW_OKAY;
-    
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&self->mutex));
-    
+
     if (result != SW_OKAY)
         if (*oid != (sw_discovery_oid) -1)
             sw_discovery_cancel(self, *oid);
@@ -1049,7 +1047,7 @@ static void service_browser_callback(
     oid_data* data = userdata;
     char type_fixed[AVAHI_DOMAIN_NAME_MAX], domain_fixed[AVAHI_DOMAIN_NAME_MAX];
     sw_discovery_browse_reply reply;
-    
+
     assert(b);
     assert(data);
 
@@ -1070,7 +1068,7 @@ static void service_browser_callback(
         case AVAHI_BROWSER_FAILURE:
             reply(data->discovery, OID_GET_INDEX(data), SW_DISCOVERY_BROWSE_INVALID, interface, name, type, domain, data->extra);
             break;
-            
+
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
         case AVAHI_BROWSER_ALL_FOR_NOW:
             break;
@@ -1089,12 +1087,12 @@ sw_result sw_discovery_browse(
     oid_data *data;
     AvahiIfIndex ifindex;
     sw_result result = SW_E_UNKNOWN;
-    
+
     assert(self);
     assert(type);
     assert(reply);
     assert(oid);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if ((*oid = oid_alloc(self, OID_SERVICE_BROWSER)) == (sw_discovery_oid) -1)
@@ -1104,22 +1102,22 @@ sw_result sw_discovery_browse(
     assert(data);
     data->reply = (sw_result (*)(void)) reply;
     data->extra = extra;
-    
+
     ifindex = interface_index == 0 ? AVAHI_IF_UNSPEC : (AvahiIfIndex) interface_index;
 
     ASSERT_SUCCESS(pthread_mutex_lock(&self->mutex));
-    
+
     if (!(data->object = avahi_service_browser_new(self->client, ifindex, AVAHI_PROTO_INET, type, domain, 0, service_browser_callback, data))) {
         result = map_error(avahi_client_errno(self->client));
         goto finish;
     }
 
     result = SW_OKAY;
-    
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&self->mutex));
-    
+
     if (result != SW_OKAY)
         if (*oid != (sw_discovery_oid) -1)
             sw_discovery_cancel(self, *oid);
@@ -1129,7 +1127,7 @@ finish:
 
 sw_result sw_discovery_cancel(sw_discovery self, sw_discovery_oid oid) {
     oid_data *data;
-    assert(self);                             
+    assert(self);
 
     AVAHI_WARN_LINKAGE;
 
@@ -1141,19 +1139,19 @@ sw_result sw_discovery_cancel(sw_discovery self, sw_discovery_oid oid) {
             case OID_SERVICE_BROWSER:
                 avahi_service_browser_free(data->object);
                 break;
-                
+
             case OID_SERVICE_RESOLVER:
                 avahi_service_resolver_free(data->object);
                 break;
-                
+
             case OID_DOMAIN_BROWSER:
                 avahi_domain_browser_free(data->object);
                 break;
-                
+
             case OID_ENTRY_GROUP:
                 avahi_entry_group_free(data->object);
                 break;
-                
+
             case OID_UNUSED:
             ;
         }
@@ -1165,7 +1163,7 @@ sw_result sw_discovery_cancel(sw_discovery self, sw_discovery_oid oid) {
     }
 
     oid_release(self, oid);
-    
+
     return SW_OKAY;
 }
 
index 42fbb71a79b7ae6ca9ef2c9c31b578e9aac88d46..fad8ebfb9b218516a2dd00618f914f4f6a57fef1 100644 (file)
@@ -180,5 +180,3 @@ sw_corby_object_set_channel
 sw_text_record_string_iterator_init
 sw_text_record_string_iterator_fina
 sw_text_record_string_iterator_next
-
-$Id$
index 017ad5d99ee2ad6d31cba90a37aac40b2c4af0c0..3c4416ec434a62c34d213ecfc743e22922e100af 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -36,7 +36,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 struct                                                                         _sw_corby_buffer;
@@ -128,7 +128,7 @@ sw_corby_buffer_fina(
 void HOWL_API
 sw_corby_buffer_reset(
                                sw_corby_buffer self);
-                               
+
 
 sw_result HOWL_API
 sw_corby_buffer_set_octets(
@@ -136,21 +136,21 @@ sw_corby_buffer_set_octets(
                                sw_octets                       octets,
                                sw_size_t                       size);
 
-                               
+
 sw_octets HOWL_API
 sw_corby_buffer_octets(
                                sw_corby_buffer self);
-                               
-                               
+
+
 sw_size_t HOWL_API
 sw_corby_buffer_bytes_used(
                                sw_corby_buffer self);
 
-                               
+
 sw_size_t HOWL_API
 sw_corby_buffer_size(
                                sw_corby_buffer self);
-                               
+
 
 sw_result HOWL_API
 sw_corby_buffer_put_int8(
@@ -193,14 +193,14 @@ sw_corby_buffer_put_octets(
                                sw_corby_buffer self,
                                sw_const_octets val,
                                sw_size_t                       size);
-                                    
+
 
 sw_result HOWL_API
 sw_corby_buffer_put_sized_octets(
                                sw_corby_buffer self,
                                sw_const_octets val,
                                sw_uint32                       len);
-                                    
+
 
 sw_result HOWL_API
 sw_corby_buffer_put_cstring(
@@ -218,7 +218,7 @@ sw_result HOWL_API
 sw_corby_buffer_put_pad(
                                sw_corby_buffer                                         self,
                                sw_corby_buffer_pad                                     pad);
-                               
+
 
 sw_result HOWL_API
 sw_corby_buffer_get_int8(
@@ -273,7 +273,7 @@ sw_corby_buffer_allocate_and_get_sized_octets(
                                sw_octets               *       val,
                                sw_uint32               *       size,
             sw_uint8                   endian);
-                                    
+
 
 sw_result HOWL_API
 sw_corby_buffer_get_zerocopy_sized_octets(
@@ -281,7 +281,7 @@ sw_corby_buffer_get_zerocopy_sized_octets(
                                sw_octets               *       val,
                                sw_uint32               *       size,
                                sw_uint8                        endian);
-                                    
+
 
 sw_result HOWL_API
 sw_corby_buffer_get_sized_octets(
@@ -297,15 +297,15 @@ sw_corby_buffer_allocate_and_get_cstring(
                                sw_string               *       val,
                                sw_uint32               *       len,
                                sw_uint8                        endian);
-                               
-                               
+
+
 sw_result HOWL_API
 sw_corby_buffer_get_zerocopy_cstring(
                                sw_corby_buffer self,
                                sw_string               *       val,
                                sw_uint32               *       len,
                                sw_uint8                        endian);
-                                    
+
 
 sw_result HOWL_API
 sw_corby_buffer_get_cstring(
@@ -313,18 +313,18 @@ sw_corby_buffer_get_cstring(
                                sw_string                       val,
                                sw_uint32               *       len,
                                sw_uint8                        endian);
-                               
-                               
+
+
 sw_result HOWL_API
 sw_corby_buffer_get_object(
                                sw_corby_buffer                         self,
                                struct _sw_corby_object **      object,
                                sw_uint8                                                endian);
-                                    
+
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 
 #endif
index 823e027220efd76b8df79702a5915043c61ed1e7..9c91fbba0cf137708b73d214731a38caedbb88b1 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -38,7 +38,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 struct                                                                                         _sw_corby_channel;
 typedef struct _sw_corby_channel                       *       sw_corby_channel;
@@ -180,7 +180,7 @@ sw_corby_channel_fina(
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 
 #endif
index 7d681387d32b6d8ae1070de302d60c3f9fe350fd..5e069ff59f3a0e3f665fff6a5fd25cf5a9315fb7 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -38,9 +38,9 @@
 
 
 /*
- * protocol tags.  the only standard one is TAG_INTERNET_IIOP. 
+ * protocol tags.  the only standard one is TAG_INTERNET_IIOP.
  * the others are proprietary pandora corby protocols.
- */ 
+ */
 #define SW_TAG_INTERNET_IOP    0
 #define SW_TAG_UIOP                            250
 #define SW_TAG_MIOP                            251
index 406b9b9c275bf7da94dd2b31088808653c5d0cc4..a06c35842e2e7b9673475af7bd7d900e24768784 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -54,7 +54,7 @@ sw_corby_message_fina(
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 
 #endif
index 1bc74070f14b8b23894090d9a1922b55107a1994..1cfd516b1061e1d4154df311a067e37218805204 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -64,7 +64,7 @@ sw_corby_object_init_from_url(
 sw_result HOWL_API
 sw_corby_object_fina(
                                                        sw_corby_object         self);
-                                                       
+
 
 sw_result HOWL_API
 sw_corby_object_start_request(
index a674082aac9ddc623551032f69e70fdb6e1e4b4f..76af578dbdc5f21eeb6776f0b84b5f473bfe1a97 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -38,7 +38,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 struct                                                                 _sw_corby_orb;
@@ -165,7 +165,7 @@ sw_corby_orb_protocol_to_address(
                                sw_const_string tag,
                                sw_string                       addr,
                                sw_port         *       port);
-                                                                                               
+
 
 sw_result HOWL_API
 sw_corby_orb_protocol_to_url(
@@ -193,7 +193,7 @@ sw_corby_orb_dispatch_message(
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 
 #endif
index 1e8a7d5ac2cc09e3a8c6b3723d835434fc02277a..082373daa019a25f63af5f58c99095a70d5be922 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -52,7 +52,7 @@ typedef sw_uint32                                             sw_discovery_oid;
 /*
  * For backwards compatibility
  */
-#define sw_discovery_publish_host_id   sw_discovery_oid        
+#define sw_discovery_publish_host_id   sw_discovery_oid
 #define sw_discovery_publish_id                        sw_discovery_oid
 #define sw_discovery_browse_id                 sw_discovery_oid
 #define sw_discovery_resolve_id                        sw_discovery_oid
@@ -107,7 +107,7 @@ typedef sw_result
                                                        sw_discovery_publish_status     status,
                                                        sw_opaque                                                       extra);
 
-typedef sw_result      
+typedef sw_result
 (HOWL_API *sw_discovery_browse_reply)(
                                                        sw_discovery                                            session,
                                                        sw_discovery_oid                                        oid,
@@ -142,10 +142,10 @@ typedef sw_result
                                                        sw_const_string                                                 fullname,
                                                        sw_uint16                                                                       rrtype,
                                                        sw_uint16                                                                       rrclass,
-                                                       sw_uint16                                                                       rrdatalen,      
+                                                       sw_uint16                                                                       rrdatalen,
                                                        sw_const_octets                                                 rrdata,
                                                        sw_uint32                                                                       ttl,
-                                                       sw_opaque                                                                       extra); 
+                                                       sw_opaque                                                                       extra);
 
 
 /*
@@ -254,7 +254,7 @@ sw_discovery_query_record(
                                        sw_const_string                                                 fullname,
                                        sw_uint16                                                                       rrtype,
                                        sw_uint16                                                                       rrclass,
-                                       sw_discovery_query_record_reply         reply,  
+                                       sw_discovery_query_record_reply         reply,
                                        sw_opaque                                                                       extra,
                                        sw_discovery_oid                                                *       oid);
 
@@ -263,7 +263,7 @@ sw_result HOWL_API
 sw_discovery_cancel(
                                        sw_discovery            self,
                                        sw_discovery_oid        oid);
-                               
+
 
 
 /* ----------------------------------------------------------
@@ -272,7 +272,7 @@ sw_discovery_cancel(
  *
  * ----------------------------------------------------------
  */
-                                               
+
 
 sw_result HOWL_API
 sw_discovery_run(
@@ -282,7 +282,7 @@ sw_discovery_run(
 sw_result HOWL_API
 sw_discovery_stop_run(
                                        sw_discovery                                            self);
-                                               
+
 
 int HOWL_API
 sw_discovery_socket(
index 91f16d790965cedab5816ae507fdd9fc5b8a1291..a5ee802891d1f8f1fcc4060b452c6e4c2e9a3c71 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
index 80a17759bcae8ae6357e9947c58b4d991a785fc3..dac6d43dbd8bec150b5a8718da47b621e04dfc96 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
index 1d26b4a32dd7dee726877f9087e2bdcb43ae704e..12c85e80f095e07918fbac2f296d1eb619317b76 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
index cf8b845bb22b8a88949230710e3db132f21cde83..3e2bfc2c85852d4b1d8f36f18260ca820c5be6fc 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
index b18a4afd9d002204d9ce4979660917bcf5bac081..ea83f8d8256d44eb8c21a5633b91683943377692 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -91,7 +91,7 @@ sw_ipv4_address_fina(
 sw_bool HOWL_API
 sw_ipv4_address_is_any(
                                sw_ipv4_address self);
-                               
+
 
 sw_saddr HOWL_API
 sw_ipv4_address_saddr(
index 03bd45309cc820d576ebf57e0c5a7e21ae8ba8d1..c53977bc8d6d812bb5d5c2669cdb4c0bdb33eaef 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -36,7 +36,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 #define SW_LOG_WARNING     1 << 0
index 53563989561a779e0738691de6642c29915a77c5..a4b1b1de64e345fce38c943d3bad5cfb8b8542a3 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
index fda0c77d47cda106887bebf89110cb898a26ca36..6bb9dcc55f89796baf0a1b184d2d622f4fea6170 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -33,7 +33,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 #if defined(__VXWORKS__)
@@ -119,7 +119,7 @@ typedef int                                         sw_result;
  * for little endian platforms.
  *
  * The macro WORDS_BIGENDIAN will be defined
- * by autoconf.  If you are using Howl on 
+ * by autoconf.  If you are using Howl on
  * a platform  that doesn't have autoconf, define
  * SW_ENDIAN directly
  * --------------------------------------------------------
@@ -185,19 +185,19 @@ extern sw_int32
 sw_strcasecmp(
                sw_const_string arg1,
                sw_const_string arg2);
-                                                
+
 extern sw_int32
 sw_strncasecmp(
                sw_const_string arg1,
                sw_const_string arg2,
                sw_len                          n);
-                                                
+
 extern sw_string
 sw_strtok_r(
                sw_string                       arg1,
                sw_const_string arg2,
                sw_string               *       lasts);
-                                                
+
 #      define sw_memset(ARG1, ARG2, ARG3)              memset((char*) ARG1, ARG2, ARG3)
 #      define sw_memcpy(ARG1, ARG2, ARG3)              memcpy((char*) ARG1, (char*) ARG2, ARG3)
 #      define sw_memcmp(ARG1, ARG2, ARG3)              memcmp((char*) ARG1, ARG2, ARG3)
@@ -413,7 +413,7 @@ sw_strerror();
 
 /*
  * Obsolete types and macros.
- * 
+ *
  * These are here for backwards compatibility, but will
  * be removed in the future
  */
index 88ac0d9247209b68ce9c8f5582437d8c988f3e78..ddb289b47a2766686e384e3c3497858acb6a3c5c 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 typedef enum _sw_socket_event
 {
        SW_SOCKET_READ          =       (1 << 0),
        SW_SOCKET_WRITE =       (1 << 1),
-       SW_SOCKET_OOB           =       (1 << 2)        
+       SW_SOCKET_OOB           =       (1 << 2)
 } sw_socket_event;
 
 
@@ -80,7 +80,7 @@ typedef sw_result
                                                                        sw_salt                                                                 salt,
                                                                        struct _sw_network_interface    *       netif,
                                                                        sw_opaque                                                               extra);
-               
+
 typedef sw_opaque                              sw_signal_handler;
 typedef sw_result
 (HOWL_API *sw_signal_handler_func)(
@@ -95,13 +95,13 @@ sw_salt_init(
                                sw_salt         *       self,
                                int                             argc,
                                char                    **      argv);
-                                 
-                                 
+
+
 sw_result HOWL_API
 sw_salt_fina(
                                sw_salt self);
 
-                                                                  
+
 sw_result HOWL_API
 sw_salt_register_socket(
                                sw_salt                                         self,
@@ -116,8 +116,8 @@ sw_result HOWL_API
 sw_salt_unregister_socket(
                                sw_salt                                         self,
                                struct _sw_socket               *       socket);
-                                 
-                                 
+
+
 sw_result HOWL_API
 sw_salt_register_timer(
                                sw_salt                                         self,
@@ -126,8 +126,8 @@ sw_salt_register_timer(
                                sw_timer_handler                        handler,
                                sw_timer_handler_func   func,
                                sw_opaque                                       extra);
-                                 
-                                 
+
+
 sw_result HOWL_API
 sw_salt_unregister_timer(
                                sw_salt                                         self,
@@ -187,7 +187,7 @@ sw_salt_run(
 sw_result HOWL_API
 sw_salt_stop_run(
                                sw_salt self);
-            
+
 
 #define SW_FALSE               0
 #define SW_TRUE                1
index 2ae5bb338967af1ade336eacbdceec3ee24e9f05..b36e02feb4ae7b34b43467845546b2671875a358 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -35,7 +35,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 struct                                                         _sw_signal;
@@ -55,7 +55,7 @@ sw_signal_fina(
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 
 #endif
index 88773e4f1845917e7a5e2e1057dab5d45d181ba5..9eaa102cf1b8c1ebffff4fb108553c52db99d1c8 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -36,7 +36,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 struct                                                                                 _sw_socket;
@@ -66,8 +66,8 @@ sw_udp_socket_init(
 sw_result HOWL_API
 sw_multicast_socket_init(
                                sw_socket       *       self);
-                                    
-                                    
+
+
 sw_result HOWL_API
 sw_socket_fina(
                                sw_socket       self);
@@ -97,21 +97,21 @@ sw_result HOWL_API
 sw_socket_listen(
                                sw_socket       self,
                                int                     qsize);
-                                    
-                                     
+
+
 sw_result HOWL_API
 sw_socket_connect(
                                sw_socket                       self,
                                sw_ipv4_address address,
                                sw_port                 port);
-                                    
-                                    
+
+
 sw_result HOWL_API
 sw_socket_accept(
                                sw_socket               self,
                                sw_socket       *       socket);
-                                    
-                           
+
+
 sw_result HOWL_API
 sw_socket_send(
                                sw_socket               self,
@@ -129,7 +129,7 @@ sw_socket_sendto(
                                sw_ipv4_address to,
                                sw_port                 port);
 
-                                    
+
 sw_result HOWL_API
 sw_socket_recv(
                                sw_socket               self,
@@ -154,13 +154,13 @@ sw_result HOWL_API
 sw_socket_set_blocking_mode(
                                sw_socket       self,
                                sw_bool blocking_mode);
-                               
-                               
+
+
 sw_result HOWL_API
 sw_socket_set_options(
                                sw_socket                               self,
                                sw_socket_options               options);
-                                 
+
 
 sw_ipv4_address HOWL_API
 sw_socket_ipv4_address(
@@ -185,31 +185,31 @@ sw_socket_close(
 sw_result HOWL_API
 sw_socket_options_init(
                                sw_socket_options       *       self);
-                                    
+
 
 sw_result HOWL_API
 sw_socket_options_fina(
                                sw_socket_options       self);
-                                    
+
 
 sw_result HOWL_API
 sw_socket_options_set_debug(
                                sw_socket_options               self,
                                sw_bool                                 val);
-                               
+
 
 sw_result HOWL_API
 sw_socket_options_set_nodelay(
                                sw_socket_options               self,
                                sw_bool                                 val);
-                                    
-                                    
+
+
 sw_result HOWL_API
 sw_socket_options_set_dontroute(
                                sw_socket_options               self,
                                sw_bool                                 val);
-                                    
-                             
+
+
 sw_result HOWL_API
 sw_socket_options_set_keepalive(
                                sw_socket_options               self,
@@ -221,8 +221,8 @@ sw_socket_options_set_linger(
                                sw_socket_options               self,
                                sw_bool                                 onoff,
                                sw_uint32                                       linger);
-                                    
-                                    
+
+
 sw_result HOWL_API
 sw_socket_options_set_reuseaddr(
                                sw_socket_options               self,
@@ -233,8 +233,8 @@ sw_result HOWL_API
 sw_socket_options_set_rcvbuf(
                                sw_socket_options               self,
                                sw_uint32                                       val);
-                                    
-                                    
+
+
 sw_result HOWL_API
 sw_socket_options_set_sndbuf(
                                sw_socket_options               self,
@@ -242,7 +242,7 @@ sw_socket_options_set_sndbuf(
 
 
 int
-sw_socket_error_code(void); 
+sw_socket_error_code(void);
 
 
 #define        SW_E_SOCKET_BASE                0x80000200
@@ -257,7 +257,7 @@ sw_socket_error_code(void);
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 
 #endif
index b3ec2261344fb08dcd2f42e6f0e8f45b191c3298..8789b3a34f4b0db33d02a7b387a141682903ad19 100644 (file)
@@ -8,7 +8,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -35,7 +35,7 @@
 #ifdef __cplusplus
 extern "C"
 {
-#endif 
+#endif
 
 
 struct                                                         _sw_timer;
@@ -94,7 +94,7 @@ sw_time_cmp(
 
 #ifdef __cplusplus
 }
-#endif 
+#endif
 
 
 #endif
index bda07b182694492caa3a0f4371c3901f8dee5b88..5efa19e24507654090e415f0469ed1609afe6a6f 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index b4a8cf3bf9709a6abb4b35fc9f349e7a23ef802f..f55b1cf52c89e44e317b9bba10e652414f2492d0 100644 (file)
@@ -5,7 +5,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -54,7 +54,7 @@ my_resolver(
        sw_result                                                               err = SW_OKAY;
 
        sw_discovery_cancel(discovery, oid);
-       
+
        fprintf(stderr, "resolve reply: 0x%x %s %s %s %s %d\n", interface_index, name, type, domain, sw_ipv4_address_name(address, name_buf, 16), port);
 
        if ((text_record_len > 0) && (text_record) && (*text_record != '\0'))
index cca60408dc9dd78dcfc35048e831bbe07bed1eac..931e78624ee1df7ac1afaf9934e5080cab544804 100644 (file)
@@ -5,7 +5,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
index a74a81c8e403d570e72be3e06c29cb35025b7168..b1c30ebca8b82dbbfec44657c1acdae116830486 100644 (file)
@@ -5,7 +5,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -40,7 +40,7 @@ query_record_reply(
                                sw_const_string                                                 fullname,
                                sw_uint16                                                                       rrtype,
                                sw_uint16                                                                       rrclass,
-                               sw_uint16                                                                       rrdatalen,      
+                               sw_uint16                                                                       rrdatalen,
                                sw_const_octets                                                 rrdata,
                                sw_uint32                                                                       ttl,
                                sw_opaque                                                                       extra)
index b921c270a79c2c86ee61c8a754a15efd01624404..1790849bbdf679a995a236f3ca08fbc1f9037774 100644 (file)
@@ -5,7 +5,7 @@
  *     are permitted provided that the following conditions are met:
  *
  *             1. Redistributions of source code must retain the above copyright notice,
- *                this list of conditions and the following disclaimer.   
+ *                this list of conditions and the following disclaimer.
  *             2. Redistributions in binary form must reproduce the above copyright notice,
  *                this list of conditions and the following disclaimer in the documentation
  *                and/or other materials provided with the distribution.
@@ -54,7 +54,7 @@ my_resolver(
        sw_result                                                               err = SW_OKAY;
 
        sw_discovery_cancel(discovery, oid);
-       
+
        fprintf(stderr, "resolve reply: 0x%x %s %s %s %s %d\n", interface_index, name, type, domain, sw_ipv4_address_name(address, name_buf, 16), port);
 
        if ((text_record_len > 0) && (text_record) && (*text_record != '\0'))
index fea653c0e0df4bdd9ac449ae1f387e41bb3f8094..66ff58b5d41f745d4315827ba5769dba5138c750 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -36,7 +34,7 @@ static void hexdump(const void* p, size_t size) {
     const uint8_t *c = p;
     assert(p);
 
-    printf("Dumping %u bytes from %p:\n", size, p);
+    printf("Dumping %zu bytes from %p:\n", size, p);
 
     while (size > 0) {
         unsigned i;
@@ -72,12 +70,12 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     char key[255];
     uint8_t val[255];
     sw_ulong val_len;
-    
+
     ASSERT_SW_OKAY(sw_text_record_init(&r));
     ASSERT_SW_OKAY(sw_text_record_add_string(r, "foo=bar"));
     ASSERT_SW_OKAY(sw_text_record_add_string(r, "waldo=baz"));
     ASSERT_SW_OKAY(sw_text_record_add_key_and_string_value(r, "quux", "nimpf"));
-    ASSERT_SW_OKAY(sw_text_record_add_key_and_binary_value(r, "quux", "\0\0\0\0", 4));
+    ASSERT_SW_OKAY(sw_text_record_add_key_and_binary_value(r, "quux", (void*) "\0\0\0\0", 4));
 
     hexdump(sw_text_record_bytes(r), sw_text_record_len(r));
 
@@ -92,7 +90,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
 
 
-    
+
     ASSERT_SW_OKAY(sw_text_record_fina(r));
 
     return 0;
index 3b717bef610cd54d02ecfdb7b11b0f73861fd2d9..7ef4df33f89bf87c47a7e731843e344b3c8d8a73 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -44,12 +42,12 @@ struct _sw_text_record {
 static size_t strlcpy(char *dest, const char *src, size_t n) {
     assert(dest);
     assert(src);
-    
+
     if (n > 0) {
         strncpy(dest, src, n-1);
         dest[n-1] = 0;
     }
-    
+
     return strlen(src);
 }
 
@@ -59,17 +57,17 @@ sw_result sw_text_record_init(sw_text_record *self) {
     assert(self);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!(*self = avahi_new(struct _sw_text_record, 1))) {
         *self = NULL;
         return SW_E_UNKNOWN;
     }
-    
+
     (*self)->strlst = NULL;
     (*self)->buffer = NULL;
     (*self)->buffer_size = 0;
     (*self)->buffer_valid = 0;
-    
+
     return SW_OKAY;
 }
 
@@ -89,12 +87,12 @@ sw_result sw_text_record_add_string(
     sw_const_string string) {
 
     AvahiStringList *n;
-    
+
     assert(self);
     assert(string);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!(n = avahi_string_list_add(self->strlst, string)))
         return SW_E_UNKNOWN;
 
@@ -112,7 +110,7 @@ sw_result sw_text_record_add_key_and_string_value(
 
     assert(self);
     assert(key);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!(n = avahi_string_list_add_pair(self->strlst, key, val)))
@@ -134,7 +132,7 @@ sw_result sw_text_record_add_key_and_binary_value(
     assert(self);
     assert(key);
     assert(len || !val);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!(n = avahi_string_list_add_pair_arbitrary(self->strlst, key, val, len)))
@@ -152,10 +150,10 @@ static int rebuild(sw_text_record self) {
         return 0;
 
     self->buffer_size = avahi_string_list_serialize(self->strlst, NULL, 0);
-    
+
     if (!(self->buffer = avahi_realloc(self->buffer, self->buffer_size + 1)))
         return -1;
-        
+
     avahi_string_list_serialize(self->strlst, self->buffer, self->buffer_size);
     self->buffer_valid = 1;
 
@@ -177,7 +175,7 @@ sw_uint32 sw_text_record_len(sw_text_record self) {
     assert(self);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (rebuild(self) < 0)
         return (uint32_t) -1;
 
@@ -186,7 +184,7 @@ sw_uint32 sw_text_record_len(sw_text_record self) {
 
 struct _sw_text_record_iterator {
     AvahiStringList *strlst, *index;
-    
+
 };
 
 sw_result sw_text_record_iterator_init(
@@ -198,7 +196,7 @@ sw_result sw_text_record_iterator_init(
     assert(self);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!(*self = avahi_new(struct _sw_text_record_iterator, 1))) {
         *self = NULL;
         return SW_E_UNKNOWN;
@@ -211,7 +209,7 @@ sw_result sw_text_record_iterator_init(
     }
 
     (*self)->index = (*self)->strlst = avahi_string_list_reverse(txt);
-    
+
     return SW_OKAY;
 }
 
@@ -222,7 +220,7 @@ sw_result sw_text_record_iterator_fina(sw_text_record_iterator self) {
 
     avahi_string_list_free(self->strlst);
     avahi_free(self);
-    
+
     return SW_OKAY;
 }
 
@@ -234,10 +232,10 @@ sw_result sw_text_record_iterator_next(
 
     char *mkey = NULL, *mvalue = NULL;
     size_t msize = 0;
-    
+
     assert(self);
     assert(key);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!self->index)
@@ -250,7 +248,7 @@ sw_result sw_text_record_iterator_next(
     memset(val, 0, SW_TEXT_RECORD_MAX_LEN);
     memcpy(val, mvalue, msize);
     *val_len = msize;
-    
+
     avahi_free(mkey);
     avahi_free(mvalue);
 
index 800b3c3af192eb347f424bb76728e838e1c02658..ff440af9c61ee9929c9aca028d1786ea0ee6dcba 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -97,14 +95,14 @@ sw_time sw_time_add(
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_time sw_time_sub(
     AVAHI_GCC_UNUSED sw_time self,
     AVAHI_GCC_UNUSED sw_time y) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_int32 sw_time_cmp(
     AVAHI_GCC_UNUSED sw_time self,
     AVAHI_GCC_UNUSED sw_time y) {
@@ -338,17 +336,17 @@ sw_result sw_socket_set_options(
     return SW_E_NO_IMPL;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_ipv4_address sw_socket_ipv4_address(AVAHI_GCC_UNUSED sw_socket self) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_port sw_socket_port(AVAHI_GCC_UNUSED sw_socket self) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_sockdesc_t sw_socket_desc(AVAHI_GCC_UNUSED sw_socket self) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
@@ -425,7 +423,7 @@ sw_result sw_socket_options_set_sndbuf(
     return SW_E_NO_IMPL;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 int sw_socket_error_code(void) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
@@ -478,7 +476,7 @@ sw_result sw_corby_orb_register_channel(
     return SW_E_NO_IMPL;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_corby_orb_delegate sw_corby_orb_get_delegate(AVAHI_GCC_UNUSED sw_corby_orb self) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
@@ -581,7 +579,7 @@ sw_result sw_corby_buffer_init_with_size_and_delegate(
 sw_result sw_corby_buffer_fina(AVAHI_GCC_UNUSED sw_corby_buffer self) {
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
-}    
+}
 
 void sw_corby_buffer_reset(AVAHI_GCC_UNUSED sw_corby_buffer self) {
     AVAHI_WARN_UNSUPPORTED;
@@ -667,7 +665,7 @@ sw_result sw_corby_buffer_put_sized_octets(
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
 }
-    
+
 sw_result sw_corby_buffer_put_cstring(
     AVAHI_GCC_UNUSED sw_corby_buffer self,
     AVAHI_GCC_UNUSED sw_const_string val) {
@@ -710,7 +708,7 @@ sw_result sw_corby_buffer_get_int16(
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
 }
-    
+
 sw_result sw_corby_buffer_get_uint16(
     AVAHI_GCC_UNUSED sw_corby_buffer self,
     AVAHI_GCC_UNUSED sw_uint16 * val,
@@ -718,7 +716,7 @@ sw_result sw_corby_buffer_get_uint16(
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
 }
-    
+
 sw_result sw_corby_buffer_get_int32(
     AVAHI_GCC_UNUSED sw_corby_buffer self,
     AVAHI_GCC_UNUSED sw_int32 * val,
@@ -815,7 +813,7 @@ sw_result sw_corby_channel_start_request(
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
 }
-    
+
 sw_result sw_corby_channel_start_reply(
     AVAHI_GCC_UNUSED sw_corby_channel self,
     AVAHI_GCC_UNUSED struct _sw_corby_buffer ** buffer,
@@ -879,9 +877,9 @@ sw_result sw_corby_channel_set_delegate(
     AVAHI_GCC_UNUSED sw_corby_channel_delegate delegate) {
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
-}    
+}
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_corby_channel_delegate sw_corby_channel_get_delegate(
     AVAHI_GCC_UNUSED sw_corby_channel self) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
@@ -893,7 +891,7 @@ void sw_corby_channel_set_app_data(
     AVAHI_WARN_UNSUPPORTED;
 }
 
-AVAHI_GCC_NORETURN 
+AVAHI_GCC_NORETURN
 sw_opaque sw_corby_channel_get_app_data(AVAHI_GCC_UNUSED sw_corby_channel self) {
     AVAHI_WARN_UNSUPPORTED_ABORT;
 }
@@ -938,7 +936,7 @@ sw_result sw_corby_object_send(
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
 }
-    
+
 sw_result sw_corby_object_recv(
     AVAHI_GCC_UNUSED sw_corby_object self,
     AVAHI_GCC_UNUSED sw_corby_message * message,
@@ -1010,7 +1008,7 @@ sw_result sw_text_record_string_iterator_fina(
     AVAHI_GCC_UNUSED sw_text_record_string_iterator self) {
     AVAHI_WARN_UNSUPPORTED;
     return SW_E_NO_IMPL;
-}    
+}
 
 sw_result sw_text_record_string_iterator_next(
     AVAHI_GCC_UNUSED sw_text_record_string_iterator self,
index 4bff7eece7eb5facdeaf7b318cf8f36d5ae60c0c..235bb59c295514f6b3263cda97d57a9e1837fb9f 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 785dba481f588e051333c8d70fb00c72813ae41d..04bd0ed87e9f7157bb7072d03bc8cb37243291da 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foowarnhhowlfoo
 #define foowarnhhowlfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 19381716dbc9e63ac6d017a0cf4f68ad67dadbe3..9a66bc0d12d9047c246f4ee6d8ea3eeb1e6a99b1 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -66,8 +64,8 @@ null_test_LDADD = $(AM_LDADD) $(PTHREAD_LIBS) $(PTHREAD_CFLAGS) ../avahi-common/
 # licensing restrictions.
 
 libdns_sd-test: libdns_sd-test.c libdns_sd.la
-       $(LIBTOOL) --mode=compile $(CC) $(AM_CFLAGS) $(PTHREAD_CFLAGS) -o libdns_sd-test.o -c libdns_sd-test.c 
-       $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(PTHREAD_CFLAGS) -o libdns_sd-test libdns_sd-test.o $(PTHREAD_LIBS) ../avahi-common/libavahi-common.la libdns_sd.la 
+       $(LIBTOOL) --mode=compile $(CC) $(AM_CFLAGS) $(PTHREAD_CFLAGS) -o libdns_sd-test.o -c libdns_sd-test.c
+       $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(PTHREAD_CFLAGS) -o libdns_sd-test libdns_sd-test.o $(PTHREAD_LIBS) ../avahi-common/libavahi-common.la libdns_sd.la
 
 CLEANFILES = libdns_sd-test.o libdns_sd-test
 
index 7c2686a72c9a682727b6da5bc63a9b0c72ae5b87..360abd705e421dd7baca34cd06d8af6884e6115a 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -64,7 +62,7 @@ struct type_info {
 
 struct _DNSServiceRef_t {
     int n_ref;
-    
+
     AvahiSimplePoll *simple_poll;
 
     int thread_fd, main_fd;
@@ -73,7 +71,7 @@ struct _DNSServiceRef_t {
     int thread_running;
 
     pthread_mutex_t mutex;
-    
+
     void *context;
     DNSServiceBrowseReply service_browser_callback;
     DNSServiceResolveReply service_resolver_callback;
@@ -100,10 +98,10 @@ static DNSServiceErrorType map_error(int error) {
     switch (error) {
         case AVAHI_OK :
             return kDNSServiceErr_NoError;
-            
+
         case AVAHI_ERR_BAD_STATE :
             return kDNSServiceErr_BadState;
-            
+
         case AVAHI_ERR_INVALID_HOST_NAME:
         case AVAHI_ERR_INVALID_DOMAIN_NAME:
         case AVAHI_ERR_INVALID_TTL:
@@ -137,13 +135,13 @@ static DNSServiceErrorType map_error(int error) {
         case AVAHI_ERR_INVALID_INTERFACE:
         case AVAHI_ERR_INVALID_PROTOCOL:
             return kDNSServiceErr_BadInterfaceIndex;
-        
+
         case AVAHI_ERR_INVALID_FLAGS:
             return kDNSServiceErr_BadFlags;
-            
+
         case AVAHI_ERR_NOT_FOUND:
             return kDNSServiceErr_NoSuchName;
-            
+
         case AVAHI_ERR_VERSION_MISMATCH:
             return kDNSServiceErr_Incompatible;
 
@@ -179,7 +177,7 @@ static void type_info_free(struct type_info *i) {
 
 static int type_info_parse(struct type_info *i, const char *t) {
     char *token = NULL;
-    
+
     assert(i);
     assert(t);
 
@@ -190,12 +188,12 @@ static int type_info_parse(struct type_info *i, const char *t) {
 
         if (*t == 0)
             break;
-        
+
         l = strcspn(t, ",");
 
         if (l <= 0)
             goto fail;
-        
+
         token = avahi_strndup(t, l);
 
         if (!token)
@@ -211,7 +209,7 @@ static int type_info_parse(struct type_info *i, const char *t) {
             token = NULL;
         } else {
             char *fst;
-            
+
             /* This is not the first token, hence a subtype */
 
             if (!(fst = avahi_strdup_printf("%s._sub.%s", token, i->type)))
@@ -239,7 +237,7 @@ static int type_info_parse(struct type_info *i, const char *t) {
 
     if (i->type)
         return 0;
-    
+
 fail:
     type_info_free(i);
     avahi_free(token);
@@ -265,7 +263,7 @@ static int read_command(int fd) {
     char command;
 
     assert(fd >= 0);
-    
+
     if ((r = read(fd, &command, 1)) != 1) {
         fprintf(stderr, __FILE__": read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
         return -1;
@@ -288,15 +286,15 @@ static int write_command(int fd, char reply) {
 static int poll_func(struct pollfd *ufds, unsigned int nfds, int timeout, void *userdata) {
     DNSServiceRef sdref = userdata;
     int ret;
-    
+
     assert(sdref);
-    
+
     ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
 
 /*     fprintf(stderr, "pre-syscall\n"); */
     ret = poll(ufds, nfds, timeout);
 /*     fprintf(stderr, "post-syscall\n"); */
-    
+
     ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
 
     return ret;
@@ -308,7 +306,7 @@ static void * thread_func(void *data) {
 
     sigfillset(&mask);
     pthread_sigmask(SIG_BLOCK, &mask, NULL);
-    
+
     sdref->thread = pthread_self();
     sdref->thread_running = 1;
 
@@ -319,7 +317,7 @@ static void * thread_func(void *data) {
             break;
 
 /*         fprintf(stderr, "Command: %c\n", command); */
-        
+
         switch (command) {
 
             case COMMAND_POLL: {
@@ -329,12 +327,12 @@ static void * thread_func(void *data) {
 
                 for (;;) {
                     errno = 0;
-                    
+
                     if ((ret = avahi_simple_poll_run(sdref->simple_poll)) < 0) {
 
                         if (errno == EINTR)
                             continue;
-                        
+
                         fprintf(stderr, __FILE__": avahi_simple_poll_run() failed: %s\n", strerror(errno));
                     }
 
@@ -345,14 +343,14 @@ static void * thread_func(void *data) {
 
                 if (write_command(sdref->thread_fd, ret < 0 ? COMMAND_POLL_FAILED : COMMAND_POLL_DONE) < 0)
                     break;
-                
+
                 break;
             }
 
             case COMMAND_QUIT:
                 return NULL;
         }
-        
+
     }
 
     return NULL;
@@ -402,12 +400,12 @@ static DNSServiceRef sdref_new(void) {
     /* Queue an initial POLL command for the thread */
     if (write_command(sdref->main_fd, COMMAND_POLL) < 0)
         goto fail;
-    
+
     if (pthread_create(&sdref->thread, NULL, thread_func, sdref) != 0)
         goto fail;
 
     sdref->thread_running = 1;
-    
+
     return sdref;
 
 fail:
@@ -420,7 +418,7 @@ fail:
 
 static void sdref_free(DNSServiceRef sdref) {
     assert(sdref);
-    
+
     if (sdref->thread_running) {
         ASSERT_SUCCESS(write_command(sdref->main_fd, COMMAND_QUIT));
         avahi_simple_poll_wakeup(sdref->simple_poll);
@@ -447,9 +445,9 @@ static void sdref_free(DNSServiceRef sdref) {
     avahi_free(sdref->service_host);
 
     type_info_free(&sdref->type_info);
-    
+
     avahi_string_list_free(sdref->service_txt);
-    
+
     avahi_free(sdref);
 }
 
@@ -471,7 +469,7 @@ static void sdref_unref(DNSServiceRef sdref) {
 int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdref) {
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!sdref || sdref->n_ref <= 0)
         return -1;
 
@@ -485,15 +483,15 @@ DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdref) {
 
     if (!sdref || sdref->n_ref <= 0)
         return kDNSServiceErr_BadParam;
-    
+
     sdref_ref(sdref);
 
     ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
-    
+
     /* Cleanup notification socket */
     if (read_command(sdref->main_fd) != COMMAND_POLL_DONE)
         goto finish;
-    
+
     if (avahi_simple_poll_dispatch(sdref->simple_poll) < 0)
         goto finish;
 
@@ -508,13 +506,13 @@ DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdref) {
         /* Request the poll */
         if (write_command(sdref->main_fd, COMMAND_POLL) < 0)
             goto finish;
-    
+
     ret = kDNSServiceErr_NoError;
-    
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
-    
+
     sdref_unref(sdref);
 
     return ret;
@@ -546,7 +544,7 @@ static void service_browser_callback(
 
     type = add_trailing_dot(type, type_fixed, sizeof(type_fixed));
     domain  = add_trailing_dot(domain, domain_fixed, sizeof(domain_fixed));
-    
+
     switch (event) {
         case AVAHI_BROWSER_NEW:
             sdref->service_browser_callback(sdref, kDNSServiceFlagsAdd, interface, kDNSServiceErr_NoError, name, type, domain, sdref->context);
@@ -559,7 +557,7 @@ static void service_browser_callback(
         case AVAHI_BROWSER_FAILURE:
             sdref->service_browser_callback(sdref, 0, interface, map_error(avahi_client_errno(sdref->client)), NULL, NULL, NULL, sdref->context);
             break;
-            
+
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
         case AVAHI_BROWSER_ALL_FOR_NOW:
             break;
@@ -569,7 +567,7 @@ static void service_browser_callback(
 static void generic_client_callback(AvahiClient *s, AvahiClientState state, void* userdata) {
     DNSServiceRef sdref = userdata;
     int error = kDNSServiceErr_Unknown;
-        
+
     assert(s);
     assert(sdref);
     assert(sdref->n_ref >= 1);
@@ -609,7 +607,7 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse(
     DNSServiceRef sdref = NULL;
     AvahiIfIndex ifindex;
     struct type_info type_info;
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!ret_sdref || !regtype)
@@ -622,7 +620,7 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse(
     }
 
     type_info_init(&type_info);
-    
+
     if (type_info_parse(&type_info, regtype) < 0 || type_info.n_subtypes > 1) {
         type_info_free(&type_info);
 
@@ -630,7 +628,7 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse(
             return kDNSServiceErr_Unsupported;
     } else
         regtype = type_info.subtypes ? (char*) type_info.subtypes->text : type_info.type;
-    
+
     if (!(sdref = sdref_new())) {
         type_info_free(&type_info);
         return kDNSServiceErr_Unknown;
@@ -640,26 +638,26 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse(
     sdref->service_browser_callback = callback;
 
     ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
-    
+
     if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, generic_client_callback, sdref, &error))) {
         ret =  map_error(error);
         goto finish;
     }
 
     ifindex = interface == kDNSServiceInterfaceIndexAny ? AVAHI_IF_UNSPEC : (AvahiIfIndex) interface;
-    
+
     if (!(sdref->service_browser = avahi_service_browser_new(sdref->client, ifindex, AVAHI_PROTO_UNSPEC, regtype, domain, 0, service_browser_callback, sdref))) {
         ret = map_error(avahi_client_errno(sdref->client));
         goto finish;
     }
-    
+
     ret = kDNSServiceErr_NoError;
     *ret_sdref = sdref;
-                                                              
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
-    
+
     if (ret != kDNSServiceErr_NoError)
         DNSServiceRefDeallocate(sdref);
 
@@ -707,7 +705,7 @@ static void service_resolver_callback(
             assert(ret == AVAHI_OK);
 
             strcat(full_name, ".");
-            
+
             sdref->service_resolver_callback(sdref, 0, interface, kDNSServiceErr_NoError, full_name, host_name, htons(port), l, (unsigned char*) p, sdref->context);
 
             avahi_free(p);
@@ -753,27 +751,27 @@ DNSServiceErrorType DNSSD_API DNSServiceResolve(
     sdref->service_resolver_callback = callback;
 
     ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
-    
+
     if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, generic_client_callback, sdref, &error))) {
         ret =  map_error(error);
         goto finish;
     }
 
     ifindex = interface == kDNSServiceInterfaceIndexAny ? AVAHI_IF_UNSPEC : (AvahiIfIndex) interface;
-    
+
     if (!(sdref->service_resolver = avahi_service_resolver_new(sdref->client, ifindex, AVAHI_PROTO_UNSPEC, name, regtype, domain, AVAHI_PROTO_UNSPEC, 0, service_resolver_callback, sdref))) {
         ret = map_error(avahi_client_errno(sdref->client));
         goto finish;
     }
-    
+
 
     ret = kDNSServiceErr_NoError;
     *ret_sdref = sdref;
-                                                              
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
-    
+
     if (ret != kDNSServiceErr_NoError)
         DNSServiceRefDeallocate(sdref);
 
@@ -782,7 +780,7 @@ finish:
 
 int DNSSD_API DNSServiceConstructFullName (
     char *fullName,
-    const char *service,   
+    const char *service,
     const char *regtype,
     const char *domain) {
 
@@ -793,7 +791,7 @@ int DNSSD_API DNSServiceConstructFullName (
 
     if (avahi_service_name_join(fullName, kDNSServiceMaxDomainName, service, regtype, domain) < 0)
         return -1;
-    
+
     return 0;
 }
 
@@ -827,7 +825,7 @@ static void domain_browser_callback(
         case AVAHI_BROWSER_FAILURE:
             sdref->domain_browser_callback(sdref, 0, interface, map_error(avahi_client_errno(sdref->client)), domain, sdref->context);
             break;
-            
+
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
         case AVAHI_BROWSER_ALL_FOR_NOW:
             break;
@@ -865,28 +863,28 @@ DNSServiceErrorType DNSSD_API DNSServiceEnumerateDomains(
     sdref->domain_browser_callback = callback;
 
     ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
-    
+
     if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, generic_client_callback, sdref, &error))) {
         ret =  map_error(error);
         goto finish;
     }
 
     ifindex = interface == kDNSServiceInterfaceIndexAny ? AVAHI_IF_UNSPEC : (AvahiIfIndex) interface;
-    
+
     if (!(sdref->domain_browser = avahi_domain_browser_new(sdref->client, ifindex, AVAHI_PROTO_UNSPEC, "local",
                                                            flags == kDNSServiceFlagsRegistrationDomains ? AVAHI_DOMAIN_BROWSER_REGISTER : AVAHI_DOMAIN_BROWSER_BROWSE,
                                                            0, domain_browser_callback, sdref))) {
         ret = map_error(avahi_client_errno(sdref->client));
         goto finish;
     }
-    
+
     ret = kDNSServiceErr_NoError;
     *ret_sdref = sdref;
-                                                              
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
-    
+
     if (ret != kDNSServiceErr_NoError)
         DNSServiceRefDeallocate(sdref);
 
@@ -904,7 +902,7 @@ static void reg_report_error(DNSServiceRef sdref, DNSServiceErrorType error) {
 
     regtype = add_trailing_dot(sdref->type_info.type, regtype_fixed, sizeof(regtype_fixed));
     domain = add_trailing_dot(sdref->service_domain, domain_fixed, sizeof(domain_fixed));
-    
+
     sdref->service_register_callback(
         sdref, 0, error,
         sdref->service_name_chosen ? sdref->service_name_chosen : sdref->service_name,
@@ -916,7 +914,7 @@ static void reg_report_error(DNSServiceRef sdref, DNSServiceErrorType error) {
 static int reg_create_service(DNSServiceRef sdref) {
     int ret;
     AvahiStringList *l;
-    
+
     assert(sdref);
     assert(sdref->n_ref >= 1);
 
@@ -964,7 +962,7 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us
     /* We've not been setup completely */
     if (!sdref->entry_group)
         return;
-    
+
     switch (state) {
         case AVAHI_CLIENT_FAILURE:
             reg_report_error(sdref, kDNSServiceErr_Unknown);
@@ -994,29 +992,29 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us
             if (!sdref->service_name_chosen) {
 
                 assert(sdref->service_name);
-                
+
                 if (!(sdref->service_name_chosen = avahi_strdup(sdref->service_name))) {
                     reg_report_error(sdref, kDNSServiceErr_NoMemory);
                     return;
                 }
             }
-            
+
             /* Register the service */
 
             if ((ret = reg_create_service(sdref)) < 0) {
                 reg_report_error(sdref, map_error(ret));
                 return;
             }
-            
+
             break;
         }
-            
+
         case AVAHI_CLIENT_S_COLLISION:
         case AVAHI_CLIENT_S_REGISTERING:
 
             /* Remove our entry */
             avahi_entry_group_reset(sdref->entry_group);
-            
+
             break;
 
         case AVAHI_CLIENT_CONNECTING:
@@ -1042,7 +1040,7 @@ static void reg_entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState st
         case AVAHI_ENTRY_GROUP_COLLISION: {
             char *n;
             int ret;
-            
+
             /* Remove our entry */
             avahi_entry_group_reset(sdref->entry_group);
 
@@ -1061,7 +1059,7 @@ static void reg_entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState st
                 reg_report_error(sdref, map_error(ret));
                 return;
             }
-            
+
             break;
         }
 
@@ -1074,7 +1072,7 @@ static void reg_entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState st
             /* Inform the user */
             reg_report_error(sdref, map_error(avahi_client_errno(sdref->client)));
             break;
-            
+
     }
 }
 
@@ -1082,14 +1080,14 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
         DNSServiceRef *ret_sdref,
         DNSServiceFlags flags,
         uint32_t interface,
-        const char *name,        
+        const char *name,
         const char *regtype,
-        const char *domain,      
-        const char *host,        
+        const char *domain,
+        const char *host,
         uint16_t port,
         uint16_t txtLen,
-        const void *txtRecord,   
-        DNSServiceRegisterReply callback,    
+        const void *txtRecord,
+        DNSServiceRegisterReply callback,
         void *context) {
 
     DNSServiceErrorType ret = kDNSServiceErr_Unknown;
@@ -1103,7 +1101,7 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
     if (!ret_sdref || !regtype)
         return kDNSServiceErr_BadParam;
     *ret_sdref = NULL;
-    
+
     if (!txtRecord) {
         txtLen = 1;
         txtRecord = "";
@@ -1114,7 +1112,7 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
         return kDNSServiceErr_Unsupported;
     }
 
-    if (txtLen > 0) 
+    if (txtLen > 0)
         if (avahi_string_list_parse(txtRecord, txtLen, &txt) < 0)
             return kDNSServiceErr_Invalid;
 
@@ -1122,7 +1120,7 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
         avahi_string_list_free(txt);
         return kDNSServiceErr_Invalid;
     }
-    
+
     if (!(sdref = sdref_new())) {
         avahi_string_list_free(txt);
         type_info_free(&type_info);
@@ -1141,9 +1139,9 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
     sdref->service_txt = txt;
 
     /* Some OOM checking would be cool here */
-    
+
     ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
-    
+
     if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, reg_client_callback, sdref, &error))) {
         ret =  map_error(error);
         goto finish;
@@ -1185,20 +1183,20 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister (
             goto finish;
         }
 
-            
+
         if ((error = reg_create_service(sdref)) < 0) {
             ret = map_error(error);
             goto finish;
         }
     }
-    
+
     ret = kDNSServiceErr_NoError;
     *ret_sdref = sdref;
-                                                              
+
 finish:
 
     ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
-    
+
     if (ret != kDNSServiceErr_NoError)
         DNSServiceRefDeallocate(sdref);
 
@@ -1207,7 +1205,7 @@ finish:
 
 DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord(
          DNSServiceRef sdref,
-         DNSRecordRef rref,     
+         DNSRecordRef rref,
          DNSServiceFlags flags,
          uint16_t rdlen,
          const void *rdata,
@@ -1226,7 +1224,7 @@ DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord(
         return kDNSServiceErr_Unsupported;
     }
 
-    if (rdlen > 0) 
+    if (rdlen > 0)
         if (avahi_string_list_parse(rdata, rdlen, &txt) < 0)
             return kDNSServiceErr_Invalid;
 
@@ -1251,7 +1249,7 @@ DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord(
                         sdref->type_info.type,
                         sdref->service_domain,
                         sdref->service_txt) < 0) {
-                
+
                 ret = map_error(avahi_client_errno(sdref->client));
                 goto finish;
             }
@@ -1260,10 +1258,10 @@ DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord(
         avahi_string_list_free(txt);
 
     ret = kDNSServiceErr_NoError;
-    
+
 finish:
     ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
-    
+
     return ret;
 }
 
index b7eb8a229a41ae3dc69691dbf2be2bc8cc3d5811..66e494e40210666ab4076ac25bb81e200a208bc4 100644 (file)
@@ -2,27 +2,27 @@
  *
  * Copyright (c) 2003-2004, Apple Computer, Inc. All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or without 
+ * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
- * 1.  Redistributions of source code must retain the above copyright notice, 
- *     this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright notice, 
- *     this list of conditions and the following disclaimer in the documentation 
- *     and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of its 
- *     contributors may be used to endorse or promote products derived from this 
- *     software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
+ * 1.  Redistributions of source code must retain the above copyright notice,
+ *     this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
+ *     contributors may be used to endorse or promote products derived from this
+ *     software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
@@ -150,7 +150,7 @@ enum
     /* Flag for signifying that a query or registration should be performed exclusively via multicast DNS,
      * even for a name in a domain (e.g. foo.apple.com.) that would normally imply unicast DNS.
      */
-     
+
     kDNSServiceFlagsReturnCNAME         = 0x800
     /* Flag for returning CNAME records in the DNSServiceQueryRecord call. CNAME records are
      * normally followed without indicating to the client that there was a CNAME record.
@@ -316,23 +316,23 @@ enum
  */
 
 
-/* 
+/*
  * Constants for specifying an interface index
  *
  * Specific interface indexes are identified via a 32-bit unsigned integer returned
  * by the if_nametoindex() family of calls.
- * 
+ *
  * If the client passes 0 for interface index, that means "do the right thing",
  * which (at present) means, "if the name is in an mDNS local multicast domain
  * (e.g. 'local.', '254.169.in-addr.arpa.', '{8,9,A,B}.E.F.ip6.arpa.') then multicast
  * on all applicable interfaces, otherwise send via unicast to the appropriate
  * DNS server." Normally, most clients will use 0 for interface index to
  * automatically get the default sensible behaviour.
- * 
+ *
  * If the client passes a positive interface index, then for multicast names that
  * indicates to do the operation only on that one interface. For unicast names the
  * interface index is ignored unless kDNSServiceFlagsForceMulticast is also set.
- * 
+ *
  * If the client passes kDNSServiceInterfaceIndexLocalOnly when registering
  * a service, then that service will be found *only* by other local clients
  * on the same machine that are browsing using kDNSServiceInterfaceIndexLocalOnly
@@ -341,7 +341,7 @@ enum
  * running on the same machine, this allows the client to advertise that service
  * in a way such that it does not inadvertently appear in service lists on
  * all the other machines on the network.
- * 
+ *
  * If the client passes kDNSServiceInterfaceIndexLocalOnly when browsing
  * then it will find *all* records registered on that same local machine.
  * Clients explicitly wishing to discover *only* LocalOnly services can
@@ -494,7 +494,7 @@ typedef void (DNSSD_API *DNSServiceDomainEnumReply)
 /* DNSServiceEnumerateDomains() Parameters:
  *
  *
- * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds 
+ * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds
  *                  then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError,
  *                  and the enumeration operation will run indefinitely until the client
  *                  terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate().
@@ -578,7 +578,7 @@ typedef void (DNSSD_API *DNSServiceRegisterReply)
 
 /* DNSServiceRegister()  Parameters:
  *
- * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds 
+ * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds
  *                  then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError,
  *                  and the registration will remain active indefinitely until the client
  *                  terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate().
@@ -843,7 +843,7 @@ typedef void (DNSSD_API *DNSServiceBrowseReply)
 
 /* DNSServiceBrowse() Parameters:
  *
- * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds 
+ * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds
  *                  then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError,
  *                  and the browse operation will run indefinitely until the client
  *                  terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate().
@@ -964,7 +964,7 @@ typedef void (DNSSD_API *DNSServiceResolveReply)
 
 /* DNSServiceResolve() Parameters
  *
- * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds 
+ * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds
  *                  then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError,
  *                  and the resolve operation will run indefinitely until the client
  *                  terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate().
@@ -1190,7 +1190,7 @@ typedef void (DNSSD_API *DNSServiceQueryRecordReply)
 
 /* DNSServiceQueryRecord() Parameters:
  *
- * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds 
+ * sdRef:           A pointer to an uninitialized DNSServiceRef. If the call succeeds
  *                  then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError,
  *                  and the query operation will run indefinitely until the client
  *                  terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate().
@@ -1683,7 +1683,7 @@ DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex
  * calls by this user that do not specify an explicit domain will browse and
  * register in this wide-area domain in addition to .local.  In addition, this
  * domain will be returned as a Browse domain via domain enumeration calls.
- * 
+ *
  *
  * Parameters:
  *
@@ -1700,8 +1700,8 @@ DNSServiceErrorType DNSSD_API DNSServiceSetDefaultDomainForUser
     (
     DNSServiceFlags                    flags,
     const char                         *domain
-    ); 
-       
+    );
+
 #endif //__APPLE_API_PRIVATE
 
 // Some C compiler cleverness. We can make the compiler check certain things for us,
index a584b4e72b39f3ab0e29893d5b10baae72a4fe0d..bf96aa5df172e0dec84b45866acf3e27c28849dd 100644 (file)
@@ -33,5 +33,3 @@ DNSServiceRemoveRecord
 -- Unsupported and Irrelevant --
 
 DNSServiceSetDefaultDomainForUser
-
-$Id$
index a6c03df1a1c2290e35be23d27c5fecb637a9d4c9..8cfb98fc4fdc295236459676878f8936b46d2a29 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 149a38c3e4f6d205630ac24088164d7c446f79a1..9bf29b487a39130f0b1fddd9ecd558134c5dd29d 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -34,7 +32,7 @@ static void hexdump(const void* p, size_t size) {
     const uint8_t *c = p;
     assert(p);
 
-    printf("Dumping %u bytes from %p:\n", size, p);
+    printf("Dumping %zu bytes from %p:\n", size, p);
 
     while (size > 0) {
         unsigned i;
@@ -87,10 +85,10 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     TXTRecordSetValue(&ref, "yeah", 0, NULL);
     hexdump(TXTRecordGetBytesPtr(&ref), TXTRecordGetLength(&ref));
-    
+
     TXTRecordSetValue(&ref, "waldo", 6, "rocked");
     hexdump(TXTRecordGetBytesPtr(&ref), TXTRecordGetLength(&ref));
-    
+
     TXTRecordRemoveValue(&ref, "foo");
     hexdump(TXTRecordGetBytesPtr(&ref), TXTRecordGetLength(&ref));
 
@@ -99,7 +97,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     TXTRecordSetValue(&ref, "kawumm", 6, "bloerb");
     hexdump(TXTRecordGetBytesPtr(&ref), TXTRecordGetLength(&ref));
-    
+
     TXTRecordSetValue(&ref, "one", 1, "1");
     hexdump(TXTRecordGetBytesPtr(&ref), TXTRecordGetLength(&ref));
 
@@ -108,7 +106,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     TXTRecordSetValue(&ref, "three", 1, "3");
     hexdump(TXTRecordGetBytesPtr(&ref), TXTRecordGetLength(&ref));
-    
+
     assert(TXTRecordContainsKey(TXTRecordGetLength(&ref), TXTRecordGetBytesPtr(&ref), "two"));
     assert(!TXTRecordContainsKey(TXTRecordGetLength(&ref), TXTRecordGetBytesPtr(&ref), "four"));
 
@@ -125,6 +123,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     hexdump(p, l);
 
     assert(TXTRecordGetItemAtIndex(TXTRecordGetLength(&ref), TXTRecordGetBytesPtr(&ref), 20, sizeof(k), k, &l, &p) == kDNSServiceErr_Invalid);
-    
+
     TXTRecordDeallocate(&ref);
 }
index 2b539e68c99ba242a21b117d0ca40a11bdd70019..9d6c11635ac26860120298e29ba6538fe416d3c2 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -51,7 +49,7 @@ void DNSSD_API TXTRecordCreate(
     AVAHI_WARN_LINKAGE;
 
     assert(txtref);
-    
+
     /* Apple's API design is flawed in so many ways, including the
      * fact that it isn't compatible with 64 bit processors. To work
      * around this we need some magic here which involves allocating
@@ -75,7 +73,7 @@ void DNSSD_API TXTRecordDeallocate(TXTRecordRef *txtref) {
     TXTRecordInternal *t;
 
     AVAHI_WARN_LINKAGE;
-    
+
     assert(txtref);
     t = INTERNAL_PTR(txtref);
     if (!t)
@@ -91,7 +89,7 @@ void DNSSD_API TXTRecordDeallocate(TXTRecordRef *txtref) {
 static int make_sure_fits_in(TXTRecordInternal *t, size_t size) {
     uint8_t *n;
     size_t nsize;
-    
+
     assert(t);
 
     if (t->size + size <= t->max_size)
@@ -101,13 +99,13 @@ static int make_sure_fits_in(TXTRecordInternal *t, size_t size) {
 
     if (nsize > 0xFFFF)
         return -1;
-    
+
     if (!(n = avahi_realloc(t->malloc_buffer, nsize)))
         return -1;
 
     if (!t->malloc_buffer && t->size)
         memcpy(n, t->buffer, t->size);
-    
+
     t->buffer = t->malloc_buffer = n;
     t->max_size = nsize;
 
@@ -134,7 +132,7 @@ static int remove_key(TXTRecordInternal *t, const char *key) {
         /* Key longer than buffer */
         if (key_len > t->size - i - 1)
             break;
-        
+
         if (key_len <= *p &&
             strncmp(key, (char*) p+1, key_len) == 0 &&
             (key_len == *p || p[1+key_len] == '=')) {
@@ -150,7 +148,7 @@ static int remove_key(TXTRecordInternal *t, const char *key) {
             found = 1;
         } else {
             /* Skip to next */
-        
+
             i += *p +1;
             p += *p +1;
         }
@@ -162,7 +160,7 @@ static int remove_key(TXTRecordInternal *t, const char *key) {
 DNSServiceErrorType DNSSD_API TXTRecordSetValue(
     TXTRecordRef *txtref,
     const char *key,
-    uint8_t length,     
+    uint8_t length,
     const void *value) {
 
     TXTRecordInternal *t;
@@ -186,7 +184,7 @@ DNSServiceErrorType DNSSD_API TXTRecordSetValue(
 
     if (n > 0xFF)
         return kDNSServiceErr_Invalid;
-    
+
     if (make_sure_fits_in(t, 1 + n) < 0)
         return kDNSServiceErr_NoMemory;
 
@@ -196,7 +194,7 @@ DNSServiceErrorType DNSSD_API TXTRecordSetValue(
 
     *(p++) = (uint8_t) n;
     t->size ++;
-    
+
     memcpy(p, key, l);
     p += l;
     t->size += l;
@@ -267,7 +265,7 @@ static const uint8_t *find_key(const uint8_t *buffer, size_t size, const char *k
     key_len = strlen(key);
 
     assert(key_len <= 0xFF);
-    
+
     p = buffer;
     i = 0;
 
@@ -280,7 +278,7 @@ static const uint8_t *find_key(const uint8_t *buffer, size_t size, const char *k
         /* Key longer than buffer */
         if (key_len > size - i - 1)
             return NULL;
-        
+
         if (key_len <= *p &&
             strncmp(key, (const char*) p+1, key_len) == 0 &&
             (key_len == *p || p[1+key_len] == '=')) {
@@ -288,7 +286,7 @@ static const uint8_t *find_key(const uint8_t *buffer, size_t size, const char *k
             /* Key matches, so let's return it */
 
             return p;
-        } 
+        }
 
         /* Skip to next */
         i += *p +1;
@@ -326,7 +324,7 @@ const void * DNSSD_API TXTRecordGetValuePtr(
 
     const uint8_t *p;
     size_t n, l;
-    
+
     AVAHI_WARN_LINKAGE;
 
     assert(key);
@@ -336,7 +334,7 @@ const void * DNSSD_API TXTRecordGetValuePtr(
 
     if (*key == 0 || strchr(key, '=') || strlen(key) > 0xFF) /* Empty or invalid key */
         return NULL;
-    
+
     assert(buffer);
 
     if (!(p = find_key(buffer, size, key)))
@@ -351,20 +349,20 @@ const void * DNSSD_API TXTRecordGetValuePtr(
 
     if (n <= 0)
         goto fail;
-    
+
     assert(*p == '=');
     p++;
     n--;
 
     if (value_len)
         *value_len = n;
-    
+
     return p;
 
 fail:
     if (value_len)
         *value_len = 0;
-    
+
     return NULL;
 }
 
@@ -381,12 +379,12 @@ uint16_t DNSSD_API TXTRecordGetCount(
 
     if (!size)
         return 0;
-    
+
     assert(buffer);
-    
+
     p = buffer;
     i = 0;
-    
+
     while (i < size) {
 
         /* Does the item fit in? */
@@ -418,7 +416,7 @@ DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex(
     size_t i;
     unsigned n = 0;
     DNSServiceErrorType ret = kDNSServiceErr_Invalid;
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!size)
@@ -428,7 +426,7 @@ DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex(
 
     p = buffer;
     i = 0;
-    
+
     while (i < size) {
 
         /* Does the item fit in? */
@@ -451,7 +449,7 @@ DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex(
 
             strncpy(key, (const char*) p + 1, l);
             key[l] = 0;
-            
+
             if (d) {
                 if (value_len)
                     *value_len = *p - l - 1;
@@ -486,6 +484,6 @@ fail:
     if (value_len)
         *value_len = 0;
 
-    return ret; 
+    return ret;
 
 }
index a460b415cd4f1eee50494da6e61b73763deef645..fe39eb7910ce165dd19c4985ed943ef2c54f7a07 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -43,7 +41,7 @@ DNSServiceErrorType DNSSD_API DNSServiceRegisterRecord (
     AVAHI_GCC_UNUSED void *context) {
 
     AVAHI_WARN_UNSUPPORTED;
-    
+
     return kDNSServiceErr_Unsupported;
 }
 
@@ -58,7 +56,7 @@ DNSServiceErrorType DNSSD_API DNSServiceQueryRecord (
     AVAHI_GCC_UNUSED void *context) {
 
     AVAHI_WARN_UNSUPPORTED;
-    
+
     return kDNSServiceErr_Unsupported;
 }
 
@@ -72,13 +70,13 @@ DNSServiceErrorType DNSSD_API DNSServiceReconfirmRecord (
     AVAHI_GCC_UNUSED const void *rdata) {
 
     AVAHI_WARN_UNSUPPORTED;
-    
+
     return kDNSServiceErr_Unsupported;
 }
 
 DNSServiceErrorType DNSSD_API DNSServiceCreateConnection(AVAHI_GCC_UNUSED DNSServiceRef *sdRef) {
     AVAHI_WARN_UNSUPPORTED;
-    
+
     return kDNSServiceErr_Unsupported;
 }
 
@@ -92,7 +90,7 @@ DNSServiceErrorType DNSSD_API DNSServiceAddRecord(
     AVAHI_GCC_UNUSED uint32_t ttl) {
 
     AVAHI_WARN_UNSUPPORTED;
-    
+
     return kDNSServiceErr_Unsupported;
 }
 
@@ -102,7 +100,7 @@ DNSServiceErrorType DNSSD_API DNSServiceRemoveRecord(
     AVAHI_GCC_UNUSED DNSServiceFlags flags) {
 
     AVAHI_WARN_UNSUPPORTED;
-    
+
     return kDNSServiceErr_Unsupported;
 }
 
index d3389c1b5c35f2695b50c162467becb22612ede4..b311736834db87124ce46a7c422061bd4749d2d5 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -55,25 +53,25 @@ const char *avahi_exe_name(void) {
 
     /* Yes, I know, this is not portable. But who cares? It's for
      * cosmetics only, anyway. */
-    
+
     pthread_mutex_lock(&mutex);
 
     if (exe_name[0] == 0) {
         int k;
-        
+
         if ((k = readlink("/proc/self/exe", exe_name, sizeof(exe_name)-1)) < 0)
             snprintf(exe_name, sizeof(exe_name), "(unknown)");
         else {
             char *slash;
-            
+
             assert((size_t) k <= sizeof(exe_name)-1);
             exe_name[k] = 0;
-            
+
             if ((slash = strrchr(exe_name, '/')))
                 memmove(exe_name, slash+1, strlen(slash)+1);
         }
     }
-    
+
     pthread_mutex_unlock(&mutex);
 
     return exe_name;
@@ -89,14 +87,14 @@ void avahi_warn(const char *fmt, ...) {
     char msg[512]  = "*** WARNING *** ";
     va_list ap;
     size_t n;
-    
+
     assert(fmt);
-                
+
     va_start(ap, fmt);
     n = strlen(msg);
     vsnprintf(msg + n, sizeof(msg) - n, fmt, ap);
     va_end(ap);
-    
+
     fprintf(stderr, "%s\n", msg);
 
     openlog(avahi_exe_name(), LOG_PID, LOG_USER);
@@ -106,7 +104,7 @@ void avahi_warn(const char *fmt, ...) {
 
 void avahi_warn_linkage(void) {
     int w;
-    
+
     pthread_mutex_lock(&linkage_mutex);
     w = linkage_warning;
     linkage_warning = 1;
index da64fab0be1d40d550afcfc7330d5a5b990e8791..0a8c2ba9d4d656cc9ea47c2600a7e2c8880038ba 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foowarnhfoo
 #define foowarnhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index d190c66ee517d21d2c76f1190767cc9397ae4915..2f095967718e8ffa26655157a39b0dec52525ed6 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-#
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -143,7 +141,8 @@ dns_test_SOURCES = \
        util.c util.h \
        rr.c rr.h \
        hashmap.c hashmap.h \
-       domain-util.c domain-util.h
+       domain-util.c domain-util.h \
+       addr-util.c addr-util.h
 dns_test_CFLAGS = $(AM_CFLAGS)
 dns_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la
 
index 9e2d1e940b266359618e52d1a7d35f286573c855..979b1b774d901af22abad6a0fa8b0ae8efc3ab89 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -66,7 +64,7 @@ int avahi_address_is_ipv4_in_ipv6(const AvahiAddress *a) {
         0x00, 0x00, 0x00, 0x00,
         0xFF, 0xFF, 0xFF, 0xFF
     };
-    
+
     assert(a);
 
     if (a->proto != AVAHI_PROTO_INET6)
@@ -75,5 +73,22 @@ int avahi_address_is_ipv4_in_ipv6(const AvahiAddress *a) {
     return memcmp(a->data.ipv6.address, ipv4_in_ipv6, sizeof(ipv4_in_ipv6)) == 0;
 }
 
+#define IPV4LL_NETWORK 0xA9FE0000L
+#define IPV4LL_NETMASK 0xFFFF0000L
+#define IPV6LL_NETWORK 0xFE80
+#define IPV6LL_NETMASK 0xFFC0
+
+int avahi_address_is_link_local(const AvahiAddress *a) {
+    assert(a);
 
+    if (a->proto == AVAHI_PROTO_INET) {
+        uint32_t n = ntohl(a->data.ipv4.address);
+        return (n & IPV4LL_NETMASK) == IPV4LL_NETWORK;
+    }
+    else if (a->proto == AVAHI_PROTO_INET6) {
+        unsigned n = (a->data.ipv6.address[0] << 8) | (a->data.ipv6.address[1] << 0);
+        return (n & IPV6LL_NETMASK) == IPV6LL_NETWORK;
+    }
 
+    return 0;
+}
index 4134de1b862bb9990d287b0c95914898fabd4c03..66a9422acc0fdb1b0c17d4643cf06c8012b66b6e 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooaddrutilhfoo
 #define fooaddrutilhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -40,6 +38,10 @@ uint16_t avahi_port_from_sockaddr(const struct sockaddr* sa);
  * encapsulated IPv4 address, returns 1 if yes, 0 otherwise */
 int avahi_address_is_ipv4_in_ipv6(const AvahiAddress *a);
 
+/** Check whether the specified address is a link-local IPv4 or IPv6 address;
+ * returns 1 if yes, 0 otherwise */
+int avahi_address_is_link_local(const AvahiAddress *a);
+
 AVAHI_C_DECL_END
 
 #endif
index a77fbb698874dedfbdd27f8c5745e4ba20899fb1..ccdbf15adf06f7d4a8450a4432013e12decde002 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -45,7 +43,7 @@ static void remove_announcer(AvahiServer *s, AvahiAnnouncer *a) {
 
     AVAHI_LLIST_REMOVE(AvahiAnnouncer, by_interface, a->interface->announcers, a);
     AVAHI_LLIST_REMOVE(AvahiAnnouncer, by_entry, a->entry->announcers, a);
-    
+
     avahi_free(a);
 }
 
@@ -61,7 +59,7 @@ static void set_timeout(AvahiAnnouncer *a, const struct timeval *tv) {
         }
     } else {
 
-        if (a->time_event) 
+        if (a->time_event)
             avahi_time_event_update(a->time_event, tv);
         else
             a->time_event = avahi_time_event_new(a->server->time_event_queue, tv, elapse_announce, a);
@@ -76,28 +74,28 @@ void avahi_s_entry_group_check_probed(AvahiSEntryGroup *g, int immediately) {
     assert(!g->dead);
 
     /* Check whether all group members have been probed */
-    
-    if (g->state != AVAHI_ENTRY_GROUP_REGISTERING || g->n_probing > 0) 
+
+    if (g->state != AVAHI_ENTRY_GROUP_REGISTERING || g->n_probing > 0)
         return;
 
     avahi_s_entry_group_change_state(g, AVAHI_ENTRY_GROUP_ESTABLISHED);
 
     if (g->dead)
         return;
-    
+
     for (e = g->entries; e; e = e->by_group_next) {
         AvahiAnnouncer *a;
-        
+
         for (a = e->announcers; a; a = a->by_entry_next) {
-            
+
             if (a->state != AVAHI_WAITING)
                 continue;
-            
+
             a->state = AVAHI_ANNOUNCING;
 
             if (immediately) {
                 /* Shortcut */
-                
+
                 a->n_iteration = 1;
                 next_state(a);
             } else {
@@ -118,17 +116,17 @@ static void next_state(AvahiAnnouncer *a) {
         assert(a->entry->group);
 
         avahi_s_entry_group_check_probed(a->entry->group, 1);
-        
+
     } else if (a->state == AVAHI_PROBING) {
 
         if (a->n_iteration >= 4) {
             /* Probing done */
-            
+
             if (a->entry->group) {
                 assert(a->entry->group->n_probing);
                 a->entry->group->n_probing--;
             }
-            
+
             if (a->entry->group && a->entry->group->state == AVAHI_ENTRY_GROUP_REGISTERING)
                 a->state = AVAHI_WAITING;
             else {
@@ -142,10 +140,10 @@ static void next_state(AvahiAnnouncer *a) {
             struct timeval tv;
 
             avahi_interface_post_probe(a->interface, a->entry->record, 0);
-            
+
             avahi_elapse_time(&tv, AVAHI_PROBE_INTERVAL_MSEC, 0);
             set_timeout(a, &tv);
-            
+
             a->n_iteration++;
         }
 
@@ -168,10 +166,10 @@ static void next_state(AvahiAnnouncer *a) {
         } else {
             struct timeval tv;
             avahi_elapse_time(&tv, a->sec_delay*1000, AVAHI_ANNOUNCEMENT_JITTER_MSEC);
-        
+
             if (a->n_iteration < 10)
                 a->sec_delay *= 2;
-            
+
             set_timeout(a, &tv);
         }
     }
@@ -185,7 +183,7 @@ static void elapse_announce(AvahiTimeEvent *e, void *userdata) {
 
 static AvahiAnnouncer *get_announcer(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
     AvahiAnnouncer *a;
-    
+
     assert(s);
     assert(e);
     assert(i);
@@ -200,7 +198,7 @@ static AvahiAnnouncer *get_announcer(AvahiServer *s, AvahiEntry *e, AvahiInterfa
 static void go_to_initial_state(AvahiAnnouncer *a) {
     AvahiEntry *e;
     struct timeval tv;
-        
+
     assert(a);
     e = a->entry;
 
@@ -212,7 +210,7 @@ static void go_to_initial_state(AvahiAnnouncer *a) {
             a->state = AVAHI_ANNOUNCING;
         else
             a->state = AVAHI_WAITING;
-        
+
     } else
         a->state = AVAHI_ESTABLISHED;
 
@@ -222,9 +220,9 @@ static void go_to_initial_state(AvahiAnnouncer *a) {
     if (a->state == AVAHI_PROBING && e->group)
         e->group->n_probing++;
 
-    if (a->state == AVAHI_PROBING) 
+    if (a->state == AVAHI_PROBING)
         set_timeout(a, avahi_elapse_time(&tv, 0, AVAHI_PROBE_JITTER_MSEC));
-    else if (a->state == AVAHI_ANNOUNCING) 
+    else if (a->state == AVAHI_ANNOUNCING)
         set_timeout(a, avahi_elapse_time(&tv, 0, AVAHI_ANNOUNCEMENT_JITTER_MSEC));
     else
         set_timeout(a, NULL);
@@ -243,13 +241,13 @@ static void new_announcer(AvahiServer *s, AvahiInterface *i, AvahiEntry *e) {
 
     /* We don't want duplicate announcers */
     if (get_announcer(s, e, i))
-        return;    
+        return;
 
     if ((!(a = avahi_new(AvahiAnnouncer, 1)))) {
         avahi_log_error(__FILE__": Out of memory.");
         return;
     }
-    
+
     a->server = s;
     a->interface = i;
     a->entry = e;
@@ -263,7 +261,7 @@ static void new_announcer(AvahiServer *s, AvahiInterface *i, AvahiEntry *e) {
 
 void avahi_announce_interface(AvahiServer *s, AvahiInterface *i) {
     AvahiEntry *e;
-    
+
     assert(s);
     assert(i);
 
@@ -277,7 +275,7 @@ void avahi_announce_interface(AvahiServer *s, AvahiInterface *i) {
 
 static void announce_walk_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, void* userdata) {
     AvahiEntry *e = userdata;
-    
+
     assert(m);
     assert(i);
     assert(e);
@@ -296,7 +294,7 @@ void avahi_announce_entry(AvahiServer *s, AvahiEntry *e) {
 
 void avahi_announce_group(AvahiServer *s, AvahiSEntryGroup *g) {
     AvahiEntry *e;
-    
+
     assert(s);
     assert(g);
 
@@ -315,7 +313,7 @@ int avahi_entry_is_registered(AvahiServer *s, AvahiEntry *e, AvahiInterface *i)
 
     if (!(a = get_announcer(s, e, i)))
         return 0;
-    
+
     return
         a->state == AVAHI_ANNOUNCING ||
         a->state == AVAHI_ESTABLISHED ||
@@ -332,7 +330,7 @@ int avahi_entry_is_probing(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
 
     if (!(a = get_announcer(s, e, i)))
         return 0;
-    
+
     return
         a->state == AVAHI_PROBING ||
         (a->state == AVAHI_WAITING && (e->flags & AVAHI_PUBLISH_UNIQUE));
@@ -340,7 +338,7 @@ int avahi_entry_is_probing(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
 
 void avahi_entry_return_to_initial_state(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
     AvahiAnnouncer *a;
-    
+
     assert(s);
     assert(e);
     assert(i);
@@ -356,12 +354,12 @@ void avahi_entry_return_to_initial_state(AvahiServer *s, AvahiEntry *e, AvahiInt
 
 static AvahiRecord *make_goodbye_record(AvahiRecord *r) {
     AvahiRecord *g;
-    
+
     assert(r);
 
     if (!(g = avahi_record_copy(r)))
         return NULL; /* OOM */
-    
+
     assert(g->ref == 1);
     g->ttl = 0;
 
@@ -370,18 +368,18 @@ static AvahiRecord *make_goodbye_record(AvahiRecord *r) {
 
 static int is_duplicate_entry(AvahiServer *s, AvahiEntry *e) {
     AvahiEntry *i;
-    
+
     assert(s);
     assert(e);
 
     for (i = avahi_hashmap_lookup(s->entries_by_key, e->record->key); i; i = i->by_key_next) {
 
-        if (i == e)
+        if ((i == e) || (i->dead))
             continue;
 
         if (!avahi_record_equal_no_ttl(i->record, e->record))
             continue;
-        
+
         return 1;
     }
 
@@ -391,7 +389,7 @@ static int is_duplicate_entry(AvahiServer *s, AvahiEntry *e) {
 static void send_goodbye_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, void* userdata) {
     AvahiEntry *e = userdata;
     AvahiRecord *g;
-    
+
     assert(m);
     assert(i);
     assert(e);
@@ -408,10 +406,10 @@ static void send_goodbye_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, v
 
     if (is_duplicate_entry(m->server, e))
         return;
-    
+
     if (!(g = make_goodbye_record(e->record)))
         return; /* OOM */
-    
+
     avahi_interface_post_response(i, g, e->flags & AVAHI_PUBLISH_UNIQUE, NULL, 1);
     avahi_record_unref(g);
 }
@@ -419,7 +417,7 @@ static void send_goodbye_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, v
 static void reannounce(AvahiAnnouncer *a) {
     AvahiEntry *e;
     struct timeval tv;
-        
+
     assert(a);
     e = a->entry;
 
@@ -430,12 +428,12 @@ static void reannounce(AvahiAnnouncer *a) {
     /* Because we might change state we decrease the probing counter first */
     if (a->state == AVAHI_PROBING && a->entry->group)
         a->entry->group->n_probing--;
-    
+
     if (a->state == AVAHI_PROBING ||
         (a->state == AVAHI_WAITING && (e->flags & AVAHI_PUBLISH_UNIQUE) && !(e->flags & AVAHI_PUBLISH_NO_PROBE)))
 
         /* We were probing or waiting after probe, so we restart probing from the beginning here */
-        
+
         a->state = AVAHI_PROBING;
     else if (a->state == AVAHI_WAITING)
 
@@ -443,26 +441,26 @@ static void reannounce(AvahiAnnouncer *a) {
         a->state = AVAHI_WAITING;
 
     else if (e->flags & AVAHI_PUBLISH_NO_ANNOUNCE)
-        
+
         /* No announcer needed */
         a->state = AVAHI_ESTABLISHED;
 
     else {
-        
+
         /* Ok, let's restart announcing */
         a->state = AVAHI_ANNOUNCING;
-    } 
-        
+    }
+
     /* Now let's increase the probing counter again */
     if (a->state == AVAHI_PROBING && e->group)
         e->group->n_probing++;
-    
+
     a->n_iteration = 1;
     a->sec_delay = 1;
 
     if (a->state == AVAHI_PROBING)
         set_timeout(a, avahi_elapse_time(&tv, 0, AVAHI_PROBE_JITTER_MSEC));
-    else if (a->state == AVAHI_ANNOUNCING) 
+    else if (a->state == AVAHI_ANNOUNCING)
         set_timeout(a, avahi_elapse_time(&tv, 0, AVAHI_ANNOUNCEMENT_JITTER_MSEC));
     else
         set_timeout(a, NULL);
@@ -472,7 +470,7 @@ static void reannounce(AvahiAnnouncer *a) {
 static void reannounce_walk_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, void* userdata) {
     AvahiEntry *e = userdata;
     AvahiAnnouncer *a;
-    
+
     assert(m);
     assert(i);
     assert(e);
@@ -492,7 +490,7 @@ void avahi_reannounce_entry(AvahiServer *s, AvahiEntry *e) {
 
     avahi_interface_monitor_walk(s->monitor, e->interface, e->protocol, reannounce_walk_callback, e);
 }
-    
+
 void avahi_goodbye_interface(AvahiServer *s, AvahiInterface *i, int send_goodbye, int remove) {
     assert(s);
     assert(i);
@@ -500,7 +498,7 @@ void avahi_goodbye_interface(AvahiServer *s, AvahiInterface *i, int send_goodbye
     if (send_goodbye)
         if (i->announcing) {
             AvahiEntry *e;
-            
+
             for (e = s->entries; e; e = e->entries_next)
                 if (!e->dead)
                     send_goodbye_callback(s->monitor, i, e);
@@ -514,7 +512,7 @@ void avahi_goodbye_interface(AvahiServer *s, AvahiInterface *i, int send_goodbye
 void avahi_goodbye_entry(AvahiServer *s, AvahiEntry *e, int send_goodbye, int remove) {
     assert(s);
     assert(e);
-    
+
     if (send_goodbye)
         if (!e->dead)
             avahi_interface_monitor_walk(s->monitor, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, send_goodbye_callback, e);
index 3a8bcf351cbc3421009b733c4a168fff15ee5f82..fd23d8be2906eeacb83d730b3fbfa6c01ac0419c 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooannouncehfoo
 #define fooannouncehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index df5539fafe942c4f4ccb227ba5b5daeb412a75e4..dee1e93858fc42cb3260d086fc6d40cc45786923 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -40,7 +38,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
     AvahiSimplePoll *simple_poll;
 
     simple_poll = avahi_simple_poll_new();
-    
+
     avahi_server_config_init(&config);
     config.publish_hinfo = 0;
     config.publish_addresses = 0;
@@ -48,7 +46,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
     config.publish_domain = 0;
     config.use_ipv6 = 0;
     config.enable_reflector = 1;
-    
+
     server = avahi_server_new(avahi_simple_poll_get(simple_poll), &config, NULL, NULL, &error);
     avahi_server_config_free(&config);
 
index cb7b97e1ad91527f932a41c166fb42606e73eb48..07d7a8de815f8effcfa13fe48f9b17d21f374d46 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -61,7 +59,7 @@ static void dump_line(const char *text, AVAHI_GCC_UNUSED void* userdata) {
 
 static void dump_timeout_callback(AvahiTimeout *timeout, void* userdata) {
     struct timeval tv;
-    
+
     AvahiServer *avahi = userdata;
     avahi_server_dump(avahi, dump_line, NULL);
 
@@ -98,7 +96,7 @@ static void record_browser_callback(
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     AVAHI_GCC_UNUSED void* userdata) {
     char *t;
-    
+
     assert(r);
 
     if (record) {
@@ -113,7 +111,7 @@ static void remove_entries(void);
 static void create_entries(int new_name);
 
 static void entry_group_callback(AVAHI_GCC_UNUSED AvahiServer *s, AVAHI_GCC_UNUSED AvahiSEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void* userdata) {
-    avahi_log_debug("entry group state: %i", state); 
+    avahi_log_debug("entry group state: %i", state);
 
     if (state == AVAHI_ENTRY_GROUP_COLLISION) {
         remove_entries();
@@ -127,8 +125,8 @@ static void entry_group_callback(AVAHI_GCC_UNUSED AvahiServer *s, AVAHI_GCC_UNUS
 static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UNUSED void* userdata) {
 
     server = s;
-    avahi_log_debug("server state: %i", state); 
-    
+    avahi_log_debug("server state: %i", state);
+
     if (state == AVAHI_SERVER_RUNNING) {
         avahi_log_debug("Server startup complete. Host name is <%s>. Service cookie is %u", avahi_server_get_host_name_fqdn(s), avahi_server_get_local_service_cookie(s));
         create_entries(0);
@@ -155,11 +153,11 @@ static void create_entries(int new_name) {
 
     remove_entries();
 
-    if (!group) 
+    if (!group)
         group = avahi_s_entry_group_new(server, entry_group_callback, NULL);
 
     assert(avahi_s_entry_group_is_empty(group));
-    
+
     if (!service_name)
         service_name = avahi_strdup("Test Service");
     else if (new_name) {
@@ -167,7 +165,7 @@ static void create_entries(int new_name) {
         avahi_free(service_name);
         service_name = n;
     }
-    
+
     if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_http._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
         avahi_log_error("Failed to add HTTP service");
         goto fail;
@@ -190,7 +188,7 @@ static void create_entries(int new_name) {
 
     r = avahi_record_new_full("cname.local", AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_CNAME, AVAHI_DEFAULT_TTL);
     r->data.cname.name = avahi_strdup("cocaine.local");
-    
+
     if (avahi_server_add(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, r) < 0) {
         avahi_record_unref(r);
         avahi_log_error("Failed to add CNAME record");
@@ -291,14 +289,14 @@ static void sr_callback(
     const AvahiAddress *a,
     uint16_t port,
     AvahiStringList *txt,
-    AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, 
+    AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     AVAHI_GCC_UNUSED void* userdata) {
 
     if (event != AVAHI_RESOLVER_FOUND)
         avahi_log_debug("SR: (%i.%i) <%s> as %s in <%s> [%s]", iface, protocol, name, service_type, domain_name, resolver_event_to_string(event));
     else {
         char t[AVAHI_ADDRESS_STR_MAX], *s;
-        
+
         avahi_address_snprint(t, sizeof(t), a);
 
         s = avahi_string_list_to_string(txt);
@@ -317,9 +315,9 @@ static void dsb_callback(
     uint16_t port,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     AVAHI_GCC_UNUSED void* userdata) {
-    
+
     char t[AVAHI_ADDRESS_STR_MAX] = "n/a";
-    
+
     if (a)
         avahi_address_snprint(t, sizeof(t), a);
 
@@ -344,7 +342,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     simple_poll = avahi_simple_poll_new();
     poll_api = avahi_simple_poll_get(simple_poll);
-    
+
     avahi_server_config_init(&config);
 
     avahi_address_parse("192.168.50.1", AVAHI_PROTO_UNSPEC, &config.wide_area_servers[0]);
@@ -353,7 +351,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     server = avahi_server_new(poll_api, &config, server_callback, NULL, &error);
     avahi_server_config_free(&config);
-    
+
     k = avahi_key_new("_http._tcp.0pointer.de", AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR);
     r = avahi_s_record_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, k, 0, record_browser_callback, NULL);
     avahi_key_unref(k);
@@ -389,7 +387,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     avahi_s_dns_server_browser_free(dsb);
 
     if (group)
-        avahi_s_entry_group_free(group);   
+        avahi_s_entry_group_free(group);
 
     if (server)
         avahi_server_free(server);
@@ -398,6 +396,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
         avahi_simple_poll_free(simple_poll);
 
     avahi_free(service_name);
-    
+
     return 0;
 }
index 48d23add9214f6838b02ef4901e3aa4ce1960a89..a51c38fc038f765b379a75bbe3f8d0224904629d 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -44,13 +42,13 @@ struct AvahiDNSServerInfo {
     AvahiSHostNameResolver *host_name_resolver;
     AvahiAddress address;
     AvahiLookupResultFlags flags;
-    
+
     AVAHI_LLIST_FIELDS(AvahiDNSServerInfo, info);
 };
 
 struct AvahiSDNSServerBrowser {
     AvahiServer *server;
-    
+
     AvahiSRecordBrowser *record_browser;
     AvahiSDNSServerBrowserCallback callback;
     void* userdata;
@@ -58,14 +56,14 @@ struct AvahiSDNSServerBrowser {
     AvahiLookupFlags user_flags;
 
     unsigned n_info;
-    
+
     AVAHI_LLIST_FIELDS(AvahiSDNSServerBrowser, browser);
     AVAHI_LLIST_HEAD(AvahiDNSServerInfo, info);
 };
 
 static AvahiDNSServerInfo* get_server_info(AvahiSDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiRecord *r) {
     AvahiDNSServerInfo *i;
-    
+
     assert(b);
     assert(r);
 
@@ -85,12 +83,12 @@ static void server_info_free(AvahiSDNSServerBrowser *b, AvahiDNSServerInfo *i) {
     avahi_record_unref(i->srv_record);
     if (i->host_name_resolver)
         avahi_s_host_name_resolver_free(i->host_name_resolver);
-    
+
     AVAHI_LLIST_REMOVE(AvahiDNSServerInfo, info, b->info, i);
 
     assert(b->n_info >= 1);
     b->n_info--;
-    
+
     avahi_free(i);
 }
 
@@ -103,9 +101,9 @@ static void host_name_resolver_callback(
     const AvahiAddress *a,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiDNSServerInfo *i = userdata;
-    
+
     assert(r);
     assert(host_name);
     assert(i);
@@ -113,7 +111,7 @@ static void host_name_resolver_callback(
     switch (event) {
         case AVAHI_RESOLVER_FOUND: {
             i->address = *a;
-            
+
             i->browser->callback(
                 i->browser,
                 i->interface,
@@ -145,7 +143,7 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSDNSServerBrowser *b = userdata;
 
     assert(rr);
@@ -157,19 +155,19 @@ static void record_browser_callback(
     switch (event) {
         case AVAHI_BROWSER_NEW: {
             AvahiDNSServerInfo *i;
-            
+
             assert(record);
             assert(record->key->type == AVAHI_DNS_TYPE_SRV);
 
             if (get_server_info(b, interface, protocol, record))
                 return;
-            
+
             if (b->n_info >= 10)
                 return;
-            
+
             if (!(i = avahi_new(AvahiDNSServerInfo, 1)))
                 return; /* OOM */
-            
+
             i->browser = b;
             i->interface = interface;
             i->protocol = protocol;
@@ -182,22 +180,22 @@ static void record_browser_callback(
                 b->user_flags,
                 host_name_resolver_callback, i);
             i->flags = flags;
-            
+
             AVAHI_LLIST_PREPEND(AvahiDNSServerInfo, info, b->info, i);
-            
+
             b->n_info++;
             break;
         }
 
         case AVAHI_BROWSER_REMOVE: {
             AvahiDNSServerInfo *i;
-            
+
             assert(record);
             assert(record->key->type == AVAHI_DNS_TYPE_SRV);
 
             if (!(i = get_server_info(b, interface, protocol, record)))
                 return;
-            
+
             if (!i->host_name_resolver)
                 b->callback(
                     b,
@@ -209,7 +207,7 @@ static void record_browser_callback(
                     i->srv_record->data.srv.port,
                     i->flags | flags,
                     b->userdata);
-            
+
             server_info_free(b, i);
             break;
         }
@@ -228,7 +226,7 @@ static void record_browser_callback(
                 0,
                 flags,
                 b->userdata);
-            
+
             break;
     }
 }
@@ -248,12 +246,12 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
         "_domain._udp",
         "_dns-update._udp"
     };
-    
+
     AvahiSDNSServerBrowser *b;
     AvahiKey *k = NULL;
     char n[AVAHI_DOMAIN_NAME_MAX];
     int r;
-    
+
     assert(server);
     assert(callback);
 
@@ -271,12 +269,12 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
         avahi_server_set_errno(server, r);
         return NULL;
     }
-    
+
     if (!(b = avahi_new(AvahiSDNSServerBrowser, 1))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     b->server = server;
     b->callback = callback;
     b->userdata = userdata;
@@ -286,15 +284,15 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
 
     AVAHI_LLIST_HEAD_INIT(AvahiDNSServerInfo, b->info);
     AVAHI_LLIST_PREPEND(AvahiSDNSServerBrowser, browser, server->dns_server_browsers, b);
-    
+
     if (!(k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(b->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, b)))
         goto fail;
-        
+
     avahi_key_unref(k);
 
     return b;
@@ -303,7 +301,7 @@ fail:
 
     if (k)
         avahi_key_unref(k);
-    
+
     avahi_s_dns_server_browser_free(b);
     return NULL;
 }
@@ -313,7 +311,7 @@ void avahi_s_dns_server_browser_free(AvahiSDNSServerBrowser *b) {
 
     while (b->info)
         server_info_free(b, b->info);
-    
+
     AVAHI_LLIST_REMOVE(AvahiSDNSServerBrowser, browser, b->server->dns_server_browsers, b);
 
     if (b->record_browser)
index 0043806ea97c767ff28e68ab2c1223b2846bdeb2..9705b2a52a620ecf9088f08b42511ad9fe7ef25b 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -34,9 +32,9 @@
 
 struct AvahiSDomainBrowser {
     int ref;
-    
+
     AvahiServer *server;
-    
+
     AvahiSRecordBrowser *record_browser;
 
     AvahiDomainBrowserType type;
@@ -46,7 +44,7 @@ struct AvahiSDomainBrowser {
     AvahiTimeEvent *defer_event;
 
     int all_for_now_scheduled;
-    
+
     AVAHI_LLIST_FIELDS(AvahiSDomainBrowser, browser);
 };
 
@@ -65,7 +63,7 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSDomainBrowser *b = userdata;
     char *n = NULL;
 
@@ -78,7 +76,7 @@ static void record_browser_callback(
         b->all_for_now_scheduled = 1;
         return;
     }
-    
+
     /* Filter flags */
     flags &= AVAHI_LOOKUP_RESULT_CACHED | AVAHI_LOOKUP_RESULT_MULTICAST | AVAHI_LOOKUP_RESULT_WIDE_AREA;
 
@@ -90,21 +88,21 @@ static void record_browser_callback(
             AvahiStringList *l;
 
             /* Filter out entries defined statically */
-            
+
             for (l = b->server->config.browse_domains; l; l = l->next)
                 if (avahi_domain_equal((char*) l->text, n))
                     return;
         }
-        
+
     }
-        
+
     b->callback(b, interface, protocol, event, n, flags, b->userdata);
 }
 
 static void defer_callback(AvahiTimeEvent *e, void *userdata) {
     AvahiSDomainBrowser *b = userdata;
     AvahiStringList *l;
-    
+
     assert(e);
     assert(b);
 
@@ -117,22 +115,22 @@ static void defer_callback(AvahiTimeEvent *e, void *userdata) {
     inc_ref(b);
 
     for (l = b->server->config.browse_domains; l; l = l->next) {
-        
+
         /* Check whether this object still exists outside our own
          * stack frame */
         if (b->ref <= 1)
             break;
-        
+
         b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_NEW, (char*) l->text, AVAHI_LOOKUP_RESULT_STATIC, b->userdata);
     }
 
     if (b->ref > 1) {
         /* If the ALL_FOR_NOW event has already been scheduled, execute it now */
-        
-        if (b->all_for_now_scheduled) 
+
+        if (b->all_for_now_scheduled)
             b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_ALL_FOR_NOW, NULL, 0, b->userdata);
     }
-    
+
     /* Decrease ref counter */
     avahi_s_domain_browser_free(b);
 }
@@ -154,12 +152,12 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new(
         "dr",
         "lb"
     };
-    
+
     AvahiSDomainBrowser *b;
     AvahiKey *k = NULL;
     char n[AVAHI_DOMAIN_NAME_MAX];
     int r;
-    
+
     assert(server);
     assert(callback);
 
@@ -176,7 +174,7 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new(
         avahi_server_set_errno(server, r);
         return NULL;
     }
-    
+
     if (!(b = avahi_new(AvahiSDomainBrowser, 1))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
@@ -197,24 +195,24 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new(
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(b->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, b)))
         goto fail;
-    
+
     avahi_key_unref(k);
 
     if (type == AVAHI_DOMAIN_BROWSER_BROWSE && b->server->config.browse_domains)
         b->defer_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
-    
+
     return b;
-    
+
 fail:
-    
+
     if (k)
         avahi_key_unref(k);
-    
+
     avahi_s_domain_browser_free(b);
-    
+
     return NULL;
 }
 
@@ -224,7 +222,7 @@ void avahi_s_domain_browser_free(AvahiSDomainBrowser *b) {
     assert(b->ref >= 1);
     if (--b->ref > 0)
         return;
-    
+
     AVAHI_LLIST_REMOVE(AvahiSDomainBrowser, browser, b->server->domain_browsers, b);
 
     if (b->record_browser)
@@ -232,6 +230,6 @@ void avahi_s_domain_browser_free(AvahiSDomainBrowser *b) {
 
     if (b->defer_event)
         avahi_time_event_free(b->defer_event);
-    
+
     avahi_free(b);
 }
index 252e3cb0f1d2fe389f4ba8f6dee36dff500e8e66..6fff07165221812c20c85c247623fb5ecd600220 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -52,7 +50,7 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSServiceTypeBrowser *b = userdata;
 
     assert(rr);
@@ -63,7 +61,7 @@ static void record_browser_callback(
 
     if (record) {
         char type[AVAHI_DOMAIN_NAME_MAX], domain[AVAHI_DOMAIN_NAME_MAX];
-        
+
         assert(record->key->type == AVAHI_DNS_TYPE_PTR);
 
         if (avahi_service_name_split(record->data.ptr.name, NULL, 0, type, sizeof(type), domain, sizeof(domain)) < 0) {
@@ -84,12 +82,12 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
     AvahiLookupFlags flags,
     AvahiSServiceTypeBrowserCallback callback,
     void* userdata) {
-    
+
     AvahiSServiceTypeBrowser *b;
     AvahiKey *k = NULL;
     char n[AVAHI_DOMAIN_NAME_MAX];
     int r;
-    
+
     assert(server);
     assert(callback);
 
@@ -105,32 +103,32 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
         avahi_server_set_errno(server, r);
         return NULL;
     }
-    
+
     if (!(b = avahi_new(AvahiSServiceTypeBrowser, 1))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     b->server = server;
     b->callback = callback;
     b->userdata = userdata;
     b->record_browser = NULL;
-    
+
     AVAHI_LLIST_PREPEND(AvahiSServiceTypeBrowser, browser, server->service_type_browsers, b);
 
     if (!(b->domain_name = avahi_normalize_name_strdup(domain))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(b->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, b)))
         goto fail;
-        
+
     avahi_key_unref(k);
 
     return b;
@@ -140,7 +138,7 @@ fail:
         avahi_key_unref(k);
 
     avahi_s_service_type_browser_free(b);
-    
+
     return NULL;
 }
 
index 43778ddc6f0c49f7f12cf0f3860be2dbe63aab07..dde36bc74048775dca2a08fc934a9cc3d2f9338d 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -36,7 +34,7 @@ struct AvahiSServiceBrowser {
     AvahiServer *server;
     char *domain_name;
     char *service_type;
-    
+
     AvahiSRecordBrowser *record_browser;
 
     AvahiSServiceBrowserCallback callback;
@@ -53,7 +51,7 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSServiceBrowser *b = userdata;
 
     assert(rr);
@@ -61,7 +59,7 @@ static void record_browser_callback(
 
     /* Filter flags */
     flags &= AVAHI_LOOKUP_RESULT_CACHED | AVAHI_LOOKUP_RESULT_MULTICAST | AVAHI_LOOKUP_RESULT_WIDE_AREA;
-    
+
     if (record) {
         char service[AVAHI_LABEL_MAX], type[AVAHI_DOMAIN_NAME_MAX], domain[AVAHI_DOMAIN_NAME_MAX];
 
@@ -76,7 +74,7 @@ static void record_browser_callback(
         }
 
         b->callback(b, interface, protocol, event, service, type, domain, flags, b->userdata);
-        
+
     } else
         b->callback(b, interface, protocol, event, NULL, b->service_type, b->domain_name, flags, b->userdata);
 
@@ -96,7 +94,7 @@ AvahiSServiceBrowser *avahi_s_service_browser_new(
     AvahiKey *k = NULL;
     char n[AVAHI_DOMAIN_NAME_MAX];
     int r;
-    
+
     assert(server);
     assert(callback);
     assert(service_type);
@@ -114,18 +112,18 @@ AvahiSServiceBrowser *avahi_s_service_browser_new(
         avahi_server_set_errno(server, r);
         return NULL;
     }
-    
+
     if (!(b = avahi_new(AvahiSServiceBrowser, 1))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     b->server = server;
     b->domain_name = b->service_type = NULL;
     b->callback = callback;
     b->userdata = userdata;
     b->record_browser = NULL;
-    
+
     AVAHI_LLIST_PREPEND(AvahiSServiceBrowser, browser, server->service_browsers, b);
 
     if (!(b->domain_name = avahi_normalize_name_strdup(domain)) ||
@@ -133,12 +131,12 @@ AvahiSServiceBrowser *avahi_s_service_browser_new(
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(b->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, b)))
         goto fail;
 
@@ -150,7 +148,7 @@ fail:
 
     if (k)
         avahi_key_unref(k);
-    
+
     avahi_s_service_browser_free(b);
     return NULL;
 }
@@ -162,7 +160,7 @@ void avahi_s_service_browser_free(AvahiSServiceBrowser *b) {
 
     if (b->record_browser)
         avahi_s_record_browser_free(b->record_browser);
-    
+
     avahi_free(b->domain_name);
     avahi_free(b->service_type);
     avahi_free(b);
index 16d89548442ac1c3ed8f813f04170314718103c5..eabd7eaaa91fe1ba815cc83ed90545f41cf124c0 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
 struct AvahiSRBLookup {
     AvahiSRecordBrowser *record_browser;
-    
+
     unsigned ref;
 
     AvahiIfIndex interface;
     AvahiProtocol protocol;
     AvahiLookupFlags flags;
-    
+
     AvahiKey *key;
 
     AvahiWideAreaLookup *wide_area;
     AvahiMulticastLookup *multicast;
 
     AvahiRList *cname_lookups;
-    
+
     AVAHI_LLIST_FIELDS(AvahiSRBLookup, lookups);
 };
 
@@ -89,7 +87,7 @@ static AvahiSRBLookup* lookup_new(
     AvahiKey *key) {
 
     AvahiSRBLookup *l;
-    
+
     assert(b);
     assert(AVAHI_IF_VALID(interface));
     assert(AVAHI_PROTO_VALID(protocol));
@@ -97,10 +95,10 @@ static AvahiSRBLookup* lookup_new(
     if (b->n_lookups >= AVAHI_LOOKUPS_PER_BROWSER_MAX)
         /* We don't like cyclic CNAMEs */
         return NULL;
-    
+
     if (!(l = avahi_new(AvahiSRBLookup, 1)))
         return NULL;
-    
+
     l->ref = 1;
     l->record_browser = b;
     l->interface = interface;
@@ -112,11 +110,11 @@ static AvahiSRBLookup* lookup_new(
     l->flags = flags;
 
     transport_flags_from_domain(b->server, &l->flags, key->name);
-    
+
     AVAHI_LLIST_PREPEND(AvahiSRBLookup, lookups, b->lookups, l);
 
     b->n_lookups ++;
-    
+
     return l;
 }
 
@@ -134,7 +132,7 @@ static void lookup_unref(AvahiSRBLookup *l) {
         avahi_wide_area_lookup_free(l->wide_area);
         l->wide_area = NULL;
     }
-    
+
     if (l->multicast) {
         avahi_multicast_lookup_free(l->multicast);
         l->multicast = NULL;
@@ -144,7 +142,7 @@ static void lookup_unref(AvahiSRBLookup *l) {
         lookup_unref(l->cname_lookups->data);
         l->cname_lookups = avahi_rlist_remove_by_link(l->cname_lookups, l->cname_lookups);
     }
-    
+
     avahi_key_unref(l->key);
     avahi_free(l);
 }
@@ -163,9 +161,9 @@ static AvahiSRBLookup *lookup_find(
     AvahiProtocol protocol,
     AvahiLookupFlags flags,
     AvahiKey *key) {
-    
+
     AvahiSRBLookup *l;
-    
+
     assert(b);
 
     for (l = b->lookups; l; l = l->lookups_next) {
@@ -201,7 +199,7 @@ static void lookup_wide_area_callback(
     AvahiLookupResultFlags flags,
     AvahiRecord *r,
     void *userdata) {
-    
+
     AvahiSRBLookup *l = userdata;
     AvahiSRecordBrowser *b;
 
@@ -215,11 +213,11 @@ static void lookup_wide_area_callback(
         return;
 
     lookup_ref(l);
-    
+
     switch (event) {
         case AVAHI_BROWSER_NEW:
             assert(r);
-            
+
             if (r->key->clazz == AVAHI_DNS_CLASS_IN &&
                 r->key->type == AVAHI_DNS_TYPE_CNAME)
                 /* It's a CNAME record, so let's follow it. We only follow it on wide area DNS! */
@@ -259,7 +257,7 @@ static void lookup_multicast_callback(
 
     AvahiSRBLookup *l = userdata;
     AvahiSRecordBrowser *b;
-    
+
     assert(e);
     assert(l);
 
@@ -269,11 +267,11 @@ static void lookup_multicast_callback(
         return;
 
     lookup_ref(l);
-    
+
     switch (event) {
         case AVAHI_BROWSER_NEW:
             assert(r);
-            
+
             if (r->key->clazz == AVAHI_DNS_CLASS_IN &&
                 r->key->type == AVAHI_DNS_TYPE_CNAME)
                 /* It's a CNAME record, so let's follow it. We allow browsing on both multicast and wide area. */
@@ -283,7 +281,7 @@ static void lookup_multicast_callback(
 
                 if (avahi_server_is_record_local(b->server, interface, protocol, r))
                     flags |= AVAHI_LOOKUP_RESULT_LOCAL;
-                
+
                 b->callback(b, interface, protocol, event, r, flags, b->userdata);
             }
             break;
@@ -323,12 +321,12 @@ static int lookup_start(AvahiSRBLookup *l) {
 
     assert(!(l->flags & AVAHI_LOOKUP_USE_WIDE_AREA) != !(l->flags & AVAHI_LOOKUP_USE_MULTICAST));
     assert(!l->wide_area && !l->multicast);
-    
+
     if (l->flags & AVAHI_LOOKUP_USE_WIDE_AREA) {
 
         if (!(l->wide_area = avahi_wide_area_lookup_new(l->record_browser->server->wide_area_lookup_engine, l->key, lookup_wide_area_callback, l)))
             return -1;
-        
+
     } else {
         assert(l->flags & AVAHI_LOOKUP_USE_MULTICAST);
 
@@ -341,15 +339,15 @@ static int lookup_start(AvahiSRBLookup *l) {
 
 static int lookup_scan_cache(AvahiSRBLookup *l) {
     int n = 0;
-    
+
     assert(l);
 
     assert(!(l->flags & AVAHI_LOOKUP_USE_WIDE_AREA) != !(l->flags & AVAHI_LOOKUP_USE_MULTICAST));
 
-    
+
     if (l->flags & AVAHI_LOOKUP_USE_WIDE_AREA) {
         n = (int) avahi_wide_area_scan_cache(l->record_browser->server->wide_area_lookup_engine, l->key, lookup_wide_area_callback, l);
-        
+
     } else {
         assert(l->flags & AVAHI_LOOKUP_USE_MULTICAST);
         n = (int) avahi_multicast_lookup_engine_scan_cache(l->record_browser->server->multicast_lookup_engine, l->interface, l->protocol, l->key, lookup_multicast_callback, l);
@@ -360,7 +358,7 @@ static int lookup_scan_cache(AvahiSRBLookup *l) {
 
 static AvahiSRBLookup* lookup_add(AvahiSRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiLookupFlags flags, AvahiKey *key) {
     AvahiSRBLookup *l;
-    
+
     assert(b);
     assert(!b->dead);
 
@@ -379,9 +377,9 @@ static int lookup_go(AvahiSRBLookup *l) {
 
     if (l->record_browser->dead)
         return 0;
-    
+
     lookup_ref(l);
-    
+
     /* Browse the cache for the root request */
     n = lookup_scan_cache(l);
 
@@ -390,7 +388,7 @@ static int lookup_go(AvahiSRBLookup *l) {
 
         if ((l->flags & AVAHI_LOOKUP_USE_MULTICAST) || n == 0)
             /* We do no start a query if the cache contained entries and we're on wide area */
-            
+
             if (lookup_start(l) < 0)
                 n = -1;
     }
@@ -403,7 +401,7 @@ static int lookup_go(AvahiSRBLookup *l) {
 static void lookup_handle_cname(AvahiSRBLookup *l, AvahiIfIndex interface, AvahiProtocol protocol, AvahiLookupFlags flags, AvahiRecord *r) {
     AvahiKey *k;
     AvahiSRBLookup *n;
-    
+
     assert(l);
     assert(r);
 
@@ -411,7 +409,7 @@ static void lookup_handle_cname(AvahiSRBLookup *l, AvahiIfIndex interface, Avahi
     assert(r->key->type == AVAHI_DNS_TYPE_CNAME);
 
     k = avahi_key_new(r->data.ptr.name, l->record_browser->key->clazz, l->record_browser->key->type);
-    n = lookup_add(l->record_browser, interface, protocol, flags, k); 
+    n = lookup_add(l->record_browser, interface, protocol, flags, k);
     avahi_key_unref(k);
 
     if (!n) {
@@ -446,7 +444,7 @@ static void lookup_drop_cname(AvahiSRBLookup *l, AvahiIfIndex interface, AvahiPr
             avahi_key_equal(n->key, k))
             break;
     }
-    
+
     avahi_key_unref(k);
 
     if (rl) {
@@ -487,11 +485,11 @@ static void defer_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void *userdata) {
             b, b->interface, b->protocol, AVAHI_BROWSER_FAILURE, NULL,
             b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_RESULT_WIDE_AREA : AVAHI_LOOKUP_RESULT_MULTICAST,
             b->userdata);
-        
+
         browser_cancel(b);
         return;
     }
-    
+
     /* Tell the client that we're done with the cache */
     b->callback(
         b, b->interface, b->protocol, AVAHI_BROWSER_CACHE_EXHAUSTED, NULL,
@@ -503,7 +501,7 @@ static void defer_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void *userdata) {
         /* If we do wide area lookups and the the cache contained
          * entries, we assume that it is complete, and tell the user
          * so by firing ALL_FOR_NOW. */
-        
+
         b->callback(b, b->interface, b->protocol, AVAHI_BROWSER_ALL_FOR_NOW, NULL, AVAHI_LOOKUP_RESULT_WIDE_AREA, b->userdata);
     }
 }
@@ -529,7 +527,7 @@ AvahiSRecordBrowser *avahi_s_record_browser_new(
     AvahiLookupFlags flags,
     AvahiSRecordBrowserCallback callback,
     void* userdata) {
-    
+
     AvahiSRecordBrowser *b;
 
     assert(server);
@@ -541,13 +539,13 @@ AvahiSRecordBrowser *avahi_s_record_browser_new(
     AVAHI_CHECK_VALIDITY_RETURN_NULL(server, !avahi_key_is_pattern(key), AVAHI_ERR_IS_PATTERN);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(server, avahi_key_is_valid(key), AVAHI_ERR_INVALID_KEY);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS);
-    AVAHI_CHECK_VALIDITY_RETURN_NULL(server, !(flags & AVAHI_LOOKUP_USE_WIDE_AREA) || !(flags & AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS); 
-    
+    AVAHI_CHECK_VALIDITY_RETURN_NULL(server, !(flags & AVAHI_LOOKUP_USE_WIDE_AREA) || !(flags & AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS);
+
     if (!(b = avahi_new(AvahiSRecordBrowser, 1))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     b->dead = 0;
     b->server = server;
     b->interface = interface;
@@ -559,13 +557,13 @@ AvahiSRecordBrowser *avahi_s_record_browser_new(
     b->n_lookups = 0;
     AVAHI_LLIST_HEAD_INIT(AvahiSRBLookup, b->lookups);
     b->root_lookup = NULL;
-    
+
     AVAHI_LLIST_PREPEND(AvahiSRecordBrowser, browser, server->record_browsers, b);
 
     /* The currently cached entries are scanned a bit later, and than we will start querying, too */
     b->defer_time_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
     assert(b->defer_time_event);
-    
+
     return b;
 }
 
@@ -583,30 +581,30 @@ void avahi_s_record_browser_destroy(AvahiSRecordBrowser *b) {
     assert(b);
 
     browser_cancel(b);
-    
+
     AVAHI_LLIST_REMOVE(AvahiSRecordBrowser, browser, b->server->record_browsers, b);
 
     avahi_key_unref(b->key);
-    
+
     avahi_free(b);
 }
 
 void avahi_browser_cleanup(AvahiServer *server) {
     AvahiSRecordBrowser *b;
     AvahiSRecordBrowser *n;
-    
+
     assert(server);
 
     while (server->need_browser_cleanup) {
         server->need_browser_cleanup = 0;
-        
+
         for (b = server->record_browsers; b; b = n) {
             n = b->browser_next;
-            
+
             if (b->dead)
                 avahi_s_record_browser_destroy(b);
         }
-    } 
+    }
 
     if (server->wide_area_lookup_engine)
         avahi_wide_area_cleanup(server->wide_area_lookup_engine);
index 36d4e2e8e2135f57fc58d9d102e0d3cde578ba31..a0dc2076293ee2f23308d12c460ebaa5ae1901cc 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foobrowsehfoo
 #define foobrowsehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -41,7 +39,7 @@ struct AvahiSRecordBrowser {
     AvahiIfIndex interface;
     AvahiProtocol protocol;
     AvahiLookupFlags flags;
-    
+
     AvahiTimeEvent *defer_time_event;
 
     AvahiSRecordBrowserCallback callback;
index 9d97b6cd0a55ab01fbb609ba164529e848112cbf..454aac53a5efa068be431b00285b068373d93ea4 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -34,8 +32,6 @@
 #include "log.h"
 #include "rr-util.h"
 
-#define AVAHI_CACHE_ENTRIES_MAX 500
-
 static void remove_entry(AvahiCache *c, AvahiCacheEntry *e) {
     AvahiCacheEntry *t;
 
@@ -54,17 +50,18 @@ static void remove_entry(AvahiCache *c, AvahiCacheEntry *e) {
 
     /* Remove from linked list */
     AVAHI_LLIST_REMOVE(AvahiCacheEntry, entry, c->entries, e);
-        
+
     if (e->time_event)
         avahi_time_event_free(e->time_event);
 
     avahi_multicast_lookup_engine_notify(c->server->multicast_lookup_engine, c->interface, e->record, AVAHI_BROWSER_REMOVE);
-    
+
     avahi_record_unref(e->record);
-    
+
     avahi_free(e);
 
-    assert(c->n_entries-- >= 1);
+    assert(c->n_entries >= 1);
+    --c->n_entries;
 }
 
 AvahiCache *avahi_cache_new(AvahiServer *server, AvahiInterface *iface) {
@@ -75,7 +72,7 @@ AvahiCache *avahi_cache_new(AvahiServer *server, AvahiInterface *iface) {
         avahi_log_error(__FILE__": Out of memory.");
         return NULL; /* OOM */
     }
-    
+
     c->server = server;
     c->interface = iface;
 
@@ -89,7 +86,7 @@ AvahiCache *avahi_cache_new(AvahiServer *server, AvahiInterface *iface) {
     c->n_entries = 0;
 
     c->last_rand_timestamp = 0;
-    
+
     return c;
 }
 
@@ -99,9 +96,9 @@ void avahi_cache_free(AvahiCache *c) {
     while (c->entries)
         remove_entry(c, c->entries);
     assert(c->n_entries == 0);
-    
+
     avahi_hashmap_free(c->hashmap);
-    
+
     avahi_free(c);
 }
 
@@ -110,34 +107,34 @@ static AvahiCacheEntry *lookup_key(AvahiCache *c, AvahiKey *k) {
     assert(k);
 
     assert(!avahi_key_is_pattern(k));
-    
+
     return avahi_hashmap_lookup(c->hashmap, k);
 }
 
 void* avahi_cache_walk(AvahiCache *c, AvahiKey *pattern, AvahiCacheWalkCallback cb, void* userdata) {
     void* ret;
-    
+
     assert(c);
     assert(pattern);
     assert(cb);
-    
+
     if (avahi_key_is_pattern(pattern)) {
         AvahiCacheEntry *e, *n;
-        
+
         for (e = c->entries; e; e = n) {
             n = e->entry_next;
-            
+
             if (avahi_key_pattern_match(pattern, e->record->key))
                 if ((ret = cb(c, pattern, e, userdata)))
                     return ret;
         }
-        
+
     } else {
         AvahiCacheEntry *e, *n;
 
         for (e = lookup_key(c, pattern); e; e = n) {
             n = e->by_key_next;
-                
+
             if ((ret = cb(c, pattern, e, userdata)))
                 return ret;
         }
@@ -170,7 +167,7 @@ static void elapse_func(AvahiTimeEvent *t, void *userdata) {
     AvahiCacheEntry *e = userdata;
 /*     char *txt; */
     unsigned percent = 0;
-    
+
     assert(t);
     assert(e);
 
@@ -184,17 +181,17 @@ static void elapse_func(AvahiTimeEvent *t, void *userdata) {
         case AVAHI_CACHE_REPLACE_FINAL:
 
             remove_entry(e->cache, e);
-            
+
             e = NULL;
 /*         avahi_log_debug("Removing entry from cache due to expiration (%s)", txt); */
             break;
-            
+
         case AVAHI_CACHE_VALID:
         case AVAHI_CACHE_POOF:
             e->state = AVAHI_CACHE_EXPIRY1;
             percent = 85;
             break;
-                
+
         case AVAHI_CACHE_EXPIRY1:
             e->state = AVAHI_CACHE_EXPIRY2;
             percent = 90;
@@ -203,7 +200,7 @@ static void elapse_func(AvahiTimeEvent *t, void *userdata) {
             e->state = AVAHI_CACHE_EXPIRY3;
             percent = 95;
             break;
-            
+
         case AVAHI_CACHE_EXPIRY3:
             e->state = AVAHI_CACHE_EXPIRY_FINAL;
             percent = 100;
@@ -217,10 +214,10 @@ static void elapse_func(AvahiTimeEvent *t, void *userdata) {
         /* Request a cache update if we are subscribed to this entry */
         if (avahi_querier_shall_refresh_cache(e->cache->interface, e->record->key))
             avahi_interface_post_query(e->cache->interface, e->record->key, 0, NULL);
-        
+
         /* Check again later */
         next_expiry(e->cache, e, percent);
-        
+
     }
 
 /*     avahi_free(txt); */
@@ -229,7 +226,7 @@ static void elapse_func(AvahiTimeEvent *t, void *userdata) {
 static void update_time_event(AvahiCache *c, AvahiCacheEntry *e) {
     assert(c);
     assert(e);
-    
+
     if (e->time_event)
         avahi_time_event_update(e->time_event, &e->expiry);
     else
@@ -239,11 +236,11 @@ static void update_time_event(AvahiCache *c, AvahiCacheEntry *e) {
 static void next_expiry(AvahiCache *c, AvahiCacheEntry *e, unsigned percent) {
     AvahiUsec usec, left, right;
     time_t now;
-    
+
     assert(c);
     assert(e);
     assert(percent > 0 && percent <= 100);
-    
+
     usec = (AvahiUsec) e->record->ttl * 10000;
 
     left = usec * percent;
@@ -257,19 +254,19 @@ static void next_expiry(AvahiCache *c, AvahiCacheEntry *e, unsigned percent) {
     }
 
     usec = left + (AvahiUsec) ((double) (right-left) * c->last_rand / (RAND_MAX+1.0));
-    
+
     e->expiry = e->timestamp;
     avahi_timeval_add(&e->expiry, usec);
-    
+
 /*     g_message("wake up in +%lu seconds", e->expiry.tv_sec - e->timestamp.tv_sec); */
-    
+
     update_time_event(c, e);
 }
 
 static void expire_in_one_second(AvahiCache *c, AvahiCacheEntry *e, AvahiCacheEntryState state) {
     assert(c);
     assert(e);
-    
+
     e->state = state;
     gettimeofday(&e->expiry, NULL);
     avahi_timeval_add(&e->expiry, 1000000); /* 1s */
@@ -278,7 +275,7 @@ static void expire_in_one_second(AvahiCache *c, AvahiCacheEntry *e, AvahiCacheEn
 
 void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const AvahiAddress *a) {
 /*     char *txt; */
-    
+
     assert(c);
     assert(r && r->ref >= 1);
 
@@ -301,7 +298,7 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const Av
         /* This is an update request */
 
         if ((first = lookup_key(c, r->key))) {
-            
+
             if (cache_flush) {
 
                 /* For unique entries drop all entries older than one second */
@@ -314,34 +311,34 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const Av
                         expire_in_one_second(c, e, AVAHI_CACHE_REPLACE_FINAL);
                 }
             }
-                
+
             /* Look for exactly the same entry */
             for (e = first; e; e = e->by_key_next)
                 if (avahi_record_equal_no_ttl(e->record, r))
                     break;
         }
-    
+
         if (e) {
-            
+
 /*             avahi_log_debug("found matching cache entry");  */
 
             /* We need to update the hash table key if we replace the
              * record */
             if (e->by_key_prev == NULL)
                 avahi_hashmap_replace(c->hashmap, r->key, e);
-            
+
             /* Update the record */
             avahi_record_unref(e->record);
             e->record = avahi_record_ref(r);
 
 /*             avahi_log_debug("cache: updating %s", txt);   */
-            
+
         } else {
             /* No entry found, therefore we create a new one */
-            
+
 /*             avahi_log_debug("cache: couldn't find matching cache entry for %s", txt);   */
 
-            if (c->n_entries >= AVAHI_CACHE_ENTRIES_MAX)
+            if (c->n_entries >= c->server->config.n_cache_entries_max)
                 return;
 
             if (!(e = avahi_new(AvahiCacheEntry, 1))) {
@@ -364,8 +361,8 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const Av
 
             /* Notify subscribers */
             avahi_multicast_lookup_engine_notify(c->server->multicast_lookup_engine, c->interface, e->record, AVAHI_BROWSER_NEW);
-        } 
-        
+        }
+
         e->origin = *a;
         e->timestamp = now;
         next_expiry(c, e, 80);
@@ -395,7 +392,7 @@ static void dump_callback(void* key, void* data, void* userdata) {
 
         if (!(t = avahi_record_to_string(e->record)))
             continue; /* OOM */
-        
+
         dump_data->callback(t, dump_data->userdata);
         avahi_free(t);
     }
@@ -420,7 +417,7 @@ int avahi_cache_dump(AvahiCache *c, AvahiDumpCallback callback, void* userdata)
 int avahi_cache_entry_half_ttl(AvahiCache *c, AvahiCacheEntry *e) {
     struct timeval now;
     unsigned age;
-    
+
     assert(c);
     assert(e);
 
@@ -429,7 +426,7 @@ int avahi_cache_entry_half_ttl(AvahiCache *c, AvahiCacheEntry *e) {
     age = (unsigned) (avahi_timeval_diff(&now, &e->timestamp)/1000000);
 
 /*     avahi_log_debug("age: %lli, ttl/2: %u", age, e->record->ttl);  */
-    
+
     return age >= e->record->ttl/2;
 }
 
@@ -483,7 +480,7 @@ static void* start_poof_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEnt
         default:
             ;
     }
-    
+
     return NULL;
 }
 
@@ -514,6 +511,3 @@ void avahi_cache_stop_poof(AvahiCache *c, AvahiRecord *record, const AvahiAddres
             next_expiry(c, e, 80);
         }
 }
-
-
-
index fd740051649c3144a12a27b40fff3725ab1a2628..49ba9b9c4d92bae42843eb49d19334862efc082b 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foocachehfoo
 #define foocachehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -52,7 +50,7 @@ struct AvahiCacheEntry {
     struct timeval expiry;
     int cache_flush;
     int poof_num;
-    
+
     AvahiAddress origin;
 
     AvahiCacheEntryState state;
@@ -66,9 +64,9 @@ struct AvahiCacheEntry {
 
 struct AvahiCache {
     AvahiServer *server;
-    
+
     AvahiInterface *interface;
-    
+
     AvahiHashmap *hashmap;
 
     AVAHI_LLIST_HEAD(AvahiCacheEntry, entries);
@@ -95,7 +93,7 @@ int avahi_cache_entry_half_ttl(AvahiCache *c, AvahiCacheEntry *e);
  * records of the specified key. The specified address is  */
 void avahi_cache_start_poof(AvahiCache *c, AvahiKey *key, const AvahiAddress *a);
 
-/* Stop a previously started POOF algorithm for a record. (Used for response suppresions records */    
+/* Stop a previously started POOF algorithm for a record. (Used for response suppresions records */
 void avahi_cache_stop_poof(AvahiCache *c, AvahiRecord *record, const AvahiAddress *a);
 
 void avahi_cache_flush(AvahiCache *c);
index dc3c864eb7b13465f98c1e0d737052be0a818f87..632f66b626a6671b5d6690a8c5e6ea1c3f3a737c 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -55,7 +53,7 @@ static void dump_line(const char *text, AVAHI_GCC_UNUSED void* userdata) {
 
 static void dump_timeout_callback(AvahiTimeout *timeout, AVAHI_GCC_UNUSED void* userdata) {
     struct timeval tv;
-    
+
     avahi_server_dump(avahi, dump_line, NULL);
 
     avahi_elapse_time(&tv, 5000, 0);
@@ -77,8 +75,8 @@ static void create_service(const char *t) {
         avahi_s_entry_group_reset(group);
     else
         group = avahi_s_entry_group_new(avahi, entry_group_callback, NULL);
-    
-    avahi_server_add_service(avahi, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_http._tcp", NULL, NULL, 80, "foo", NULL);   
+
+    avahi_server_add_service(avahi, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_http._tcp", NULL, NULL, 80, "foo", NULL);
     avahi_s_entry_group_commit(group);
 
     try++;
@@ -86,8 +84,8 @@ static void create_service(const char *t) {
 
 static void rename_timeout_callback(AvahiTimeout *timeout, AVAHI_GCC_UNUSED void *userdata) {
     struct timeval tv;
-    
-    if (access("flag", F_OK) == 0) { 
+
+    if (access("flag", F_OK) == 0) {
         create_service("New - Bonjour Service Name");
         return;
     }
@@ -112,7 +110,7 @@ static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UN
         avahi_server_dump(avahi, dump_line, NULL);
     } else if (state == AVAHI_SERVER_COLLISION) {
         char *n;
-        
+
         n = avahi_alternative_host_name(avahi_server_get_host_name(s));
         avahi_log_warn("Host name conflict, retrying with <%s>", n);
         avahi_server_set_host_name(s, n);
@@ -147,14 +145,14 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     /* Evil, but the conformace test requires that*/
     create_service("gurke");
 
-    
+
     avahi_simple_poll_loop(simple_poll);
-    
+
     if (group)
-        avahi_s_entry_group_free(group);   
+        avahi_s_entry_group_free(group);
     avahi_server_free(avahi);
 
     avahi_simple_poll_free(simple_poll);
-    
+
     return 0;
 }
index 94d19700271d73435f456c148bc3d41182d532f7..1f5012691affa92a397dd8f829899ca7ad6a1de1 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foocorehfoo
 #define foocorehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -67,6 +65,7 @@ typedef struct AvahiServerConfig {
     int allow_point_to_point;         /**< Enable publishing on POINTOPOINT interfaces */
     int publish_a_on_ipv6;            /**< Publish an IPv4 A RR on IPv6 sockets */
     int publish_aaaa_on_ipv4;         /**< Publish an IPv4 A RR on IPv6 sockets */
+    unsigned n_cache_entries_max;     /**< Maximum number of cache entries per interface */
 } AvahiServerConfig;
 
 /** Allocate a new mDNS responder object. */
index d93e508bbf4bf58bca2a697d56d4bf5e0623c286..f50e691a76240c9476651fa3ba7fad4bfe9a4003 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 1a7f95f9c9d0793f300d7d17c87abead1daafb3f..fdd9010618e1b6fffbced65682dbdf95418c9825 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodnssrvhfoo
 #define foodnssrvhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -76,7 +74,7 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
     AvahiProtocol protocol,
     const char *domain,
     AvahiDNSServerType type,
-    AvahiProtocol aprotocol,  /**< Address protocol for the DNS server */ 
+    AvahiProtocol aprotocol,  /**< Address protocol for the DNS server */
     AvahiLookupFlags flags,                 /**< Lookup flags. */
     AvahiSDNSServerBrowserCallback callback,
     void* userdata);
index ae2343d96288a41eae8f82059489a7c4360d698f..ebe2305900e2ff8269570ff1b5e2ecc872e6b9f1 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -57,7 +55,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     assert(avahi_dns_packet_consume_name(p, t, sizeof(t)) == 0);
     avahi_log_debug(">%s<", t);
     assert(avahi_domain_equal(a, t));
-    
+
     assert(avahi_dns_packet_consume_name(p, t, sizeof(t)) == 0);
     avahi_log_debug(">%s<", t);
     assert(avahi_domain_equal(b, t));
@@ -69,11 +67,11 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     assert(avahi_dns_packet_consume_name(p, t, sizeof(t)) == 0);
     avahi_log_debug(">%s<", t);
     assert(avahi_domain_equal(d, t));
-    
+
     avahi_dns_packet_free(p);
 
     /* RDATA PARSING AND SERIALIZATION */
-    
+
     /* Create an AvahiRecord with some usful data */
     r = avahi_record_new_full("foobar.local", AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_HINFO, AVAHI_DEFAULT_TTL);
     assert(r);
@@ -110,6 +108,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     avahi_free(m);
     avahi_record_unref(r);
-    
+
     return 0;
 }
index 41ccc8f3503c689e93ae6e612d22100f3656b3b5..2fcd91f875baf9712980e4a7f36a8e2699547900 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -51,10 +49,10 @@ AvahiDnsPacket* avahi_dns_packet_new(unsigned mtu) {
 
     if (max_size < AVAHI_DNS_PACKET_HEADER_SIZE)
         max_size = AVAHI_DNS_PACKET_HEADER_SIZE;
-    
+
     if (!(p = avahi_malloc(sizeof(AvahiDnsPacket) + max_size)))
         return p;
-    
+
     p->size = p->rindex = AVAHI_DNS_PACKET_HEADER_SIZE;
     p->max_size = max_size;
     p->name_table = NULL;
@@ -69,7 +67,7 @@ AvahiDnsPacket* avahi_dns_packet_new_query(unsigned mtu) {
 
     if (!(p = avahi_dns_packet_new(mtu)))
         return NULL;
-    
+
     avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_FLAGS, AVAHI_DNS_FLAGS(0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
     return p;
 }
@@ -79,7 +77,7 @@ AvahiDnsPacket* avahi_dns_packet_new_response(unsigned mtu, int aa) {
 
     if (!(p = avahi_dns_packet_new(mtu)))
         return NULL;
-    
+
     avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_FLAGS, AVAHI_DNS_FLAGS(1, 0, aa, 0, 0, 0, 0, 0, 0, 0));
     return p;
 }
@@ -97,7 +95,7 @@ AvahiDnsPacket* avahi_dns_packet_new_reply(AvahiDnsPacket* p, unsigned mtu, int
 
         saved_rindex = p->rindex;
         p->rindex = AVAHI_DNS_PACKET_HEADER_SIZE;
-        
+
         for (n = avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_QDCOUNT); n > 0; n--) {
             AvahiKey *k;
             int unicast_response;
@@ -120,7 +118,7 @@ AvahiDnsPacket* avahi_dns_packet_new_reply(AvahiDnsPacket* p, unsigned mtu, int
                                (avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_FLAGS) & AVAHI_DNS_FLAG_OPCODE));
 
     return r;
-} 
+}
 
 
 void avahi_dns_packet_free(AvahiDnsPacket *p) {
@@ -128,14 +126,14 @@ void avahi_dns_packet_free(AvahiDnsPacket *p) {
 
     if (p->name_table)
         avahi_hashmap_free(p->name_table);
-    
+
     avahi_free(p);
 }
 
 void avahi_dns_packet_set_field(AvahiDnsPacket *p, unsigned idx, uint16_t v) {
     assert(p);
     assert(idx < AVAHI_DNS_PACKET_HEADER_SIZE);
-    
+
     ((uint16_t*) AVAHI_DNS_PACKET_DATA(p))[idx] = htons(v);
 }
 
@@ -151,12 +149,12 @@ void avahi_dns_packet_inc_field(AvahiDnsPacket *p, unsigned idx) {
     assert(idx < AVAHI_DNS_PACKET_HEADER_SIZE);
 
     avahi_dns_packet_set_field(p, idx, avahi_dns_packet_get_field(p, idx) + 1);
-}   
+}
 
 
 static void name_table_cleanup(void *key, void *value, void *user_data) {
     AvahiDnsPacket *p = user_data;
-    
+
     if ((uint8_t*) value >= AVAHI_DNS_PACKET_DATA(p) + p->size)
         avahi_hashmap_remove(p->name_table, key);
 }
@@ -169,23 +167,23 @@ void avahi_dns_packet_cleanup_name_table(AvahiDnsPacket *p) {
 uint8_t* avahi_dns_packet_append_name(AvahiDnsPacket *p, const char *name) {
     uint8_t *d, *saved_ptr = NULL;
     size_t saved_size;
-    
+
     assert(p);
     assert(name);
 
     saved_size = p->size;
     saved_ptr = avahi_dns_packet_extend(p, 0);
-    
+
     while (*name) {
         uint8_t* prev;
         const char *pname;
         char label[64], *u;
-        
+
         /* Check whether we can compress this name. */
 
         if (p->name_table && (prev = avahi_hashmap_lookup(p->name_table, name))) {
             unsigned idx;
-            
+
             assert(prev >= AVAHI_DNS_PACKET_DATA(p));
             idx = (unsigned) (prev - AVAHI_DNS_PACKET_DATA(p));
 
@@ -203,7 +201,7 @@ uint8_t* avahi_dns_packet_append_name(AvahiDnsPacket *p, const char *name) {
         }
 
         pname = name;
-        
+
         if (!(avahi_unescape_label(&name, label, sizeof(label))))
             goto fail;
 
@@ -222,7 +220,7 @@ uint8_t* avahi_dns_packet_append_name(AvahiDnsPacket *p, const char *name) {
 
     if (!(d = avahi_dns_packet_extend(p, 1)))
         goto fail;
-    
+
     *d = 0;
 
     return saved_ptr;
@@ -237,10 +235,10 @@ fail:
 uint8_t* avahi_dns_packet_append_uint16(AvahiDnsPacket *p, uint16_t v) {
     uint8_t *d;
     assert(p);
-    
+
     if (!(d = avahi_dns_packet_extend(p, sizeof(uint16_t))))
         return NULL;
-    
+
     d[0] = (uint8_t) (v >> 8);
     d[1] = (uint8_t) v;
     return d;
@@ -252,7 +250,7 @@ uint8_t *avahi_dns_packet_append_uint32(AvahiDnsPacket *p, uint32_t v) {
 
     if (!(d = avahi_dns_packet_extend(p, sizeof(uint32_t))))
         return NULL;
-    
+
     d[0] = (uint8_t) (v >> 24);
     d[1] = (uint8_t) (v >> 16);
     d[2] = (uint8_t) (v >> 8);
@@ -278,13 +276,13 @@ uint8_t *avahi_dns_packet_append_bytes(AvahiDnsPacket  *p, const void *b, size_t
 uint8_t* avahi_dns_packet_append_string(AvahiDnsPacket *p, const char *s) {
     uint8_t* d;
     size_t k;
-    
+
     assert(p);
     assert(s);
 
     if ((k = strlen(s)) >= 255)
         k = 255;
-    
+
     if (!(d = avahi_dns_packet_extend(p, k+1)))
         return NULL;
 
@@ -296,15 +294,15 @@ uint8_t* avahi_dns_packet_append_string(AvahiDnsPacket *p, const char *s) {
 
 uint8_t *avahi_dns_packet_extend(AvahiDnsPacket *p, size_t l) {
     uint8_t *d;
-    
+
     assert(p);
 
     if (p->size+l > p->max_size)
         return NULL;
-    
+
     d = AVAHI_DNS_PACKET_DATA(p) + p->size;
     p->size += l;
-    
+
     return d;
 }
 
@@ -316,7 +314,7 @@ int avahi_dns_packet_check_valid(AvahiDnsPacket *p) {
         return -1;
 
     flags = avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_FLAGS);
-    
+
     if (flags & AVAHI_DNS_FLAG_OPCODE)
         return -1;
 
@@ -329,9 +327,9 @@ int avahi_dns_packet_check_valid_multicast(AvahiDnsPacket *p) {
 
     if (avahi_dns_packet_check_valid(p) < 0)
         return -1;
-    
+
     flags = avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_FLAGS);
-    
+
     if (flags & AVAHI_DNS_FLAG_RCODE)
         return -1;
 
@@ -340,7 +338,7 @@ int avahi_dns_packet_check_valid_multicast(AvahiDnsPacket *p) {
 
 int avahi_dns_packet_is_query(AvahiDnsPacket *p) {
     assert(p);
-    
+
     return !(avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_FLAGS) & AVAHI_DNS_FLAG_QR);
 }
 
@@ -351,7 +349,7 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_
     unsigned label_ptr;
     int i;
     assert(p && ret_name && l);
-    
+
     for (i = 0; i < AVAHI_DNS_LABELS_MAX; i++) {
         uint8_t n;
 
@@ -368,15 +366,15 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_
             if (l < 1)
                 return -1;
             *ret_name = 0;
-            
+
             return ret;
-            
+
         } else if (n <= 63) {
             /* Uncompressed label */
             idx++;
             if (!compressed)
                 ret++;
-        
+
             if (idx + n > p->size)
                 return -1;
 
@@ -393,7 +391,7 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_
                 return -1;
 
             idx += n;
-            
+
             if (!compressed)
                 ret += n;
         } else if ((n & 0xC0) == 0xC0) {
@@ -411,7 +409,7 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_
 
             if (!compressed)
                 ret += 2;
-            
+
             compressed = 1;
         } else
             return -1;
@@ -422,7 +420,7 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_
 
 int avahi_dns_packet_consume_name(AvahiDnsPacket *p, char *ret_name, size_t l) {
     int r;
-    
+
     if ((r = consume_labels(p, p->rindex, ret_name, l)) < 0)
         return -1;
 
@@ -458,7 +456,7 @@ int avahi_dns_packet_consume_uint32(AvahiDnsPacket *p, uint32_t *ret_v) {
     d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex);
     *ret_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
     p->rindex += sizeof(uint32_t);
-    
+
     return 0;
 }
 
@@ -466,7 +464,7 @@ int avahi_dns_packet_consume_bytes(AvahiDnsPacket *p, void * ret_data, size_t l)
     assert(p);
     assert(ret_data);
     assert(l > 0);
-    
+
     if (p->rindex + l > p->size)
         return -1;
 
@@ -478,7 +476,7 @@ int avahi_dns_packet_consume_bytes(AvahiDnsPacket *p, void * ret_data, size_t l)
 
 int avahi_dns_packet_consume_string(AvahiDnsPacket *p, char *ret_string, size_t l) {
     size_t k;
-    
+
     assert(p);
     assert(ret_string);
     assert(l > 0);
@@ -496,7 +494,7 @@ int avahi_dns_packet_consume_string(AvahiDnsPacket *p, char *ret_string, size_t
 
     memcpy(ret_string, AVAHI_DNS_PACKET_DATA(p)+p->rindex+1, l-1);
     ret_string[l-1] = 0;
-    
+
     p->rindex += 1+k;
 
     return 0;
@@ -504,7 +502,7 @@ int avahi_dns_packet_consume_string(AvahiDnsPacket *p, char *ret_string, size_t
 
 const void* avahi_dns_packet_get_rptr(AvahiDnsPacket *p) {
     assert(p);
-    
+
     if (p->rindex > p->size)
         return NULL;
 
@@ -524,32 +522,32 @@ int avahi_dns_packet_skip(AvahiDnsPacket *p, size_t length) {
 static int parse_rdata(AvahiDnsPacket *p, AvahiRecord *r, uint16_t rdlength) {
     char buf[AVAHI_DOMAIN_NAME_MAX];
     const void* start;
-    
+
     assert(p);
     assert(r);
 
     start = avahi_dns_packet_get_rptr(p);
+
     switch (r->key->type) {
         case AVAHI_DNS_TYPE_PTR:
         case AVAHI_DNS_TYPE_CNAME:
         case AVAHI_DNS_TYPE_NS:
-            
+
             if (avahi_dns_packet_consume_name(p, buf, sizeof(buf)) < 0)
                 return -1;
 
             r->data.ptr.name = avahi_strdup(buf);
             break;
 
-            
+
         case AVAHI_DNS_TYPE_SRV:
-            
+
             if (avahi_dns_packet_consume_uint16(p, &r->data.srv.priority) < 0 ||
                 avahi_dns_packet_consume_uint16(p, &r->data.srv.weight) < 0 ||
                 avahi_dns_packet_consume_uint16(p, &r->data.srv.port) < 0 ||
                 avahi_dns_packet_consume_name(p, buf, sizeof(buf)) < 0)
                 return -1;
-            
+
             r->data.srv.name = avahi_strdup(buf);
             break;
 
@@ -557,12 +555,12 @@ static int parse_rdata(AvahiDnsPacket *p, AvahiRecord *r, uint16_t rdlength) {
 
             if (avahi_dns_packet_consume_string(p, buf, sizeof(buf)) < 0)
                 return -1;
-            
+
             r->data.hinfo.cpu = avahi_strdup(buf);
-            
+
             if (avahi_dns_packet_consume_string(p, buf, sizeof(buf)) < 0)
                 return -1;
-            
+
             r->data.hinfo.os = avahi_strdup(buf);
             break;
 
@@ -571,12 +569,12 @@ static int parse_rdata(AvahiDnsPacket *p, AvahiRecord *r, uint16_t rdlength) {
             if (rdlength > 0) {
                 if (avahi_string_list_parse(avahi_dns_packet_get_rptr(p), rdlength, &r->data.txt.string_list) < 0)
                     return -1;
-                
+
                 if (avahi_dns_packet_skip(p, rdlength) < 0)
                     return -1;
             } else
                 r->data.txt.string_list = NULL;
-            
+
             break;
 
         case AVAHI_DNS_TYPE_A:
@@ -585,27 +583,27 @@ static int parse_rdata(AvahiDnsPacket *p, AvahiRecord *r, uint16_t rdlength) {
 
             if (avahi_dns_packet_consume_bytes(p, &r->data.a.address, sizeof(AvahiIPv4Address)) < 0)
                 return -1;
-            
+
             break;
 
         case AVAHI_DNS_TYPE_AAAA:
 
 /*             avahi_log_debug("aaaa"); */
-            
+
             if (avahi_dns_packet_consume_bytes(p, &r->data.aaaa.address, sizeof(AvahiIPv6Address)) < 0)
                 return -1;
-            
+
             break;
-            
+
         default:
 
 /*             avahi_log_debug("generic"); */
-            
+
             if (rdlength > 0) {
 
                 r->data.generic.data = avahi_memdup(avahi_dns_packet_get_rptr(p), rdlength);
-                r->data.generic.size = rdlength; 
-                
+                r->data.generic.size = rdlength;
+
                 if (avahi_dns_packet_skip(p, rdlength) < 0)
                     return -1;
             }
@@ -616,7 +614,7 @@ static int parse_rdata(AvahiDnsPacket *p, AvahiRecord *r, uint16_t rdlength) {
     /* Check if we read enough data */
     if ((const uint8_t*) avahi_dns_packet_get_rptr(p) - (const uint8_t*) start != rdlength)
         return -1;
-    
+
     return 0;
 }
 
@@ -640,16 +638,16 @@ AvahiRecord* avahi_dns_packet_consume_record(AvahiDnsPacket *p, int *ret_cache_f
     if (ret_cache_flush)
         *ret_cache_flush = !!(class & AVAHI_DNS_CACHE_FLUSH);
     class &= ~AVAHI_DNS_CACHE_FLUSH;
-    
+
     if (!(r = avahi_record_new_full(name, class, type, ttl)))
         goto fail;
-    
+
     if (parse_rdata(p, r, rdlength) < 0)
         goto fail;
 
     if (!avahi_record_is_valid(r))
         goto fail;
-    
+
     return r;
 
 fail:
@@ -675,7 +673,7 @@ AvahiKey* avahi_dns_packet_consume_key(AvahiDnsPacket *p, int *ret_unicast_respo
         *ret_unicast_response = !!(class & AVAHI_DNS_UNICAST_RESPONSE);
 
     class &= ~AVAHI_DNS_UNICAST_RESPONSE;
-    
+
     if (!(k = avahi_key_new(name, class, type)))
         return NULL;
 
@@ -690,12 +688,12 @@ AvahiKey* avahi_dns_packet_consume_key(AvahiDnsPacket *p, int *ret_unicast_respo
 uint8_t* avahi_dns_packet_append_key(AvahiDnsPacket *p, AvahiKey *k, int unicast_response) {
     uint8_t *t;
     size_t size;
-    
+
     assert(p);
     assert(k);
 
     size = p->size;
-    
+
     if (!(t = avahi_dns_packet_append_name(p, k->name)) ||
         !avahi_dns_packet_append_uint16(p, k->type) ||
         !avahi_dns_packet_append_uint16(p, k->clazz | (unicast_response ? AVAHI_DNS_UNICAST_RESPONSE : 0))) {
@@ -711,16 +709,16 @@ uint8_t* avahi_dns_packet_append_key(AvahiDnsPacket *p, AvahiKey *k, int unicast
 static int append_rdata(AvahiDnsPacket *p, AvahiRecord *r) {
     assert(p);
     assert(r);
-    
+
     switch (r->key->type) {
-        
+
         case AVAHI_DNS_TYPE_PTR:
         case AVAHI_DNS_TYPE_CNAME:
         case AVAHI_DNS_TYPE_NS:
-            
+
             if (!(avahi_dns_packet_append_name(p, r->data.ptr.name)))
                 return -1;
-            
+
             break;
 
         case AVAHI_DNS_TYPE_SRV:
@@ -759,16 +757,16 @@ static int append_rdata(AvahiDnsPacket *p, AvahiRecord *r) {
 
             if (!avahi_dns_packet_append_bytes(p, &r->data.a.address, sizeof(r->data.a.address)))
                 return -1;
-            
+
             break;
 
         case AVAHI_DNS_TYPE_AAAA:
-            
+
             if (!avahi_dns_packet_append_bytes(p, &r->data.aaaa.address, sizeof(r->data.aaaa.address)))
                 return -1;
-            
+
             break;
-            
+
         default:
 
             if (r->data.generic.size)
@@ -802,7 +800,7 @@ uint8_t* avahi_dns_packet_append_record(AvahiDnsPacket *p, AvahiRecord *r, int c
 
     if (append_rdata(p, r) < 0)
         goto fail;
-    
+
     size = avahi_dns_packet_extend(p, 0) - start;
     assert(size <= AVAHI_DNS_RDATA_MAX);
 
@@ -810,7 +808,7 @@ uint8_t* avahi_dns_packet_append_record(AvahiDnsPacket *p, AvahiRecord *r, int c
 
     l[0] = (uint8_t) ((uint16_t) size >> 8);
     l[1] = (uint8_t) ((uint16_t) size);
-    
+
     return t;
 
 
@@ -831,17 +829,17 @@ size_t avahi_dns_packet_space(AvahiDnsPacket *p) {
     assert(p);
 
     assert(p->size <= p->max_size);
-    
+
     return p->max_size - p->size;
 }
 
 int avahi_rdata_parse(AvahiRecord *record, const void* rdata, size_t size) {
     int ret;
     AvahiDnsPacket p;
-    
+
     assert(record);
     assert(rdata);
-    
+
     p.data = (void*) rdata;
     p.max_size = p.size = size;
     p.rindex = 0;
@@ -850,14 +848,14 @@ int avahi_rdata_parse(AvahiRecord *record, const void* rdata, size_t size) {
     ret = parse_rdata(&p, record, size);
 
     assert(!p.name_table);
-    
+
     return ret;
 }
 
 size_t avahi_rdata_serialize(AvahiRecord *record, void *rdata, size_t max_size) {
     int ret;
     AvahiDnsPacket p;
-    
+
     assert(record);
     assert(rdata);
     assert(max_size > 0);
@@ -874,6 +872,6 @@ size_t avahi_rdata_serialize(AvahiRecord *record, void *rdata, size_t max_size)
 
     if (ret < 0)
         return (size_t) -1;
-    
+
     return p.size;
 }
index 7ec9935e40602d019755b55ff94ffebf3c86094b..52e8d88fa45761636ecf9c2a8fa8117929969fab 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodnshfoo
 #define foodnshfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 777a064d009372a04f59ebfbc6c0ff280e75d85f..6eed27f21e9338ef13f9acd4336f7eabc0b816e8 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -41,8 +39,8 @@ static void strip_bad_chars(char *s) {
     char *p, *d;
 
     s[strcspn(s, ".")] = 0;
-    
-    for (p = s, d = s; *p; p++) 
+
+    for (p = s, d = s; *p; p++)
         if ((*p >= 'a' && *p <= 'z') ||
             (*p >= 'A' && *p <= 'Z') ||
             (*p >= '0' && *p <= '9') ||
@@ -55,7 +53,7 @@ static void strip_bad_chars(char *s) {
 #ifdef __linux__
 static int load_lsb_distrib_id(char *ret_s, size_t size) {
     FILE *f;
-    
+
     assert(ret_s);
     assert(size > 0);
 
@@ -100,7 +98,7 @@ char *avahi_get_host_name(char *ret_s, size_t size) {
         *ret_s = 0;
         avahi_log_warn("System host name is set to 'localhost'. This is not a suitable mDNS host name, looking for alternatives.");
     }
-    
+
     if (*ret_s == 0) {
         /* No hostname was set, so let's take the OS name */
 
@@ -118,7 +116,7 @@ char *avahi_get_host_name(char *ret_s, size_t size) {
         {
             /* Try uname() second */
             struct utsname utsname;
-            
+
             if (uname(&utsname) >= 0) {
                 snprintf(ret_s, size, "%s", utsname.sysname);
                 strip_bad_chars(ret_s);
@@ -132,8 +130,8 @@ char *avahi_get_host_name(char *ret_s, size_t size) {
     }
 
     if (size >= AVAHI_LABEL_MAX)
-       ret_s[AVAHI_LABEL_MAX-1] = 0;    
-    
+       ret_s[AVAHI_LABEL_MAX-1] = 0;
+
     return ret_s;
 }
 
@@ -164,7 +162,7 @@ int avahi_binary_domain_cmp(const char *a, const char *b) {
 
         if ((r = strcmp(ca, cb)))
             return r;
-        
+
         if (!*a && !*b)
             return 0;
     }
@@ -179,12 +177,12 @@ int avahi_domain_ends_with(const char *domain, const char *suffix) {
 
         if (*domain == 0)
             return 0;
-        
+
         if (avahi_domain_equal(domain, suffix))
             return 1;
 
         r = avahi_unescape_label(&domain, dummy, sizeof(dummy));
         assert(r);
-    } 
+    }
 }
 
index 01233d8bde5903fc3a101ae2dd8336b5caf7badd..082fde65c7784a2e8a875e02b6852d0f553fca3c 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodomainutilhfoo
 #define foodomainutilhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -31,7 +29,7 @@
 AVAHI_C_DECL_BEGIN
 
 /** Return the local host name. */
-char *avahi_get_host_name(char *ret_s, size_t size); 
+char *avahi_get_host_name(char *ret_s, size_t size);
 
 /** Return the local host name. avahi_free() the result! */
 char *avahi_get_host_name_strdup(void);
index 55c9ea29d99804c3cdd972d0a4ce2206b1095950..b02964cabeda8d651b0d98f2cc79c3b01f07cc65 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -107,7 +105,7 @@ void avahi_entry_group_free(AvahiServer *s, AvahiSEntryGroup *g) {
 
     if (g->register_time_event)
         avahi_time_event_free(g->register_time_event);
-    
+
     AVAHI_LLIST_REMOVE(AvahiSEntryGroup, groups, s->groups, g);
     avahi_free(g);
 }
@@ -117,10 +115,10 @@ void avahi_cleanup_dead_entries(AvahiServer *s) {
 
     if (s->need_group_cleanup) {
         AvahiSEntryGroup *g, *next;
-        
+
         for (g = s->groups; g; g = next) {
             next = g->groups_next;
-            
+
             if (g->dead)
                 avahi_entry_group_free(s, g);
         }
@@ -130,10 +128,10 @@ void avahi_cleanup_dead_entries(AvahiServer *s) {
 
     if (s->need_entry_cleanup) {
         AvahiEntry *e, *next;
-        
+
         for (e = s->entries; e; e = next) {
             next = e->entries_next;
-            
+
             if (e->dead)
                 avahi_entry_free(s, e);
         }
@@ -147,7 +145,7 @@ void avahi_cleanup_dead_entries(AvahiServer *s) {
 
 static int check_record_conflict(AvahiServer *s, AvahiIfIndex interface, AvahiProtocol protocol, AvahiRecord *r, AvahiPublishFlags flags) {
     AvahiEntry *e;
-    
+
     assert(s);
     assert(r);
 
@@ -157,7 +155,7 @@ static int check_record_conflict(AvahiServer *s, AvahiIfIndex interface, AvahiPr
 
         if (!(flags & AVAHI_PUBLISH_UNIQUE) && !(e->flags & AVAHI_PUBLISH_UNIQUE))
             continue;
-        
+
         if ((flags & AVAHI_PUBLISH_ALLOW_MULTIPLE) && (e->flags & AVAHI_PUBLISH_ALLOW_MULTIPLE) )
             continue;
 
@@ -188,7 +186,7 @@ static AvahiEntry * server_add_internal(
     AvahiRecord *r) {
 
     AvahiEntry *e;
-    
+
     assert(s);
     assert(r);
 
@@ -225,11 +223,11 @@ static AvahiEntry * server_add_internal(
                                      !g ||
                                      (g->state != AVAHI_ENTRY_GROUP_ESTABLISHED && g->state != AVAHI_ENTRY_GROUP_REGISTERING) ||
                                      (flags & AVAHI_PUBLISH_UPDATE), AVAHI_ERR_BAD_STATE);
-    
+
     if (flags & AVAHI_PUBLISH_UPDATE) {
         AvahiRecord *old_record;
         int is_first = 1;
-        
+
         /* Update and existing record */
 
         /* Find the first matching entry */
@@ -265,14 +263,14 @@ static AvahiEntry * server_add_internal(
         /* If we were the first entry in the list, we need to update the key */
         if (is_first)
             avahi_hashmap_replace(s->entries_by_key, e->record->key, e);
-        
+
         avahi_record_unref(old_record);
 
     } else {
         AvahiEntry *t;
 
         /* Add a new record */
-    
+
         if (check_record_conflict(s, interface, protocol, r, flags) < 0) {
             avahi_server_set_errno(s, AVAHI_ERR_COLLISION);
             return NULL;
@@ -282,7 +280,7 @@ static AvahiEntry * server_add_internal(
             avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
             return NULL;
         }
-        
+
         e->server = s;
         e->record = avahi_record_ref(r);
         e->group = g;
@@ -290,20 +288,20 @@ static AvahiEntry * server_add_internal(
         e->protocol = protocol;
         e->flags = flags;
         e->dead = 0;
-        
+
         AVAHI_LLIST_HEAD_INIT(AvahiAnnouncer, e->announcers);
-        
+
         AVAHI_LLIST_PREPEND(AvahiEntry, entries, s->entries, e);
-        
+
         /* Insert into hash table indexed by name */
         t = avahi_hashmap_lookup(s->entries_by_key, e->record->key);
         AVAHI_LLIST_PREPEND(AvahiEntry, by_key, t, e);
         avahi_hashmap_replace(s->entries_by_key, e->record->key, t);
-        
+
         /* Insert into group list */
         if (g)
-            AVAHI_LLIST_PREPEND(AvahiEntry, by_group, g->entries, e); 
-        
+            AVAHI_LLIST_PREPEND(AvahiEntry, by_group, g->entries, e);
+
         avahi_announce_entry(s, e);
     }
 
@@ -331,10 +329,10 @@ const AvahiRecord *avahi_server_iterate(AvahiServer *s, AvahiSEntryGroup *g, voi
 
     if (!*e)
         *e = g ? g->entries : s->entries;
-    
+
     while (*e && (*e)->dead)
         *e = g ? (*e)->by_group_next : (*e)->entries_next;
-        
+
     if (!*e)
         return NULL;
 
@@ -343,7 +341,7 @@ const AvahiRecord *avahi_server_iterate(AvahiServer *s, AvahiSEntryGroup *g, voi
 
 int avahi_server_dump(AvahiServer *s, AvahiDumpCallback callback, void* userdata) {
     AvahiEntry *e;
-    
+
     assert(s);
     assert(callback);
 
@@ -355,10 +353,10 @@ int avahi_server_dump(AvahiServer *s, AvahiDumpCallback callback, void* userdata
 
         if (e->dead)
             continue;
-        
+
         if (!(t = avahi_record_to_string(e->record)))
             return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
-        
+
         snprintf(ln, sizeof(ln), "%s ; iface=%i proto=%i", t, e->interface, e->protocol);
         avahi_free(t);
 
@@ -384,7 +382,7 @@ static AvahiEntry *server_add_ptr_internal(
 
     AvahiRecord *r;
     AvahiEntry *e;
-    
+
     assert(s);
     assert(dest);
 
@@ -398,13 +396,13 @@ static AvahiEntry *server_add_ptr_internal(
         avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-        
+
     r->data.ptr.name = avahi_normalize_name_strdup(dest);
     e = server_add_internal(s, g, interface, protocol, flags, r);
     avahi_record_unref(r);
     return e;
 }
-    
+
 int avahi_server_add_ptr(
     AvahiServer *s,
     AvahiSEntryGroup *g,
@@ -438,7 +436,7 @@ int avahi_server_add_address(
     int ret = AVAHI_OK;
     AvahiEntry *entry = NULL, *reverse = NULL;
     AvahiRecord  *r;
-    
+
     assert(s);
     assert(a);
 
@@ -454,7 +452,7 @@ int avahi_server_add_address(
     AVAHI_CHECK_VALIDITY(s, !name || avahi_is_valid_fqdn(name), AVAHI_ERR_INVALID_HOST_NAME);
 
     /* Prepare the host naem */
-    
+
     if (!name)
         name = s->host_name_fqdn;
     else {
@@ -464,29 +462,29 @@ int avahi_server_add_address(
 
     transport_flags_from_domain(s, &flags, name);
     AVAHI_CHECK_VALIDITY(s, flags & AVAHI_PUBLISH_USE_MULTICAST, AVAHI_ERR_NOT_SUPPORTED);
-    
+
     /* Create the A/AAAA record */
-    
+
     if (a->proto == AVAHI_PROTO_INET) {
 
         if (!(r = avahi_record_new_full(name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, AVAHI_DEFAULT_TTL_HOST_NAME))) {
             ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
             goto finish;
         }
-        
+
         r->data.a.address = a->data.ipv4;
-        
+
     } else {
         assert(a->proto == AVAHI_PROTO_INET6);
-            
+
         if (!(r = avahi_record_new_full(name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA, AVAHI_DEFAULT_TTL_HOST_NAME))) {
             ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
             goto finish;
         }
-        
+
         r->data.aaaa.address = a->data.ipv6;
     }
-        
+
     entry = server_add_internal(s, g, interface, protocol, (flags & ~ AVAHI_PUBLISH_NO_REVERSE) | AVAHI_PUBLISH_UNIQUE | AVAHI_PUBLISH_ALLOW_MULTIPLE, r);
     avahi_record_unref(r);
 
@@ -496,17 +494,17 @@ int avahi_server_add_address(
     }
 
     /* Create the reverse lookup entry */
-    
+
     if (!(flags & AVAHI_PUBLISH_NO_REVERSE)) {
         char reverse_n[AVAHI_DOMAIN_NAME_MAX];
         avahi_reverse_lookup_name(a, reverse_n, sizeof(reverse_n));
-            
+
         if (!(reverse = server_add_ptr_internal(s, g, interface, protocol, flags | AVAHI_PUBLISH_UNIQUE, AVAHI_DEFAULT_TTL_HOST_NAME, reverse_n, name))) {
             ret = avahi_server_errno(s);
             goto finish;
         }
     }
-    
+
 finish:
 
     if (ret != AVAHI_OK && !(flags & AVAHI_PUBLISH_UPDATE)) {
@@ -531,7 +529,7 @@ static AvahiEntry *server_add_txt_strlst_nocopy(
 
     AvahiRecord *r;
     AvahiEntry *e;
-    
+
     assert(s);
 
     if (!(r = avahi_record_new_full(name ? name : s->host_name_fqdn, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_TXT, ttl))) {
@@ -539,7 +537,7 @@ static AvahiEntry *server_add_txt_strlst_nocopy(
         avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     r->data.txt.string_list = strlst;
     e = server_add_internal(s, g, interface, protocol, flags, r);
     avahi_record_unref(r);
@@ -580,7 +578,7 @@ static int server_add_service_strlst_nocopy(
     AvahiRecord *r = NULL;
     int ret = AVAHI_OK;
     AvahiEntry *srv_entry = NULL, *txt_entry = NULL, *ptr_entry = NULL, *enum_entry = NULL;
-    
+
     assert(s);
     assert(type);
     assert(name);
@@ -605,7 +603,7 @@ static int server_add_service_strlst_nocopy(
 
     transport_flags_from_domain(s, &flags, domain);
     AVAHI_CHECK_VALIDITY_SET_RET_GOTO_FAIL(s, flags & AVAHI_PUBLISH_USE_MULTICAST, AVAHI_ERR_NOT_SUPPORTED);
-    
+
     if (!(h = avahi_normalize_name_strdup(host))) {
         ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         goto fail;
@@ -619,19 +617,19 @@ static int server_add_service_strlst_nocopy(
     }
 
     /* Add service enumeration PTR record */
-    
+
     if (!(ptr_entry = server_add_ptr_internal(s, g, interface, protocol, 0, AVAHI_DEFAULT_TTL, ptr_name, svc_name))) {
         ret = avahi_server_errno(s);
         goto fail;
     }
 
     /* Add SRV record */
-    
+
     if (!(r = avahi_record_new_full(svc_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV, AVAHI_DEFAULT_TTL_HOST_NAME))) {
         ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     r->data.srv.priority = 0;
     r->data.srv.weight = 0;
     r->data.srv.port = port;
@@ -649,7 +647,7 @@ static int server_add_service_strlst_nocopy(
 
     if (!(flags & AVAHI_PUBLISH_NO_COOKIE))
         strlst = add_magic_cookie(s, strlst);
-    
+
     txt_entry = server_add_txt_strlst_nocopy(s, g, interface, protocol, AVAHI_PUBLISH_UNIQUE, AVAHI_DEFAULT_TTL, svc_name, strlst);
     strlst = NULL;
 
@@ -659,7 +657,7 @@ static int server_add_service_strlst_nocopy(
     }
 
     /* Add service type enumeration record */
-    
+
     if (!(enum_entry = server_add_ptr_internal(s, g, interface, protocol, 0, AVAHI_DEFAULT_TTL, enum_ptr, ptr_name))) {
         ret = avahi_server_errno(s);
         goto fail;
@@ -676,10 +674,10 @@ fail:
         if (enum_entry)
             avahi_entry_free(s, enum_entry);
     }
-    
+
     avahi_string_list_free(strlst);
     avahi_free(h);
-    
+
     return ret;
 }
 
@@ -718,11 +716,11 @@ int avahi_server_add_service(
 
     va_list va;
     int ret;
-    
+
     va_start(va, port);
     ret = server_add_service_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, host, port, avahi_string_list_new_va(va));
     va_end(va);
-    
+
     return ret;
 }
 
@@ -732,15 +730,15 @@ static int server_update_service_txt_strlst_nocopy(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     AvahiStringList *strlst) {
 
     char svc_name[AVAHI_DOMAIN_NAME_MAX];
     int ret = AVAHI_OK;
     AvahiEntry *e;
-    
+
     assert(s);
     assert(type);
     assert(name);
@@ -769,17 +767,17 @@ static int server_update_service_txt_strlst_nocopy(
     /* Add TXT record */
     if (!(flags & AVAHI_PUBLISH_NO_COOKIE))
         strlst = add_magic_cookie(s, strlst);
-    
+
     e = server_add_txt_strlst_nocopy(s, g, interface, protocol, AVAHI_PUBLISH_UNIQUE | AVAHI_PUBLISH_UPDATE, AVAHI_DEFAULT_TTL, svc_name, strlst);
     strlst = NULL;
 
     if (!e)
         ret = avahi_server_errno(s);
-    
+
 fail:
-    
+
     avahi_string_list_free(strlst);
-    
+
     return ret;
 }
 
@@ -789,9 +787,9 @@ int avahi_server_update_service_txt_strlst(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     AvahiStringList *strlst) {
 
     return server_update_service_txt_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, avahi_string_list_copy(strlst));
@@ -804,18 +802,18 @@ int avahi_server_update_service_txt(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     ...) {
 
     va_list va;
     int ret;
-    
+
     va_start(va, domain);
     ret = server_update_service_txt_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, avahi_string_list_new_va(va));
     va_end(va);
-    
+
     return ret;
 }
 
@@ -825,14 +823,14 @@ int avahi_server_add_service_subtype(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,        
-    const char *type,        
-    const char *domain,      
+    const char *name,
+    const char *type,
+    const char *domain,
     const char *subtype) {
 
     int ret = AVAHI_OK;
     char svc_name[AVAHI_DOMAIN_NAME_MAX], ptr_name[AVAHI_DOMAIN_NAME_MAX];
-    
+
     assert(name);
     assert(type);
     assert(subtype);
@@ -861,7 +859,7 @@ int avahi_server_add_service_subtype(
         goto fail;
 
 fail:
-    
+
     return ret;
 }
 
@@ -877,7 +875,7 @@ static void hexstring(char *s, size_t sl, const void *p, size_t pl) {
             k++;
             pl--;
         }
-        
+
         b = !b;
 
         sl--;
@@ -900,9 +898,9 @@ static AvahiEntry *server_add_dns_server_name(
 
     AvahiEntry *e;
     char t[AVAHI_DOMAIN_NAME_MAX], normalized_d[AVAHI_DOMAIN_NAME_MAX], *n;
-    
+
     AvahiRecord *r;
-    
+
     assert(s);
     assert(name);
 
@@ -911,7 +909,7 @@ static AvahiEntry *server_add_dns_server_name(
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, port != 0, AVAHI_ERR_INVALID_PORT);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, avahi_is_valid_fqdn(name), AVAHI_ERR_INVALID_HOST_NAME);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, !domain || avahi_is_valid_domain_name(domain), AVAHI_ERR_INVALID_DOMAIN_NAME);
-    
+
     if (!domain)
         domain = s->domain_name;
 
@@ -922,17 +920,17 @@ static AvahiEntry *server_add_dns_server_name(
         avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     AVAHI_ASSERT_TRUE(avahi_normalize_name(domain, normalized_d, sizeof(normalized_d)));
 
     snprintf(t, sizeof(t), "%s.%s", type == AVAHI_DNS_SERVER_RESOLVE ? "_domain._udp" : "_dns-update._udp", normalized_d);
-    
+
     if (!(r = avahi_record_new_full(t, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV, AVAHI_DEFAULT_TTL_HOST_NAME))) {
         avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         avahi_free(n);
         return NULL;
     }
-    
+
     r->data.srv.priority = 0;
     r->data.srv.weight = 0;
     r->data.srv.port = port;
@@ -973,7 +971,7 @@ int avahi_server_add_dns_server_address(
 
     transport_flags_from_domain(s, &flags, domain);
     AVAHI_CHECK_VALIDITY(s, flags & AVAHI_PUBLISH_USE_MULTICAST, AVAHI_ERR_NOT_SUPPORTED);
-    
+
     if (address->proto == AVAHI_PROTO_INET) {
         hexstring(h, sizeof(h), &address->data, sizeof(AvahiIPv4Address));
         snprintf(n, sizeof(n), "ip-%s.%s", h, domain);
@@ -988,13 +986,13 @@ int avahi_server_add_dns_server_address(
 
     if (!r)
         return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
-    
+
     a_entry = server_add_internal(s, g, interface, protocol, AVAHI_PUBLISH_UNIQUE | AVAHI_PUBLISH_ALLOW_MULTIPLE, r);
     avahi_record_unref(r);
 
     if (!a_entry)
         return avahi_server_errno(s);
-    
+
     if (!(s_entry = server_add_dns_server_name(s, g, interface, protocol, flags, domain, type, n, port))) {
         if (!(flags & AVAHI_PUBLISH_UPDATE))
             avahi_entry_free(s, a_entry);
@@ -1016,7 +1014,7 @@ void avahi_s_entry_group_change_state(AvahiSEntryGroup *g, AvahiEntryGroupState
 
         /* If the entry group was established for a time longer then
          * 5s, reset the establishment trial counter */
-        
+
         if (avahi_age(&g->established_at) > 5000000)
             g->n_register_try = 0;
     } else if (g->state == AVAHI_ENTRY_GROUP_REGISTERING) {
@@ -1025,30 +1023,30 @@ void avahi_s_entry_group_change_state(AvahiSEntryGroup *g, AvahiEntryGroupState
             g->register_time_event = NULL;
         }
     }
-    
+
     if (state == AVAHI_ENTRY_GROUP_ESTABLISHED)
 
         /* If the entry group is now established, remember the time
          * this happened */
-        
+
         gettimeofday(&g->established_at, NULL);
-    
+
     g->state = state;
-    
+
     if (g->callback)
         g->callback(g->server, g, state, g->userdata);
 }
 
 AvahiSEntryGroup *avahi_s_entry_group_new(AvahiServer *s, AvahiSEntryGroupCallback callback, void* userdata) {
     AvahiSEntryGroup *g;
-    
+
     assert(s);
 
     if (!(g = avahi_new(AvahiSEntryGroup, 1))) {
         avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     g->server = s;
     g->callback = callback;
     g->userdata = userdata;
@@ -1067,7 +1065,7 @@ AvahiSEntryGroup *avahi_s_entry_group_new(AvahiServer *s, AvahiSEntryGroupCallba
 
 void avahi_s_entry_group_free(AvahiSEntryGroup *g) {
     AvahiEntry *e;
-    
+
     assert(g);
     assert(g->server);
 
@@ -1084,9 +1082,11 @@ void avahi_s_entry_group_free(AvahiSEntryGroup *g) {
     }
 
     g->dead = 1;
-    
+
     g->server->need_group_cleanup = 1;
     g->server->need_entry_cleanup = 1;
+
+    avahi_cleanup_dead_entries(g->server);
 }
 
 static void entry_group_commit_real(AvahiSEntryGroup *g) {
@@ -1109,14 +1109,14 @@ static void entry_group_register_time_event_callback(AVAHI_GCC_UNUSED AvahiTimeE
 
     avahi_time_event_free(g->register_time_event);
     g->register_time_event = NULL;
-    
+
     /* Holdoff time passed, so let's start probing */
     entry_group_commit_real(g);
 }
 
 int avahi_s_entry_group_commit(AvahiSEntryGroup *g) {
     struct timeval now;
-    
+
     assert(g);
     assert(!g->dead);
 
@@ -1144,7 +1144,7 @@ int avahi_s_entry_group_commit(AvahiSEntryGroup *g) {
          /* Holdoff time has not yet passed, so let's wait */
         assert(!g->register_time_event);
         g->register_time_event = avahi_time_event_new(g->server->time_event_queue, &g->register_time, entry_group_register_time_event_callback, g);
-        
+
         avahi_s_entry_group_change_state(g, AVAHI_ENTRY_GROUP_REGISTERING);
     }
 
@@ -1154,7 +1154,7 @@ int avahi_s_entry_group_commit(AvahiSEntryGroup *g) {
 void avahi_s_entry_group_reset(AvahiSEntryGroup *g) {
     AvahiEntry *e;
     assert(g);
-    
+
     for (e = g->entries; e; e = e->by_group_next) {
         if (!e->dead) {
             avahi_goodbye_entry(g->server, e, 1, 1);
@@ -1166,6 +1166,8 @@ void avahi_s_entry_group_reset(AvahiSEntryGroup *g) {
     g->n_probing = 0;
 
     avahi_s_entry_group_change_state(g, AVAHI_ENTRY_GROUP_UNCOMMITED);
+
+    avahi_cleanup_dead_entries(g->server);
 }
 
 int avahi_entry_is_commited(AvahiEntry *e) {
index e35016d2740b37ec865a3c57cee605b5780dd732..c294754ada767c9f35c386f9c10fde5d47b02115 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -34,7 +32,7 @@ int avahi_set_cloexec(int fd) {
     int n;
 
     assert(fd >= 0);
-    
+
     if ((n = fcntl(fd, F_GETFD)) < 0)
         return -1;
 
@@ -46,7 +44,7 @@ int avahi_set_cloexec(int fd) {
 
 int avahi_set_nonblock(int fd) {
     int n;
-    
+
     assert(fd >= 0);
 
     if ((n = fcntl(fd, F_GETFL)) < 0)
@@ -61,13 +59,13 @@ int avahi_set_nonblock(int fd) {
 int avahi_wait_for_write(int fd) {
     fd_set fds;
     int r;
-    
+
     FD_ZERO(&fds);
     FD_SET(fd, &fds);
-    
+
     if ((r = select(fd+1, NULL, &fds, NULL, NULL)) < 0)
         return -1;
-    
+
     assert(r > 0);
 
     return 0;
index 047b9bb22f5abfe55b7059e61d0e3ee3f33a2495..68607f8ee3b1a5e254e6f258a3f7c7e379fdbad3 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foofdutilhfoo
 #define foofdutilhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 9826d536f6ab8aabd8ca16a6750d9d38a6b25cc9..209d0e585afb3264e68006b32df0e59d67c24370 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -46,7 +44,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     for (n = 0; n < 1000; n ++)
         avahi_hashmap_insert(m, avahi_strdup_printf("key %u", n), avahi_strdup_printf("value %u", n));
-    
+
     printf("%s\n", (const char*) avahi_hashmap_lookup(m, "bla"));
 
     avahi_hashmap_replace(m, avahi_strdup("bla"), avahi_strdup("#3"));
@@ -57,7 +55,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     t = (const char*) avahi_hashmap_lookup(m, "bla");
     printf("%s\n", t ? t : "(null)");
-    
+
     avahi_hashmap_free(m);
 
     return 0;
index 07bd7078cfd87b54c95a4873cf8b00a810264a3d..9b55bd316bcc258604443d902918f2f5b29c383a 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -49,7 +47,7 @@ struct AvahiHashmap {
     AvahiHashFunc hash_func;
     AvahiEqualFunc equal_func;
     AvahiFreeFunc key_free_func, value_free_func;
-    
+
     Entry *entries[HASH_MAP_SIZE];
     AVAHI_LLIST_HEAD(Entry, entries_list);
 };
@@ -59,7 +57,7 @@ static Entry* entry_get(AvahiHashmap *m, const void *key) {
     Entry *e;
 
     idx = m->hash_func(key) % HASH_MAP_SIZE;
-    
+
     for (e = m->entries[idx]; e; e = e->bucket_next)
         if (m->equal_func(key, e->key))
             return e;
@@ -87,7 +85,7 @@ static void entry_free(AvahiHashmap *m, Entry *e, int stolen) {
 
 AvahiHashmap* avahi_hashmap_new(AvahiHashFunc hash_func, AvahiEqualFunc equal_func, AvahiFreeFunc key_free_func, AvahiFreeFunc value_free_func) {
     AvahiHashmap *m;
-    
+
     assert(hash_func);
     assert(equal_func);
 
@@ -100,7 +98,7 @@ AvahiHashmap* avahi_hashmap_new(AvahiHashFunc hash_func, AvahiEqualFunc equal_fu
     m->value_free_func = value_free_func;
 
     AVAHI_LLIST_HEAD_INIT(Entry, m->entries_list);
-    
+
     return m;
 }
 
@@ -109,13 +107,13 @@ void avahi_hashmap_free(AvahiHashmap *m) {
 
     while (m->entries_list)
         entry_free(m, m->entries_list, 0);
-    
+
     avahi_free(m);
 }
 
 void* avahi_hashmap_lookup(AvahiHashmap *m, const void *key) {
     Entry *e;
-    
+
     assert(m);
 
     if (!(e = entry_get(m, key)))
@@ -135,7 +133,7 @@ int avahi_hashmap_insert(AvahiHashmap *m, void *key, void *value) {
             m->key_free_func(key);
         if (m->value_free_func)
             m->value_free_func(value);
-        
+
         return 1;
     }
 
@@ -150,7 +148,7 @@ int avahi_hashmap_insert(AvahiHashmap *m, void *key, void *value) {
 
     idx = m->hash_func(key) % HASH_MAP_SIZE;
     AVAHI_LLIST_PREPEND(Entry, bucket, m->entries[idx], e);
-        
+
     return 0;
 }
 
@@ -169,7 +167,7 @@ int avahi_hashmap_replace(AvahiHashmap *m, void *key, void *value) {
 
         e->key = key;
         e->value = value;
-            
+
         return 1;
     }
 
@@ -184,13 +182,13 @@ int avahi_hashmap_replace(AvahiHashmap *m, void *key, void *value) {
 
     idx = m->hash_func(key) % HASH_MAP_SIZE;
     AVAHI_LLIST_PREPEND(Entry, bucket, m->entries[idx], e);
-        
+
     return 0;
 }
 
 void avahi_hashmap_remove(AvahiHashmap *m, const void *key) {
     Entry *e;
-    
+
     assert(m);
 
     if (!(e = entry_get(m, key)))
@@ -216,7 +214,7 @@ unsigned avahi_string_hash(const void *data) {
     unsigned hash = 0;
 
     assert(p);
-    
+
     for (; *p; p++)
         hash = 31 * hash + *p;
 
@@ -228,7 +226,7 @@ int avahi_string_equal(const void *a, const void *b) {
 
     assert(p);
     assert(q);
-    
+
     return strcmp(p, q) == 0;
 }
 
@@ -236,7 +234,7 @@ unsigned avahi_int_hash(const void *data) {
     const int *i = data;
 
     assert(i);
-    
+
     return (unsigned) *i;
 }
 
@@ -245,6 +243,6 @@ int avahi_int_equal(const void *a, const void *b) {
 
     assert(_a);
     assert(_b);
-    
+
     return *_a == *_b;
 }
index 120cf302630fc95911e84b14d4aa436e5b219a90..9d7e81fc27ebd58cdcf36c6759c498de71ba9180 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foohashmaphfoo
 #define foohashmaphfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index c8ed9e05c6e913a58b7a9e9c30f4690b4c513a05..2782697a368f73a48df940945e8163172345a183 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -50,7 +48,7 @@ static int netlink_list_items(AvahiNetlink *nl, uint16_t type, unsigned *ret_seq
     uint8_t req[1024];
 
     /* Issue a wild dump NETLINK request */
-    
+
     memset(&req, 0, sizeof(req));
     n = (struct nlmsghdr*) req;
     n->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg));
@@ -69,7 +67,7 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
     AvahiInterfaceMonitor *m = userdata;
 
     /* This routine is called for every RTNETLINK response packet */
-    
+
     assert(m);
     assert(n);
     assert(m->osdep.netlink == nl);
@@ -77,7 +75,7 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
     if (n->nlmsg_type == RTM_NEWLINK) {
 
         /* A new interface appeared or an existing one has been modified */
-        
+
         struct ifinfomsg *ifinfomsg = NLMSG_DATA(n);
         AvahiHwInterface *hw;
         struct rtattr *a = NULL;
@@ -93,7 +91,7 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
          * interface appears, but when it changes, too */
 
         if (!(hw = avahi_interface_monitor_get_hw_interface(m, ifinfomsg->ifi_index)))
-            
+
             /* No object found, so let's create a new
              * one. avahi_hw_interface_new() will call
              * avahi_interface_new() internally twice for IPv4 and
@@ -136,10 +134,10 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
                     hw->mac_address_size = RTA_PAYLOAD(a);
                     if (hw->mac_address_size > AVAHI_MAC_ADDRESS_MAX)
                         hw->mac_address_size = AVAHI_MAC_ADDRESS_MAX;
-                    
+
                     memcpy(hw->mac_address, RTA_DATA(a), hw->mac_address_size);
                     break;
-                    
+
                 default:
                     ;
             }
@@ -156,7 +154,7 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
         /* Update any associated RRs of this interface. (i.e. the
          * _workstation._tcp record containing the MAC address) */
         avahi_hw_interface_update_rrs(hw, 0);
-        
+
     } else if (n->nlmsg_type == RTM_DELLINK) {
 
         /* An interface has been removed */
@@ -174,11 +172,11 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
 
         /* Free our object */
         avahi_hw_interface_free(hw, 0);
-        
+
     } else if (n->nlmsg_type == RTM_NEWADDR || n->nlmsg_type == RTM_DELADDR) {
 
         /* An address has been added, modified or removed */
-        
+
         struct ifaddrmsg *ifaddrmsg = NLMSG_DATA(n);
         AvahiInterface *i;
         struct rtattr *a = NULL;
@@ -207,7 +205,7 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
             switch(a->rta_type) {
                 case IFA_ADDRESS:
                     /* Fill in address data */
-                    
+
                     if ((raddr.proto == AVAHI_PROTO_INET6 && RTA_PAYLOAD(a) != 16) ||
                         (raddr.proto == AVAHI_PROTO_INET && RTA_PAYLOAD(a) != 4))
                         return;
@@ -220,7 +218,7 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
                 default:
                     ;
             }
-            
+
             a = RTA_NEXT(a, l);
         }
 
@@ -260,16 +258,16 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
 
         /* Update any associated RRs, like A or AAAA for our new/removed address */
         avahi_interface_update_rrs(i, 0);
-        
+
     } else if (n->nlmsg_type == NLMSG_DONE) {
 
         /* This wild dump request ended, so let's see what we do next */
-        
+
         if (m->osdep.list == LIST_IFACE) {
 
             /* Mmmm, interfaces have been wild dumped already, so
              * let's go on with wild dumping the addresses */
-            
+
             if (netlink_list_items(m->osdep.netlink, RTM_GETADDR, &m->osdep.query_addr_seq) < 0) {
                 avahi_log_warn("NETLINK: Failed to list addrs: %s", strerror(errno));
                 m->osdep.list = LIST_DONE;
@@ -300,14 +298,14 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat
             /* Tell the user that the wild dump is complete */
             avahi_log_info("Network interface enumeration completed.");
         }
-        
+
     } else if (n->nlmsg_type == NLMSG_ERROR &&
                (n->nlmsg_seq == m->osdep.query_link_seq || n->nlmsg_seq == m->osdep.query_addr_seq)) {
         struct nlmsgerr *e = NLMSG_DATA (n);
 
         /* Some kind of error happened. Let's just tell the user and
          * ignore it otherwise */
-        
+
         if (e->error)
             avahi_log_warn("NETLINK: Failed to browse: %s", strerror(-e->error));
     }
@@ -317,7 +315,7 @@ int avahi_interface_monitor_init_osdep(AvahiInterfaceMonitor *m) {
     assert(m);
 
     /* Initialize our own data */
-    
+
     m->osdep.netlink = NULL;
     m->osdep.query_addr_seq = m->osdep.query_link_seq = 0;
 
@@ -361,7 +359,7 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
 
     /* Let's handle netlink events until we are done with wild
      * dumping */
-    
+
     while (!m->list_complete)
         if (!avahi_netlink_work(m->osdep.netlink, 1) == 0)
             break;
index eed648c8565a248e9ccc99cfe7f0aeaf4ff9e5ca..677f86dd7c6b561692edd1a4733edd241467c1b5 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooifacelinuxhfoo
 #define fooifacelinuxhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -28,9 +26,9 @@ typedef struct AvahiInterfaceMonitorOSDep AvahiInterfaceMonitorOSDep;
 
 struct AvahiInterfaceMonitorOSDep {
     AvahiNetlink *netlink;
-        
+
     unsigned query_addr_seq, query_link_seq;
-    
+
     enum {
         LIST_IFACE,
         LIST_ADDR,
index 391081eeca6d2318e25729848cc4bb085afae527..9a2e953398e6d03dacaae7bd515937dbd44f9063 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -48,8 +46,8 @@
 #include "iface-pfroute.h"
 #include "util.h"
 
-static int bitcount (unsigned int n)  
-{  
+static int bitcount (unsigned int n)
+{
   int count=0 ;
   while (n)
     {
@@ -64,39 +62,39 @@ static void rtm_info(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
   AvahiHwInterface *hw;
   struct if_msghdr *ifm = (struct if_msghdr *)rtm;
   struct sockaddr_dl *sdl = (struct sockaddr_dl *)(ifm + 1);
-  
+
   if (sdl->sdl_family != AF_LINK)
     return;
-  
+
   if (ifm->ifm_addrs == 0 && ifm->ifm_index > 0) {
     if (!(hw = avahi_interface_monitor_get_hw_interface(m, (AvahiIfIndex) ifm->ifm_index)))
       return;
     avahi_hw_interface_free(hw, 0);
     return;
   }
-  
+
   if (!(hw = avahi_interface_monitor_get_hw_interface(m, ifm->ifm_index)))
     if (!(hw = avahi_hw_interface_new(m, (AvahiIfIndex) ifm->ifm_index)))
       return; /* OOM */
-  
+
   hw->flags_ok =
     (ifm->ifm_flags & IFF_UP) &&
     (!m->server->config.use_iff_running || (ifm->ifm_flags & IFF_RUNNING)) &&
     !(ifm->ifm_flags & IFF_LOOPBACK) &&
     (ifm->ifm_flags & IFF_MULTICAST) &&
     (m->server->config.allow_point_to_point || !(ifm->ifm_flags & IFF_POINTOPOINT));
-  
+
   avahi_free(hw->name);
   hw->name = avahi_strndup(sdl->sdl_data, sdl->sdl_nlen);
-      
+
   hw->mtu = ifm->ifm_data.ifi_mtu;
-  
+
   hw->mac_address_size = sdl->sdl_alen;
   if (hw->mac_address_size > AVAHI_MAC_ADDRESS_MAX)
     hw->mac_address_size = AVAHI_MAC_ADDRESS_MAX;
-  
+
   memcpy(hw->mac_address, sdl->sdl_data + sdl->sdl_nlen, hw->mac_address_size);
+
 /*   { */
 /*     char mac[256]; */
 /*     avahi_log_debug("======\n name: %s\n index:%d\n mtu:%d\n mac:%s\n flags_ok:%d\n======",  */
@@ -105,7 +103,7 @@ static void rtm_info(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
 /*                 avahi_format_mac_address(mac, sizeof(mac), hw->mac_address, hw->mac_address_size), */
 /*                 hw->flags_ok); */
 /*   } */
-  
+
   avahi_hw_interface_check_relevant(hw);
   avahi_hw_interface_update_rrs(hw, 0);
 }
@@ -155,14 +153,14 @@ static void rtm_addr(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
     return;
 
   raddr.proto = avahi_af_to_proto(sa->sa_family);
-  
+
   for(cp = cp0, i = 0; i < RTAX_MAX; i++)
     {
       if (!(ifam->ifam_addrs & (1<<i)))
        continue;
       sa = (struct sockaddr *)cp;
 #ifdef HAVE_SYS_SYSCTL_H
-      if (sa->sa_len == 0) 
+      if (sa->sa_len == 0)
        continue;
 #endif
       switch(sa->sa_family) {
@@ -231,7 +229,7 @@ static void rtm_addr(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
        return;
       avahi_interface_address_free(addriface);
     }
-  
+
   avahi_interface_check_relevant(iface);
   avahi_interface_update_rrs(iface, 0);
 }
@@ -240,7 +238,7 @@ static void parse_rtmsg(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
 {
   assert(m);
   assert(rtm);
-  
+
   if (rtm->rtm_version != RTM_VERSION) {
     avahi_log_warn("routing message version %d not understood",
                   rtm->rtm_version);
@@ -301,15 +299,15 @@ int avahi_interface_monitor_init_osdep(AvahiInterfaceMonitor *m) {
     }
     m->osdep.pfroute->fd = fd;
 
-    if (!(m->osdep.pfroute->watch = m->server->poll_api->watch_new(m->server->poll_api, 
-                                                                  m->osdep.pfroute->fd, 
-                                                                  AVAHI_WATCH_IN, 
-                                                                  socket_event, 
+    if (!(m->osdep.pfroute->watch = m->server->poll_api->watch_new(m->server->poll_api,
+                                                                  m->osdep.pfroute->fd,
+                                                                  AVAHI_WATCH_IN,
+                                                                  socket_event,
                                                                   m))) {
       avahi_log_error(__FILE__": Failed to create watch.");
       goto fail;
     }
-    
+
     return 0;
 
 fail:
@@ -317,10 +315,10 @@ fail:
     if (m->osdep.pfroute) {
       if (m->osdep.pfroute->watch)
         m->server->poll_api->watch_free(m->osdep.pfroute->watch);
-      
+
       if (fd >= 0)
         close(fd);
-      
+
       m->osdep.pfroute = NULL;
     }
 
@@ -333,7 +331,7 @@ void avahi_interface_monitor_free_osdep(AvahiInterfaceMonitor *m) {
     if (m->osdep.pfroute) {
       if (m->osdep.pfroute->watch)
         m->server->poll_api->watch_free(m->osdep.pfroute->watch);
-      
+
       if (m->osdep.pfroute->fd >= 0)
         close(m->osdep.pfroute->fd);
 
@@ -423,7 +421,7 @@ static void if_add_interface(struct lifreq *lifreq, AvahiInterfaceMonitor *m, in
     index = if_nametoindex(lifreq->lifr_name);
 
     if (!(hw = avahi_interface_monitor_get_hw_interface(m, (AvahiIfIndex) index))) {
-        if (!(hw = avahi_hw_interface_new(m, (AvahiIfIndex) index))) 
+        if (!(hw = avahi_hw_interface_new(m, (AvahiIfIndex) index)))
             return; /* OOM */
 
         hw->flags_ok =
@@ -445,7 +443,7 @@ static void if_add_interface(struct lifreq *lifreq, AvahiInterfaceMonitor *m, in
             return; /* OOM */
 
     addriface->global_scope = 1;
-    
+
     avahi_hw_interface_check_relevant(hw);
     avahi_hw_interface_update_rrs(hw, 0);
 }
@@ -459,7 +457,7 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
   struct rt_msghdr *rtm;
 
   assert(m);
-  
+
  retry2:
   mib[0] = CTL_NET;
   mib[1] = PF_ROUTE;
@@ -492,7 +490,7 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
     rtm = (struct rt_msghdr *)next;
     parse_rtmsg(rtm, m);
   }
-  
+
   m->list_complete = 1;
   avahi_interface_monitor_check_relevant(m);
   avahi_interface_monitor_update_rrs(m, 0);
index 34098da492d4351ae56ed52900ab246521697cb2..3766cb06c697f138ab4c9f590efd19da99a48ede 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooifacepfroutehfoo
 #define fooifacepfroutehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 5fbfc199c6c4fe9a7439f920c5d9b3f20baaca77..0736df4753e343aeb9bd52207e3eaafa73202816 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 4106ea7b717739096d9c8fd911af437f1412d56b..466c16a447ad9bfa50a1f84249ac7f23cffe5071 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooifacehfoo
 #define fooifacehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -47,9 +45,9 @@ typedef struct AvahiHwInterface AvahiHwInterface;
 #else
 typedef struct AvahiInterfaceMonitorOSDep AvahiInterfaceMonitorOSDep;
 struct AvahiInterfaceMonitorOSDep {
-        
+
     unsigned query_addr_seq, query_link_seq;
-    
+
     enum {
         LIST_IFACE,
         LIST_ADDR,
@@ -79,7 +77,7 @@ struct AvahiHwInterface {
     char *name;
     AvahiIfIndex index;
     int flags_ok;
-    
+
     unsigned mtu;
 
     uint8_t mac_address[AVAHI_MAC_ADDRESS_MAX];
@@ -96,7 +94,7 @@ struct AvahiInterface {
 
     AVAHI_LLIST_FIELDS(AvahiInterface, interface);
     AVAHI_LLIST_FIELDS(AvahiInterface, by_hardware);
-    
+
     AvahiProtocol protocol;
     int announcing;
     AvahiAddress local_mcast_address;
@@ -125,7 +123,7 @@ struct AvahiInterfaceAddress {
     unsigned prefix_len;
 
     int global_scope;
-    
+
     AvahiSEntryGroup *entry_group;
 };
 
index d0a10d665161b2b2c3f2bd022db619e007c0cdda..a4b10ed2f762c1fdc3cedd2b90c8112027c0f8b2 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foointernalhfoo
 #define foointernalhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -53,7 +51,7 @@ typedef struct AvahiLegacyUnicastReflectSlot AvahiLegacyUnicastReflectSlot;
 
 struct AvahiLegacyUnicastReflectSlot {
     AvahiServer *server;
-    
+
     uint16_t id, original_id;
     AvahiAddress address;
     uint16_t port;
@@ -67,7 +65,7 @@ struct AvahiEntry {
     AvahiSEntryGroup *group;
 
     int dead;
-    
+
     AvahiPublishFlags flags;
     AvahiRecord *record;
     AvahiIfIndex interface;
@@ -76,7 +74,7 @@ struct AvahiEntry {
     AVAHI_LLIST_FIELDS(AvahiEntry, entries);
     AVAHI_LLIST_FIELDS(AvahiEntry, by_key);
     AVAHI_LLIST_FIELDS(AvahiEntry, by_group);
-    
+
     AVAHI_LLIST_HEAD(AvahiAnnouncer, announcers);
 };
 
@@ -89,20 +87,20 @@ struct AvahiSEntryGroup {
     AvahiSEntryGroupCallback callback;
 
     unsigned n_probing;
-    
+
     unsigned n_register_try;
     struct timeval register_time;
     AvahiTimeEvent *register_time_event;
 
     struct timeval established_at;
-    
+
     AVAHI_LLIST_FIELDS(AvahiSEntryGroup, groups);
     AVAHI_LLIST_HEAD(AvahiEntry, entries);
 };
 
 struct AvahiServer {
     const AvahiPoll *poll_api;
-    
+
     AvahiInterfaceMonitor *monitor;
     AvahiServerConfig config;
 
@@ -110,7 +108,7 @@ struct AvahiServer {
     AvahiHashmap *entries_by_key;
 
     AVAHI_LLIST_HEAD(AvahiSEntryGroup, groups);
-    
+
     AVAHI_LLIST_HEAD(AvahiSRecordBrowser, record_browsers);
     AvahiHashmap *record_browser_hashmap;
     AVAHI_LLIST_HEAD(AvahiSHostNameResolver, host_name_resolvers);
@@ -122,9 +120,9 @@ struct AvahiServer {
     AVAHI_LLIST_HEAD(AvahiSDNSServerBrowser, dns_server_browsers);
 
     int need_entry_cleanup, need_group_cleanup, need_browser_cleanup;
-    
+
     AvahiTimeEventQueue *time_event_queue;
-    
+
     char *host_name, *host_name_fqdn, *domain_name;
 
     int fd_ipv4, fd_ipv6,
@@ -189,8 +187,8 @@ int avahi_server_add_ptr(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    uint32_t ttl,          
-    const char *name,      
+    uint32_t ttl,
+    const char *name,
     const char *dest);
 
 #define AVAHI_CHECK_VALIDITY(server, expression, error) { \
index bfd40217b4319a2a5bb1dceab560712640df8f20..d1107657f2485d41253c00324a0f0125a5d3c266 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -36,9 +34,9 @@ void avahi_set_log_function(AvahiLogFunction function) {
 
 void avahi_log_ap(AvahiLogLevel level, const char*format, va_list ap) {
     char txt[256];
-    
+
     vsnprintf(txt, sizeof(txt), format, ap);
-    
+
     if (log_function)
         log_function(level, txt);
     else
index 25e394013a120182d601c1ef338c1ecd47618660..878f07a4682dc67d098407191a8ba9e039c55f27 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foologhfoo
 #define foologhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 0ce6fe80ef9aff40dea06a3456dbda0d5d096e79..06dec6ee238e0f666cd404422f181d2d674a257a 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foolookuphfoo
 #define foolookuphfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -80,7 +78,7 @@ void avahi_s_record_browser_free(AvahiSRecordBrowser *b);
 /** Callback prototype for AvahiSHostNameResolver events */
 typedef void (*AvahiSHostNameResolverCallback)(
     AvahiSHostNameResolver *r,
-    AvahiIfIndex interface,  
+    AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiResolverEvent event, /**< Resolving event */
     const char *host_name,   /**< Host name which should be resolved. May differ in case from the query */
@@ -108,7 +106,7 @@ typedef void (*AvahiSAddressResolverCallback)(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiResolverEvent event,
-    const AvahiAddress *a,   
+    const AvahiAddress *a,
     const char *host_name,   /**< A host name for the specified address, if one was found, i.e. event == AVAHI_RESOLVER_FOUND */
     AvahiLookupResultFlags flags,  /**< Lookup flags */
     void* userdata);
index c3afcb0094e8fd3391ae3ed15e194dfefcb6a9df..75988bfcd5434c154429f6664f828f7bbcd667f4 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -41,17 +39,17 @@ struct AvahiMulticastLookup {
     int dead;
 
     AvahiKey *key, *cname_key;
-    
+
     AvahiMulticastLookupCallback callback;
     void *userdata;
 
     AvahiIfIndex interface;
     AvahiProtocol protocol;
-    
+
     int queriers_added;
 
     AvahiTimeEvent *all_for_now_event;
-    
+
     AVAHI_LLIST_FIELDS(AvahiMulticastLookup, lookups);
     AVAHI_LLIST_FIELDS(AvahiMulticastLookup, by_key);
 };
@@ -85,10 +83,10 @@ AvahiMulticastLookup *avahi_multicast_lookup_new(
     AvahiKey *key,
     AvahiMulticastLookupCallback callback,
     void *userdata) {
-    
+
     AvahiMulticastLookup *l, *t;
     struct timeval tv;
-        
+
     assert(e);
     assert(AVAHI_IF_VALID(interface));
     assert(AVAHI_PROTO_VALID(protocol));
@@ -121,7 +119,7 @@ AvahiMulticastLookup *avahi_multicast_lookup_new(
 
     /* Issue the ALL_FOR_NOW event one second after the querier was initially created */
     l->all_for_now_event = avahi_time_event_new(e->server->time_event_queue, &tv, all_for_now_callback, l);
-    
+
     return l;
 }
 
@@ -146,7 +144,7 @@ static void lookup_destroy(AvahiMulticastLookup *l) {
     assert(l);
 
     lookup_stop(l);
-    
+
     t = avahi_hashmap_lookup(l->engine->lookups_by_key, l->key);
     AVAHI_LLIST_REMOVE(AvahiMulticastLookup, by_key, t, l);
     if (t)
@@ -161,7 +159,7 @@ static void lookup_destroy(AvahiMulticastLookup *l) {
 
     if (l->cname_key)
         avahi_key_unref(l->cname_key);
-    
+
     avahi_free(l);
 }
 
@@ -179,13 +177,13 @@ void avahi_multicast_lookup_free(AvahiMulticastLookup *l) {
 void avahi_multicast_lookup_engine_cleanup(AvahiMulticastLookupEngine *e) {
     AvahiMulticastLookup *l, *n;
     assert(e);
-    
+
     while (e->cleanup_dead) {
         e->cleanup_dead = 0;
-        
+
         for (l = e->lookups; l; l = n) {
             n = l->lookups_next;
-            
+
             if (l->dead)
                 lookup_destroy(l);
         }
@@ -219,7 +217,7 @@ static void* scan_cache_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEnt
         cbdata->userdata);
 
     cbdata->n_found ++;
-    
+
     return NULL;
 }
 
@@ -231,12 +229,12 @@ static void scan_interface_callback(AvahiInterfaceMonitor *m, AvahiInterface *i,
     assert(cbdata);
 
     cbdata->interface = i;
-    
+
     avahi_cache_walk(i->cache, cbdata->key, scan_cache_callback, cbdata);
 
     if (cbdata->cname_key)
         avahi_cache_walk(i->cache, cbdata->cname_key, scan_cache_callback, cbdata);
-    
+
     cbdata->interface = NULL;
 }
 
@@ -247,9 +245,9 @@ unsigned avahi_multicast_lookup_engine_scan_cache(
     AvahiKey *key,
     AvahiMulticastLookupCallback callback,
     void *userdata) {
-    
+
     struct cbdata cbdata;
-    
+
     assert(e);
     assert(key);
     assert(callback);
@@ -264,9 +262,9 @@ unsigned avahi_multicast_lookup_engine_scan_cache(
     cbdata.userdata = userdata;
     cbdata.interface = NULL;
     cbdata.n_found = 0;
-    
+
     avahi_interface_monitor_walk(e->server->monitor, interface, protocol, scan_interface_callback, &cbdata);
-    
+
     if (cbdata.cname_key)
         avahi_key_unref(cbdata.cname_key);
 
@@ -275,12 +273,12 @@ unsigned avahi_multicast_lookup_engine_scan_cache(
 
 void avahi_multicast_lookup_engine_new_interface(AvahiMulticastLookupEngine *e, AvahiInterface *i) {
     AvahiMulticastLookup *l;
-    
+
     assert(e);
     assert(i);
 
     for (l = e->lookups; l; l = l->lookups_next) {
-        
+
         if (l->dead || !l->callback)
             continue;
 
@@ -291,7 +289,7 @@ void avahi_multicast_lookup_engine_new_interface(AvahiMulticastLookupEngine *e,
 
 void avahi_multicast_lookup_engine_notify(AvahiMulticastLookupEngine *e, AvahiInterface *i, AvahiRecord *record, AvahiBrowserEvent event) {
     AvahiMulticastLookup *l;
-    
+
     assert(e);
     assert(record);
     assert(i);
@@ -313,7 +311,7 @@ void avahi_multicast_lookup_engine_notify(AvahiMulticastLookupEngine *e, AvahiIn
 
             if (l->dead || !l->callback)
                 continue;
-            
+
             if ((key = avahi_key_new_cname(l->key))) {
                 if (avahi_key_equal(record->key, key))
                     l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_RESULT_MULTICAST, record, l->userdata);
@@ -326,9 +324,9 @@ void avahi_multicast_lookup_engine_notify(AvahiMulticastLookupEngine *e, AvahiIn
 
 AvahiMulticastLookupEngine *avahi_multicast_lookup_engine_new(AvahiServer *s) {
     AvahiMulticastLookupEngine *e;
-    
+
     assert(s);
-    
+
     e = avahi_new(AvahiMulticastLookupEngine, 1);
     e->server = s;
     e->cleanup_dead = 0;
index 43e240db86550737cfaa2d45b4e934be0f304a2e..270766647ac8c66ac5e46cbb0946ca7271dbd716 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foomulticastlookuphfoo
 #define foomulticastlookuphfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 5050801de831eebe5f9457723bfbd4e1fa690848..4ded5ec7de371f34c642fc8af8f00febf9c4c1c7 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -53,7 +51,7 @@ int avahi_netlink_work(AvahiNetlink *nl, int block) {
     struct iovec iov;
     struct nlmsghdr *p;
     char cred_msg[CMSG_SPACE(sizeof(struct ucred))];
-    
+
     assert(nl);
 
     iov.iov_base = nl->buffer;
@@ -70,7 +68,7 @@ int avahi_netlink_work(AvahiNetlink *nl, int block) {
     if ((bytes = recvmsg(nl->fd, &smsg, 0)) < 0) {
         if (errno == EAGAIN || errno == EINTR)
             return 0;
-        
+
         avahi_log_error(__FILE__": recvmsg() failed: %s", strerror(errno));
         return -1;
     }
@@ -88,18 +86,18 @@ int avahi_netlink_work(AvahiNetlink *nl, int block) {
         return -1;
 
     p = (struct nlmsghdr *) nl->buffer;
-    
+
     assert(nl->callback);
-    
+
     for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
         if (!NLMSG_OK(p, (size_t) bytes)) {
             avahi_log_warn(__FILE__": packet truncated");
             return -1;
         }
-        
+
         nl->callback(nl, p, nl->userdata);
     }
-    
+
     return 0;
 }
 
@@ -126,7 +124,7 @@ AvahiNetlink *avahi_netlink_new(const AvahiPoll *poll_api, uint32_t groups, void
         avahi_log_error(__FILE__": socket(PF_NETLINK): %s", strerror(errno));
         return NULL;
     }
-    
+
     memset(&addr, 0, sizeof(addr));
     addr.nl_family = AF_NETLINK;
     addr.nl_groups = groups;
@@ -162,7 +160,7 @@ AvahiNetlink *avahi_netlink_new(const AvahiPoll *poll_api, uint32_t groups, void
         avahi_log_error(__FILE__": Failed to create watch.");
         goto fail;
     }
-    
+
     return nl;
 
 fail:
@@ -186,7 +184,7 @@ void avahi_netlink_free(AvahiNetlink *nl) {
 
     if (nl->fd >= 0)
         close(nl->fd);
-    
+
     avahi_free(nl->buffer);
     avahi_free(nl);
 }
@@ -194,7 +192,7 @@ void avahi_netlink_free(AvahiNetlink *nl) {
 int avahi_netlink_send(AvahiNetlink *nl, struct nlmsghdr *m, unsigned *ret_seq) {
     assert(nl);
     assert(m);
-    
+
     m->nlmsg_seq = nl->seq++;
     m->nlmsg_flags |= NLM_F_ACK;
 
index 8f2f8cbbd93c61dd062214f03f9053d88ceec22b..9c6eb281d3e39eb44163a8c9e18358f37fca3c50 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foonetlinkhfoo
 #define foonetlinkhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index d85a2221f6e32f0ee336ffd84250f70dba87650d..6d0fd62f35314eeebdca339442ecebb268c45f35 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -32,8 +30,8 @@
 
 #include "prioq.h"
 
-#define POINTER_TO_INT(p) ((int) (p))
-#define INT_TO_POINTER(i) ((void*) (i))
+#define POINTER_TO_INT(p) ((int) (long) (p))
+#define INT_TO_POINTER(i) ((void*) (long) (i))
 
 static int compare_int(const void* a, const void* b) {
     int i = POINTER_TO_INT(a), j = POINTER_TO_INT(b);
@@ -69,7 +67,7 @@ static void rec(AvahiPrioQueueNode *n) {
             assert(n->parent->right == NULL);
     }
 
-    
+
     if (n->parent) {
         int a = POINTER_TO_INT(n->parent->data), b = POINTER_TO_INT(n->data);
         if (a > b) {
@@ -101,12 +99,12 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
         assert(q->n_nodes == q2->n_nodes);
 
         printf("%i\n", POINTER_TO_INT(((AvahiPrioQueueNode*)q2->root->data)->data));
-        
+
         avahi_prio_queue_remove(q, q2->root->data);
         avahi_prio_queue_remove(q2, q2->root);
     }
 
-        
+
 /*     prev = 0; */
 /*     while (q->root) { */
 /*         int v = GPOINTER_TO_INT(q->root->data); */
index 8d91d8704570ac67e7c2dd5f44f5ac1a74a51774..28b50189dae7d5e26d8edddd672aa9aff0cbdab8 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -36,11 +34,11 @@ AvahiPrioQueue* avahi_prio_queue_new(AvahiPQCompareFunc compare) {
 
     if (!(q = avahi_new(AvahiPrioQueue, 1)))
         return NULL; /* OOM */
-    
+
     q->root = q->last = NULL;
     q->n_nodes = 0;
     q->compare = compare;
-    
+
     return q;
 }
 
@@ -64,7 +62,7 @@ static AvahiPrioQueueNode* get_node_at_xy(AvahiPrioQueue *q, unsigned x, unsigne
 
     for (r = 0; r < y; r++) {
         assert(n);
-        
+
         if ((x >> (y-r-1)) & 1)
             n = n->right;
         else
@@ -91,7 +89,7 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
 
     if (a->parent == b) {
         /* B is parent of A */
-        
+
         p = b->parent;
         b->parent = a;
 
@@ -113,7 +111,7 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
                 a->right->parent = a;
             if ((b->right = r))
                 b->right->parent = b;
-            
+
         } else {
             if ((b->right = a->right))
                 b->right->parent = b;
@@ -127,7 +125,7 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
         }
     } else if (b->parent == a) {
         /* A ist parent of B */
-        
+
         p = a->parent;
         a->parent = b;
 
@@ -162,7 +160,7 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
         }
     } else {
         AvahiPrioQueueNode *apl = NULL, *bpl = NULL;
-        
+
         /* Swap parents */
         ap = a->parent;
         bp = b->parent;
@@ -171,15 +169,15 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
             apl = ap->left;
         if (bp)
             bpl = bp->left;
-        
+
         if ((a->parent = bp)) {
             if (bpl == b)
                 bp->left = a;
-            else 
+            else
                 bp->right = a;
         } else
             q->root = a;
-                
+
         if ((b->parent = ap)) {
             if (apl == a)
                 ap->left = b;
@@ -189,8 +187,8 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
             q->root = b;
 
         /* Swap children */
-        l = a->left; 
-        r = a->right; 
+        l = a->left;
+        r = a->right;
 
         if ((a->left = b->left))
             a->left->parent = a;
@@ -204,7 +202,7 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
         if ((b->right = r))
             b->right->parent = b;
     }
-    
+
     /* Swap siblings */
     ap = a->prev; an = a->next;
     bp = b->prev; bn = b->next;
@@ -221,7 +219,7 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
 
         if ((b->prev = ap))
             b->prev->next = b;
-        
+
     } else if (b->next == a) {
         /* B is predecessor of A */
         a->next = b;
@@ -240,15 +238,15 @@ static void exchange_nodes(AvahiPrioQueue *q, AvahiPrioQueueNode *a, AvahiPrioQu
 
         if ((a->prev = bp))
             a->prev->next = a;
-        
+
         if ((a->next = bn))
             a->next->prev = a;
         else
             q->last = a;
-        
+
         if ((b->prev = ap))
             b->prev->next = b;
-        
+
         if ((b->next = an))
             b->next->prev = b;
         else
@@ -295,14 +293,14 @@ AvahiPrioQueueNode* avahi_prio_queue_put(AvahiPrioQueue *q, void* data) {
 
     if (!(n = avahi_new(AvahiPrioQueueNode, 1)))
         return NULL; /* OOM */
-    
+
     n->queue = q;
     n->data = data;
 
     if (q->last) {
         assert(q->root);
         assert(q->n_nodes);
-         
+
         n->y = q->last->y;
         n->x = q->last->x+1;
 
@@ -313,7 +311,7 @@ AvahiPrioQueueNode* avahi_prio_queue_put(AvahiPrioQueue *q, void* data) {
 
         q->last->next = n;
         n->prev = q->last;
-        
+
         assert(n->y > 0);
         n->parent = get_node_at_xy(q, n->x/2, n->y-1);
 
@@ -324,7 +322,7 @@ AvahiPrioQueueNode* avahi_prio_queue_put(AvahiPrioQueue *q, void* data) {
     } else {
         assert(!q->root);
         assert(!q->n_nodes);
-        
+
         n->y = n->x = 0;
         q->root = n;
         n->prev = n->parent = NULL;
@@ -358,7 +356,7 @@ void avahi_prio_queue_remove(AvahiPrioQueue *q, AvahiPrioQueueNode *n) {
     assert(!n->right);
 
     q->last = n->prev;
-    
+
     if (n->prev) {
         n->prev->next = NULL;
         assert(n->parent);
index ace92f632bafb1be3e50549ab8684023a14b59a8..b3d31eb58b7316030664e3988e68c895f1c202fb 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooprioqhfoo
 #define fooprioqhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 106bb8135fda21b15bac6aa9744b036f4095e721..1e63411ce167fb585ee5f9a8bf2de35260e5c666 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -41,13 +39,13 @@ typedef struct AvahiProbeJob AvahiProbeJob;
 struct AvahiProbeJob {
     AvahiProbeScheduler *scheduler;
     AvahiTimeEvent *time_event;
-    
+
     int chosen; /* Use for packet assembling */
     int done;
     struct timeval delivery;
 
     AvahiRecord *record;
-    
+
     AVAHI_LLIST_FIELDS(AvahiProbeJob, jobs);
 };
 
@@ -61,7 +59,7 @@ struct AvahiProbeScheduler {
 
 static AvahiProbeJob* job_new(AvahiProbeScheduler *s, AvahiRecord *record, int done) {
     AvahiProbeJob *pj;
-    
+
     assert(s);
     assert(record);
 
@@ -69,7 +67,7 @@ static AvahiProbeJob* job_new(AvahiProbeScheduler *s, AvahiRecord *record, int d
         avahi_log_error(__FILE__": Out of memory");
         return NULL; /* OOM */
     }
-    
+
     pj->scheduler = s;
     pj->record = avahi_record_ref(record);
     pj->time_event = NULL;
@@ -138,13 +136,13 @@ AvahiProbeScheduler *avahi_probe_scheduler_new(AvahiInterface *i) {
         avahi_log_error(__FILE__": Out of memory");
         return NULL;
     }
-        
+
     s->interface = i;
     s->time_event_queue = i->monitor->server->time_event_queue;
 
     AVAHI_LLIST_HEAD_INIT(AvahiProbeJob, s->jobs);
     AVAHI_LLIST_HEAD_INIT(AvahiProbeJob, s->history);
-    
+
     return s;
 }
 
@@ -157,13 +155,13 @@ void avahi_probe_scheduler_free(AvahiProbeScheduler *s) {
 
 void avahi_probe_scheduler_clear(AvahiProbeScheduler *s) {
     assert(s);
-    
+
     while (s->jobs)
         job_free(s, s->jobs);
     while (s->history)
         job_free(s, s->history);
 }
+
 static int packet_add_probe_query(AvahiProbeScheduler *s, AvahiDnsPacket *p, AvahiProbeJob *pj) {
     size_t size;
     AvahiKey *k;
@@ -174,7 +172,7 @@ static int packet_add_probe_query(AvahiProbeScheduler *s, AvahiDnsPacket *p, Ava
     assert(pj);
 
     assert(!pj->chosen);
-    
+
     /* Estimate the size for this record */
     size =
         avahi_key_get_estimate_size(pj->record->key) +
@@ -187,7 +185,7 @@ static int packet_add_probe_query(AvahiProbeScheduler *s, AvahiDnsPacket *p, Ava
     /* Create the probe query */
     if (!(k = avahi_key_new(pj->record->key->name, pj->record->key->clazz, AVAHI_DNS_TYPE_ANY)))
         return 0; /* OOM */
-            
+
     b = !!avahi_dns_packet_append_key(p, k, 0);
     assert(b);
 
@@ -202,7 +200,7 @@ static int packet_add_probe_query(AvahiProbeScheduler *s, AvahiDnsPacket *p, Ava
         /* Does the record match the probe? */
         if (k->clazz != pj->record->key->clazz || !avahi_domain_equal(k->name, pj->record->key->name))
             continue;
-        
+
         /* This job wouldn't fit in */
         if (avahi_record_get_estimate_size(pj->record) > avahi_dns_packet_space(p))
             break;
@@ -212,7 +210,7 @@ static int packet_add_probe_query(AvahiProbeScheduler *s, AvahiDnsPacket *p, Ava
     }
 
     avahi_key_unref(k);
-            
+
     return 1;
 }
 
@@ -234,7 +232,7 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
     if (!(p = avahi_dns_packet_new_query(s->interface->hardware->mtu)))
         return; /* OOM */
     n = 1;
-    
+
     /* Add the import probe */
     if (!packet_add_probe_query(s, p, pj)) {
         size_t size;
@@ -249,7 +247,7 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
             avahi_key_get_estimate_size(pj->record->key) +
             avahi_record_get_estimate_size(pj->record) +
             AVAHI_DNS_PACKET_HEADER_SIZE;
-        
+
         if (!(p = avahi_dns_packet_new_query(size + AVAHI_DNS_PACKET_EXTRA_SIZE)))
             return; /* OOM */
 
@@ -257,7 +255,7 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
             avahi_dns_packet_free(p);
             return;  /* OOM */
         }
-        
+
         b = avahi_dns_packet_append_key(p, k, 0) && avahi_dns_packet_append_record(p, pj->record, 0, 0);
         avahi_key_unref(k);
 
@@ -266,8 +264,8 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
             avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_QDCOUNT, 1);
             avahi_interface_send_packet(s->interface, p);
         } else
-            avahi_log_warn("Probe record too large, cannot send");   
-        
+            avahi_log_warn("Probe record too large, cannot send");
+
         avahi_dns_packet_free(p);
         job_mark_done(s, pj);
 
@@ -279,10 +277,10 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
 
         if (pj->chosen)
             continue;
-        
+
         if (!packet_add_probe_query(s, p, pj))
             break;
-        
+
         n++;
     }
 
@@ -304,15 +302,15 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
             /* Unmark all following jobs */
             for (; pj; pj = pj->jobs_next)
                 pj->chosen = 0;
-            
+
             break;
         }
 
         job_mark_done(s, pj);
-        
+
         n ++;
     }
-    
+
     avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_NSCOUNT, n);
 
     /* Send it now */
@@ -328,7 +326,7 @@ static AvahiProbeJob* find_scheduled_job(AvahiProbeScheduler *s, AvahiRecord *re
 
     for (pj = s->jobs; pj; pj = pj->jobs_next) {
         assert(!pj->done);
-        
+
         if (avahi_record_equal_no_ttl(pj->record, record))
             return pj;
     }
@@ -338,7 +336,7 @@ static AvahiProbeJob* find_scheduled_job(AvahiProbeScheduler *s, AvahiRecord *re
 
 static AvahiProbeJob* find_history_job(AvahiProbeScheduler *s, AvahiRecord *record) {
     AvahiProbeJob *pj;
-    
+
     assert(s);
     assert(record);
 
@@ -353,7 +351,7 @@ static AvahiProbeJob* find_history_job(AvahiProbeScheduler *s, AvahiRecord *reco
                 job_free(s, pj);
                 return NULL;
             }
-                
+
             return pj;
         }
     }
@@ -364,7 +362,7 @@ static AvahiProbeJob* find_history_job(AvahiProbeScheduler *s, AvahiRecord *reco
 int avahi_probe_scheduler_post(AvahiProbeScheduler *s, AvahiRecord *record, int immediately) {
     AvahiProbeJob *pj;
     struct timeval tv;
-    
+
     assert(s);
     assert(record);
     assert(!avahi_key_is_pattern(record->key));
@@ -387,11 +385,11 @@ int avahi_probe_scheduler_post(AvahiProbeScheduler *s, AvahiRecord *record, int
         /* Create a new job and schedule it */
         if (!(pj = job_new(s, record, 0)))
             return 0; /* OOM */
-        
+
         pj->delivery = tv;
         pj->time_event = avahi_time_event_new(s->time_event_queue, &pj->delivery, elapse_callback, pj);
 
-        
+
 /*     avahi_log_debug("Accepted new probe job."); */
 
         return 1;
index 3af13191fcff9b66b6cb99c7c4a035b00c09d117..e47de415c336c6b4254dd588899ce70aef69d09d 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooprobeschedhfoo
 #define fooprobeschedhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 77c49afc95b3bda423792898dac73b83bce5059e..90797de57d199d0f0f3a010f20167395848bbb49 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foopublishhfoo
 #define foopublishhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -83,7 +81,7 @@ int avahi_server_add(
     AvahiProtocol protocol,   /**< A protocol family to attach this record to. One of the AVAHI_PROTO_xxx constants. Use AVAHI_PROTO_UNSPEC to make this record available on all protocols (wich means on both IPv4 and IPv6). */
     AvahiPublishFlags flags,    /**< Special flags for this record */
     AvahiRecord *r            /**< The record to add. This function increases the reference counter of this object. */);
-    
+
 /** Add an IP address mapping to the server. This will add both the
  * host-name-to-address and the reverse mapping to the server. See
  * avahi_server_add() for more information. If adding one of the RRs
@@ -114,7 +112,7 @@ int avahi_server_add_service(
     AvahiPublishFlags flags,
     const char *name,         /**< Service name, e.g. "Lennart's Files" */
     const char *type,         /**< DNS-SD type, e.g. "_http._tcp" */
-    const char *domain,       
+    const char *domain,
     const char *host,         /**< Host name where this servcie resides, or NULL if on the local host */
     uint16_t port,              /**< Port number of the service */
     ...  /**< Text records, terminated by NULL */) AVAHI_GCC_SENTINEL;
@@ -152,9 +150,9 @@ int avahi_server_update_service_txt_strlst(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     AvahiStringList *strlst);
 
 /** Update the TXT record for a service with the NULL termonate list of strings */
@@ -164,9 +162,9 @@ int avahi_server_update_service_txt(
     AvahiIfIndex interface,
     AvahiProtocol protocol,
     AvahiPublishFlags flags,
-    const char *name,     
-    const char *type,     
-    const char *domain,   
+    const char *name,
+    const char *type,
+    const char *domain,
     ...) AVAHI_GCC_SENTINEL;
 
 /** Check if there is a service locally defined and return the entry group it is attached to. Returns NULL if the service isn't local*/
index 1c28ea0ea962dc8248b53aeeb172b797f9d856c4..e1ce913dac02f06058d269316d2a642036e2d966 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -73,7 +71,7 @@ static void create_second_service_browser(AvahiTimeout *timeout, AVAHI_GCC_UNUSE
 
     service_browser2 = avahi_s_service_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, SERVICE_TYPE, DOMAIN, 0, sb_callback, NULL);
     assert(service_browser2);
-    
+
     poll_api->timeout_free(timeout);
 }
 
@@ -84,10 +82,10 @@ static void quit(AVAHI_GCC_UNUSED AvahiTimeout *timeout, AVAHI_GCC_UNUSED void *
 int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     struct timeval tv;
     AvahiServerConfig config;
-    
+
     simple_poll = avahi_simple_poll_new();
     assert(simple_poll);
-    
+
     poll_api = avahi_simple_poll_get(simple_poll);
     assert(poll_api);
 
@@ -100,25 +98,25 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     avahi_address_parse("192.168.50.1", AVAHI_PROTO_UNSPEC, &config.wide_area_servers[0]);
     config.n_wide_area_servers = 1;
     config.enable_wide_area = 1;
-    
+
     server = avahi_server_new(poll_api, &config, NULL, NULL, NULL);
     assert(server);
     avahi_server_config_free(&config);
 
     service_browser1 = avahi_s_service_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, SERVICE_TYPE, DOMAIN, 0, sb_callback, NULL);
     assert(service_browser1);
-    
+
     poll_api->timeout_new(poll_api, avahi_elapse_time(&tv, 10000, 0), create_second_service_browser, NULL);
 
     poll_api->timeout_new(poll_api, avahi_elapse_time(&tv, 60000, 0), quit, NULL);
 
-    
+
     for (;;)
         if (avahi_simple_poll_iterate(simple_poll, -1) != 0)
             break;
 
     avahi_server_free(server);
     avahi_simple_poll_free(simple_poll);
-    
+
     return 0;
 }
index 8a230cd7c886c003230b6c574e4c5ea30c9950e6..2b1c919b16d28a77db1a98d5af4306a1c7defbe9 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -47,7 +45,7 @@ struct AvahiQuerier {
 
     unsigned post_id;
     int post_id_valid;
-    
+
     AVAHI_LLIST_FIELDS(AvahiQuerier, queriers);
 };
 
@@ -59,14 +57,14 @@ void avahi_querier_free(AvahiQuerier *q) {
 
     avahi_key_unref(q->key);
     avahi_time_event_free(q->time_event);
-    
+
     avahi_free(q);
 }
 
 static void querier_elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void *userdata) {
     AvahiQuerier *q = userdata;
     struct timeval tv;
-    
+
     assert(q);
 
     if (q->n_used <= 0) {
@@ -84,15 +82,15 @@ static void querier_elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void *us
         /* The queue accepted our query. We store the query id here,
          * that allows us to drop the query at a later point if the
          * query is very short-lived. */
-        
+
         q->post_id_valid = 1;
     }
 
     q->sec_delay *= 2;
-    
+
     if (q->sec_delay >= 60*60)  /* 1h */
         q->sec_delay = 60*60;
-    
+
     avahi_elapse_time(&tv, q->sec_delay*1000, 0);
     avahi_time_event_update(q->time_event, &tv);
 }
@@ -100,12 +98,12 @@ static void querier_elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void *us
 void avahi_querier_add(AvahiInterface *i, AvahiKey *key, struct timeval *ret_ctime) {
     AvahiQuerier *q;
     struct timeval tv;
-    
+
     assert(i);
     assert(key);
-    
+
     if ((q = avahi_hashmap_lookup(i->queriers_by_key, key))) {
-        
+
         /* Someone is already browsing for records of this RR key */
         q->n_used++;
 
@@ -120,7 +118,7 @@ void avahi_querier_add(AvahiInterface *i, AvahiKey *key, struct timeval *ret_cti
     /* No one is browsing for this RR key, so we add a new querier */
     if (!(q = avahi_new(AvahiQuerier, 1)))
         return; /* OOM */
-    
+
     q->key = avahi_key_ref(key);
     q->interface = i;
     q->n_used = 1;
@@ -185,7 +183,7 @@ static void remove_querier_callback(AvahiInterfaceMonitor *m, AvahiInterface *i,
 void avahi_querier_remove_for_all(AvahiServer *s, AvahiIfIndex idx, AvahiProtocol protocol, AvahiKey *key) {
     assert(s);
     assert(key);
-    
+
     avahi_interface_monitor_walk(s->monitor, idx, protocol, remove_querier_callback, key);
 }
 
@@ -196,7 +194,7 @@ struct cbdata {
 
 static void add_querier_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, void* userdata) {
     struct cbdata *cbdata = userdata;
-    
+
     assert(m);
     assert(i);
     assert(cbdata);
@@ -212,7 +210,7 @@ static void add_querier_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, vo
 
 void avahi_querier_add_for_all(AvahiServer *s, AvahiIfIndex idx, AvahiProtocol protocol, AvahiKey *key, struct timeval *ret_ctime) {
     struct cbdata cbdata;
-    
+
     assert(s);
     assert(key);
 
@@ -221,13 +219,13 @@ void avahi_querier_add_for_all(AvahiServer *s, AvahiIfIndex idx, AvahiProtocol p
 
     if (ret_ctime)
         ret_ctime->tv_sec = ret_ctime->tv_usec = 0;
-    
+
     avahi_interface_monitor_walk(s->monitor, idx, protocol, add_querier_callback, &cbdata);
 }
 
 int avahi_querier_shall_refresh_cache(AvahiInterface *i, AvahiKey *key) {
     AvahiQuerier *q;
-    
+
     assert(i);
     assert(key);
 
@@ -237,19 +235,19 @@ int avahi_querier_shall_refresh_cache(AvahiInterface *i, AvahiKey *key) {
         /* This key is currently not subscribed at all, so no cache
          * refresh is needed */
         return 0;
-    
+
     if (q->n_used <= 0) {
 
         /* If this is an entry nobody references right now, don't
          * consider it "existing". */
-        
+
         /* Remove this querier since it is referenced by nobody
          * and the cached data will soon be out of date */
         avahi_querier_free(q);
 
         /* Tell the cache that no refresh is needed */
         return 0;
-        
+
     } else {
         struct timeval tv;
 
@@ -266,6 +264,6 @@ int avahi_querier_shall_refresh_cache(AvahiInterface *i, AvahiKey *key) {
 void avahi_querier_free_all(AvahiInterface *i) {
     assert(i);
 
-    while (i->queriers) 
+    while (i->queriers)
         avahi_querier_free(i->queriers);
 }
index 3f4eead8ebcc87a75a682951928b0dd5db259e0b..6a32a3b2fb165db67316aae6842f6701d5b8df55 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooquerierhfoo
 #define fooquerierhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 0319b02df06c47220b72916b3e31c542f99b2eb8..ff833f97b95c2fe3243c5961fecbd79f148a8e8b 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -40,10 +38,10 @@ typedef struct AvahiKnownAnswer AvahiKnownAnswer;
 struct AvahiQueryJob {
     unsigned id;
     int n_posted;
-    
+
     AvahiQueryScheduler *scheduler;
     AvahiTimeEvent *time_event;
-    
+
     int done;
     struct timeval delivery;
 
@@ -56,7 +54,7 @@ struct AvahiQueryJob {
      * entries) most of the time, but this might be a wrong
      * assumption, especially on setups where traffic reflection is
      * involved. */
-    
+
     AVAHI_LLIST_FIELDS(AvahiQueryJob, jobs);
 };
 
@@ -80,7 +78,7 @@ struct AvahiQueryScheduler {
 
 static AvahiQueryJob* job_new(AvahiQueryScheduler *s, AvahiKey *key, int done) {
     AvahiQueryJob *qj;
-    
+
     assert(s);
     assert(key);
 
@@ -88,14 +86,14 @@ static AvahiQueryJob* job_new(AvahiQueryScheduler *s, AvahiKey *key, int done) {
         avahi_log_error(__FILE__": Out of memory");
         return NULL;
     }
-    
+
     qj->scheduler = s;
     qj->key = avahi_key_ref(key);
     qj->time_event = NULL;
     qj->n_posted = 1;
     qj->id = s->next_id++;
-    
-    if ((qj->done = done)) 
+
+    if ((qj->done = done))
         AVAHI_LLIST_PREPEND(AvahiQueryJob, jobs, s->history, qj);
     else
         AVAHI_LLIST_PREPEND(AvahiQueryJob, jobs, s->jobs, qj);
@@ -158,11 +156,11 @@ AvahiQueryScheduler *avahi_query_scheduler_new(AvahiInterface *i) {
         avahi_log_error(__FILE__": Out of memory");
         return NULL; /* OOM */
     }
-    
+
     s->interface = i;
     s->time_event_queue = i->monitor->server->time_event_queue;
     s->next_id = 0;
-    
+
     AVAHI_LLIST_HEAD_INIT(AvahiQueryJob, s->jobs);
     AVAHI_LLIST_HEAD_INIT(AvahiQueryJob, s->history);
     AVAHI_LLIST_HEAD_INIT(AvahiKnownAnswer, s->known_answers);
@@ -180,7 +178,7 @@ void avahi_query_scheduler_free(AvahiQueryScheduler *s) {
 
 void avahi_query_scheduler_clear(AvahiQueryScheduler *s) {
     assert(s);
-    
+
     while (s->jobs)
         job_free(s, s->jobs);
     while (s->history)
@@ -190,7 +188,7 @@ void avahi_query_scheduler_clear(AvahiQueryScheduler *s) {
 static void* known_answer_walk_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void* userdata) {
     AvahiQueryScheduler *s = userdata;
     AvahiKnownAnswer *ka;
-    
+
     assert(c);
     assert(pattern);
     assert(e);
@@ -198,12 +196,12 @@ static void* known_answer_walk_callback(AvahiCache *c, AvahiKey *pattern, AvahiC
 
     if (avahi_cache_entry_half_ttl(c, e))
         return NULL;
-    
+
     if (!(ka = avahi_new0(AvahiKnownAnswer, 1))) {
         avahi_log_error(__FILE__": Out of memory");
         return NULL;
     }
-    
+
     ka->scheduler = s;
     ka->record = avahi_record_ref(e->record);
 
@@ -221,7 +219,7 @@ static int packet_add_query_job(AvahiQueryScheduler *s, AvahiDnsPacket *p, Avahi
 
     /* Add all matching known answers to the list */
     avahi_cache_walk(s->interface->cache, qj->key, known_answer_walk_callback, s);
-    
+
     job_mark_done(s, qj);
 
     return 1;
@@ -234,7 +232,7 @@ static void append_known_answers_and_send(AvahiQueryScheduler *s, AvahiDnsPacket
     assert(p);
 
     n = 0;
-    
+
     while ((ka = s->known_answers)) {
         int too_large = 0;
 
@@ -266,7 +264,7 @@ static void append_known_answers_and_send(AvahiQueryScheduler *s, AvahiDnsPacket
         if (!too_large)
             n++;
     }
-    
+
     avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_ANCOUNT, n);
     avahi_interface_send_packet(s->interface, p);
     avahi_dns_packet_free(p);
@@ -289,10 +287,10 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
     }
 
     assert(!s->known_answers);
-    
+
     if (!(p = avahi_dns_packet_new_query(s->interface->hardware->mtu)))
         return; /* OOM */
-    
+
     b = packet_add_query_job(s, p, qj);
     assert(b); /* An query must always fit in */
     n = 1;
@@ -320,7 +318,7 @@ static AvahiQueryJob* find_scheduled_job(AvahiQueryScheduler *s, AvahiKey *key)
 
     for (qj = s->jobs; qj; qj = qj->jobs_next) {
         assert(!qj->done);
-        
+
         if (avahi_key_equal(qj->key, key))
             return qj;
     }
@@ -330,7 +328,7 @@ static AvahiQueryJob* find_scheduled_job(AvahiQueryScheduler *s, AvahiKey *key)
 
 static AvahiQueryJob* find_history_job(AvahiQueryScheduler *s, AvahiKey *key) {
     AvahiQueryJob *qj;
-    
+
     assert(s);
     assert(key);
 
@@ -345,7 +343,7 @@ static AvahiQueryJob* find_history_job(AvahiQueryScheduler *s, AvahiKey *key) {
                 job_free(s, qj);
                 return NULL;
             }
-                
+
             return qj;
         }
     }
@@ -356,13 +354,13 @@ static AvahiQueryJob* find_history_job(AvahiQueryScheduler *s, AvahiKey *key) {
 int avahi_query_scheduler_post(AvahiQueryScheduler *s, AvahiKey *key, int immediately, unsigned *ret_id) {
     struct timeval tv;
     AvahiQueryJob *qj;
-    
+
     assert(s);
     assert(key);
 
     if ((qj = find_history_job(s, key)))
         return 0;
-    
+
     avahi_elapse_time(&tv, immediately ? 0 : AVAHI_QUERY_DEFER_MSEC, 0);
 
     if ((qj = find_scheduled_job(s, key))) {
@@ -376,25 +374,25 @@ int avahi_query_scheduler_post(AvahiQueryScheduler *s, AvahiKey *key, int immedi
         }
 
         qj->n_posted++;
-        
+
     } else {
 
         if (!(qj = job_new(s, key, 0)))
             return 0; /* OOM */
-        
+
         qj->delivery = tv;
         qj->time_event = avahi_time_event_new(s->time_event_queue, &qj->delivery, elapse_callback, qj);
     }
 
     if (ret_id)
         *ret_id = qj->id;
-    
+
     return 1;
 }
 
 void avahi_query_scheduler_incoming(AvahiQueryScheduler *s, AvahiKey *key) {
     AvahiQueryJob *qj;
-    
+
     assert(s);
     assert(key);
 
@@ -412,14 +410,14 @@ void avahi_query_scheduler_incoming(AvahiQueryScheduler *s, AvahiKey *key) {
     if (!(qj = find_history_job(s, key)))
         if (!(qj = job_new(s, key, 1)))
             return; /* OOM */
-    
+
     gettimeofday(&qj->delivery, NULL);
     job_set_elapse_time(s, qj, AVAHI_QUERY_HISTORY_MSEC, 0);
 }
 
 int avahi_query_scheduler_withdraw_by_id(AvahiQueryScheduler *s, unsigned id) {
     AvahiQueryJob *qj;
-    
+
     assert(s);
 
     /* Very short lived queries can withdraw an already scheduled item
@@ -428,7 +426,7 @@ int avahi_query_scheduler_withdraw_by_id(AvahiQueryScheduler *s, unsigned id) {
 
     for (qj = s->jobs; qj; qj = qj->jobs_next) {
         assert(!qj->done);
-        
+
         if (qj->id == id) {
             /* Entry found */
 
@@ -441,7 +439,7 @@ int avahi_query_scheduler_withdraw_by_id(AvahiQueryScheduler *s, unsigned id) {
                  * case since there should exist only one querier per
                  * key, but there are exceptions, notably reflected
                  * traffic.) */
-                
+
                 job_free(s, qj);
                 return 1;
             }
index 52385583afe1a86cb0083f4a8c4eca180c12e688..b45520c9629b3567f8955335673ff95f1b51e261 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooqueryschedhfoo
 #define fooqueryschedhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 25d21ace6e4f49be625c65cfae3c2f5eb5a2159a..dd4adbc45501f52c2f50e5120c7f0172193643c4 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -37,7 +35,7 @@
 struct AvahiSAddressResolver {
     AvahiServer *server;
     AvahiAddress address;
-    
+
     AvahiSRecordBrowser *record_browser;
 
     AvahiSAddressResolverCallback callback;
@@ -58,7 +56,7 @@ struct AvahiSAddressResolver {
 
 static void finish(AvahiSAddressResolver *r, AvahiResolverEvent event) {
     assert(r);
-    
+
     if (r->time_event) {
         avahi_time_event_free(r->time_event);
         r->time_event = NULL;
@@ -78,7 +76,7 @@ static void finish(AvahiSAddressResolver *r, AvahiResolverEvent event) {
 
 static void time_event_callback(AvahiTimeEvent *e, void *userdata) {
     AvahiSAddressResolver *r = userdata;
-    
+
     assert(e);
     assert(r);
 
@@ -105,53 +103,53 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSAddressResolver *r = userdata;
 
     assert(rr);
     assert(r);
 
     switch (event) {
-        case AVAHI_BROWSER_NEW: 
+        case AVAHI_BROWSER_NEW:
             assert(record);
             assert(record->key->type == AVAHI_DNS_TYPE_PTR);
-            
+
             if (r->interface > 0 && interface != r->interface)
                 return;
-            
+
             if (r->protocol != AVAHI_PROTO_UNSPEC && protocol != r->protocol)
                 return;
-            
+
             if (r->interface <= 0)
                 r->interface = interface;
-            
+
             if (r->protocol == AVAHI_PROTO_UNSPEC)
                 r->protocol = protocol;
-            
+
             if (!r->ptr_record) {
                 r->ptr_record = avahi_record_ref(record);
                 r->flags = flags;
-                
+
                 finish(r, AVAHI_RESOLVER_FOUND);
             }
             break;
-            
+
         case AVAHI_BROWSER_REMOVE:
             assert(record);
             assert(record->key->type == AVAHI_DNS_TYPE_PTR);
-            
+
             if (r->ptr_record && avahi_record_equal_no_ttl(record, r->ptr_record)) {
                 avahi_record_unref(r->ptr_record);
                 r->ptr_record = NULL;
                 r->flags = flags;
-                
+
                 /** Look for a replacement */
                 avahi_s_record_browser_restart(r->record_browser);
                 start_timeout(r);
             }
 
             break;
-            
+
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
         case AVAHI_BROWSER_ALL_FOR_NOW:
             break;
@@ -184,7 +182,7 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
     AvahiLookupFlags flags,
     AvahiSAddressResolverCallback callback,
     void* userdata) {
-    
+
     AvahiSAddressResolver *r;
     AvahiKey *k;
     char n[AVAHI_DOMAIN_NAME_MAX];
@@ -197,7 +195,7 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
     AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_PROTO_VALID(protocol), AVAHI_ERR_INVALID_PROTOCOL);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(server, address->proto == AVAHI_PROTO_INET || address->proto == AVAHI_PROTO_INET6, AVAHI_ERR_INVALID_PROTOCOL);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS);
-    
+
     avahi_reverse_lookup_name(address, n, sizeof(n));
 
     if (!(k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR))) {
@@ -210,7 +208,7 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
         avahi_key_unref(k);
         return NULL;
     }
-    
+
     r->server = server;
     r->address = *address;
     r->callback = callback;
@@ -236,7 +234,7 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
             r->retry_with_multicast = 1;
         }
     }
-    
+
     r->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, r);
 
     if (!r->record_browser) {
@@ -245,7 +243,7 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
     }
 
     start_timeout(r);
-    
+
     return r;
 }
 
@@ -265,6 +263,6 @@ void avahi_s_address_resolver_free(AvahiSAddressResolver *r) {
 
     if (r->key)
         avahi_key_unref(r->key);
-    
+
     avahi_free(r);
 }
index 59dc3cf611b8b3e52bed9c7a07030ced93deae86..08f209b62676083ea8503066a47fa0c082855b9e 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -38,7 +36,7 @@
 struct AvahiSHostNameResolver {
     AvahiServer *server;
     char *host_name;
-    
+
     AvahiSRecordBrowser *record_browser_a;
     AvahiSRecordBrowser *record_browser_aaaa;
 
@@ -66,20 +64,20 @@ static void finish(AvahiSHostNameResolver *r, AvahiResolverEvent event) {
     switch (event) {
         case AVAHI_RESOLVER_FOUND: {
             AvahiAddress a;
-            
+
             assert(r->address_record);
-            
+
             switch (r->address_record->key->type) {
                 case AVAHI_DNS_TYPE_A:
                     a.proto = AVAHI_PROTO_INET;
                     a.data.ipv4 = r->address_record->data.a.address;
                     break;
-                    
+
                 case AVAHI_DNS_TYPE_AAAA:
                     a.proto = AVAHI_PROTO_INET6;
                     a.data.ipv6 = r->address_record->data.aaaa.address;
                     break;
-                    
+
                 default:
                     abort();
             }
@@ -88,9 +86,9 @@ static void finish(AvahiSHostNameResolver *r, AvahiResolverEvent event) {
             break;
 
         }
-            
+
         case AVAHI_RESOLVER_FAILURE:
-            
+
             r->callback(r, r->interface, r->protocol, event, r->host_name, NULL, r->flags, r->userdata);
             break;
     }
@@ -98,7 +96,7 @@ static void finish(AvahiSHostNameResolver *r, AvahiResolverEvent event) {
 
 static void time_event_callback(AvahiTimeEvent *e, void *userdata) {
     AvahiSHostNameResolver *r = userdata;
-    
+
     assert(e);
     assert(r);
 
@@ -126,9 +124,9 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSHostNameResolver *r = userdata;
-    
+
     assert(rr);
     assert(r);
 
@@ -140,20 +138,20 @@ static void record_browser_callback(
 
             if (r->interface > 0 && interface != r->interface)
                 return;
-            
+
             if (r->protocol != AVAHI_PROTO_UNSPEC && protocol != r->protocol)
                 return;
-            
+
             if (r->interface <= 0)
                 r->interface = interface;
-            
+
             if (r->protocol == AVAHI_PROTO_UNSPEC)
                 r->protocol = protocol;
-            
+
             if (!r->address_record) {
                 r->address_record = avahi_record_ref(record);
                 r->flags = flags;
-                
+
                 finish(r, AVAHI_RESOLVER_FOUND);
             }
 
@@ -169,13 +167,13 @@ static void record_browser_callback(
 
                 r->flags = flags;
 
-                
+
                 /** Look for a replacement */
                 if (r->record_browser_aaaa)
                     avahi_s_record_browser_restart(r->record_browser_aaaa);
                 if (r->record_browser_a)
                     avahi_s_record_browser_restart(r->record_browser_a);
-                
+
                 start_timeout(r);
             }
 
@@ -189,7 +187,7 @@ static void record_browser_callback(
         case AVAHI_BROWSER_FAILURE:
 
             /* Stop browsers */
-            
+
             if (r->record_browser_aaaa)
                 avahi_s_record_browser_free(r->record_browser_aaaa);
             if (r->record_browser_a)
@@ -197,7 +195,7 @@ static void record_browser_callback(
 
             r->record_browser_a = r->record_browser_aaaa = NULL;
             r->flags = flags;
-            
+
             finish(r, AVAHI_RESOLVER_FAILURE);
             break;
     }
@@ -212,10 +210,10 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
     AvahiLookupFlags flags,
     AvahiSHostNameResolverCallback callback,
     void* userdata) {
-    
+
     AvahiSHostNameResolver *r;
     AvahiKey *k;
-   
+
     assert(server);
     assert(host_name);
     assert(callback);
@@ -230,7 +228,7 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     r->server = server;
     r->host_name = avahi_normalize_name_strdup(host_name);
     r->callback = callback;
@@ -255,7 +253,7 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
 
         if (!r->record_browser_a)
             goto fail;
-    } 
+    }
 
     if (aprotocol == AVAHI_PROTO_INET6 || aprotocol == AVAHI_PROTO_UNSPEC) {
         k = avahi_key_new(host_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA);
@@ -269,7 +267,7 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
     assert(r->record_browser_aaaa || r->record_browser_a);
 
     start_timeout(r);
-    
+
     return r;
 
 fail:
@@ -293,7 +291,7 @@ void avahi_s_host_name_resolver_free(AvahiSHostNameResolver *r) {
 
     if (r->address_record)
         avahi_record_unref(r->address_record);
-    
+
     avahi_free(r->host_name);
     avahi_free(r);
 }
index 1ad60780a9c9843b7e9a69799f89d63216f2f46a..3377a509cc76d0fd3123b3b941b318300d6aaaae 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -54,7 +52,7 @@ struct AvahiSServiceResolver {
 
     AvahiRecord *srv_record, *txt_record, *address_record;
     AvahiLookupResultFlags srv_flags, txt_flags, address_flags;
-    
+
     AvahiSServiceResolverCallback callback;
     void* userdata;
     AvahiLookupFlags user_flags;
@@ -66,7 +64,7 @@ struct AvahiSServiceResolver {
 
 static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event) {
     AvahiLookupResultFlags flags;
-    
+
     assert(r);
 
     if (r->time_event) {
@@ -78,10 +76,10 @@ static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event) {
         r->txt_flags |
         r->srv_flags |
         r->address_flags;
-    
+
     switch (event) {
         case AVAHI_RESOLVER_FAILURE:
-            
+
             r->callback(
                 r,
                 r->interface,
@@ -101,9 +99,9 @@ static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event) {
 
         case AVAHI_RESOLVER_FOUND: {
             AvahiAddress a;
-            
+
             assert(event == AVAHI_RESOLVER_FOUND);
-            
+
             assert(r->srv_record);
 
             if (r->address_record) {
@@ -112,17 +110,17 @@ static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event) {
                         a.proto = AVAHI_PROTO_INET;
                         a.data.ipv4 = r->address_record->data.a.address;
                         break;
-                        
+
                     case AVAHI_DNS_TYPE_AAAA:
                         a.proto = AVAHI_PROTO_INET6;
                         a.data.ipv6 = r->address_record->data.aaaa.address;
                         break;
-                        
+
                     default:
                         assert(0);
                 }
             }
-            
+
             r->callback(
                 r,
                 r->interface,
@@ -145,7 +143,7 @@ static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event) {
 
 static void time_event_callback(AvahiTimeEvent *e, void *userdata) {
     AvahiSServiceResolver *r = userdata;
-    
+
     assert(e);
     assert(r);
 
@@ -173,7 +171,7 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSServiceResolver *r = userdata;
 
     assert(rr);
@@ -191,30 +189,30 @@ static void record_browser_callback(
         case AVAHI_BROWSER_NEW: {
             int changed = 0;
             assert(record);
-            
+
             if (r->interface > 0 && interface > 0 &&  interface != r->interface)
                 return;
-            
+
             if (r->protocol != AVAHI_PROTO_UNSPEC && protocol != AVAHI_PROTO_UNSPEC && protocol != r->protocol)
                 return;
-            
+
             if (r->interface <= 0)
                 r->interface = interface;
-            
+
             if (r->protocol == AVAHI_PROTO_UNSPEC)
                 r->protocol = protocol;
-            
+
             switch (record->key->type) {
                 case AVAHI_DNS_TYPE_SRV:
                     if (!r->srv_record) {
                         r->srv_record = avahi_record_ref(record);
                         changed = 1;
-                        
+
                         if (r->record_browser_a) {
                             avahi_s_record_browser_free(r->record_browser_a);
                             r->record_browser_a = NULL;
                         }
-                        
+
                         if (r->record_browser_aaaa) {
                             avahi_s_record_browser_free(r->record_browser_aaaa);
                             r->record_browser_aaaa = NULL;
@@ -226,8 +224,8 @@ static void record_browser_callback(
                                 AvahiKey *k = avahi_key_new(r->srv_record->data.srv.name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A);
                                 r->record_browser_a = avahi_s_record_browser_new(r->server, r->interface, r->protocol, k, r->user_flags & ~(AVAHI_LOOKUP_NO_TXT|AVAHI_LOOKUP_NO_ADDRESS), record_browser_callback, r);
                                 avahi_key_unref(k);
-                            } 
-                        
+                            }
+
                             if (r->address_protocol == AVAHI_PROTO_INET6 || r->address_protocol == AVAHI_PROTO_UNSPEC) {
                                 AvahiKey *k = avahi_key_new(r->srv_record->data.srv.name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA);
                                 r->record_browser_aaaa = avahi_s_record_browser_new(r->server, r->interface, r->protocol, k, r->user_flags & ~(AVAHI_LOOKUP_NO_TXT|AVAHI_LOOKUP_NO_ADDRESS), record_browser_callback, r);
@@ -236,7 +234,7 @@ static void record_browser_callback(
                         }
                     }
                     break;
-                
+
                 case AVAHI_DNS_TYPE_TXT:
 
                     assert(!(r->user_flags & AVAHI_LOOKUP_NO_TXT));
@@ -246,7 +244,7 @@ static void record_browser_callback(
                         changed = 1;
                     }
                     break;
-                
+
                 case AVAHI_DNS_TYPE_A:
                 case AVAHI_DNS_TYPE_AAAA:
 
@@ -257,7 +255,7 @@ static void record_browser_callback(
                         changed = 1;
                     }
                     break;
-                
+
                 default:
                     abort();
             }
@@ -272,14 +270,14 @@ static void record_browser_callback(
             break;
 
         }
-            
+
         case AVAHI_BROWSER_REMOVE:
 
             assert(record);
 
             switch (record->key->type) {
                 case AVAHI_DNS_TYPE_SRV:
-                    
+
                     if (r->srv_record && avahi_record_equal_no_ttl(record, r->srv_record)) {
                         avahi_record_unref(r->srv_record);
                         r->srv_record = NULL;
@@ -288,42 +286,42 @@ static void record_browser_callback(
                             avahi_s_record_browser_free(r->record_browser_a);
                             r->record_browser_a = NULL;
                         }
-                        
+
                         if (r->record_browser_aaaa) {
                             avahi_s_record_browser_free(r->record_browser_aaaa);
                             r->record_browser_aaaa = NULL;
                         }
-                        
+
                         /** Look for a replacement */
                         avahi_s_record_browser_restart(r->record_browser_srv);
                         start_timeout(r);
                     }
-                    
+
                     break;
-                    
+
                 case AVAHI_DNS_TYPE_TXT:
-                    
+
                     assert(!(r->user_flags & AVAHI_LOOKUP_NO_TXT));
-                    
+
                     if (r->txt_record && avahi_record_equal_no_ttl(record, r->txt_record)) {
                         avahi_record_unref(r->txt_record);
                         r->txt_record = NULL;
-                        
+
                         /** Look for a replacement */
                         avahi_s_record_browser_restart(r->record_browser_txt);
                         start_timeout(r);
                     }
                     break;
-                    
+
                 case AVAHI_DNS_TYPE_A:
                 case AVAHI_DNS_TYPE_AAAA:
-                    
+
                     assert(!(r->user_flags & AVAHI_LOOKUP_NO_ADDRESS));
-                    
+
                     if (r->address_record && avahi_record_equal_no_ttl(record, r->address_record)) {
                         avahi_record_unref(r->address_record);
                         r->address_record = NULL;
-                        
+
                         /** Look for a replacement */
                         if (r->record_browser_aaaa)
                             avahi_s_record_browser_restart(r->record_browser_aaaa);
@@ -332,7 +330,7 @@ static void record_browser_callback(
                         start_timeout(r);
                     }
                     break;
-                    
+
                 default:
                     abort();
             }
@@ -344,7 +342,7 @@ static void record_browser_callback(
             break;
 
         case AVAHI_BROWSER_FAILURE:
-            
+
             if (rr == r->record_browser_a && r->record_browser_aaaa) {
                 /* We were looking for both AAAA and A, and the other query is still living, so we'll not die */
                 avahi_s_record_browser_free(r->record_browser_a);
@@ -360,7 +358,7 @@ static void record_browser_callback(
             }
 
             /* Hmm, everything's lost, tell the user */
-            
+
             if (r->record_browser_srv)
                 avahi_s_record_browser_free(r->record_browser_srv);
             if (r->record_browser_txt)
@@ -388,12 +386,12 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
     AvahiLookupFlags flags,
     AvahiSServiceResolverCallback callback,
     void* userdata) {
-    
+
     AvahiSServiceResolver *r;
     AvahiKey *k;
     char n[AVAHI_DOMAIN_NAME_MAX];
     int ret;
-    
+
     assert(server);
     assert(type);
     assert(callback);
@@ -413,12 +411,12 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
         avahi_server_set_errno(server, ret);
         return NULL;
     }
-    
+
     if (!(r = avahi_new(AvahiSServiceResolver, 1))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     r->server = server;
     r->service_name = avahi_strdup(name);
     r->service_type = avahi_normalize_name_strdup(type);
@@ -448,7 +446,7 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
         k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_TXT);
         r->record_browser_txt = avahi_s_record_browser_new(server, interface, protocol, k, flags & ~(AVAHI_LOOKUP_NO_TXT|AVAHI_LOOKUP_NO_ADDRESS),  record_browser_callback, r);
         avahi_key_unref(k);
-        
+
         if (!r->record_browser_txt) {
             avahi_s_service_resolver_free(r);
             return NULL;
@@ -456,7 +454,7 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
     }
 
     start_timeout(r);
-    
+
     return r;
 }
 
@@ -467,7 +465,7 @@ void avahi_s_service_resolver_free(AvahiSServiceResolver *r) {
 
     if (r->time_event)
         avahi_time_event_free(r->time_event);
-    
+
     if (r->record_browser_srv)
         avahi_s_record_browser_free(r->record_browser_srv);
     if (r->record_browser_txt)
@@ -483,7 +481,7 @@ void avahi_s_service_resolver_free(AvahiSServiceResolver *r) {
         avahi_record_unref(r->txt_record);
     if (r->address_record)
         avahi_record_unref(r->address_record);
-    
+
     avahi_free(r->service_name);
     avahi_free(r->service_type);
     avahi_free(r->domain_name);
index b194ef3f6f009a5b274052051f8cedc3e8500fef..abac0a1e594dd83f9560f2b0a165870923131b9d 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -55,7 +53,7 @@ typedef enum {
 struct AvahiResponseJob {
     AvahiResponseScheduler *scheduler;
     AvahiTimeEvent *time_event;
-    
+
     AvahiResponseJobState state;
     struct timeval delivery;
 
@@ -63,7 +61,7 @@ struct AvahiResponseJob {
     int flush_cache;
     AvahiAddress querier;
     int querier_valid;
-    
+
     AVAHI_LLIST_FIELDS(AvahiResponseJob, jobs);
 };
 
@@ -78,7 +76,7 @@ struct AvahiResponseScheduler {
 
 static AvahiResponseJob* job_new(AvahiResponseScheduler *s, AvahiRecord *record, AvahiResponseJobState state) {
     AvahiResponseJob *rj;
-    
+
     assert(s);
     assert(record);
 
@@ -86,14 +84,14 @@ static AvahiResponseJob* job_new(AvahiResponseScheduler *s, AvahiRecord *record,
         avahi_log_error(__FILE__": Out of memory");
         return NULL;
     }
-    
+
     rj->scheduler = s;
     rj->record = avahi_record_ref(record);
     rj->time_event = NULL;
     rj->flush_cache = 0;
     rj->querier_valid = 0;
-    
-    if ((rj->state = state) == AVAHI_SCHEDULED) 
+
+    if ((rj->state = state) == AVAHI_SCHEDULED)
         AVAHI_LLIST_PREPEND(AvahiResponseJob, jobs, s->jobs, rj);
     else if (rj->state == AVAHI_DONE)
         AVAHI_LLIST_PREPEND(AvahiResponseJob, jobs, s->history, rj);
@@ -161,10 +159,10 @@ AvahiResponseScheduler *avahi_response_scheduler_new(AvahiInterface *i) {
         avahi_log_error(__FILE__": Out of memory");
         return NULL;
     }
-        
+
     s->interface = i;
     s->time_event_queue = i->monitor->server->time_event_queue;
-    
+
     AVAHI_LLIST_HEAD_INIT(AvahiResponseJob, s->jobs);
     AVAHI_LLIST_HEAD_INIT(AvahiResponseJob, s->history);
     AVAHI_LLIST_HEAD_INIT(AvahiResponseJob, s->suppressed);
@@ -181,7 +179,7 @@ void avahi_response_scheduler_free(AvahiResponseScheduler *s) {
 
 void avahi_response_scheduler_clear(AvahiResponseScheduler *s) {
     assert(s);
-    
+
     while (s->jobs)
         job_free(s, s->jobs);
     while (s->history)
@@ -192,7 +190,7 @@ void avahi_response_scheduler_clear(AvahiResponseScheduler *s) {
 
 static void enumerate_aux_records_callback(AVAHI_GCC_UNUSED AvahiServer *s, AvahiRecord *r, int flush_cache, void* userdata) {
     AvahiResponseJob *rj = userdata;
-    
+
     assert(r);
     assert(rj);
 
@@ -212,7 +210,7 @@ static int packet_add_response_job(AvahiResponseScheduler *s, AvahiDnsPacket *p,
      * auxilliary packets, too */
     avahi_server_enumerate_aux_records(s->interface->monitor->server, s->interface, rj->record, enumerate_aux_records_callback, rj);
     job_mark_done(s, rj);
-    
+
     return 1;
 }
 
@@ -232,16 +230,16 @@ static void send_response_packet(AvahiResponseScheduler *s, AvahiResponseJob *rj
 
         /* Try to fill up packet with more responses, if available */
         while (s->jobs) {
-            
+
             if (!packet_add_response_job(s, p, s->jobs))
                 break;
-            
+
             n++;
         }
-        
+
     } else {
         size_t size;
-        
+
         avahi_dns_packet_free(p);
 
         /* OK, the packet was too small, so create one that fits */
@@ -269,7 +267,7 @@ static void elapse_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* data) {
 
     assert(rj);
 
-    if (rj->state == AVAHI_DONE || rj->state == AVAHI_SUPPRESSED) 
+    if (rj->state == AVAHI_DONE || rj->state == AVAHI_SUPPRESSED)
         job_free(rj->scheduler, rj);         /* Lets drop this entry */
     else
         send_response_packet(rj->scheduler, rj);
@@ -283,7 +281,7 @@ static AvahiResponseJob* find_scheduled_job(AvahiResponseScheduler *s, AvahiReco
 
     for (rj = s->jobs; rj; rj = rj->jobs_next) {
         assert(rj->state == AVAHI_SCHEDULED);
-    
+
         if (avahi_record_equal_no_ttl(rj->record, record))
             return rj;
     }
@@ -293,7 +291,7 @@ static AvahiResponseJob* find_scheduled_job(AvahiResponseScheduler *s, AvahiReco
 
 static AvahiResponseJob* find_history_job(AvahiResponseScheduler *s, AvahiRecord *record) {
     AvahiResponseJob *rj;
-    
+
     assert(s);
     assert(record);
 
@@ -304,13 +302,13 @@ static AvahiResponseJob* find_history_job(AvahiResponseScheduler *s, AvahiRecord
             /* Check whether this entry is outdated */
 
 /*             avahi_log_debug("history age: %u", (unsigned) (avahi_age(&rj->delivery)/1000)); */
-            
+
             if (avahi_age(&rj->delivery)/1000 > AVAHI_RESPONSE_HISTORY_MSEC) {
                 /* it is outdated, so let's remove it */
                 job_free(s, rj);
                 return NULL;
             }
-                
+
             return rj;
         }
     }
@@ -320,7 +318,7 @@ static AvahiResponseJob* find_history_job(AvahiResponseScheduler *s, AvahiRecord
 
 static AvahiResponseJob* find_suppressed_job(AvahiResponseScheduler *s, AvahiRecord *record, const AvahiAddress *querier) {
     AvahiResponseJob *rj;
-    
+
     assert(s);
     assert(record);
     assert(querier);
@@ -328,7 +326,7 @@ static AvahiResponseJob* find_suppressed_job(AvahiResponseScheduler *s, AvahiRec
     for (rj = s->suppressed; rj; rj = rj->jobs_next) {
         assert(rj->state == AVAHI_SUPPRESSED);
         assert(rj->querier_valid);
-        
+
         if (avahi_record_equal_no_ttl(rj->record, record) &&
             avahi_address_cmp(&rj->querier, querier) == 0) {
             /* Check whether this entry is outdated */
@@ -350,7 +348,7 @@ int avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *record
     AvahiResponseJob *rj;
     struct timeval tv;
 /*     char *t; */
-    
+
     assert(s);
     assert(record);
 
@@ -385,7 +383,7 @@ int avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *record
     }
 
     avahi_elapse_time(&tv, immediately ? 0 : AVAHI_RESPONSE_DEFER_MSEC, immediately ? 0 : AVAHI_RESPONSE_JITTER_MSEC);
-         
+
     if ((rj = find_scheduled_job(s, record))) {
 /*          avahi_log_debug("Response suppressed by local duplicate suppression (scheduled)"); */
 
@@ -416,7 +414,7 @@ int avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *record
         /* Create a new job and schedule it */
         if (!(rj = job_new(s, record, AVAHI_SCHEDULED)))
             return 0; /* OOM */
-        
+
         rj->delivery = tv;
         rj->time_event = avahi_time_event_new(s->time_event_queue, &rj->delivery, elapse_callback, rj);
         rj->flush_cache = flush_cache;
@@ -435,7 +433,7 @@ void avahi_response_scheduler_incoming(AvahiResponseScheduler *s, AvahiRecord *r
     /* This function is called whenever an incoming response was
      * receieved. We drop scheduled responses which match here. The
      * keyword is "DUPLICATE ANSWER SUPPRESION". */
-    
+
     if ((rj = find_scheduled_job(s, record))) {
 
         if ((!rj->flush_cache || flush_cache) &&    /* flush cache bit was set correctly */
@@ -461,20 +459,20 @@ void avahi_response_scheduler_incoming(AvahiResponseScheduler *s, AvahiRecord *r
 
     rj->flush_cache = flush_cache;
     rj->querier_valid = 0;
-    
+
     gettimeofday(&rj->delivery, NULL);
     job_set_elapse_time(s, rj, AVAHI_RESPONSE_HISTORY_MSEC, 0);
 }
 
 void avahi_response_scheduler_suppress(AvahiResponseScheduler *s, AvahiRecord *record, const AvahiAddress *querier) {
     AvahiResponseJob *rj;
-    
+
     assert(s);
     assert(record);
     assert(querier);
 
     if ((rj = find_scheduled_job(s, record))) {
-        
+
         if (rj->querier_valid && avahi_address_cmp(querier, &rj->querier) == 0 && /* same originator */
             avahi_record_is_goodbye(record) == avahi_record_is_goodbye(rj->record) && /* both goodbye packets, or both not */
             record->ttl >= rj->record->ttl/2) {                                  /* sensible TTL */
@@ -490,7 +488,7 @@ void avahi_response_scheduler_suppress(AvahiResponseScheduler *s, AvahiRecord *r
         /* Let's update the old entry */
         avahi_record_unref(rj->record);
         rj->record = avahi_record_ref(record);
-        
+
     } else {
 
         /* Create a new entry */
index 68c4a9d7ecee4677ed3de90c54fd8e34ba65404b..548839e83d22721e4181ec3bf51538668ca70810 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooresponseschedhfoo
 #define fooresponseschedhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index b3c35b4384c54f5a113f3a4b0849958f893151f0..0eebc0017c5fde1da8221c153c432773fdd627cf 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foorrutilhfoo
 #define foorrutilhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 8b7fab7d861493814faac1e5ed6e0f2d6d5e4967..7fa0beebf610eb129b68e960be6f24c3d33549e9 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -40,6 +38,7 @@
 #include "hashmap.h"
 #include "domain-util.h"
 #include "rr-util.h"
+#include "addr-util.h"
 
 AvahiKey *avahi_key_new(const char *name, uint16_t class, uint16_t type) {
     AvahiKey *k;
@@ -49,13 +48,13 @@ AvahiKey *avahi_key_new(const char *name, uint16_t class, uint16_t type) {
         avahi_log_error("avahi_new() failed.");
         return NULL;
     }
-    
+
     if (!(k->name = avahi_normalize_name_strdup(name))) {
         avahi_log_error("avahi_normalize_name() failed.");
         avahi_free(k);
         return NULL;
     }
-    
+
     k->ref = 1;
     k->clazz = class;
     k->type = type;
@@ -87,7 +86,7 @@ AvahiKey *avahi_key_ref(AvahiKey *k) {
 void avahi_key_unref(AvahiKey *k) {
     assert(k);
     assert(k->ref >= 1);
-    
+
     if ((--k->ref) <= 0) {
         avahi_free(k->name);
         avahi_free(k);
@@ -96,14 +95,14 @@ void avahi_key_unref(AvahiKey *k) {
 
 AvahiRecord *avahi_record_new(AvahiKey *k, uint32_t ttl) {
     AvahiRecord *r;
-    
+
     assert(k);
-    
+
     if (!(r = avahi_new(AvahiRecord, 1))) {
         avahi_log_error("avahi_new() failed.");
         return NULL;
     }
-        
+
     r->ref = 1;
     r->key = avahi_key_ref(k);
 
@@ -119,7 +118,7 @@ AvahiRecord *avahi_record_new_full(const char *name, uint16_t class, uint16_t ty
     AvahiKey *k;
 
     assert(name);
-    
+
     if (!(k = avahi_key_new(name, class, type))) {
         avahi_log_error("avahi_key_new() failed.");
         return NULL;
@@ -173,18 +172,18 @@ void avahi_record_unref(AvahiRecord *r) {
             case AVAHI_DNS_TYPE_A:
             case AVAHI_DNS_TYPE_AAAA:
                 break;
-            
+
             default:
                 avahi_free(r->data.generic.data);
         }
-        
+
         avahi_key_unref(r->key);
         avahi_free(r);
     }
 }
 
 const char *avahi_dns_class_to_string(uint16_t class) {
-    if (class & AVAHI_DNS_CACHE_FLUSH) 
+    if (class & AVAHI_DNS_CACHE_FLUSH)
         return "FLUSH";
 
     switch (class) {
@@ -227,12 +226,12 @@ const char *avahi_dns_type_to_string(uint16_t type) {
 char *avahi_key_to_string(const AvahiKey *k) {
     char class[16], type[16];
     const char *c, *t;
-    
+
     assert(k);
     assert(k->ref >= 1);
 
     /* According to RFC3597 */
-    
+
     if (!(c = avahi_dns_class_to_string(k->clazz))) {
         snprintf(class, sizeof(class), "CLASS%u", k->clazz);
         c = class;
@@ -242,7 +241,7 @@ char *avahi_key_to_string(const AvahiKey *k) {
         snprintf(type, sizeof(type), "TYPE%u", k->type);
         t = type;
     }
-    
+
     return avahi_strdup_printf("%s\t%s\t%s", k->name, c, t);
 }
 
@@ -252,16 +251,16 @@ char *avahi_record_to_string(const AvahiRecord *r) {
 
     assert(r);
     assert(r->ref >= 1);
-    
+
     switch (r->key->type) {
         case AVAHI_DNS_TYPE_A:
             inet_ntop(AF_INET, &r->data.a.address.address, t = buf, sizeof(buf));
             break;
-            
+
         case AVAHI_DNS_TYPE_AAAA:
             inet_ntop(AF_INET6, &r->data.aaaa.address.address, t = buf, sizeof(buf));
             break;
-            
+
         case AVAHI_DNS_TYPE_PTR:
         case AVAHI_DNS_TYPE_CNAME:
         case AVAHI_DNS_TYPE_NS:
@@ -296,11 +295,11 @@ char *avahi_record_to_string(const AvahiRecord *r) {
             char *e;
 
             /* According to RFC3597 */
-            
+
             snprintf(t = buf, sizeof(buf), "\\# %u", r->data.generic.size);
 
             e = strchr(t, 0);
-            
+
             for (c = r->data.generic.data, n = r->data.generic.size, i = 0;
                  n > 0 && i < 20;
                  c ++, n --, i++) {
@@ -317,7 +316,7 @@ char *avahi_record_to_string(const AvahiRecord *r) {
     s = avahi_strdup_printf("%s %s ; ttl=%u", p, t, r->ttl);
     avahi_free(p);
     avahi_free(d);
-    
+
     return s;
 }
 
@@ -327,7 +326,7 @@ int avahi_key_equal(const AvahiKey *a, const AvahiKey *b) {
 
     if (a == b)
         return 1;
-    
+
     return avahi_domain_equal(a->name, b->name) &&
         a->type == b->type &&
         a->clazz == b->clazz;
@@ -341,7 +340,7 @@ int avahi_key_pattern_match(const AvahiKey *pattern, const AvahiKey *k) {
 
     if (pattern == k)
         return 1;
-    
+
     return avahi_domain_equal(pattern->name, k->name) &&
         (pattern->type == k->type || pattern->type == AVAHI_DNS_TYPE_ANY) &&
         (pattern->clazz == k->clazz || pattern->clazz == AVAHI_DNS_CLASS_ANY);
@@ -359,7 +358,7 @@ unsigned avahi_key_hash(const AvahiKey *k) {
     assert(k);
 
     return
-        avahi_domain_hash(k->name) + 
+        avahi_domain_hash(k->name) +
         k->type +
         k->clazz;
 }
@@ -400,7 +399,7 @@ static int rdata_equal(const AvahiRecord *a, const AvahiRecord *b) {
             return a->data.generic.size == b->data.generic.size &&
                 (a->data.generic.size == 0 || memcmp(a->data.generic.data, b->data.generic.data, a->data.generic.size) == 0);
     }
-    
+
 }
 
 int avahi_record_equal_no_ttl(const AvahiRecord *a, const AvahiRecord *b) {
@@ -423,7 +422,7 @@ AvahiRecord *avahi_record_copy(AvahiRecord *r) {
         avahi_log_error("avahi_new() failed.");
         return NULL;
     }
-    
+
     copy->ref = 1;
     copy->key = avahi_key_ref(r->key);
     copy->ttl = r->ttl;
@@ -471,7 +470,7 @@ AvahiRecord *avahi_record_copy(AvahiRecord *r) {
                 goto fail;
             copy->data.generic.size = r->data.generic.size;
             break;
-                
+
     }
 
     return copy;
@@ -481,7 +480,7 @@ fail:
 
     avahi_key_unref(copy->key);
     avahi_free(copy);
-    
+
     return NULL;
 }
 
@@ -535,7 +534,7 @@ size_t avahi_record_get_estimate_size(AvahiRecord *r) {
 static int lexicographical_memcmp(const void* a, size_t al, const void* b, size_t bl) {
     size_t c;
     int ret;
-    
+
     assert(a);
     assert(b);
 
@@ -585,7 +584,7 @@ int avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b) {
                 (r = uint16_cmp(a->data.srv.weight, b->data.srv.weight)) == 0 &&
                 (r = uint16_cmp(a->data.srv.port, b->data.srv.port)) == 0)
                 r = avahi_binary_domain_cmp(a->data.srv.name, b->data.srv.name);
-            
+
             return r;
         }
 
@@ -606,15 +605,15 @@ int avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b) {
 
             asize = avahi_string_list_serialize(a->data.txt.string_list, NULL, 0);
             bsize = avahi_string_list_serialize(b->data.txt.string_list, NULL, 0);
-            
+
             if (asize > 0 && !(ma = avahi_new(uint8_t, asize)))
                 goto fail;
-            
+
             if (bsize > 0 && !(mb = avahi_new(uint8_t, bsize))) {
                 avahi_free(ma);
                 goto fail;
             }
-            
+
             avahi_string_list_serialize(a->data.txt.string_list, ma, asize);
             avahi_string_list_serialize(b->data.txt.string_list, mb, bsize);
 
@@ -626,13 +625,13 @@ int avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b) {
                 r = -1;
             else
                 r = 0;
-            
+
             avahi_free(ma);
             avahi_free(mb);
 
             return r;
         }
-        
+
         case AVAHI_DNS_TYPE_A:
             return memcmp(&a->data.a.address, &b->data.a.address, sizeof(AvahiIPv4Address));
 
@@ -644,7 +643,7 @@ int avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b) {
                                           b->data.generic.data, b->data.generic.size);
     }
 
-    
+
 fail:
     avahi_log_error(__FILE__": Out of memory");
     return -1; /* or whatever ... */
@@ -661,7 +660,7 @@ int avahi_key_is_valid(AvahiKey *k) {
 
     if (!avahi_is_valid_domain_name(k->name))
         return 0;
-    
+
     return 1;
 }
 
@@ -685,7 +684,7 @@ int avahi_record_is_valid(AvahiRecord *r) {
             return
                 strlen(r->data.hinfo.os) <= 255 &&
                 strlen(r->data.hinfo.cpu) <= 255;
-            
+
         case AVAHI_DNS_TYPE_TXT: {
 
             AvahiStringList *strlst;
@@ -697,7 +696,38 @@ int avahi_record_is_valid(AvahiRecord *r) {
             return 1;
         }
     }
-            
 
     return 1;
 }
+
+static AvahiAddress *get_address(const AvahiRecord *r, AvahiAddress *a) {
+    assert(r);
+
+    switch (r->key->type) {
+        case AVAHI_DNS_TYPE_A:
+            a->proto = AVAHI_PROTO_INET;
+            a->data.ipv4 = r->data.a.address;
+            break;
+
+        case AVAHI_DNS_TYPE_AAAA:
+            a->proto = AVAHI_PROTO_INET6;
+            a->data.ipv6 = r->data.aaaa.address;
+            break;
+
+        default:
+            return NULL;
+    }
+
+    return a;
+}
+
+int avahi_record_is_link_local_address(const AvahiRecord *r) {
+    AvahiAddress a;
+
+    assert(r);
+
+    if (!get_address(r, &a))
+        return 0;
+
+    return avahi_address_is_link_local(&a);
+}
index 6bfe0ec2b4a608b4154dfd59bedef5d6cfd133a7..794b83fb1f4aa7f242f2c9bca09c2104c2ce0e76 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foorrhfoo
 #define foorrhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -37,8 +35,8 @@ AVAHI_C_DECL_BEGIN
 enum {
     AVAHI_DNS_TYPE_ANY = 0xFF,   /**< Special query type for requesting all records */
     AVAHI_DNS_TYPE_OPT = 41,     /**< EDNS0 option */
-    AVAHI_DNS_TYPE_TKEY = 249, 
-    AVAHI_DNS_TYPE_TSIG = 250, 
+    AVAHI_DNS_TYPE_TKEY = 249,
+    AVAHI_DNS_TYPE_TSIG = 250,
     AVAHI_DNS_TYPE_IXFR = 251,
     AVAHI_DNS_TYPE_AXFR = 252
 };
@@ -67,16 +65,16 @@ typedef struct AvahiKey {
 typedef struct AvahiRecord {
     int ref;         /**< Reference counter */
     AvahiKey *key;   /**< Reference to the query key of this record */
-    
+
     uint32_t ttl;     /**< DNS TTL of this record */
 
     union {
-        
+
         struct {
             void* data;
             uint16_t size;
         } generic; /**< Generic record data for unknown types */
-        
+
         struct {
             uint16_t priority;
             uint16_t weight;
@@ -106,7 +104,7 @@ typedef struct AvahiRecord {
         } aaaa; /**< Data for AAAA records */
 
     } data; /**< Record data */
-    
+
 } AvahiRecord;
 
 /** Create a new AvahiKey object. The reference counter will be set to 1. */
@@ -121,7 +119,7 @@ void avahi_key_unref(AvahiKey *k);
 /** Check whether two AvahiKey object contain the same
  * data. AVAHI_DNS_CLASS_ANY/AVAHI_DNS_TYPE_ANY are treated like any
  * other class/type. */
-int avahi_key_equal(const AvahiKey *a, const AvahiKey *b); 
+int avahi_key_equal(const AvahiKey *a, const AvahiKey *b);
 
 /** Return a numeric hash value for a key for usage in hash tables. */
 unsigned avahi_key_hash(const AvahiKey *k);
@@ -152,7 +150,7 @@ char *avahi_key_to_string(const AvahiKey *k);
 
 /** Create a textual representation of the specified record, similar
  * in style to BIND zone file data. avahi_free() the result! */
-char *avahi_record_to_string(const AvahiRecord *r); 
+char *avahi_record_to_string(const AvahiRecord *r);
 
 /** Check whether two records are equal (regardless of the TTL */
 int avahi_record_equal_no_ttl(const AvahiRecord *a, const AvahiRecord *b);
@@ -169,6 +167,9 @@ int avahi_rdata_parse(AvahiRecord *record, const void* rdata, size_t size);
 /** Serialize an AvahiRecord object into binary rdata. This function is actually implemented in dns.c */
 size_t avahi_rdata_serialize(AvahiRecord *record, void *rdata, size_t max_size);
 
+/** Return TRUE if the AvahiRecord object is a link-local A or AAAA address */
+int avahi_record_is_link_local_address(const AvahiRecord *r);
+
 AVAHI_C_DECL_END
 
 #endif
index 915ecbb87bccb3297e5d5187c6d4d4978ebfdf33..0a794abafbd6c2ceae175558b682cecacd47edb5 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -57,7 +55,7 @@ AvahiRecordList *avahi_record_list_new(void) {
         avahi_log_error("avahi_new() failed.");
         return NULL;
     }
-    
+
     AVAHI_LLIST_HEAD_INIT(AvahiRecordListItem, l->read);
     AVAHI_LLIST_HEAD_INIT(AvahiRecordListItem, l->unread);
 
@@ -76,18 +74,18 @@ static void item_free(AvahiRecordList *l, AvahiRecordListItem *i) {
     assert(l);
     assert(i);
 
-    if (i->read) 
+    if (i->read)
         AVAHI_LLIST_REMOVE(AvahiRecordListItem, items, l->read, i);
     else
         AVAHI_LLIST_REMOVE(AvahiRecordListItem, items, l->unread, i);
-    
+
     avahi_record_unref(i->record);
     avahi_free(i);
 }
 
 void avahi_record_list_flush(AvahiRecordList *l) {
     assert(l);
-    
+
     while (l->read)
         item_free(l, l->read);
     while (l->unread)
@@ -104,7 +102,7 @@ AvahiRecord* avahi_record_list_next(AvahiRecordList *l, int *ret_flush_cache, in
         return NULL;
 
     assert(!i->read);
-    
+
     r = avahi_record_ref(i->record);
     if (ret_unicast_response)
         *ret_unicast_response = i->unicast_response;
@@ -117,7 +115,7 @@ AvahiRecord* avahi_record_list_next(AvahiRecordList *l, int *ret_flush_cache, in
     AVAHI_LLIST_PREPEND(AvahiRecordListItem, items, l->read, i);
 
     i->read = 1;
-    
+
     return r;
 }
 
@@ -126,7 +124,7 @@ static AvahiRecordListItem *get(AvahiRecordList *l, AvahiRecord *r) {
 
     assert(l);
     assert(r);
-    
+
     for (i = l->read; i; i = i->items_next)
         if (avahi_record_equal_no_ttl(i->record, r))
             return i;
@@ -140,7 +138,7 @@ static AvahiRecordListItem *get(AvahiRecordList *l, AvahiRecord *r) {
 
 void avahi_record_list_push(AvahiRecordList *l, AvahiRecord *r, int flush_cache, int unicast_response, int auxiliary) {
     AvahiRecordListItem *i;
-        
+
     assert(l);
     assert(r);
 
@@ -151,7 +149,7 @@ void avahi_record_list_push(AvahiRecordList *l, AvahiRecord *r, int flush_cache,
         avahi_log_error("avahi_new() failed.");
         return;
     }
-    
+
     i->unicast_response = unicast_response;
     i->flush_cache = flush_cache;
     i->auxiliary = auxiliary;
@@ -159,7 +157,7 @@ void avahi_record_list_push(AvahiRecordList *l, AvahiRecord *r, int flush_cache,
     i->read = 0;
 
     l->all_flush_cache = l->all_flush_cache && flush_cache;
-    
+
     AVAHI_LLIST_PREPEND(AvahiRecordListItem, items, l->unread, i);
 }
 
@@ -177,7 +175,7 @@ void avahi_record_list_drop(AvahiRecordList *l, AvahiRecord *r) {
 
 int avahi_record_list_is_empty(AvahiRecordList *l) {
     assert(l);
-    
+
     return !l->unread && !l->read;
 }
 
@@ -185,6 +183,6 @@ int avahi_record_list_all_flush_cache(AvahiRecordList *l) {
     assert(l);
 
     /* Return TRUE if all entries in this list have flush_cache set */
-    
+
     return l->all_flush_cache;
 }
index 9c07ecd5acca8bd0bc89810297b16fea0775506b..c7b5aba18b901168a93ff5276fb634a468c0d9f8 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foorrlisthfoo
 #define foorrlisthfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index bb625a577ca123e4fb90a771400425d9e0065785..558fec948b34546cad0c9b3cd92c2dcc480e8e60 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -51,6 +49,8 @@
 #include "domain-util.h"
 #include "rr-util.h"
 
+#define AVAHI_DEFAULT_CACHE_ENTRIES_MAX 4096
+
 static void enum_aux_records(AvahiServer *s, AvahiInterface *i, const char *name, uint16_t type, void (*callback)(AvahiServer *s, AvahiRecord *r, int flush_cache, void* userdata), void* userdata) {
     assert(s);
     assert(i);
@@ -659,7 +659,6 @@ static void handle_response_packet(AvahiServer *s, AvahiDnsPacket *p, AvahiInter
              avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ARCOUNT); n > 0; n--) {
         AvahiRecord *record;
         int cache_flush = 0;
-/*         char *txt; */
 
         if (!(record = avahi_dns_packet_consume_record(p, &cache_flush))) {
             avahi_log_warn(__FILE__": Packet too short or invalid while reading response record. (Maybe a UTF-8 problem?)");
@@ -669,7 +668,7 @@ static void handle_response_packet(AvahiServer *s, AvahiDnsPacket *p, AvahiInter
         if (!avahi_key_is_pattern(record->key)) {
 
             if (handle_conflict(s, i, record, cache_flush)) {
-                if (!from_local_iface)
+                if (!from_local_iface && !avahi_record_is_link_local_address(record))
                     reflect_response(s, i, record, cache_flush);
                 avahi_cache_update(i->cache, record, cache_flush, a);
                 avahi_response_scheduler_incoming(i->response_scheduler, record, cache_flush);
@@ -680,7 +679,7 @@ static void handle_response_packet(AvahiServer *s, AvahiDnsPacket *p, AvahiInter
     }
 
     /* If the incoming response contained a conflicting record, some
-       records have been scheduling for sending. We need to flush them
+       records have been scheduled for sending. We need to flush them
        here. */
     if (!avahi_record_list_is_empty(s->record_list))
         avahi_server_generate_response(s, i, NULL, NULL, 0, 0, 1);
@@ -1009,13 +1008,6 @@ static void dispatch_legacy_unicast_packet(AvahiServer *s, AvahiDnsPacket *p) {
     avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_ID, slot->id);
 }
 
-static void cleanup_dead(AvahiServer *s) {
-    assert(s);
-
-    avahi_cleanup_dead_entries(s);
-    avahi_browser_cleanup(s);
-}
-
 static void mcast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) {
     AvahiServer *s = userdata;
     AvahiAddress dest, src;
@@ -1044,11 +1036,11 @@ static void mcast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, vo
         if (iface != AVAHI_IF_UNSPEC)
             dispatch_packet(s, p, &src, port, &dest, iface, ttl);
         else
-            avahi_log_error("Incoming packet recieved on address that isn't local.");
+            avahi_log_error("Incoming packet received on address that isn't local.");
 
         avahi_dns_packet_free(p);
 
-        cleanup_dead(s);
+        avahi_cleanup_dead_entries(s);
     }
 }
 
@@ -1071,7 +1063,7 @@ static void legacy_unicast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent e
         dispatch_legacy_unicast_packet(s, p);
         avahi_dns_packet_free(p);
 
-        cleanup_dead(s);
+        avahi_cleanup_dead_entries(s);
     }
 }
 
@@ -1593,6 +1585,7 @@ AvahiServerConfig* avahi_server_config_init(AvahiServerConfig *c) {
     c->allow_point_to_point = 0;
     c->publish_aaaa_on_ipv4 = 1;
     c->publish_a_on_ipv6 = 0;
+    c->n_cache_entries_max = AVAHI_DEFAULT_CACHE_ENTRIES_MAX;
 
     return c;
 }
index 4146d5ad593e5d3d05dc8265192a147c539f390f..be62105dba8788975d83b9f2a196f3a761b83bdd 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -450,6 +448,9 @@ static int sendmsg_loop(int fd, struct msghdr *msg, int flags) {
         if (sendmsg(fd, msg, flags) >= 0)
             break;
 
+        if (errno == EINTR)
+            continue;
+
         if (errno != EAGAIN) {
             char where[64];
             struct sockaddr_in *sin = msg->msg_name;
@@ -652,6 +653,10 @@ AvahiDnsPacket *avahi_recv_dns_packet_ipv4(
         goto fail;
     }
 
+    /* For corrupt packets FIONREAD returns zero size (See rhbz #607297) */
+    if (!ms)
+        goto fail;
+
     p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE);
 
     io.iov_base = AVAHI_DNS_PACKET_DATA(p);
@@ -805,6 +810,10 @@ AvahiDnsPacket *avahi_recv_dns_packet_ipv6(
         goto fail;
     }
 
+    /* For corrupt packets FIONREAD returns zero size (See rhbz #607297) */
+    if (!ms)
+        goto fail;
+
     p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE);
 
     io.iov_base = AVAHI_DNS_PACKET_DATA(p);
index 237b5346972d22608c6ff7190953319aba42069c..92f12d74113f6694908b0158b2990b2aff66c2d7 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foosockethfoo
 #define foosockethfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index c66a55ae49babe4623f044d61ec4e9bd50046871..d7b2e39c97f894e353f0810caafb7a9f92f52f23 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -32,8 +30,8 @@
 #include "timeeventq.h"
 #include "log.h"
 
-#define POINTER_TO_INT(p) ((int) (p))
-#define INT_TO_POINTER(i) ((void*) (i))
+#define POINTER_TO_INT(p) ((int) (long) (p))
+#define INT_TO_POINTER(i) ((void*) (long) (i))
 
 static AvahiTimeEventQueue *q = NULL;
 
index 17334ee063ba55af276bb6e19aeb12fbb4305b5f..2799bf242602171d69b96b878e61bb4f8de4d05b 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -83,7 +81,7 @@ static void expiration_event(AVAHI_GCC_UNUSED AvahiTimeout *timeout, void *userd
         struct timeval now;
 
         gettimeofday(&now, NULL);
-    
+
         /* Check if expired */
         if (avahi_timeval_compare(&now, &e->expiry) >= 0) {
 
@@ -97,7 +95,7 @@ static void expiration_event(AVAHI_GCC_UNUSED AvahiTimeout *timeout, void *userd
 
             update_timeout(q);
             return;
-        } 
+        }
     }
 
     avahi_log_debug(__FILE__": Strange, expiration_event() called, but nothing really happened.");
@@ -129,9 +127,9 @@ AvahiTimeEventQueue* avahi_time_event_queue_new(const AvahiPoll *poll_api) {
     if (!(q->prioq = avahi_prio_queue_new(compare)))
         goto oom;
 
-    if (!(q->timeout = poll_api->timeout_new(poll_api, NULL, expiration_event, q))) 
+    if (!(q->timeout = poll_api->timeout_new(poll_api, NULL, expiration_event, q)))
         goto oom;
-    
+
     return q;
 
 oom:
@@ -142,13 +140,13 @@ oom:
         if (q->prioq)
             avahi_prio_queue_free(q->prioq);
     }
-    
+
     return NULL;
 }
 
 void avahi_time_event_queue_free(AvahiTimeEventQueue *q) {
     AvahiTimeEvent *e;
-    
+
     assert(q);
 
     while ((e = time_event_queue_root(q)))
@@ -156,7 +154,7 @@ void avahi_time_event_queue_free(AvahiTimeEventQueue *q) {
     avahi_prio_queue_free(q->prioq);
 
     q->poll_api->timeout_free(q->timeout);
-    
+
     avahi_free(q);
 }
 
@@ -165,9 +163,9 @@ AvahiTimeEvent* avahi_time_event_new(
     const struct timeval *timeval,
     AvahiTimeEventCallback callback,
     void* userdata) {
-    
+
     AvahiTimeEvent *e;
-    
+
     assert(q);
     assert(callback);
     assert(userdata);
@@ -176,7 +174,7 @@ AvahiTimeEvent* avahi_time_event_new(
         avahi_log_error(__FILE__": Out of memory");
         return NULL; /* OOM */
     }
-    
+
     e->queue = q;
     e->callback = callback;
     e->userdata = userdata;
@@ -187,9 +185,9 @@ AvahiTimeEvent* avahi_time_event_new(
         e->expiry.tv_sec = 0;
         e->expiry.tv_usec = 0;
     }
-    
+
     fix_expiry_time(e);
-    
+
     e->last_run.tv_sec = 0;
     e->last_run.tv_usec = 0;
 
@@ -221,7 +219,7 @@ void avahi_time_event_update(AvahiTimeEvent *e, const struct timeval *timeval) {
     e->expiry = *timeval;
     fix_expiry_time(e);
     avahi_prio_queue_shuffle(e->queue->prioq, e->node);
-    
+
     update_timeout(e->queue);
 }
 
index cdfa5e693f64114009df9224363782bea56f81c6..a695b6aaf3c0a892b9e233ac0ff27bb871f6d998 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef footimeeventqhfoo
 #define footimeeventqhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 6b92900e5b4b94bd001911d13ba71dfed64a2269..feb884a02989f84ead31ab8320e267b20c5276d2 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -42,11 +40,11 @@ static AvahiSEntryGroup *group = NULL;
 
 static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UNUSED void* userdata) {
 
-    avahi_log_debug("server state: %i", state); 
-    
+    avahi_log_debug("server state: %i", state);
+
     if (state == AVAHI_SERVER_RUNNING) {
         int ret;
-        
+
         group = avahi_s_entry_group_new(s, NULL, NULL);
         assert(group);
 
@@ -62,7 +60,7 @@ static void modify_txt_callback(AVAHI_GCC_UNUSED AvahiTimeout *e, void *userdata
     AvahiServer *s = userdata;
 
     avahi_log_debug("modifying");
-    
+
     ret = avahi_server_update_service_txt(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "foo", "_http._tcp", NULL, "test2", NULL);
     assert(ret == AVAHI_OK);
 }
@@ -76,7 +74,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
     simple_poll = avahi_simple_poll_new();
     assert(simple_poll);
-    
+
     poll_api = avahi_simple_poll_get(simple_poll);
     assert(poll_api);
 
index b1925f0e207f5a41686fe7f5d81d5ac1e285d9bf..21ef94c4f405ae0639f44d08d58784be0e08380c 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -37,11 +35,11 @@ void avahi_hexdump(const void* p, size_t size) {
     assert(p);
 
     printf("Dumping %lu bytes from %p:\n", (unsigned long) size, p);
-    
+
     while (size > 0) {
         unsigned i;
 
-        for (i = 0; i < 16; i++) { 
+        for (i = 0; i < 16; i++) {
             if (i < size)
                 printf("%02x ", c[i]);
             else
@@ -54,14 +52,14 @@ void avahi_hexdump(const void* p, size_t size) {
             else
                 printf(" ");
         }
-        
+
         printf("\n");
 
         c += 16;
 
         if (size <= 16)
             break;
-        
+
         size -= 16;
     }
 }
@@ -74,22 +72,22 @@ char *avahi_format_mac_address(char *r, size_t l, const uint8_t* mac, size_t siz
     assert(r);
     assert(l > 0);
     assert(mac);
-    
+
     if (size <= 0) {
         *r = 0;
         return r;
     }
-    
+
     for (i = 0; i < size; i++) {
         if (l < 3)
             break;
-        
+
         *(t++) = hex[*mac >> 4];
         *(t++) = hex[*mac & 0xF];
         *(t++) = ':';
 
         l -= 3;
-        
+
         mac++;
     }
 
@@ -97,7 +95,7 @@ char *avahi_format_mac_address(char *r, size_t l, const uint8_t* mac, size_t siz
         *(t-1) = 0;
     else
         *r = 0;
-    
+
     return r;
 }
 
index 8d2caeea5d4c1726cd1a8b0b979e0d807ebc9fc1..e13c334ffb4c9025beba8e52c827a8879448b9e6 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooutilhfoo
 #define fooutilhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index add81c7e920efb67e81f38fd61bc4881f9e2deb6..d5e64e57d2b65d404db8b72023217b48c6a51580 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -48,13 +46,13 @@ typedef struct AvahiWideAreaCacheEntry AvahiWideAreaCacheEntry;
 
 struct AvahiWideAreaCacheEntry {
     AvahiWideAreaLookupEngine *engine;
-    
+
     AvahiRecord *record;
     struct timeval timestamp;
     struct timeval expiry;
 
     AvahiTimeEvent *time_event;
-    
+
     AVAHI_LLIST_FIELDS(AvahiWideAreaCacheEntry, by_key);
     AVAHI_LLIST_FIELDS(AvahiWideAreaCacheEntry, cache);
 };
@@ -62,12 +60,12 @@ struct AvahiWideAreaCacheEntry {
 struct AvahiWideAreaLookup {
     AvahiWideAreaLookupEngine *engine;
     int dead;
-    
+
     uint32_t id;  /* effectively just an uint16_t, but we need it as an index for a hash table */
     AvahiTimeEvent *time_event;
 
     AvahiKey *key, *cname_key;
-    
+
     int n_send;
     AvahiDnsPacket *packet;
 
@@ -87,7 +85,7 @@ struct AvahiWideAreaLookupEngine {
     AvahiWatch *watch_ipv4, *watch_ipv6;
 
     uint16_t next_id;
-    
+
     /* Cache */
     AVAHI_LLIST_HEAD(AvahiWideAreaCacheEntry, cache);
     AvahiHashmap *cache_by_key;
@@ -108,23 +106,23 @@ struct AvahiWideAreaLookupEngine {
 static AvahiWideAreaLookup* find_lookup(AvahiWideAreaLookupEngine *e, uint16_t id) {
     AvahiWideAreaLookup *l;
     int i = (int) id;
-    
+
     assert(e);
 
     if (!(l = avahi_hashmap_lookup(e->lookups_by_id, &i)))
         return NULL;
-    
+
     assert(l->id == id);
 
     if (l->dead)
         return NULL;
-    
+
     return l;
 }
 
 static int send_to_dns_server(AvahiWideAreaLookup *l, AvahiDnsPacket *p) {
     AvahiAddress *a;
-    
+
     assert(l);
     assert(p);
 
@@ -135,20 +133,20 @@ static int send_to_dns_server(AvahiWideAreaLookup *l, AvahiDnsPacket *p) {
 
     a = &l->engine->dns_servers[l->engine->current_dns_server];
     l->dns_server_used = *a;
-    
+
     if (a->proto == AVAHI_PROTO_INET) {
 
         if (l->engine->fd_ipv4 < 0)
             return -1;
-        
+
         return avahi_send_dns_packet_ipv4(l->engine->fd_ipv4, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv4, AVAHI_DNS_PORT);
-        
+
     } else {
         assert(a->proto == AVAHI_PROTO_INET6);
 
         if (l->engine->fd_ipv6 < 0)
             return -1;
-        
+
         return avahi_send_dns_packet_ipv6(l->engine->fd_ipv6, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv6, AVAHI_DNS_PORT);
     }
 }
@@ -164,7 +162,7 @@ static void next_dns_server(AvahiWideAreaLookupEngine *e) {
 
 static void lookup_stop(AvahiWideAreaLookup *l) {
     assert(l);
-    
+
     l->callback = NULL;
 
     if (l->time_event) {
@@ -187,7 +185,7 @@ static void sender_timeout_callback(AvahiTimeEvent *e, void *userdata) {
             /* There is no other DNS server, fail */
             l->n_send = 1000;
     }
-    
+
     if (l->n_send >= 6) {
         avahi_log_warn(__FILE__": Query timed out.");
         avahi_server_set_errno(l->engine->server, AVAHI_ERR_TIMEOUT);
@@ -208,7 +206,7 @@ AvahiWideAreaLookup *avahi_wide_area_lookup_new(
     AvahiKey *key,
     AvahiWideAreaLookupCallback callback,
     void *userdata) {
-    
+
     struct timeval tv;
     AvahiWideAreaLookup *l, *t;
     uint8_t *p;
@@ -234,7 +232,7 @@ AvahiWideAreaLookup *avahi_wide_area_lookup_new(
             break; /* This ID is not yet used. */
 
     l->id = e->next_id++;
-    
+
     /* We keep the packet around in case we need to repeat our query */
     l->packet = avahi_dns_packet_new(0);
 
@@ -243,7 +241,7 @@ AvahiWideAreaLookup *avahi_wide_area_lookup_new(
 
     p = avahi_dns_packet_append_key(l->packet, key, 0);
     assert(p);
-    
+
     avahi_dns_packet_set_field(l->packet, AVAHI_DNS_FIELD_QDCOUNT, 1);
 
     if (send_to_dns_server(l, l->packet) < 0) {
@@ -257,7 +255,7 @@ AvahiWideAreaLookup *avahi_wide_area_lookup_new(
     }
 
     l->n_send = 1;
-    
+
     l->time_event = avahi_time_event_new(e->server->time_event_queue, avahi_elapse_time(&tv, 500, 0), sender_timeout_callback, l);
 
     avahi_hashmap_insert(e->lookups_by_id, &l->id, l);
@@ -267,14 +265,14 @@ AvahiWideAreaLookup *avahi_wide_area_lookup_new(
     avahi_hashmap_replace(e->lookups_by_key, avahi_key_ref(l->key), t);
 
     AVAHI_LLIST_PREPEND(AvahiWideAreaLookup, lookups, e->lookups, l);
-    
+
     return l;
 }
 
 static void lookup_destroy(AvahiWideAreaLookup *l) {
     AvahiWideAreaLookup *t;
     assert(l);
-    
+
     lookup_stop(l);
 
     t = avahi_hashmap_lookup(l->engine->lookups_by_key, l->key);
@@ -285,7 +283,7 @@ static void lookup_destroy(AvahiWideAreaLookup *l) {
         avahi_hashmap_remove(l->engine->lookups_by_key, l->key);
 
     AVAHI_LLIST_REMOVE(AvahiWideAreaLookup, lookups, l->engine->lookups, l);
-    
+
     avahi_hashmap_remove(l->engine->lookups_by_id, &l->id);
     avahi_dns_packet_free(l->packet);
 
@@ -294,7 +292,7 @@ static void lookup_destroy(AvahiWideAreaLookup *l) {
 
     if (l->cname_key)
         avahi_key_unref(l->cname_key);
-    
+
     avahi_free(l);
 }
 
@@ -315,10 +313,10 @@ void avahi_wide_area_cleanup(AvahiWideAreaLookupEngine *e) {
 
     while (e->cleanup_dead) {
         e->cleanup_dead = 0;
-    
+
         for (l = e->lookups; l; l = n) {
             n = l->lookups_next;
-            
+
             if (l->dead)
                 lookup_destroy(l);
         }
@@ -349,7 +347,7 @@ static void cache_entry_free(AvahiWideAreaCacheEntry *c) {
 
 static void expiry_event(AvahiTimeEvent *te, void *userdata) {
     AvahiWideAreaCacheEntry *e = userdata;
-    
+
     assert(te);
     assert(e);
 
@@ -358,7 +356,7 @@ static void expiry_event(AvahiTimeEvent *te, void *userdata) {
 
 static AvahiWideAreaCacheEntry* find_record_in_cache(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
     AvahiWideAreaCacheEntry *c;
-    
+
     assert(e);
     assert(r);
 
@@ -371,17 +369,17 @@ static AvahiWideAreaCacheEntry* find_record_in_cache(AvahiWideAreaLookupEngine *
 
 static void run_callbacks(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
     AvahiWideAreaLookup *l;
-    
+
     assert(e);
     assert(r);
 
     for (l = avahi_hashmap_lookup(e->lookups_by_key, r->key); l; l = l->by_key_next) {
         if (l->dead || !l->callback)
             continue;
-        
+
         l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA, r, l->userdata);
     }
-    
+
     if (r->key->clazz == AVAHI_DNS_CLASS_IN && r->key->type == AVAHI_DNS_TYPE_CNAME) {
         /* It's a CNAME record, so we have to scan the all lookups to see if one matches */
 
@@ -390,7 +388,7 @@ static void run_callbacks(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
 
             if (l->dead || !l->callback)
                 continue;
-            
+
             if ((key = avahi_key_new_cname(l->key))) {
                 if (avahi_key_equal(r->key, key))
                     l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA, r, l->userdata);
@@ -404,7 +402,7 @@ static void run_callbacks(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
 static void add_to_cache(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
     AvahiWideAreaCacheEntry *c;
     int is_new;
-    
+
     assert(e);
     assert(r);
 
@@ -422,7 +420,7 @@ static void add_to_cache(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
         if (e->cache_n_entries >= CACHE_ENTRIES_MAX)
             /* Eventually we should improve the caching algorithm here */
             goto finish;
-        
+
         c = avahi_new(AvahiWideAreaCacheEntry, 1);
         c->engine = e;
         c->time_event = NULL;
@@ -438,7 +436,7 @@ static void add_to_cache(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
     }
 
     c->record = avahi_record_ref(r);
-    
+
     gettimeofday(&c->timestamp, NULL);
     c->expiry = c->timestamp;
     avahi_timeval_add(&c->expiry, r->ttl * 1000000);
@@ -449,7 +447,7 @@ static void add_to_cache(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
         c->time_event = avahi_time_event_new(e->server->time_event_queue, &c->expiry, expiry_event, c);
 
 finish:
-    
+
     if (is_new)
         run_callbacks(e, r);
 }
@@ -484,7 +482,7 @@ static void handle_packet(AvahiWideAreaLookupEngine *e, AvahiDnsPacket *p) {
     int i, r;
 
     AvahiBrowserEvent final_event = AVAHI_BROWSER_ALL_FOR_NOW;
-    
+
     assert(e);
     assert(p);
 
@@ -513,7 +511,7 @@ static void handle_packet(AvahiWideAreaLookupEngine *e, AvahiDnsPacket *p) {
     /* Skip over the question */
     for (i = (int) avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_QDCOUNT); i > 0; i--) {
         AvahiKey *k;
-        
+
         if (!(k = avahi_dns_packet_consume_key(p, NULL))) {
             avahi_log_warn(__FILE__": Wide area response packet too short or invalid while reading question key. (Maybe a UTF-8 problem?)");
             avahi_server_set_errno(e->server, AVAHI_ERR_INVALID_PACKET);
@@ -543,7 +541,7 @@ static void handle_packet(AvahiWideAreaLookupEngine *e, AvahiDnsPacket *p) {
     }
 
 finish:
-    
+
     if (l && !l->dead) {
         if (l->callback)
             l->callback(e, final_event, AVAHI_LOOKUP_RESULT_WIDE_AREA, NULL, l->userdata);
@@ -555,7 +553,7 @@ finish:
 static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent events, void *userdata) {
     AvahiWideAreaLookupEngine *e = userdata;
     AvahiDnsPacket *p = NULL;
-    
+
     if (fd == e->fd_ipv4)
         p = avahi_recv_dns_packet_ipv4(e->fd_ipv4, NULL, NULL, NULL, NULL, NULL);
     else {
@@ -571,7 +569,7 @@ static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSE
 
 AvahiWideAreaLookupEngine *avahi_wide_area_engine_new(AvahiServer *s) {
     AvahiWideAreaLookupEngine *e;
-    
+
     assert(s);
 
     e = avahi_new(AvahiWideAreaLookupEngine, 1);
@@ -590,7 +588,7 @@ AvahiWideAreaLookupEngine *avahi_wide_area_engine_new(AvahiServer *s) {
 
         if (e->fd_ipv4 >= 0)
             close(e->fd_ipv4);
-        
+
         avahi_free(e);
         return NULL;
     }
@@ -598,7 +596,7 @@ AvahiWideAreaLookupEngine *avahi_wide_area_engine_new(AvahiServer *s) {
     /* Create watches */
 
     e->watch_ipv4 = e->watch_ipv6 = NULL;
-    
+
     if (e->fd_ipv4 >= 0)
         e->watch_ipv4 = s->poll_api->watch_new(e->server->poll_api, e->fd_ipv4, AVAHI_WATCH_IN, socket_event, e);
     if (e->fd_ipv6 >= 0)
@@ -622,12 +620,12 @@ AvahiWideAreaLookupEngine *avahi_wide_area_engine_new(AvahiServer *s) {
 
 void avahi_wide_area_engine_free(AvahiWideAreaLookupEngine *e) {
     assert(e);
-    
+
     avahi_wide_area_clear_cache(e);
 
     while (e->lookups)
         lookup_destroy(e->lookups);
-    
+
     avahi_hashmap_free(e->cache_by_key);
     avahi_hashmap_free(e->lookups_by_id);
     avahi_hashmap_free(e->lookups_by_key);
@@ -640,7 +638,7 @@ void avahi_wide_area_engine_free(AvahiWideAreaLookupEngine *e) {
 
     if (e->fd_ipv6 >= 0)
         close(e->fd_ipv6);
-    
+
     if (e->fd_ipv4 >= 0)
         close(e->fd_ipv4);
 
@@ -660,14 +658,14 @@ void avahi_wide_area_set_servers(AvahiWideAreaLookupEngine *e, const AvahiAddres
     assert(e);
 
     if (a) {
-        for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_WIDE_AREA_SERVERS_MAX; a++, n--) 
+        for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_WIDE_AREA_SERVERS_MAX; a++, n--)
             if ((a->proto == AVAHI_PROTO_INET && e->fd_ipv4 >= 0) || (a->proto == AVAHI_PROTO_INET6 && e->fd_ipv6 >= 0))
                 e->dns_servers[e->n_dns_servers++] = *a;
     } else {
         assert(n == 0);
         e->n_dns_servers = 0;
     }
-    
+
     e->current_dns_server = 0;
 
     avahi_wide_area_clear_cache(e);
@@ -675,12 +673,12 @@ void avahi_wide_area_set_servers(AvahiWideAreaLookupEngine *e, const AvahiAddres
 
 void avahi_wide_area_cache_dump(AvahiWideAreaLookupEngine *e, AvahiDumpCallback callback, void* userdata) {
     AvahiWideAreaCacheEntry *c;
-    
+
     assert(e);
     assert(callback);
 
     callback(";; WIDE AREA CACHE ;;; ", userdata);
-    
+
     for (c = e->cache; c; c = c->cache_next) {
         char *t = avahi_record_to_string(c->record);
         callback(t, userdata);
@@ -692,7 +690,7 @@ unsigned avahi_wide_area_scan_cache(AvahiWideAreaLookupEngine *e, AvahiKey *key,
     AvahiWideAreaCacheEntry *c;
     AvahiKey *cname_key;
     unsigned n = 0;
-    
+
     assert(e);
     assert(key);
     assert(callback);
@@ -708,7 +706,7 @@ unsigned avahi_wide_area_scan_cache(AvahiWideAreaLookupEngine *e, AvahiKey *key,
             callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA|AVAHI_LOOKUP_RESULT_CACHED, c->record, userdata);
             n++;
         }
-        
+
         avahi_key_unref(cname_key);
     }
 
@@ -722,4 +720,4 @@ int avahi_wide_area_has_servers(AvahiWideAreaLookupEngine *e) {
 }
 
 
-    
+
index 1af613b990cab34e4ccc39a320a4dcb6a39fce9f..b1dc570f9d49ff9e81893c4327f04b90f066e919 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foowideareahfoo
 #define foowideareahfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index bb2aeab07c47e4f5886190f1899e6c70c0043cd2..f1a6f8d604b77743f0ba5cb1861c56d9715d3f9e 100644 (file)
@@ -1,3 +1,5 @@
+avahi-daemon.service
+avahi-daemon.socket
 avahi-daemon
 avahi-dbus.conf
 ini-file-parser-test
diff --git a/avahi-daemon/AddressResolver.introspect b/avahi-daemon/AddressResolver.introspect
deleted file mode 100644 (file)
index 3550ecd..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out" />
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.AddressResolver">
-
-    <method name="Free"/>
-      
-    <signal name="Found">
-      <arg name="interface" type="i" direction="out"/>
-      <arg name="protocol" type="i" direction="out"/>
-      <arg name="aprotocol" type="i" direction="out"/>
-      <arg name="address" type="s" direction="out"/>
-      <arg name="name" type="s" direction="out"/>
-      <arg name="flags" type="u" direction="out"/>
-    </signal>
-
-    <signal name="Failure">
-      <arg name="error" type="s"/>
-    </signal>
-
-  </interface> 
-</node>
diff --git a/avahi-daemon/DomainBrowser.introspect b/avahi-daemon/DomainBrowser.introspect
deleted file mode 100644 (file)
index 5840060..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-  
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out" />
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.DomainBrowser">
-
-    <method name="Free"/>
-      
-    <signal name="ItemNew">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="domain" type="s"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="ItemRemove">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="domain" type="s"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="Failure">
-      <arg name="error" type="s"/>
-    </signal>
-
-    <signal name="AllForNow"/>
-
-    <signal name="CacheExhausted"/>
-
-  </interface> 
-</node>
-
diff --git a/avahi-daemon/EntryGroup.introspect b/avahi-daemon/EntryGroup.introspect
deleted file mode 100644 (file)
index e49bbe6..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-  
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out"/>
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.EntryGroup">
-    <method name="Free"/>
-    <method name="Commit"/>
-    <method name="Reset"/>
-
-    <method name="GetState">
-      <arg name="state" type="i" direction="out"/>
-    </method>
-
-    <signal name="StateChanged">
-      <arg name="state" type="i"/>
-      <arg name="error" type="s"/>
-    </signal>
-
-    <method name="IsEmpty">
-      <arg name="empty" type="b" direction="out"/>
-    </method>
-
-    <method name="AddService">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="type" type="s" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="host" type="s" direction="in"/>
-      <arg name="port" type="q" direction="in"/>
-      <arg name="txt" type="aay" direction="in"/>
-    </method>
-
-    <method name="AddServiceSubtype">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="type" type="s" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="subtype" type="s" direction="in"/>
-    </method>
-
-    <method name="UpdateServiceTxt">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="type" type="s" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="txt" type="aay" direction="in"/>
-    </method>
-
-    <method name="AddAddress">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="address" type="s" direction="in"/>
-    </method>
-
-    <method name="AddRecord">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="clazz" type="q" direction="in"/>
-      <arg name="type" type="q" direction="in"/>
-      <arg name="ttl" type="u" direction="in"/>
-      <arg name="rdata" type="ay" direction="in"/>
-    </method>
-  </interface>
-</node>
diff --git a/avahi-daemon/HostNameResolver.introspect b/avahi-daemon/HostNameResolver.introspect
deleted file mode 100644 (file)
index 9ac2e36..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out" />
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.HostNameResolver">
-
-    <method name="Free"/>
-
-    <signal name="Found">
-      <arg name="interface" type="i" direction="out"/>
-      <arg name="protocol" type="i" direction="out"/>
-      <arg name="name" type="s" direction="out"/>
-      <arg name="aprotocol" type="i" direction="out"/>
-      <arg name="address" type="s" direction="out"/>
-      <arg name="flags" type="u" direction="out"/>
-    </signal>
-
-    <signal name="Failure">
-      <arg name="error" type="s"/>
-    </signal>
-
-  </interface>
-</node>
index 0aac0fc9ab8410c6e30e777118be6beb25f3cbf3..b5d2bf475baa08ca6f18d95f570e614aac96cb87 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -27,7 +25,8 @@ if HAVE_XML
 
 pkgsysconfdir=$(sysconfdir)/avahi
 servicedir=$(pkgsysconfdir)/services
-introspectiondir=$(pkgdatadir)/introspection
+introspectiondir=$(datadir)/dbus-1/interfaces
+dbussystemservicesdir=$(datadir)/dbus-1/system-services
 
 AM_CFLAGS+= \
        -DAVAHI_DAEMON_RUNTIME_DIR=\"$(avahi_runtime_dir)/avahi-daemon/\" \
@@ -53,6 +52,7 @@ avahi_daemon_SOURCES = \
        static-hosts.c static-hosts.h \
        ini-file-parser.c ini-file-parser.h \
        setproctitle.c setproctitle.h \
+       sd-daemon.h sd-daemon.c \
        ../avahi-client/check-nss.c
 
 avahi_daemon_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS) $(XML_CFLAGS)
@@ -63,19 +63,37 @@ ini_file_parser_test_SOURCES = \
        ini-file-parser-test.c
 
 ini_file_parser_test_CFLAGS = $(AM_CFLAGS)
-ini_file_parser_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la 
+ini_file_parser_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la
 
 pkgsysconf_DATA = \
        avahi-daemon.conf \
        hosts
 
-service_DATA = \
+dist_service_DATA = \
        ssh.service \
        sftp-ssh.service
 
-pkgdata_DATA = \
+dist_pkgdata_DATA = \
        avahi-service.dtd
 
+%.service: %.service.in
+       $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+
+%.socket: %.socket.in
+       $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' \
+               -e 's,@avahi_runtime_dir\@,$(avahi_runtime_dir),g' $< > $@
+
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+       avahi-daemon.service \
+       avahi-daemon.socket
+
+dist_dbussystemservices_DATA = \
+       org.freedesktop.Avahi.service
+endif
+
+CLEANFILES = $(systemdsystemunit_DATA)
+
 if ENABLE_CHROOT
 
 avahi_daemon_SOURCES += \
@@ -117,43 +135,32 @@ avahi_daemon_LDADD += \
 
 avahi_daemon_CFLAGS += $(DBUS_CFLAGS) -DDBUS_SYSTEM_BUS_DEFAULT_ADDRESS=\"$(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)\"
 
-dbusservice_DATA = avahi-dbus.conf
+dist_dbusservice_DATA = avahi-dbus.conf
 
-introspection_DATA = \
-       Server.introspect \
-       EntryGroup.introspect \
-       DomainBrowser.introspect \
-       ServiceTypeBrowser.introspect \
-       ServiceBrowser.introspect \
-       ServiceResolver.introspect \
-       AddressResolver.introspect \
-       HostNameResolver.introspect \
-       RecordBrowser.introspect
+dist_introspection_DATA = \
+       org.freedesktop.Avahi.Server.xml \
+       org.freedesktop.Avahi.EntryGroup.xml \
+       org.freedesktop.Avahi.DomainBrowser.xml \
+       org.freedesktop.Avahi.ServiceTypeBrowser.xml \
+       org.freedesktop.Avahi.ServiceBrowser.xml \
+       org.freedesktop.Avahi.ServiceResolver.xml \
+       org.freedesktop.Avahi.AddressResolver.xml \
+       org.freedesktop.Avahi.HostNameResolver.xml \
+       org.freedesktop.Avahi.RecordBrowser.xml
 
 endif
 endif
 endif
 
 EXTRA_DIST = \
-       avahi-service.dtd \
        avahi-daemon.conf \
        example.service \
-       avahi-dbus.conf \
-       Server.introspect \
-       EntryGroup.introspect \
-       DomainBrowser.introspect \
-       ServiceTypeBrowser.introspect \
-       ServiceBrowser.introspect \
-       ServiceResolver.introspect \
-       AddressResolver.introspect \
-       HostNameResolver.introspect \
-       RecordBrowser.introspect \
-       ssh.service \
-       sftp-ssh.service \
        hosts \
        example.service \
        introspect.dtd \
-       introspect.xsl
+       introspect.xsl \
+       avahi-daemon.service.in \
+       avahi-daemon.socket.in
 
 xmllint:
        xmllint --noout --valid example.service
@@ -163,3 +170,7 @@ xmllint:
 
 install-data-local:
        test -z "$(localstatedir)/run" || $(mkdir_p) "$(DESTDIR)$(localstatedir)/run"
+
+update-systemd:
+       curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
+       curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h
diff --git a/avahi-daemon/RecordBrowser.introspect b/avahi-daemon/RecordBrowser.introspect
deleted file mode 100644 (file)
index 57c1e66..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-  
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out" />
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.RecordBrowser">
-
-    <method name="Free"/>
-      
-    <signal name="ItemNew">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="name" type="s"/>
-      <arg name="clazz" type="q"/>
-      <arg name="type" type="q"/>
-      <arg name="rdata" type="ay"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="ItemRemove">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="name" type="s"/>
-      <arg name="clazz" type="q"/>
-      <arg name="type" type="q"/>
-      <arg name="rdata" type="ay"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="Failure">
-      <arg name="error" type="s"/>
-    </signal>
-
-    <signal name="AllForNow"/>
-
-    <signal name="CacheExhausted"/>
-
-  </interface> 
-</node>
diff --git a/avahi-daemon/Server.introspect b/avahi-daemon/Server.introspect
deleted file mode 100644 (file)
index 9d743ba..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-
- <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out"/>
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.Server">
-
-    <method name="GetVersionString">
-      <arg name="version" type="s" direction="out"/>
-    </method>
-
-    <method name="GetAPIVersion">
-      <arg name="version" type="u" direction="out"/>
-    </method>
-
-    <method name="GetHostName">
-      <arg name="name" type="s" direction="out"/>
-    </method>
-    <method name="SetHostName">
-      <arg name="name" type="s" direction="in"/>
-    </method>
-    <method name="GetHostNameFqdn">
-      <arg name="name" type="s" direction="out"/>
-    </method>
-    <method name="GetDomainName">
-      <arg name="name" type="s" direction="out"/>
-    </method>
-
-    <method name="IsNSSSupportAvailable">
-      <arg name="yes" type="b" direction="out"/>
-    </method>
-
-    <method name="GetState">
-      <arg name="state" type="i" direction="out"/>
-    </method>
-
-    <signal name="StateChanged">
-      <arg name="state" type="i"/>
-      <arg name="error" type="s"/>
-    </signal>
-
-    <method name="GetLocalServiceCookie">
-      <arg name="cookie" type="u" direction="out"/>
-    </method>
-
-    <method name="GetAlternativeHostName">
-      <arg name="name" type="s" direction="in"/>
-      <arg name="name" type="s" direction="out"/>
-    </method>
-
-    <method name="GetAlternativeServiceName">
-      <arg name="name" type="s" direction="in"/>
-      <arg name="name" type="s" direction="out"/>
-    </method>
-
-    <method name="GetNetworkInterfaceNameByIndex">
-      <arg name="index" type="i" direction="in"/>
-      <arg name="name" type="s" direction="out"/>
-    </method>
-    <method name="GetNetworkInterfaceIndexByName">
-      <arg name="name" type="s" direction="in"/>
-      <arg name="index" type="i" direction="out"/>
-    </method>
-
-    <method name="ResolveHostName">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="interface" type="i" direction="out"/>
-      <arg name="protocol" type="i" direction="out"/>
-      <arg name="name" type="s" direction="out"/>
-      <arg name="aprotocol" type="i" direction="out"/>
-      <arg name="address" type="s" direction="out"/>
-      <arg name="flags" type="u" direction="out"/>
-    </method>
-
-    <method name="ResolveAddress">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="address" type="s" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="interface" type="i" direction="out"/>
-      <arg name="protocol" type="i" direction="out"/>
-      <arg name="aprotocol" type="i" direction="out"/>
-      <arg name="address" type="s" direction="out"/>
-      <arg name="name" type="s" direction="out"/>
-      <arg name="flags" type="u" direction="out"/>
-    </method>
-
-    <method name="ResolveService">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="type" type="s" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="interface" type="i" direction="out"/>
-      <arg name="protocol" type="i" direction="out"/>
-      <arg name="name" type="s" direction="out"/>
-      <arg name="type" type="s" direction="out"/>
-      <arg name="domain" type="s" direction="out"/>
-      <arg name="host" type="s" direction="out"/>
-      <arg name="aprotocol" type="i" direction="out"/>
-      <arg name="address" type="s" direction="out"/>
-      <arg name="port" type="q" direction="out"/>
-      <arg name="txt" type="aay" direction="out"/>
-      <arg name="flags" type="u" direction="out"/>
-    </method>
-
-    <method name="EntryGroupNew">
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-    <method name="DomainBrowserNew">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="btype" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-    <method name="ServiceTypeBrowserNew">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-    <method name="ServiceBrowserNew">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="type" type="s" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-    <method name="ServiceResolverNew">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="type" type="s" direction="in"/>
-      <arg name="domain" type="s" direction="in"/>
-      <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-    <method name="HostNameResolverNew">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="aprotocol" type="i" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-    <method name="AddressResolverNew">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="address" type="s" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-    <method name="RecordBrowserNew">
-      <arg name="interface" type="i" direction="in"/>
-      <arg name="protocol" type="i" direction="in"/>
-      <arg name="name" type="s" direction="in"/>
-      <arg name="clazz" type="q" direction="in"/>
-      <arg name="type" type="q" direction="in"/>
-      <arg name="flags" type="u" direction="in"/>
-
-      <arg name="path" type="o" direction="out"/>
-    </method>
-
-
-  </interface>
-</node>
diff --git a/avahi-daemon/ServiceBrowser.introspect b/avahi-daemon/ServiceBrowser.introspect
deleted file mode 100644 (file)
index 4a7b430..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-  
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out" />
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.ServiceBrowser">
-
-    <method name="Free"/>
-      
-    <signal name="ItemNew">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="name" type="s"/>
-      <arg name="type" type="s"/>
-      <arg name="domain" type="s"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="ItemRemove">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="name" type="s"/>
-      <arg name="type" type="s"/>
-      <arg name="domain" type="s"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="Failure">
-      <arg name="error" type="s"/>
-    </signal>
-
-    <signal name="AllForNow"/>
-
-    <signal name="CacheExhausted"/>
-
-  </interface> 
-</node>
diff --git a/avahi-daemon/ServiceResolver.introspect b/avahi-daemon/ServiceResolver.introspect
deleted file mode 100644 (file)
index 2be9347..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out" />
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.ServiceResolver">
-
-    <method name="Free"/>
-      
-    <signal name="Found">
-      <arg name="interface" type="i" direction="out"/>
-      <arg name="protocol" type="i" direction="out"/>
-      <arg name="name" type="s" direction="out"/>
-      <arg name="type" type="s" direction="out"/>
-      <arg name="domain" type="s" direction="out"/>
-      <arg name="host" type="s" direction="out"/>
-      <arg name="aprotocol" type="i" direction="out"/>
-      <arg name="address" type="s" direction="out"/>
-      <arg name="port" type="q" direction="out"/>
-      <arg name="txt" type="aay" direction="out"/>
-      <arg name="flags" type="u" direction="out"/>
-    </signal>
-
-    <signal name="Failure">
-      <arg name="error" type="s"/>
-    </signal>
-
-  </interface> 
-</node>
diff --git a/avahi-daemon/ServiceTypeBrowser.introspect b/avahi-daemon/ServiceTypeBrowser.introspect
deleted file mode 100644 (file)
index cb07f24..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
-<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
-<!DOCTYPE node SYSTEM "introspect.dtd">
-
-<!-- $Id$ -->
-
-<!--
-  This file is part of avahi.
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-  02111-1307 USA.
--->
-
-<node>
-  
-  <interface name="org.freedesktop.DBus.Introspectable">
-    <method name="Introspect">
-      <arg name="data" type="s" direction="out" />
-    </method>
-  </interface>
-
-  <interface name="org.freedesktop.Avahi.ServiceTypeBrowser">
-
-    <method name="Free"/>
-      
-    <signal name="ItemNew">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="type" type="s"/>
-      <arg name="domain" type="s"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="ItemRemove">
-      <arg name="interface" type="i"/>
-      <arg name="protocol" type="i"/>
-      <arg name="type" type="s"/>
-      <arg name="domain" type="s"/>
-      <arg name="flags" type="u"/>
-    </signal>
-
-    <signal name="Failure">
-      <arg name="error" type="s"/>
-    </signal>
-
-    <signal name="AllForNow"/>
-
-    <signal name="CacheExhausted"/>
-
-  </interface> 
-</node>
index ad69c735354ded96b43b96f765c13c42f4cea41e..456f330e66acc66a0e5d32d17669b2f1c2b919f7 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -33,6 +31,10 @@ use-ipv6=no
 #enable-dbus=yes
 #disallow-other-stacks=no
 #allow-point-to-point=no
+#cache-entries-max=4096
+#clients-max=4096
+#objects-per-client-max=1024
+#entries-per-entry-group-max=32
 
 [wide-area]
 enable-wide-area=yes
diff --git a/avahi-daemon/avahi-daemon.service.in b/avahi-daemon/avahi-daemon.service.in
new file mode 100644 (file)
index 0000000..d5a9dd4
--- /dev/null
@@ -0,0 +1,31 @@
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+[Unit]
+Requires=basic.target avahi-daemon.socket
+After=basic.target syslog.target avahi-daemon.socket
+Conflicts=shutdown.target
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.Avahi
+ExecStart=@sbindir@/avahi-daemon -s
+ExecReload=@sbindir@/avahi-daemon -r
+
+[Install]
+WantedBy=multi-user.target
+Also=avahi-daemon.socket
diff --git a/avahi-daemon/avahi-daemon.socket.in b/avahi-daemon/avahi-daemon.socket.in
new file mode 100644 (file)
index 0000000..b8e6b79
--- /dev/null
@@ -0,0 +1,27 @@
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+[Unit]
+After=sysinit.target
+Before=sockets.target
+Conflicts=shutdown.target
+
+[Socket]
+ListenStream=@avahi_runtime_dir@/avahi-daemon/socket
+
+[Install]
+WantedBy=sockets.target
index c3c25e23b732889cf49d4c6e6477e054243e8132..daf96372a080aed261caeb8597f5509f12e2c615 100644 (file)
@@ -1,5 +1,3 @@
-<!-- $Id$ -->
-
 <!ELEMENT service-group (name,service+)>
 <!ATTLIST service-group>
 <!ELEMENT name (#PCDATA)>
index fbb9d7a84c5453f43ee3d87c1a7302d73e1717b1..0e21acfde9dc8a56f3021f9b51f0c56980018751 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -38,18 +36,18 @@ int avahi_caps_reduce(void) {
     int ret = 0;
     cap_t caps;
     static cap_value_t cap_values[] = { CAP_SYS_CHROOT, CAP_SETUID, CAP_SETGID };
-    
+
     /* Let's reduce our caps to the minimum set and tell Linux to keep
      * them across setuid(). This is called before we drop
      * privileges. */
-    
+
     caps = cap_init();
     assert(caps);
     cap_clear(caps);
 
     cap_set_flag(caps, CAP_EFFECTIVE, 3, cap_values, CAP_SET);
     cap_set_flag(caps, CAP_PERMITTED, 3, cap_values, CAP_SET);
-    
+
     if (cap_set_proc(caps) < 0) {
         avahi_log_error("cap_set_proc() failed: %s", strerror(errno));
         ret = -1;
@@ -73,7 +71,7 @@ int avahi_caps_reduce2(void) {
     /* Reduce our caps to the bare minimum and tell Linux not to keep
      * them across setuid(). This is called after we drop
      * privileges. */
-    
+
     /* No longer retain caps across setuid() */
     if (prctl(PR_SET_KEEPCAPS, 0, 0, 0, 0) < 0) {
         avahi_log_error("prctl(PR_SET_KEEPCAPS) failed: %s", strerror(errno));
@@ -106,12 +104,12 @@ int avahi_caps_drop_all(void) {
     caps = cap_init();
     assert(caps);
     cap_clear(caps);
-    
+
     if (cap_set_proc(caps) < 0) {
         avahi_log_error("cap_set_proc() failed: %s", strerror(errno));
         ret = -1;
     }
     cap_free(caps);
-    
+
     return ret;
 }
index 788acebf4ae0ac7f214ff9ac8d93ac3647b93dd0..5119bd041f775d62d8660a6f0e4c5488e2ed477f 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foocapshfoo
 #define foocapshfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 20e2f03596eb35e6c5aedce0559d6db111fd695b..d796a399510703b45f2661262e3cc848e4419d8d 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -66,15 +64,15 @@ static const char* const get_file_name_table[AVAHI_CHROOT_MAX] = {
     NULL,
     "/etc/resolv.conf",
 #ifdef HAVE_DBUS
-    AVAHI_DBUS_INTROSPECTION_DIR"/Server.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/EntryGroup.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/AddressResolver.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/DomainBrowser.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/HostNameResolver.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/ServiceBrowser.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/ServiceResolver.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/ServiceTypeBrowser.introspect",
-    AVAHI_DBUS_INTROSPECTION_DIR"/RecordBrowser.introspect",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.Server.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.EntryGroup.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.AddressResolver.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.DomainBrowser.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.HostNameResolver.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.ServiceBrowser.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.ServiceResolver.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.ServiceTypeBrowser.xml",
+    AVAHI_DBUS_INTROSPECTION_DIR"/org.freedesktop.Avahi.RecordBrowser.xml",
 #endif
     NULL,
     NULL
@@ -106,19 +104,19 @@ static int send_fd(int fd, int payload_fd) {
     struct iovec iov;
     struct msghdr msg;
     union {
-       struct cmsghdr hdr;
-       char buf[CMSG_SPACE(sizeof(int))];
+        struct cmsghdr hdr;
+        char buf[CMSG_SPACE(sizeof(int))];
     } cmsg;
 
     /* Send a file descriptor over the socket */
-    
+
     memset(&iov, 0, sizeof(iov));
     memset(&msg, 0, sizeof(msg));
     memset(&cmsg, 0, sizeof(cmsg));
-       
-    iov.iov_base = &dummy;  
+
+    iov.iov_base = &dummy;
     iov.iov_len = sizeof(dummy);
-       
+
     msg.msg_iov = &iov;
     msg.msg_iovlen = 1;
     msg.msg_name = NULL;
@@ -127,7 +125,7 @@ static int send_fd(int fd, int payload_fd) {
     msg.msg_control = &cmsg;
     msg.msg_controllen = sizeof(cmsg);
     msg.msg_flags = 0;
-               
+
     cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(int));
     cmsg.hdr.cmsg_level = SOL_SOCKET;
     cmsg.hdr.cmsg_type = SCM_RIGHTS;
@@ -146,8 +144,8 @@ static int recv_fd(int fd) {
     struct iovec iov;
     struct msghdr msg;
     union {
-       struct cmsghdr hdr;
-       char buf[CMSG_SPACE(sizeof(int))];
+        struct cmsghdr hdr;
+        char buf[CMSG_SPACE(sizeof(int))];
     } cmsg;
 
     /* Receive a file descriptor from a socket */
@@ -155,10 +153,10 @@ static int recv_fd(int fd) {
     memset(&iov, 0, sizeof(iov));
     memset(&msg, 0, sizeof(msg));
     memset(&cmsg, 0, sizeof(cmsg));
-    
+
     iov.iov_base = &dummy;
     iov.iov_len = sizeof(dummy);
-    
+
     msg.msg_iov = &iov;
     msg.msg_iovlen = 1;
     msg.msg_name = NULL;
@@ -167,12 +165,12 @@ static int recv_fd(int fd) {
     msg.msg_control = cmsg.buf;
     msg.msg_controllen = sizeof(cmsg);
     msg.msg_flags = 0;
-               
+
     cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(int));
     cmsg.hdr.cmsg_level = SOL_SOCKET;
     cmsg.hdr.cmsg_type = SCM_RIGHTS;
     *((int*) CMSG_DATA(&cmsg.hdr)) = -1;
-               
+
     if (recvmsg(fd, &msg, 0) <= 0) {
         avahi_log_error("recvmsg() failed: %s", strerror(errno));
         return -1;
@@ -183,7 +181,7 @@ static int recv_fd(int fd) {
             errno = EINVAL;
             return -1;
         }
-        
+
         if (!(h = CMSG_FIRSTHDR(&msg))) {
             avahi_log_error("recvmsg() sent no fd.");
             errno = EINVAL;
@@ -197,7 +195,7 @@ static int recv_fd(int fd) {
         return *((int*)CMSG_DATA(h));
     }
 }
-                
+
 static int helper_main(int fd) {
     int ret = 1;
     assert(fd >= 0);
@@ -207,7 +205,7 @@ static int helper_main(int fd) {
      * mind that this code is security sensitive! */
 
     avahi_log_debug(__FILE__": chroot() helper started");
-    
+
     for (;;) {
         uint8_t command;
         ssize_t r;
@@ -217,7 +215,7 @@ static int helper_main(int fd) {
             /* EOF? */
             if (r == 0)
                 break;
-            
+
             avahi_log_error(__FILE__": read() failed: %s", strerror(errno));
             goto fail;
         }
@@ -250,7 +248,7 @@ static int helper_main(int fd) {
                         avahi_log_error(__FILE__": write() failed: %s\n", strerror(errno));
                         goto fail;
                     }
-                    
+
                     break;
                 }
 
@@ -258,24 +256,24 @@ static int helper_main(int fd) {
                     goto fail;
 
                 close(payload);
-                
+
                 break;
             }
 
             case AVAHI_CHROOT_UNLINK_SOCKET:
             case AVAHI_CHROOT_UNLINK_PID: {
                 uint8_t c = AVAHI_CHROOT_SUCCESS;
-                
+
                 unlink(unlink_file_name_table[(int) command]);
 
                 if (write(fd, &c, sizeof(c)) != sizeof(c)) {
                     avahi_log_error(__FILE__": write() failed: %s\n", strerror(errno));
                     goto fail;
                 }
-                
+
                 break;
             }
-                
+
             default:
                 avahi_log_error(__FILE__": Unknown command %02x.", command);
                 break;
@@ -283,11 +281,11 @@ static int helper_main(int fd) {
     }
 
     ret = 0;
-    
+
 fail:
 
     avahi_log_debug(__FILE__": chroot() helper exiting with return value %i", ret);
-    
+
     return ret;
 }
 
@@ -296,12 +294,12 @@ int avahi_chroot_helper_start(const char *argv0) {
     pid_t pid;
 
     assert(helper_fd < 0);
-    
+
     if (socketpair(AF_UNIX, SOCK_STREAM, 0, sock) < 0) {
         avahi_log_error("socketpair() failed: %s", strerror(errno));
         return -1;
     }
-    
+
     if ((pid = fork()) < 0) {
         close(sock[0]);
         close(sock[1]);
@@ -309,15 +307,13 @@ int avahi_chroot_helper_start(const char *argv0) {
         return -1;
     } else if (pid == 0) {
 
-        setsid();
-        
         /* Drop all remaining capabilities */
         avahi_caps_drop_all();
 
         avahi_set_proc_title(argv0, "%s: chroot helper", argv0);
 
         daemon_retval_done();
-        
+
         close(sock[0]);
         helper_main(sock[1]);
         _exit(0);
@@ -342,7 +338,7 @@ int avahi_chroot_helper_get_fd(const char *fname) {
 
     if (helper_fd >= 0) {
         uint8_t command;
-        
+
         for (command = 2; command < AVAHI_CHROOT_MAX; command++)
             if (get_file_name_table[(int) command] &&
                 strcmp(fname, get_file_name_table[(int) command]) == 0)
@@ -355,7 +351,7 @@ int avahi_chroot_helper_get_fd(const char *fname) {
         }
 
         assert(get_file_name_table[(int) command]);
-        
+
         if (write(helper_fd, &command, sizeof(command)) < 0) {
             avahi_log_error("write() failed: %s\n", strerror(errno));
             return -1;
@@ -386,7 +382,7 @@ int avahi_chroot_helper_unlink(const char *fname) {
     if (helper_fd >= 0) {
         uint8_t c, command;
         ssize_t r;
-        
+
         for (command = 2; command < AVAHI_CHROOT_MAX; command++)
             if (unlink_file_name_table[(int) command] &&
                 strcmp(fname, unlink_file_name_table[(int) command]) == 0)
@@ -407,11 +403,11 @@ int avahi_chroot_helper_unlink(const char *fname) {
             avahi_log_error("read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
             return -1;
         }
-        
+
         return 0;
-        
+
     } else
-        
+
         return unlink(fname);
-    
+
 }
index ea61c5ab9fc139ff39f0c700130db796c8abe2c5..2828d5433d2b08a83e3fd3ecb2c51f640023f501 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foochroothelperhfoo
 #define foochroothelperhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index f05af8fdb950c4e6e69032ffedac902a4bbd3d90..a77e03c62b0c5faaf633b7ca440821e03119b3dd 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -43,11 +41,11 @@ void avahi_dbus_async_address_resolver_free(AsyncAddressResolverInfo *i) {
         dbus_connection_unregister_object_path(server->bus, i->path);
         avahi_free(i->path);
     }
-    
+
     AVAHI_LLIST_REMOVE(AsyncAddressResolverInfo, async_address_resolvers, i->client->async_address_resolvers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -55,12 +53,17 @@ void avahi_dbus_async_address_resolver_free(AsyncAddressResolverInfo *i) {
 void avahi_dbus_async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address, const char *host_name, AvahiLookupResultFlags flags, void* userdata) {
     AsyncAddressResolverInfo *i = userdata;
     DBusMessage *reply;
-    
+
     assert(r);
     assert(i);
 
     reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_ADDRESS_RESOLVER, avahi_dbus_map_resolve_signal_name(event));
-    
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[AVAHI_ADDRESS_STR_MAX], *pt = t;
         int32_t i_interface, i_protocol, i_aprotocol;
@@ -74,7 +77,7 @@ void avahi_dbus_async_address_resolver_callback(AvahiSAddressResolver *r, AvahiI
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) address->proto;
         u_flags = (uint32_t) flags;
-        
+
         dbus_message_append_args(
             reply,
             DBUS_TYPE_INT32, &i_interface,
@@ -90,7 +93,7 @@ void avahi_dbus_async_address_resolver_callback(AvahiSAddressResolver *r, AvahiI
         avahi_dbus_append_server_error(reply);
     }
 
-    dbus_message_set_destination(reply, i->client->name);  
+    dbus_message_set_destination(reply, i->client->name);
     dbus_connection_send(server->bus, reply, NULL);
     dbus_message_unref(reply);
 }
@@ -102,7 +105,7 @@ DBusHandlerResult avahi_dbus_msg_async_address_resolver_impl(DBusConnection *c,
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -112,12 +115,12 @@ DBusHandlerResult avahi_dbus_msg_async_address_resolver_impl(DBusConnection *c,
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "AddressResolver.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.AddressResolver.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ADDRESS_RESOLVER, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -128,12 +131,12 @@ DBusHandlerResult avahi_dbus_msg_async_address_resolver_impl(DBusConnection *c,
         avahi_dbus_async_address_resolver_free(i);
         return avahi_dbus_respond_ok(c, m);
     }
-    
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
index a2c99a7f9d845d25734801382bdcfa6a17d40506..7c2d06318ede0ead77c68adca567eadd3dafa829 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -45,8 +43,8 @@ void avahi_dbus_async_host_name_resolver_free(AsyncHostNameResolverInfo *i) {
     }
     AVAHI_LLIST_REMOVE(AsyncHostNameResolverInfo, async_host_name_resolvers, i->client->async_host_name_resolvers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -54,12 +52,17 @@ void avahi_dbus_async_host_name_resolver_free(AsyncHostNameResolverInfo *i) {
 void avahi_dbus_async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const char *host_name, const AvahiAddress *a, AvahiLookupResultFlags flags, void* userdata) {
     AsyncHostNameResolverInfo *i = userdata;
     DBusMessage *reply;
-    
+
     assert(r);
     assert(i);
 
     reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_HOST_NAME_RESOLVER, avahi_dbus_map_resolve_signal_name(event));
-    
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[AVAHI_ADDRESS_STR_MAX], *pt = t;
         int32_t i_interface, i_protocol, i_aprotocol;
@@ -73,7 +76,7 @@ void avahi_dbus_async_host_name_resolver_callback(AvahiSHostNameResolver *r, Ava
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) a->proto;
         u_flags = (uint32_t) flags;
-        
+
         dbus_message_append_args(
             reply,
             DBUS_TYPE_INT32, &i_interface,
@@ -88,7 +91,7 @@ void avahi_dbus_async_host_name_resolver_callback(AvahiSHostNameResolver *r, Ava
         avahi_dbus_append_server_error(reply);
     }
 
-    dbus_message_set_destination(reply, i->client->name);  
+    dbus_message_set_destination(reply, i->client->name);
     dbus_connection_send(server->bus, reply, NULL);
     dbus_message_unref(reply);
 }
@@ -100,7 +103,7 @@ DBusHandlerResult avahi_dbus_msg_async_host_name_resolver_impl(DBusConnection *c
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -110,12 +113,12 @@ DBusHandlerResult avahi_dbus_msg_async_host_name_resolver_impl(DBusConnection *c
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "HostNameResolver.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.HostNameResolver.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_HOST_NAME_RESOLVER, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -126,13 +129,12 @@ DBusHandlerResult avahi_dbus_msg_async_host_name_resolver_impl(DBusConnection *c
         avahi_dbus_async_host_name_resolver_free(i);
         return avahi_dbus_respond_ok(c, m);
     }
-    
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
-
index a9a13644977e8a754d509e7364305d737c96333f..2b58e2d13d90009195c25df8addb9c53e33caecc 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -43,11 +41,11 @@ void avahi_dbus_async_service_resolver_free(AsyncServiceResolverInfo *i) {
         dbus_connection_unregister_object_path(server->bus, i->path);
         avahi_free(i->path);
     }
-    
+
     AVAHI_LLIST_REMOVE(AsyncServiceResolverInfo, async_service_resolvers, i->client->async_service_resolvers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -64,26 +62,31 @@ void avahi_dbus_async_service_resolver_callback(
     const AvahiAddress *a,
     uint16_t port,
     AvahiStringList *txt,
-    AvahiLookupResultFlags flags, 
+    AvahiLookupResultFlags flags,
     void* userdata) {
 
     AsyncServiceResolverInfo *i = userdata;
     DBusMessage *reply;
-    
+
     assert(r);
     assert(i);
 
     reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_RESOLVER, avahi_dbus_map_resolve_signal_name(event));
-    
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[AVAHI_ADDRESS_STR_MAX], *pt = t;
         int32_t i_interface, i_protocol, i_aprotocol;
         uint32_t u_flags;
-    
+
         assert(host_name);
 
 /*         avahi_log_debug(__FILE__": [%s] Successfully resolved service <%s.%s.%s>", i->path, name, type, domain); */
-        
+
         if (a)
             avahi_address_snprint(t, sizeof(t), a);
         else
@@ -97,9 +100,9 @@ void avahi_dbus_async_service_resolver_callback(
 
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
-        if (a) 
+        if (a)
            i_aprotocol = (int32_t) a->proto;
-       else 
+       else
            i_aprotocol = AVAHI_PROTO_UNSPEC;
         u_flags = (uint32_t) flags;
 
@@ -127,7 +130,7 @@ void avahi_dbus_async_service_resolver_callback(
         avahi_dbus_append_server_error(reply);
     }
 
-    dbus_message_set_destination(reply, i->client->name);  
+    dbus_message_set_destination(reply, i->client->name);
     dbus_connection_send(server->bus, reply, NULL);
     dbus_message_unref(reply);
 }
@@ -139,7 +142,7 @@ DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c,
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -149,12 +152,12 @@ DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c,
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "ServiceResolver.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.ServiceResolver.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVICE_RESOLVER, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -165,13 +168,12 @@ DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c,
         avahi_dbus_async_service_resolver_free(i);
         return avahi_dbus_respond_ok(c, m);
     }
-    
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
-
index b529ede450a8daae1ac590d0a501385d5a11b1ff..e51996f7de74b9d3be9950741f1cbbf9b7e9b947 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -43,11 +41,11 @@ void avahi_dbus_domain_browser_free(DomainBrowserInfo *i) {
         dbus_connection_unregister_object_path(server->bus, i->path);
         avahi_free(i->path);
     }
-    
+
     AVAHI_LLIST_REMOVE(DomainBrowserInfo, domain_browsers, i->client->domain_browsers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -59,7 +57,7 @@ DBusHandlerResult avahi_dbus_msg_domain_browser_impl(DBusConnection *c, DBusMess
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -69,12 +67,12 @@ DBusHandlerResult avahi_dbus_msg_domain_browser_impl(DBusConnection *c, DBusMess
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "DomainBrowser.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.DomainBrowser.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -84,15 +82,15 @@ DBusHandlerResult avahi_dbus_msg_domain_browser_impl(DBusConnection *c, DBusMess
 
         avahi_dbus_domain_browser_free(i);
         return avahi_dbus_respond_ok(c, m);
-        
+
     }
-    
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
@@ -101,7 +99,7 @@ void avahi_dbus_domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex int
     DBusMessage *m;
     int32_t i_interface, i_protocol;
     uint32_t u_flags;
-    
+
     assert(b);
     assert(i);
 
@@ -111,6 +109,11 @@ void avahi_dbus_domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex int
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER, avahi_dbus_map_browse_signal_name(event));
 
+    if (!m) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_BROWSER_NEW || event == AVAHI_BROWSER_REMOVE) {
         assert(domain);
         dbus_message_append_args(
@@ -122,9 +125,8 @@ void avahi_dbus_domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex int
             DBUS_TYPE_INVALID);
     } else if (event == AVAHI_BROWSER_FAILURE)
         avahi_dbus_append_server_error(m);
-    
-    dbus_message_set_destination(m, i->client->name);   
+
+    dbus_message_set_destination(m, i->client->name);
     dbus_connection_send(server->bus, m, NULL);
     dbus_message_unref(m);
 }
-
index 0e1a21cba6095bb50c4a4288bfd9e1d781c86dfa..4e879a5ba215db16f3ba8b788a0b423c94048426 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -47,9 +45,9 @@ void avahi_dbus_entry_group_free(EntryGroupInfo *i) {
     }
     AVAHI_LLIST_REMOVE(EntryGroupInfo, entry_groups, i->client->entry_groups, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
-    
+
     avahi_free(i);
 }
 
@@ -58,13 +56,18 @@ void avahi_dbus_entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiE
     DBusMessage *m;
     int32_t t;
     const char *e;
-    
+
     assert(s);
     assert(g);
     assert(i);
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "StateChanged");
-    
+
+    if (!m) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     t = (int32_t) state;
     if (state == AVAHI_ENTRY_GROUP_FAILURE)
         e = avahi_error_number_to_dbus(avahi_server_errno(s));
@@ -72,13 +75,13 @@ void avahi_dbus_entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiE
         e = AVAHI_DBUS_ERR_COLLISION;
     else
         e = AVAHI_DBUS_ERR_OK;
-        
+
     dbus_message_append_args(
         m,
         DBUS_TYPE_INT32, &t,
         DBUS_TYPE_STRING, &e,
         DBUS_TYPE_INVALID);
-    dbus_message_set_destination(m, i->client->name);  
+    dbus_message_set_destination(m, i->client->name);
     dbus_connection_send(server->bus, m, NULL);
     dbus_message_unref(m);
 }
@@ -90,7 +93,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -100,12 +103,12 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "EntryGroup.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.EntryGroup.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -115,7 +118,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
 
         avahi_dbus_entry_group_free(i);
         return avahi_dbus_respond_ok(c, m);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Commit")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -125,21 +128,21 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
 
         if (avahi_s_entry_group_commit(i->entry_group) < 0)
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
-        
+
         return avahi_dbus_respond_ok(c, m);
-        
-        
+
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "Reset")) {
-        
+
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
             avahi_log_warn("Error parsing EntryGroup::Reset message");
             goto fail;
         }
 
         avahi_s_entry_group_reset(i->entry_group);
-       i->n_entries = 0;
+        i->n_entries = 0;
         return avahi_dbus_respond_ok(c, m);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "IsEmpty")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -148,10 +151,10 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
         }
 
         return avahi_dbus_respond_boolean(c, m, !!avahi_s_entry_group_is_empty(i->entry_group));
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "GetState")) {
         AvahiEntryGroupState state;
-        
+
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
             avahi_log_warn("Error parsing EntryGroup::GetState message");
             goto fail;
@@ -159,14 +162,14 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
 
         state = avahi_s_entry_group_get_state(i->entry_group);
         return avahi_dbus_respond_int32(c, m, (int32_t) state);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService")) {
         int32_t interface, protocol;
         uint32_t flags;
         char *type, *name, *domain, *host;
         uint16_t port;
         AvahiStringList *strlst = NULL;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -176,7 +179,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
                 DBUS_TYPE_STRING, &type,
                 DBUS_TYPE_STRING, &domain,
                 DBUS_TYPE_STRING, &host,
-                DBUS_TYPE_UINT16, &port, 
+                DBUS_TYPE_UINT16, &port,
                 DBUS_TYPE_INVALID) ||
             !type || !name ||
             avahi_dbus_read_strlst(m, 8, &strlst) < 0) {
@@ -184,7 +187,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
             goto fail;
         }
 
-        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) {
+        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max) {
             avahi_string_list_free(strlst);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
         }
@@ -202,17 +205,17 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
 
         if (!(flags & AVAHI_PUBLISH_UPDATE))
             i->n_entries ++;
-            
+
         avahi_string_list_free(strlst);
-        
+
         return avahi_dbus_respond_ok(c, m);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddServiceSubtype")) {
 
         int32_t interface, protocol;
         uint32_t flags;
         char *type, *name, *domain, *subtype;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -227,18 +230,18 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
             goto fail;
         }
 
-        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX)
+        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max)
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
 
         if (domain && !*domain)
             domain = NULL;
 
-        if (avahi_server_add_service_subtype(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, subtype) < 0) 
+        if (avahi_server_add_service_subtype(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, name, type, domain, subtype) < 0)
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
 
         if (!(flags & AVAHI_PUBLISH_UPDATE))
             i->n_entries ++;
-        
+
         return avahi_dbus_respond_ok(c, m);
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "UpdateServiceTxt")) {
@@ -246,7 +249,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
         uint32_t flags;
         char *type, *name, *domain;
         AvahiStringList *strlst;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -271,15 +274,15 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
         }
 
         avahi_string_list_free(strlst);
-        
+
         return avahi_dbus_respond_ok(c, m);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddAddress")) {
         int32_t interface, protocol;
         uint32_t flags;
         char *name, *address;
         AvahiAddress a;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -292,9 +295,9 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
             goto fail;
         }
 
-        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX)
+        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max)
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
-        
+
         if (!(avahi_address_parse(address, AVAHI_PROTO_UNSPEC, &a)))
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_ADDRESS, NULL);
 
@@ -303,7 +306,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
 
         if (!(flags & AVAHI_PUBLISH_UPDATE))
             i->n_entries ++;
-        
+
         return avahi_dbus_respond_ok(c, m);
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddRecord")) {
         int32_t interface, protocol;
@@ -312,7 +315,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
         char *name;
         void *rdata;
         AvahiRecord *r;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -328,7 +331,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
             goto fail;
         }
 
-        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX)
+        if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= server->n_entries_per_entry_group_max)
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL);
 
         if (!avahi_is_valid_domain_name (name))
@@ -341,7 +344,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
             avahi_record_unref (r);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_RDATA, NULL);
         }
-        
+
         if (avahi_server_add(avahi_server, i->entry_group, (AvahiIfIndex) interface, (AvahiProtocol) protocol, (AvahiPublishFlags) flags, r) < 0) {
             avahi_record_unref (r);
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
@@ -349,18 +352,18 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
 
         if (!(flags & AVAHI_PUBLISH_UPDATE))
             i->n_entries ++;
-       
-        avahi_record_unref (r); 
+
+        avahi_record_unref (r);
 
         return avahi_dbus_respond_ok(c, m);
-    } 
-    
+    }
+
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
index 11c1094abf65c1e7055ad4f4bf8cccb71457a10e..0b865781fe67e76b6bcbab30a62e239cc07451a0 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodbusinternalhfoo
 #define foodbusinternalhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -45,9 +43,9 @@ typedef struct SyncServiceResolverInfo SyncServiceResolverInfo;
 typedef struct AsyncServiceResolverInfo AsyncServiceResolverInfo;
 typedef struct RecordBrowserInfo RecordBrowserInfo;
 
-#define CLIENTS_MAX 256
-#define OBJECTS_PER_CLIENT_MAX 250
-#define ENTRIES_PER_ENTRY_GROUP_MAX 20
+#define DEFAULT_CLIENTS_MAX 4096
+#define DEFAULT_OBJECTS_PER_CLIENT_MAX 1024
+#define DEFAULT_ENTRIES_PER_ENTRY_GROUP_MAX 32
 
 struct EntryGroupInfo {
     unsigned id;
@@ -55,8 +53,8 @@ struct EntryGroupInfo {
     AvahiSEntryGroup *entry_group;
     char *path;
 
-    int n_entries;
-    
+    unsigned n_entries;
+
     AVAHI_LLIST_FIELDS(EntryGroupInfo, entry_groups);
 };
 
@@ -151,8 +149,8 @@ struct Client {
     unsigned id;
     char *name;
     unsigned current_id;
-    int n_objects;
-    
+    unsigned n_objects;
+
     AVAHI_LLIST_FIELDS(Client, clients);
     AVAHI_LLIST_HEAD(EntryGroupInfo, entry_groups);
     AVAHI_LLIST_HEAD(SyncHostNameResolverInfo, sync_host_name_resolvers);
@@ -171,11 +169,17 @@ struct Server {
     const AvahiPoll *poll_api;
     DBusConnection *bus;
     AVAHI_LLIST_HEAD(Client, clients);
-    int n_clients;
+    unsigned n_clients;
     unsigned current_id;
 
     AvahiTimeout *reconnect_timeout;
     int reconnect;
+
+    unsigned n_clients_max;
+    unsigned n_objects_per_client_max;
+    unsigned n_entries_per_entry_group_max;
+
+    int disable_user_service_publishing;
 };
 
 extern Server *server;
@@ -224,7 +228,7 @@ void avahi_dbus_sync_service_resolver_callback(
     const AvahiAddress *a,
     uint16_t port,
     AvahiStringList *txt,
-    AvahiLookupResultFlags flags, 
+    AvahiLookupResultFlags flags,
     void* userdata);
 
 void avahi_dbus_async_service_resolver_free(AsyncServiceResolverInfo *i);
@@ -240,7 +244,7 @@ void avahi_dbus_async_service_resolver_callback(
     const AvahiAddress *a,
     uint16_t port,
     AvahiStringList *txt,
-    AvahiLookupResultFlags flags, 
+    AvahiLookupResultFlags flags,
     void* userdata);
 
 DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
index d61935a0f70acc8aad52d33c5ca8656ed81b8815..91ea8fae58f99d8b54fe94dfcfe43bcfcb1ddb74 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
 Server *server = NULL;
 
-static int disable_user_service_publishing = 0;
-
 static int dbus_connect(void);
 static void dbus_disconnect(void);
 
 static void client_free(Client *c) {
-    
+
     assert(server);
     assert(c);
 
@@ -83,7 +79,7 @@ static void client_free(Client *c) {
 
     while (c->async_host_name_resolvers)
         avahi_dbus_async_host_name_resolver_free(c->async_host_name_resolvers);
-    
+
     while (c->sync_address_resolvers)
         avahi_dbus_sync_address_resolver_free(c->sync_address_resolvers);
 
@@ -109,13 +105,13 @@ static void client_free(Client *c) {
         avahi_dbus_record_browser_free(c->record_browsers);
 
     assert(c->n_objects == 0);
-    
+
     avahi_free(c->name);
     AVAHI_LLIST_REMOVE(Client, clients, server->clients, c);
     avahi_free(c);
 
+    assert(server->n_clients >= 1);
     server->n_clients --;
-    assert(server->n_clients >= 0);
 }
 
 static Client *client_get(const char *name, int create) {
@@ -131,16 +127,16 @@ static Client *client_get(const char *name, int create) {
     if (!create)
         return NULL;
 
-    if (server->n_clients >= CLIENTS_MAX)
+    if (server->n_clients >= server->n_clients_max)
         return NULL;
-    
+
     /* If not existent yet, create a new entry */
     client = avahi_new(Client, 1);
     client->id = server->current_id++;
     client->name = avahi_strdup(name);
     client->current_id = 0;
     client->n_objects = 0;
-    
+
     AVAHI_LLIST_HEAD_INIT(EntryGroupInfo, client->entry_groups);
     AVAHI_LLIST_HEAD_INIT(SyncHostNameResolverInfo, client->sync_host_name_resolvers);
     AVAHI_LLIST_HEAD_INIT(AsyncHostNameResolverInfo, client->async_host_name_resolvers);
@@ -157,7 +153,7 @@ static Client *client_get(const char *name, int create) {
 
     server->n_clients++;
     assert(server->n_clients > 0);
-    
+
     return client;
 }
 
@@ -190,11 +186,11 @@ static DBusHandlerResult msg_signal_filter_impl(AVAHI_GCC_UNUSED DBusConnection
 
         if (server->reconnect) {
             avahi_log_warn("Disconnected from D-Bus, trying to reconnect in %ims...", RECONNECT_MSEC);
-            
+
             dbus_disconnect();
-            
+
             avahi_elapse_time(&tv, RECONNECT_MSEC, 0);
-            
+
             if (server->reconnect_timeout)
                 server->poll_api->timeout_update(server->reconnect_timeout, &tv);
             else
@@ -203,9 +199,9 @@ static DBusHandlerResult msg_signal_filter_impl(AVAHI_GCC_UNUSED DBusConnection
             avahi_log_warn("Disconnected from D-Bus, exiting.");
             raise(SIGQUIT);
         }
-            
+
         return DBUS_HANDLER_RESULT_HANDLED;
-        
+
     } else if (dbus_message_is_signal(m, DBUS_INTERFACE_DBUS, "NameAcquired")) {
         char *name;
 
@@ -216,7 +212,7 @@ static DBusHandlerResult msg_signal_filter_impl(AVAHI_GCC_UNUSED DBusConnection
 
 /*         avahi_log_info(__FILE__": name acquired (%s)", name); */
         return DBUS_HANDLER_RESULT_HANDLED;
-        
+
     } else if (dbus_message_is_signal(m, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) {
         char *name, *old, *new;
 
@@ -229,7 +225,7 @@ static DBusHandlerResult msg_signal_filter_impl(AVAHI_GCC_UNUSED DBusConnection
             Client *client;
 
             if ((client = client_get(name, FALSE))) {
-                avahi_log_debug(__FILE__": client %s vanished.", name); 
+                avahi_log_debug(__FILE__": client %s vanished.", name);
                 client_free(client);
             }
         }
@@ -238,7 +234,7 @@ static DBusHandlerResult msg_signal_filter_impl(AVAHI_GCC_UNUSED DBusConnection
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
@@ -253,8 +249,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
                     dbus_message_get_member(m));
 
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "Server.introspect");
-        
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.Server.xml");
+
     else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetHostName")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -263,23 +259,23 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         }
 
         return avahi_dbus_respond_string(c, m, avahi_server_get_host_name(avahi_server));
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "SetHostName")) {
 
         char *name;
-        
+
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID)) {
             avahi_log_warn("Error parsing Server::SetHostName message");
             goto fail;
         }
-        
-        if (avahi_server_set_host_name(avahi_server, name) < 0) 
+
+        if (avahi_server_set_host_name(avahi_server, name) < 0)
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
 
         avahi_log_info("Changing host name to '%s'.", name);
-        
+
         return avahi_dbus_respond_ok(c, m);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetDomainName")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -295,9 +291,9 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_log_warn("Error parsing Server::GetHostNameFqdn message");
             goto fail;
         }
-    
+
         return avahi_dbus_respond_string(c, m, avahi_server_get_host_name_fqdn(avahi_server));
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "IsNSSSupportAvailable")) {
         if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) {
             avahi_log_warn("Error parsing Server::IsNSSSupportAvailable message");
@@ -305,14 +301,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         }
 
         return avahi_dbus_respond_boolean(c, m, nss_support);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetVersionString")) {
 
         if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) {
             avahi_log_warn("Error parsing Server::GetVersionString message");
             goto fail;
         }
-    
+
         return avahi_dbus_respond_string(c, m, PACKAGE_STRING);
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetAPIVersion")) {
@@ -321,17 +317,17 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_log_warn("Error parsing Server::GetAPIVersion message");
             goto fail;
         }
-    
+
         return avahi_dbus_respond_uint32(c, m, AVAHI_DBUS_API_VERSION);
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetState")) {
         AvahiServerState state;
-        
+
         if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) {
             avahi_log_warn("Error parsing Server::GetState message");
             goto fail;
         }
-        
+
         state = avahi_server_get_state(avahi_server);
         return avahi_dbus_respond_int32(c, m, (int32_t) state);
 
@@ -341,13 +337,13 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_log_warn("Error parsing Server::GetLocalServiceCookie message");
             goto fail;
         }
-        
+
         return avahi_dbus_respond_uint32(c, m, avahi_server_get_local_service_cookie(avahi_server));
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetNetworkInterfaceNameByIndex")) {
         int32_t idx;
-       char name[IF_NAMESIZE];
-        
+        char name[IF_NAMESIZE];
+
         if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INT32, &idx, DBUS_TYPE_INVALID))) {
             avahi_log_warn("Error parsing Server::GetNetworkInterfaceNameByIndex message");
             goto fail;
@@ -361,14 +357,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             snprintf(txt, sizeof(txt), "OS Error: %s", strerror(errno));
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_OS, txt);
         }
-        
+
         return avahi_dbus_respond_string(c, m, name);
 #endif
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetNetworkInterfaceIndexByName")) {
         char *n;
         int32_t idx;
-        
+
         if (!(dbus_message_get_args(m, &error, DBUS_TYPE_STRING, &n, DBUS_TYPE_INVALID)) || !n) {
             avahi_log_warn("Error parsing Server::GetNetworkInterfaceIndexByName message");
             goto fail;
@@ -382,13 +378,13 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             snprintf(txt, sizeof(txt), "OS Error: %s", strerror(errno));
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_OS, txt);
         }
-        
+
         return avahi_dbus_respond_int32(c, m, idx);
 #endif
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetAlternativeHostName")) {
         char *n, * t;
-        
+
         if (!(dbus_message_get_args(m, &error, DBUS_TYPE_STRING, &n, DBUS_TYPE_INVALID)) || !n) {
             avahi_log_warn("Error parsing Server::GetAlternativeHostName message");
             goto fail;
@@ -402,7 +398,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
 
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetAlternativeServiceName")) {
         char *n, *t;
-        
+
         if (!(dbus_message_get_args(m, &error, DBUS_TYPE_STRING, &n, DBUS_TYPE_INVALID)) || !n) {
             avahi_log_warn("Error parsing Server::GetAlternativeServiceName message");
             goto fail;
@@ -413,7 +409,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         avahi_free(t);
 
         return DBUS_HANDLER_RESULT_HANDLED;
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "EntryGroupNew")) {
         Client *client;
         EntryGroupInfo *i;
@@ -431,15 +427,15 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             goto fail;
         }
 
-        if (disable_user_service_publishing)
+        if (server->disable_user_service_publishing)
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_PERMITTED, NULL);
-        
+
         if (!(client = client_get(dbus_message_get_sender(m), TRUE))) {
             avahi_log_warn("Too many clients, client request failed.");
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -451,7 +447,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         i->n_entries = 0;
         AVAHI_LLIST_PREPEND(EntryGroupInfo, entry_groups, client->entry_groups, i);
         client->n_objects++;
-        
+
         if (!(i->entry_group = avahi_s_entry_group_new(avahi_server, avahi_dbus_entry_group_callback, i))) {
             avahi_dbus_entry_group_free(i);
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
@@ -460,14 +456,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         i->path = avahi_strdup_printf("/Client%u/EntryGroup%u", client->id, i->id);
         dbus_connection_register_object_path(c, i->path, &vtable, i);
         return avahi_dbus_respond_path(c, m, i->path);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveHostName")) {
         Client *client;
         int32_t interface, protocol, aprotocol;
         uint32_t flags;
         char *name;
         SyncHostNameResolverInfo *i;
-            
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -485,7 +481,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -500,9 +496,9 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_dbus_sync_host_name_resolver_free(i);
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
         }
-        
+
         return DBUS_HANDLER_RESULT_HANDLED;
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveAddress")) {
         Client *client;
         int32_t interface, protocol;
@@ -510,13 +506,13 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         char *address;
         SyncAddressResolverInfo *i;
         AvahiAddress a;
-            
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
                 DBUS_TYPE_INT32, &protocol,
                 DBUS_TYPE_STRING, &address,
-                DBUS_TYPE_UINT32, &flags, 
+                DBUS_TYPE_UINT32, &flags,
                 DBUS_TYPE_INVALID) || !address) {
             avahi_log_warn("Error parsing Server::ResolveAddress message");
             goto fail;
@@ -530,7 +526,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -545,9 +541,9 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_dbus_sync_address_resolver_free(i);
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
         }
-        
+
         return DBUS_HANDLER_RESULT_HANDLED;
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "DomainBrowserNew")) {
         Client *client;
         DomainBrowserInfo *i;
@@ -562,7 +558,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         int32_t interface, protocol, type;
         uint32_t flags;
         char *domain;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -580,7 +576,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -618,7 +614,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         int32_t interface, protocol;
         uint32_t flags;
         char *domain;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -635,7 +631,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -654,11 +650,11 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_dbus_service_type_browser_free(i);
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
         }
-        
+
         i->path = avahi_strdup_printf("/Client%u/ServiceTypeBrowser%u", client->id, i->id);
         dbus_connection_register_object_path(c, i->path, &vtable, i);
         return avahi_dbus_respond_path(c, m, i->path);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ServiceBrowserNew")) {
         Client *client;
         ServiceBrowserInfo *i;
@@ -673,7 +669,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         int32_t interface, protocol;
         uint32_t flags;
         char *domain, *type;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -691,7 +687,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -714,14 +710,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         i->path = avahi_strdup_printf("/Client%u/ServiceBrowser%u", client->id, i->id);
         dbus_connection_register_object_path(c, i->path, &vtable, i);
         return avahi_dbus_respond_path(c, m, i->path);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ResolveService")) {
         Client *client;
         int32_t interface, protocol, aprotocol;
         uint32_t flags;
         char *name, *type, *domain;
         SyncServiceResolverInfo *i;
-            
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -740,8 +736,8 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_log_warn("Too many clients, client request failed.");
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
-        
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -751,7 +747,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
 
         if (!*name)
             name = NULL;
-        
+
         i = avahi_new(SyncServiceResolverInfo, 1);
         i->client = client;
         i->message = dbus_message_ref(m);
@@ -762,9 +758,9 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_dbus_sync_service_resolver_free(i);
             return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
         }
-        
+
         return DBUS_HANDLER_RESULT_HANDLED;
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "ServiceResolverNew")) {
         Client *client;
         int32_t interface, protocol, aprotocol;
@@ -793,13 +789,13 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_log_warn("Error parsing Server::ServiceResolverNew message");
             goto fail;
         }
-            
+
         if (!(client = client_get(dbus_message_get_sender(m), TRUE))) {
             avahi_log_warn(__FILE__": Too many clients, client request failed.");
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -809,7 +805,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
 
         if (!*name)
             name = NULL;
-        
+
         i = avahi_new(AsyncServiceResolverInfo, 1);
         i->id = ++client->current_id;
         i->client = client;
@@ -823,7 +819,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         }
 
 /*         avahi_log_debug(__FILE__": [%s], new service resolver for <%s.%s.%s>", i->path, name, type, domain); */
-        
+
         i->path = avahi_strdup_printf("/Client%u/ServiceResolver%u", client->id, i->id);
         dbus_connection_register_object_path(c, i->path, &vtable, i);
         return avahi_dbus_respond_path(c, m, i->path);
@@ -842,7 +838,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             NULL,
             NULL
         };
-            
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -854,13 +850,13 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             avahi_log_warn("Error parsing Server::HostNameResolverNew message");
             goto fail;
         }
-            
+
         if (!(client = client_get(dbus_message_get_sender(m), TRUE))) {
             avahi_log_warn(__FILE__": Too many clients, client request failed.");
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -896,7 +892,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             NULL,
             NULL
         };
-            
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -916,7 +912,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -936,7 +932,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         i->path = avahi_strdup_printf("/Client%u/AddressResolver%u", client->id, i->id);
         dbus_connection_register_object_path(c, i->path, &vtable, i);
         return avahi_dbus_respond_path(c, m, i->path);
-        
+
     } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "RecordBrowserNew")) {
         Client *client;
         RecordBrowserInfo *i;
@@ -953,7 +949,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         char *name;
         uint16_t type, clazz;
         AvahiKey *key;
-        
+
         if (!dbus_message_get_args(
                 m, &error,
                 DBUS_TYPE_INT32, &interface,
@@ -967,7 +963,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             goto fail;
         }
 
-        if (!avahi_is_valid_domain_name(name)) 
+        if (!avahi_is_valid_domain_name(name))
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_DOMAIN_NAME, NULL);
 
         if (!(client = client_get(dbus_message_get_sender(m), TRUE))) {
@@ -975,7 +971,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
         }
 
-        if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
+        if (client->n_objects >= server->n_objects_per_client_max) {
             avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
             return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);
         }
@@ -997,7 +993,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
         }
 
         avahi_key_unref(key);
-        
+
         i->path = avahi_strdup_printf("/Client%u/RecordBrowser%u", client->id, i->id);
         dbus_connection_register_object_path(c, i->path, &vtable, i);
         return avahi_dbus_respond_path(c, m, i->path);
@@ -1008,7 +1004,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
@@ -1016,11 +1012,17 @@ void dbus_protocol_server_state_changed(AvahiServerState state) {
     DBusMessage *m;
     int32_t t;
     const char *e;
-    
+
     if (!server || !server->bus)
         return;
 
     m = dbus_message_new_signal(AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "StateChanged");
+
+    if (!m) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     t = (int32_t) state;
 
     if (state == AVAHI_SERVER_COLLISION)
@@ -1029,7 +1031,7 @@ void dbus_protocol_server_state_changed(AvahiServerState state) {
         e = avahi_error_number_to_dbus(avahi_server_errno(avahi_server));
     else
         e = AVAHI_DBUS_ERR_OK;
-    
+
     dbus_message_append_args(m, DBUS_TYPE_INT32, &t, DBUS_TYPE_STRING, &e, DBUS_TYPE_INVALID);
     dbus_connection_send(server->bus, m, NULL);
     dbus_message_unref(m);
@@ -1052,7 +1054,7 @@ static int dbus_connect(void) {
 
     dbus_error_init(&error);
 
-#ifdef HAVE_DBUS_BUS_GET_PRIVATE    
+#ifdef HAVE_DBUS_BUS_GET_PRIVATE
     if (!(server->bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) {
         assert(dbus_error_is_set(&error));
         avahi_log_error("dbus_bus_get_private(): %s", error.message);
@@ -1064,7 +1066,7 @@ static int dbus_connect(void) {
 
         if (!(a = getenv("DBUS_SYSTEM_BUS_ADDRESS")) || !*a)
             a = DBUS_SYSTEM_BUS_DEFAULT_ADDRESS;
-        
+
         if (!(server->bus = dbus_connection_open_private(a, &error))) {
             assert(dbus_error_is_set(&error));
             avahi_log_error("dbus_bus_open_private(): %s", error.message);
@@ -1078,14 +1080,14 @@ static int dbus_connect(void) {
         }
     }
 #endif
-    
+
     if (avahi_dbus_connection_glue(server->bus, server->poll_api) < 0) {
         avahi_log_error("avahi_dbus_connection_glue() failed");
         goto fail;
     }
 
     dbus_connection_set_exit_on_disconnect(server->bus, FALSE);
-    
+
     if (dbus_bus_request_name(
             server->bus,
             AVAHI_DBUS_NAME,
@@ -1108,14 +1110,14 @@ static int dbus_connect(void) {
         avahi_log_error("dbus_connection_add_filter() failed");
         goto fail;
     }
-    
+
     dbus_bus_add_match(server->bus, "type='signal',""interface='" DBUS_INTERFACE_DBUS  "'", &error);
 
     if (dbus_error_is_set(&error)) {
         avahi_log_error("dbus_bus_add_match(): %s", error.message);
         goto fail;
     }
-    
+
     if (!(dbus_connection_register_object_path(server->bus, AVAHI_DBUS_PATH_SERVER, &server_vtable, NULL))) {
         avahi_log_error("dbus_connection_register_object_path() failed");
         goto fail;
@@ -1145,7 +1147,7 @@ static void dbus_disconnect(void) {
 
     while (server->clients)
         client_free(server->clients);
-    
+
     assert(server->n_clients == 0);
 
     if (server->bus) {
@@ -1159,9 +1161,13 @@ static void dbus_disconnect(void) {
     }
 }
 
-int dbus_protocol_setup(const AvahiPoll *poll_api, int _disable_user_service_publishing, int force) {
+int dbus_protocol_setup(const AvahiPoll *poll_api,
+                        int _disable_user_service_publishing,
+                        int _n_clients_max,
+                        int _n_objects_per_client_max,
+                        int _n_entries_per_entry_group_max,
+                        int force) {
 
-    disable_user_service_publishing = _disable_user_service_publishing;
 
     server = avahi_new(Server, 1);
     AVAHI_LLIST_HEAD_INIT(Clients, server->clients);
@@ -1171,6 +1177,10 @@ int dbus_protocol_setup(const AvahiPoll *poll_api, int _disable_user_service_pub
     server->poll_api = poll_api;
     server->reconnect_timeout = NULL;
     server->reconnect = force;
+    server->disable_user_service_publishing = _disable_user_service_publishing;
+    server->n_clients_max = _n_clients_max > 0 ? _n_clients_max : DEFAULT_CLIENTS_MAX;
+    server->n_objects_per_client_max = _n_objects_per_client_max > 0 ? _n_objects_per_client_max : DEFAULT_OBJECTS_PER_CLIENT_MAX;
+    server->n_entries_per_entry_group_max = _n_entries_per_entry_group_max > 0 ? _n_entries_per_entry_group_max : DEFAULT_ENTRIES_PER_ENTRY_GROUP_MAX;
 
     if (dbus_connect() < 0) {
         struct timeval tv;
@@ -1179,11 +1189,11 @@ int dbus_protocol_setup(const AvahiPoll *poll_api, int _disable_user_service_pub
             goto fail;
 
         avahi_log_warn("WARNING: Failed to contact D-Bus daemon, retrying in %ims.", RECONNECT_MSEC);
-        
+
         avahi_elapse_time(&tv, RECONNECT_MSEC, 0);
         server->reconnect_timeout = server->poll_api->timeout_new(server->poll_api, &tv, reconnect_callback, NULL);
     }
-        
+
     return 0;
 
 fail:
@@ -1209,7 +1219,7 @@ void dbus_protocol_shutdown(void) {
 
         if (server->reconnect_timeout)
             server->poll_api->timeout_free(server->reconnect_timeout);
-        
+
         avahi_free(server);
         server = NULL;
     }
index d4404f2379eb0d4122290cee558c30f545510ad6..218448732685393e467ba305017c448f14770bac 100644 (file)
@@ -1,28 +1,31 @@
 #ifndef foodbusprotocolhfoo
 #define foodbusprotocolhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
   USA.
 ***/
 
-int dbus_protocol_setup(const AvahiPoll *poll_api, int disable_user_service_publishing, int force);
+int dbus_protocol_setup(const AvahiPoll *poll_api,
+                        int _disable_user_service_publishing,
+                        int _n_clients_max,
+                        int _n_objects_per_client_max,
+                        int _n_entries_per_entry_group_max,
+                        int force);
 void dbus_protocol_shutdown(void);
 void dbus_protocol_server_state_changed(AvahiServerState state);
 
index ea23fe417448af42879599daaf591dd5e121eeba..c0337cfb62e95409b40e846266039956f263ce18 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -45,8 +43,8 @@ void avahi_dbus_record_browser_free(RecordBrowserInfo *i) {
     }
     AVAHI_LLIST_REMOVE(RecordBrowserInfo, record_browsers, i->client->record_browsers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -58,7 +56,7 @@ DBusHandlerResult avahi_dbus_msg_record_browser_impl(DBusConnection *c, DBusMess
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -68,12 +66,12 @@ DBusHandlerResult avahi_dbus_msg_record_browser_impl(DBusConnection *c, DBusMess
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "RecordBrowser.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.RecordBrowser.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_RECORD_BROWSER, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -83,15 +81,15 @@ DBusHandlerResult avahi_dbus_msg_record_browser_impl(DBusConnection *c, DBusMess
 
         avahi_dbus_record_browser_free(i);
         return avahi_dbus_respond_ok(c, m);
-        
+
     }
-    
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
@@ -103,12 +101,12 @@ void avahi_dbus_record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     RecordBrowserInfo *i = userdata;
     DBusMessage *m = NULL;
     int32_t i_interface, i_protocol;
     uint32_t u_flags;
-    
+
     assert(b);
     assert(i);
 
@@ -118,11 +116,16 @@ void avahi_dbus_record_browser_callback(
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_RECORD_BROWSER, avahi_dbus_map_browse_signal_name(event));
 
+    if (!m) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_BROWSER_NEW || event == AVAHI_BROWSER_REMOVE) {
         uint8_t rdata[0xFFFF];
         size_t size;
         assert(record);
-        
+
         if (!(dbus_message_append_args(
                   m,
                   DBUS_TYPE_INT32, &i_interface,
@@ -132,28 +135,28 @@ void avahi_dbus_record_browser_callback(
                   DBUS_TYPE_UINT16, &record->key->type,
                   DBUS_TYPE_INVALID)))
             goto fail;
-            
+
         if ((size = avahi_rdata_serialize(record, rdata, sizeof(rdata))) == (size_t) -1 ||
             avahi_dbus_append_rdata(m, rdata, size) < 0) {
             avahi_log_debug(__FILE__": Failed to append rdata");
             dbus_message_unref(m);
             return;
         }
-        
+
         dbus_message_append_args(
             m,
             DBUS_TYPE_UINT32, &u_flags,
             DBUS_TYPE_INVALID);
-        
+
     } else if (event == AVAHI_BROWSER_FAILURE)
         avahi_dbus_append_server_error(m);
-    
-    dbus_message_set_destination(m, i->client->name);   
+
+    dbus_message_set_destination(m, i->client->name);
     dbus_connection_send(server->bus, m, NULL);
     dbus_message_unref(m);
 
     return;
-    
+
 fail:
 
     if (m)
index 1515ddfbc164a0c397f19014e78392894c090a60..962dca0cde10e02b8276b3acd0fe16854f51553c 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -43,11 +41,11 @@ void avahi_dbus_service_browser_free(ServiceBrowserInfo *i) {
         dbus_connection_unregister_object_path(server->bus, i->path);
         avahi_free(i->path);
     }
-    
+
     AVAHI_LLIST_REMOVE(ServiceBrowserInfo, service_browsers, i->client->service_browsers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -59,7 +57,7 @@ DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMes
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -69,12 +67,12 @@ DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMes
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "ServiceBrowser.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.ServiceBrowser.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVICE_BROWSER, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -84,15 +82,15 @@ DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMes
 
         avahi_dbus_service_browser_free(i);
         return avahi_dbus_respond_ok(c, m);
-        
+
     }
-    
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
@@ -101,28 +99,33 @@ void avahi_dbus_service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex i
     DBusMessage *m;
     int32_t i_interface, i_protocol;
     uint32_t u_flags;
-    
+
     assert(b);
     assert(i);
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_BROWSER, avahi_dbus_map_browse_signal_name(event));
 
+    if (!m) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_BROWSER_NEW) {
         /* Patch in AVAHI_LOOKUP_RESULT_OUR_OWN */
 
         if (avahi_dbus_is_our_own_service(i->client, interface, protocol, name, type, domain) > 0)
             flags |= AVAHI_LOOKUP_RESULT_OUR_OWN;
     }
-    
+
     i_interface = (int32_t) interface;
     i_protocol = (int32_t) protocol;
     u_flags = (uint32_t) flags;
-    
+
     if (event == AVAHI_BROWSER_NEW || event == AVAHI_BROWSER_REMOVE) {
         assert(name);
         assert(type);
         assert(domain);
-        
+
         dbus_message_append_args(
             m,
             DBUS_TYPE_INT32, &i_interface,
@@ -134,8 +137,8 @@ void avahi_dbus_service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex i
             DBUS_TYPE_INVALID);
     } else if (event == AVAHI_BROWSER_FAILURE)
         avahi_dbus_append_server_error(m);
-    
-    dbus_message_set_destination(m, i->client->name);   
+
+    dbus_message_set_destination(m, i->client->name);
     dbus_connection_send(server->bus, m, NULL);
     dbus_message_unref(m);
 }
index 9207a74f049a058ba83aeaf92dec752d5c1f5e3c..20afdbec76e160100ad6fa6d5fae97ca61ae9f77 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -43,11 +41,11 @@ void avahi_dbus_service_type_browser_free(ServiceTypeBrowserInfo *i) {
         dbus_connection_unregister_object_path(server->bus, i->path);
         avahi_free(i->path);
     }
-    
+
     AVAHI_LLIST_REMOVE(ServiceTypeBrowserInfo, service_type_browsers, i->client->service_type_browsers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -59,7 +57,7 @@ DBusHandlerResult avahi_dbus_msg_service_type_browser_impl(DBusConnection *c, DB
     assert(c);
     assert(m);
     assert(i);
-    
+
     dbus_error_init(&error);
 
     avahi_log_debug(__FILE__": interface=%s, path=%s, member=%s",
@@ -69,12 +67,12 @@ DBusHandlerResult avahi_dbus_msg_service_type_browser_impl(DBusConnection *c, DB
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "ServiceTypeBrowser.introspect");
-    
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.ServiceTypeBrowser.xml");
+
     /* Access control */
-    if (strcmp(dbus_message_get_sender(m), i->client->name)) 
+    if (strcmp(dbus_message_get_sender(m), i->client->name))
         return avahi_dbus_respond_error(c, m, AVAHI_ERR_ACCESS_DENIED, NULL);
-    
+
     if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER, "Free")) {
 
         if (!dbus_message_get_args(m, &error, DBUS_TYPE_INVALID)) {
@@ -84,15 +82,15 @@ DBusHandlerResult avahi_dbus_msg_service_type_browser_impl(DBusConnection *c, DB
 
         avahi_dbus_service_type_browser_free(i);
         return avahi_dbus_respond_ok(c, m);
-        
+
     }
-    
+
     avahi_log_warn("Missed message %s::%s()", dbus_message_get_interface(m), dbus_message_get_member(m));
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
@@ -101,7 +99,7 @@ void avahi_dbus_service_type_browser_callback(AvahiSServiceTypeBrowser *b, Avahi
     DBusMessage *m;
     int32_t i_interface, i_protocol;
     uint32_t u_flags;
-    
+
     assert(b);
     assert(i);
 
@@ -111,6 +109,11 @@ void avahi_dbus_service_type_browser_callback(AvahiSServiceTypeBrowser *b, Avahi
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER, avahi_dbus_map_browse_signal_name(event));
 
+    if (!m) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_BROWSER_NEW || event == AVAHI_BROWSER_REMOVE) {
         assert(type);
         assert(domain);
@@ -124,10 +127,8 @@ void avahi_dbus_service_type_browser_callback(AvahiSServiceTypeBrowser *b, Avahi
             DBUS_TYPE_INVALID);
     } else if (event == AVAHI_BROWSER_FAILURE)
         avahi_dbus_append_server_error(m);
-        
-    dbus_message_set_destination(m, i->client->name);   
+
+    dbus_message_set_destination(m, i->client->name);
     dbus_connection_send(server->bus, m, NULL);
     dbus_message_unref(m);
 }
-
-
index 0a5fa599cf2099e20baa69f87a7336bfae656173..9845420c9b730cd9f1405010edc4720c289ea372 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -42,15 +40,15 @@ void avahi_dbus_sync_address_resolver_free(SyncAddressResolverInfo *i) {
     dbus_message_unref(i->message);
     AVAHI_LLIST_REMOVE(SyncAddressResolverInfo, sync_address_resolvers, i->client->sync_address_resolvers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
 
 void avahi_dbus_sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address, const char *host_name, AvahiLookupResultFlags flags, void* userdata) {
     SyncAddressResolverInfo *i = userdata;
-    
+
     assert(r);
     assert(address);
     assert(i);
@@ -68,8 +66,14 @@ void avahi_dbus_sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIf
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) address->proto;
         u_flags = (uint32_t) flags;
-        
+
         reply = dbus_message_new_method_return(i->message);
+
+        if (!reply) {
+            avahi_log_error("Failed allocate message");
+            goto finish;
+        }
+
         dbus_message_append_args(
             reply,
             DBUS_TYPE_INT32, &i_interface,
@@ -87,6 +91,6 @@ void avahi_dbus_sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIf
         avahi_dbus_respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL);
     }
 
+finish:
     avahi_dbus_sync_address_resolver_free(i);
 }
-
index 9750dd41e4b1b33e08ca3ed1c75253b370e66427..e5113276d483ff45d698fd085a3392d99f6783f1 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -42,15 +40,15 @@ void avahi_dbus_sync_host_name_resolver_free(SyncHostNameResolverInfo *i) {
     dbus_message_unref(i->message);
     AVAHI_LLIST_REMOVE(SyncHostNameResolverInfo, sync_host_name_resolvers, i->client->sync_host_name_resolvers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
 
 void avahi_dbus_sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const char *host_name, const AvahiAddress *a, AvahiLookupResultFlags flags, void* userdata) {
     SyncHostNameResolverInfo *i = userdata;
-    
+
     assert(r);
     assert(host_name);
     assert(i);
@@ -68,8 +66,14 @@ void avahi_dbus_sync_host_name_resolver_callback(AvahiSHostNameResolver *r, Avah
         i_protocol = (int32_t) protocol;
         i_aprotocol = (int32_t) a->proto;
         u_flags = (uint32_t) flags;
-        
+
         reply = dbus_message_new_method_return(i->message);
+
+        if (!reply) {
+            avahi_log_error("Failed allocate message");
+            goto finish;
+        }
+
         dbus_message_append_args(
             reply,
             DBUS_TYPE_INT32, &i_interface,
@@ -87,6 +91,6 @@ void avahi_dbus_sync_host_name_resolver_callback(AvahiSHostNameResolver *r, Avah
         avahi_dbus_respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL);
     }
 
+finish:
     avahi_dbus_sync_host_name_resolver_free(i);
 }
-
index 21ae4815dbc4d5e4defc16d2a7866dee30ecc289..ed7276afd4734ecbe56e0cb8f33b95dfff991752 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -42,8 +40,8 @@ void avahi_dbus_sync_service_resolver_free(SyncServiceResolverInfo *i) {
     dbus_message_unref(i->message);
     AVAHI_LLIST_REMOVE(SyncServiceResolverInfo, sync_service_resolvers, i->client->sync_service_resolvers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -60,11 +58,11 @@ void avahi_dbus_sync_service_resolver_callback(
     const AvahiAddress *a,
     uint16_t port,
     AvahiStringList *txt,
-    AvahiLookupResultFlags flags, 
+    AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     SyncServiceResolverInfo *i = userdata;
-    
+
     assert(r);
     assert(i);
 
@@ -73,13 +71,13 @@ void avahi_dbus_sync_service_resolver_callback(
         int32_t i_interface, i_protocol, i_aprotocol;
         uint32_t u_flags;
         DBusMessage *reply;
-    
+
         assert(host_name);
 
         if (!name)
             name = "";
 
-        if (a) 
+        if (a)
             avahi_address_snprint(t, sizeof(t), a);
         else
             t[0] = 0;
@@ -88,16 +86,22 @@ void avahi_dbus_sync_service_resolver_callback(
 
         if (avahi_dbus_is_our_own_service(i->client, interface, protocol, name, type, domain) > 0)
             flags |= AVAHI_LOOKUP_RESULT_OUR_OWN;
-        
+
         i_interface = (int32_t) interface;
         i_protocol = (int32_t) protocol;
-        if (a) 
-           i_aprotocol = (int32_t) a->proto;
-       else 
-           i_aprotocol = AVAHI_PROTO_UNSPEC;
+        if (a)
+            i_aprotocol = (int32_t) a->proto;
+        else
+            i_aprotocol = AVAHI_PROTO_UNSPEC;
         u_flags = (uint32_t) flags;
 
         reply = dbus_message_new_method_return(i->message);
+
+        if (!reply) {
+            avahi_log_error("Failed allocate message");
+            goto finish;
+        }
+
         dbus_message_append_args(
             reply,
             DBUS_TYPE_INT32, &i_interface,
@@ -112,7 +116,7 @@ void avahi_dbus_sync_service_resolver_callback(
             DBUS_TYPE_INVALID);
 
         avahi_dbus_append_string_list(reply, txt);
-                
+
         dbus_message_append_args(
             reply,
             DBUS_TYPE_UINT32, &u_flags,
@@ -122,9 +126,10 @@ void avahi_dbus_sync_service_resolver_callback(
         dbus_message_unref(reply);
     } else {
         assert(event == AVAHI_RESOLVER_FAILURE);
-        
+
         avahi_dbus_respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL);
     }
 
+finish:
     avahi_dbus_sync_service_resolver_free(i);
 }
index ca08d7b1dffb1461c57aed62fc187b51e39704ac..2983b299b0a52fe667c1bdc997850463dcfb7ff4 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -52,13 +50,19 @@ DBusHandlerResult avahi_dbus_respond_error(DBusConnection *c, DBusMessage *m, in
 
     if (!text)
         text = avahi_strerror(error);
-    
+
     reply = dbus_message_new_error(m, avahi_error_number_to_dbus(error), text);
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return DBUS_HANDLER_RESULT_NEED_MEMORY;
+    }
+
     dbus_connection_send(c, reply, NULL);
     dbus_message_unref(reply);
 
     avahi_log_debug(__FILE__": Responding error '%s' (%i)", text, error);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
@@ -66,10 +70,16 @@ DBusHandlerResult avahi_dbus_respond_string(DBusConnection *c, DBusMessage *m, c
     DBusMessage *reply;
 
     reply = dbus_message_new_method_return(m);
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return DBUS_HANDLER_RESULT_NEED_MEMORY;
+    }
+
     dbus_message_append_args(reply, DBUS_TYPE_STRING, &text, DBUS_TYPE_INVALID);
     dbus_connection_send(c, reply, NULL);
     dbus_message_unref(reply);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
@@ -77,10 +87,16 @@ DBusHandlerResult avahi_dbus_respond_int32(DBusConnection *c, DBusMessage *m, in
     DBusMessage *reply;
 
     reply = dbus_message_new_method_return(m);
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return DBUS_HANDLER_RESULT_NEED_MEMORY;
+    }
+
     dbus_message_append_args(reply, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID);
     dbus_connection_send(c, reply, NULL);
     dbus_message_unref(reply);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
@@ -88,10 +104,16 @@ DBusHandlerResult avahi_dbus_respond_uint32(DBusConnection *c, DBusMessage *m, u
     DBusMessage *reply;
 
     reply = dbus_message_new_method_return(m);
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return DBUS_HANDLER_RESULT_NEED_MEMORY;
+    }
+
     dbus_message_append_args(reply, DBUS_TYPE_UINT32, &u, DBUS_TYPE_INVALID);
     dbus_connection_send(c, reply, NULL);
     dbus_message_unref(reply);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
@@ -99,10 +121,16 @@ DBusHandlerResult avahi_dbus_respond_boolean(DBusConnection *c, DBusMessage *m,
     DBusMessage *reply;
 
     reply = dbus_message_new_method_return(m);
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return DBUS_HANDLER_RESULT_NEED_MEMORY;
+    }
+
     dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &b, DBUS_TYPE_INVALID);
     dbus_connection_send(c, reply, NULL);
     dbus_message_unref(reply);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
@@ -110,9 +138,15 @@ DBusHandlerResult avahi_dbus_respond_ok(DBusConnection *c, DBusMessage *m) {
     DBusMessage *reply;
 
     reply = dbus_message_new_method_return(m);
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return DBUS_HANDLER_RESULT_NEED_MEMORY;
+    }
+
     dbus_connection_send(c, reply, NULL);
     dbus_message_unref(reply);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
@@ -120,10 +154,16 @@ DBusHandlerResult avahi_dbus_respond_path(DBusConnection *c, DBusMessage *m, con
     DBusMessage *reply;
 
     reply = dbus_message_new_method_return(m);
+
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return DBUS_HANDLER_RESULT_NEED_MEMORY;
+    }
+
     dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
     dbus_connection_send(c, reply, NULL);
     dbus_message_unref(reply);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
@@ -131,7 +171,7 @@ void avahi_dbus_append_server_error(DBusMessage *reply) {
     const char *t;
 
     t = avahi_error_number_to_dbus(avahi_server_errno(avahi_server));
-    
+
     dbus_message_append_args(
         reply,
         DBUS_TYPE_STRING, &t,
@@ -166,7 +206,7 @@ static char *file_get_contents(const char *fname) {
     char *buf = NULL;
 
     assert(fname);
-    
+
 #ifdef ENABLE_CHROOT
     fd = avahi_chroot_helper_get_fd(fname);
 #else
@@ -205,22 +245,22 @@ static char *file_get_contents(const char *fname) {
     close(fd);
 
     return buf;
-    
+
 fail:
     if (fd >= 0)
         close(fd);
-    
+
     if (buf)
         avahi_free(buf);
 
     return NULL;
-        
+
 }
 
 DBusHandlerResult avahi_dbus_handle_introspect(DBusConnection *c, DBusMessage *m, const char *fname) {
     char *contents, *path;
     DBusError error;
-    
+
     assert(c);
     assert(m);
     assert(fname);
@@ -235,21 +275,21 @@ DBusHandlerResult avahi_dbus_handle_introspect(DBusConnection *c, DBusMessage *m
     path = avahi_strdup_printf("%s/%s", AVAHI_DBUS_INTROSPECTION_DIR, fname);
     contents = file_get_contents(path);
     avahi_free(path);
-    
+
     if (!contents) {
         avahi_log_error("Failed to load introspection data.");
         goto fail;
     }
-    
+
     avahi_dbus_respond_string(c, m, contents);
     avahi_free(contents);
-    
+
     return DBUS_HANDLER_RESULT_HANDLED;
 
 fail:
     if (dbus_error_is_set(&error))
         dbus_error_free(&error);
-    
+
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
 }
@@ -257,20 +297,20 @@ fail:
 void avahi_dbus_append_string_list(DBusMessage *reply, AvahiStringList *txt) {
     AvahiStringList *p;
     DBusMessageIter iter, sub;
-    
+
     assert(reply);
 
     dbus_message_iter_init_append(reply, &iter);
     dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "ay", &sub);
-    
+
     for (p = txt; p; p = p->next) {
         DBusMessageIter sub2;
         const uint8_t *data = p->text;
-        
+
         dbus_message_iter_open_container(&sub, DBUS_TYPE_ARRAY, "y", &sub2);
-        dbus_message_iter_append_fixed_array(&sub2, DBUS_TYPE_BYTE, &data, p->size); 
+        dbus_message_iter_append_fixed_array(&sub2, DBUS_TYPE_BYTE, &data, p->size);
         dbus_message_iter_close_container(&sub, &sub2);
-        
+
     }
     dbus_message_iter_close_container(&iter, &sub);
 }
@@ -281,12 +321,12 @@ int avahi_dbus_read_rdata(DBusMessage *m, int idx, void **rdata, uint32_t *size)
     uint8_t *k;
 
     assert(m);
-    
+
     dbus_message_iter_init(m, &iter);
 
     for (j = 0; j < idx; j++)
        dbus_message_iter_next(&iter);
-    
+
     if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
         dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_BYTE)
         goto fail;
@@ -296,9 +336,9 @@ int avahi_dbus_read_rdata(DBusMessage *m, int idx, void **rdata, uint32_t *size)
 
     *rdata = k;
     *size = n;
-    
+
     return 0;
-    
+
 fail:
     avahi_log_warn("Error parsing data");
 
@@ -314,49 +354,49 @@ int avahi_dbus_read_strlst(DBusMessage *m, int idx, AvahiStringList **l) {
 
     assert(m);
     assert(l);
-    
+
     dbus_message_iter_init(m, &iter);
 
     for (j = 0; j < idx; j++)
         dbus_message_iter_next(&iter);
-    
+
     if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
         dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_ARRAY)
         goto fail;
 
     dbus_message_iter_recurse(&iter, &sub);
-        
+
     for (;;) {
         int at, n;
         const uint8_t *k;
         DBusMessageIter sub2;
-        
+
         if ((at = dbus_message_iter_get_arg_type(&sub)) == DBUS_TYPE_INVALID)
             break;
-        
+
         assert(at == DBUS_TYPE_ARRAY);
-        
+
         if (dbus_message_iter_get_element_type(&sub) != DBUS_TYPE_BYTE)
             goto fail;
 
         dbus_message_iter_recurse(&sub, &sub2);
-            
+
         k = (const uint8_t*) "";
         n = 0;
         dbus_message_iter_get_fixed_array(&sub2, &k, &n);
 
         if (!k)
             k = (const uint8_t*) "";
-            
+
         strlst = avahi_string_list_add_arbitrary(strlst, k, n);
-        
+
         dbus_message_iter_next(&sub);
     }
 
     *l = strlst;
-    
+
     return 0;
-    
+
 fail:
     avahi_log_warn("Error parsing TXT data");
 
@@ -381,15 +421,15 @@ int avahi_dbus_is_our_own_service(Client *c, AvahiIfIndex interface, AvahiProtoc
 
 int avahi_dbus_append_rdata(DBusMessage *message, const void *rdata, size_t size) {
     DBusMessageIter iter, sub;
+
     assert(message);
+
     dbus_message_iter_init_append(message, &iter);
+
     if (!(dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING, &sub)) ||
         !(dbus_message_iter_append_fixed_array(&sub, DBUS_TYPE_BYTE, &rdata, size)) ||
         !(dbus_message_iter_close_container(&iter, &sub)))
         return -1;
-    
+
     return 0;
 }
index e994915d9c515bfc473b373b6d336cc2e9e5fe7b..a5133674d901db9ea2e25eb51109674860c41735 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foodbusutilhfoo
 #define foodbusutilhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 7d6c6b803fca762080f94b1bd971663a0dc29281..46db2ae47fd8803e7f850ab85dfa49a2ece960a5 100644 (file)
@@ -1,8 +1,6 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 
-<!-- $Id$ -->
-
 <!--
   This file is part of avahi.
  
index 495daa7be0f01a6f9e1153b3ed0579fe67050550..4483340f5298accd35eb025099049967b334317c 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-#
 # This file is part of avahi.
 # 
 # avahi is free software; you can redistribute it and/or modify it
index 6560ab933992563812aec7bb3adb5676e4f12d09..6ca66418784cccdb54bc7be35c51ca8dc54b5986 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -52,7 +50,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
             for (i = split; *i; i++)
                 printf("<%s> ", *i);
-            
+
             avahi_strfreev(split);
 
             printf("\n");
index 1b50335ba4e0fcbfaac772dfbc4bf9614539ad69..0a99ce366cf542d3bc18aafc482236e184558ccd 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -38,14 +36,14 @@ AvahiIniFile* avahi_ini_file_load(const char *fname) {
     FILE *fo;
     AvahiIniFileGroup *group = NULL;
     unsigned line;
-    
+
     assert(fname);
 
     if (!(fo = fopen(fname, "r"))) {
         avahi_log_error("Failed to open file '%s': %s", fname, strerror(errno));
         return NULL;
     }
-    
+
     f = avahi_new(AvahiIniFile, 1);
     AVAHI_LLIST_HEAD_INIT(AvahiIniFileGroup, f->groups);
     f->n_groups = 0;
@@ -54,12 +52,12 @@ AvahiIniFile* avahi_ini_file_load(const char *fname) {
     while (!feof(fo)) {
         char ln[256], *s, *e;
         AvahiIniFilePair *pair;
-        
+
         if (!(fgets(ln, sizeof(ln), fo)))
             break;
 
         line++;
-        
+
         s = ln + strspn(ln, " \t");
         s[strcspn(s, "\r\n")] = 0;
 
@@ -69,19 +67,19 @@ AvahiIniFile* avahi_ini_file_load(const char *fname) {
 
         if (*s == '[') {
             /* new group */
-            
+
             if (!(e = strchr(s, ']'))) {
                 avahi_log_error("Unclosed group header in %s:%u: <%s>", fname, line, s);
                 goto fail;
             }
 
             *e = 0;
-            
+
             group = avahi_new(AvahiIniFileGroup, 1);
             group->name = avahi_strdup(s+1);
             group->n_pairs = 0;
             AVAHI_LLIST_HEAD_INIT(AvahiIniFilePair, group->pairs);
-            
+
             AVAHI_LLIST_PREPEND(AvahiIniFileGroup, groups, f->groups, group);
             f->n_groups++;
         } else {
@@ -91,26 +89,26 @@ AvahiIniFile* avahi_ini_file_load(const char *fname) {
                 avahi_log_error("Missing assignment in %s:%u: <%s>", fname, line, s);
                 goto fail;
             }
-            
+
             if (!group) {
                 avahi_log_error("Assignment outside group in %s:%u <%s>", fname, line, s);
                 goto fail;
             }
-            
+
             /* Split the key and the value */
             *(e++) = 0;
-            
+
             pair = avahi_new(AvahiIniFilePair, 1);
             pair->key = avahi_strdup(s);
             pair->value = avahi_strdup(e);
-            
+
             AVAHI_LLIST_PREPEND(AvahiIniFilePair, pairs, group->pairs, pair);
             group->n_pairs++;
         }
     }
-    
+
     fclose(fo);
-        
+
     return f;
 
 fail:
@@ -130,7 +128,7 @@ void avahi_ini_file_free(AvahiIniFile *f) {
 
     while ((g = f->groups)) {
         AvahiIniFilePair *p;
-        
+
         while ((p = g->pairs)) {
             avahi_free(p->key);
             avahi_free(p->value);
@@ -190,7 +188,7 @@ void avahi_strfreev(char **p) {
 
     if (!p)
         return;
-    
+
     for (i = p; *i; i++)
         avahi_free(*i);
 
index 82c5acfcca99bac969dfb213e29d57508bc319ab..dd3aace29d98cb19e1b1b455b3daa910fbcc2249 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooinifileparserhfoo
 #define fooinifileparserhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 32a371c28c8a46e997b25b6d63f14bec18e38650..5d6856005b8497d6cc3ce2aca85cbf766e879770 100644 (file)
@@ -19,8 +19,6 @@
   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 
 -->
 
-<!-- $Id$ -->
-
 <xsl:output method="xml" version="1.0" encoding="iso-8859-15" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes"/>
 
 <xsl:template match="/">
index c3cbb0e898f9a4025de28cbe4fe1d5a652388ef3..d1a3b3e773d8efad276d164f457e2b3bd2ef16e1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -79,6 +77,7 @@
 #include "static-services.h"
 #include "static-hosts.h"
 #include "ini-file-parser.h"
+#include "sd-daemon.h"
 
 #ifdef HAVE_DBUS
 #include "dbus-protocol.h"
@@ -107,6 +106,9 @@ typedef struct {
 #ifdef HAVE_DBUS
     int enable_dbus;
     int fail_on_missing_dbus;
+    unsigned n_clients_max;
+    unsigned n_objects_per_client_max;
+    unsigned n_entries_per_entry_group_max;
 #endif
     int drop_root;
     int set_rlimits;
@@ -528,6 +530,26 @@ static int is_yes(const char *s) {
     return *s == 'y' || *s == 'Y' || *s == '1' || *s == 't' || *s == 'T';
 }
 
+static int parse_unsigned(const char *s, unsigned *u) {
+    char *e = NULL;
+    unsigned long ul;
+    unsigned k;
+
+    errno = 0;
+    ul = strtoul(s, &e, 0);
+
+    if (!e || *e || errno != 0)
+        return -1;
+
+    k = (unsigned) ul;
+
+    if ((unsigned long) k != ul)
+        return -1;
+
+    *u = k;
+    return 0;
+}
+
 static int load_config_file(DaemonConfig *c) {
     int r = -1;
     AvahiIniFile *f;
@@ -619,6 +641,44 @@ static int load_config_file(DaemonConfig *c) {
                         c->server_config.deny_interfaces = avahi_string_list_add(c->server_config.deny_interfaces, *t);
 
                     avahi_strfreev(e);
+                } else if (strcasecmp(p->key, "cache-entries-max") == 0) {
+                    unsigned k;
+
+                    if (parse_unsigned(p->value, &k) < 0) {
+                        avahi_log_error("Invalid cache-entries-max setting %s", p->value);
+                        goto finish;
+                    }
+
+                    c->server_config.n_cache_entries_max = k;
+#ifdef HAVE_DBUS
+                } else if (strcasecmp(p->key, "clients-max") == 0) {
+                    unsigned k;
+
+                    if (parse_unsigned(p->value, &k) < 0) {
+                        avahi_log_error("Invalid clients-max setting %s", p->value);
+                        goto finish;
+                    }
+
+                    c->n_clients_max = k;
+                } else if (strcasecmp(p->key, "objects-per-client-max") == 0) {
+                    unsigned k;
+
+                    if (parse_unsigned(p->value, &k) < 0) {
+                        avahi_log_error("Invalid objects-per-client-max setting %s", p->value);
+                        goto finish;
+                    }
+
+                    c->n_objects_per_client_max = k;
+                } else if (strcasecmp(p->key, "entries-per-entry-group-max") == 0) {
+                    unsigned k;
+
+                    if (parse_unsigned(p->value, &k) < 0) {
+                        avahi_log_error("Invalid entries-per-entry-group-max setting %s", p->value);
+                        goto finish;
+                    }
+
+                    c->n_entries_per_entry_group_max = k;
+#endif
                 } else {
                     avahi_log_error("Invalid configuration key \"%s\" in group \"%s\"\n", p->key, g->name);
                     goto finish;
@@ -1010,7 +1070,12 @@ static int run_server(DaemonConfig *c) {
 
 #ifdef HAVE_DBUS
     if (c->enable_dbus) {
-        if (dbus_protocol_setup(poll_api, config.disable_user_service_publishing, !c->fail_on_missing_dbus
+        if (dbus_protocol_setup(poll_api,
+                                config.disable_user_service_publishing,
+                                config.n_clients_max,
+                                config.n_objects_per_client_max,
+                                config.n_entries_per_entry_group_max,
+                                !c->fail_on_missing_dbus
 #ifdef ENABLE_CHROOT
                                 && !config.use_chroot
 #endif
@@ -1307,7 +1372,7 @@ static void enforce_rlimits(void) {
 #endif
 
     /* the sysctl() call from iface-pfroute.c needs locked memory on FreeBSD */
-#if defined(RLIMIT_MEMLOCK) && !defined(__FreeBSD__)
+#if defined(RLIMIT_MEMLOCK) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
     /* We don't need locked memory */
     set_one_rlimit(RLIMIT_MEMLOCK, 0, "RLIMIT_MEMLOCK");
 #endif
@@ -1348,6 +1413,9 @@ int main(int argc, char *argv[]) {
 #ifdef HAVE_DBUS
     config.enable_dbus = 1;
     config.fail_on_missing_dbus = 1;
+    config.n_clients_max = 0;
+    config.n_objects_per_client_max = 0;
+    config.n_entries_per_entry_group_max = 0;
 #endif
 
     config.drop_root = 1;
@@ -1455,10 +1523,11 @@ int main(int argc, char *argv[]) {
         if (config.use_syslog || config.daemonize)
             daemon_log_use = DAEMON_LOG_SYSLOG;
 
-        if (daemon_close_all(-1) < 0) {
-            avahi_log_error("Failed to close remaining file descriptors: %s", strerror(errno));
-            goto finish;
-        }
+        if (sd_listen_fds(0) <= 0)
+            if (daemon_close_all(-1) < 0) {
+                avahi_log_error("Failed to close remaining file descriptors: %s", strerror(errno));
+                goto finish;
+            }
 
         if (make_runtime_dir() < 0)
             goto finish;
index 77af0d06e2f27d0531999d9a7b085614d4dc9338..ef04c2d911da15561c0d5c7dd7730307a4d582b9 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foomainhfoo
 #define foomainhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
diff --git a/avahi-daemon/org.freedesktop.Avahi.AddressResolver.xml b/avahi-daemon/org.freedesktop.Avahi.AddressResolver.xml
new file mode 100644 (file)
index 0000000..bae9c2f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out" />
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.AddressResolver">
+
+    <method name="Free"/>
+
+    <signal name="Found">
+      <arg name="interface" type="i" direction="out"/>
+      <arg name="protocol" type="i" direction="out"/>
+      <arg name="aprotocol" type="i" direction="out"/>
+      <arg name="address" type="s" direction="out"/>
+      <arg name="name" type="s" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
+    </signal>
+
+    <signal name="Failure">
+      <arg name="error" type="s"/>
+    </signal>
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.DomainBrowser.xml b/avahi-daemon/org.freedesktop.Avahi.DomainBrowser.xml
new file mode 100644 (file)
index 0000000..22c614e
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out" />
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.DomainBrowser">
+
+    <method name="Free"/>
+
+    <signal name="ItemNew">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="domain" type="s"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="ItemRemove">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="domain" type="s"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="Failure">
+      <arg name="error" type="s"/>
+    </signal>
+
+    <signal name="AllForNow"/>
+
+    <signal name="CacheExhausted"/>
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.EntryGroup.xml b/avahi-daemon/org.freedesktop.Avahi.EntryGroup.xml
new file mode 100644 (file)
index 0000000..43fd63c
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out"/>
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.EntryGroup">
+    <method name="Free"/>
+    <method name="Commit"/>
+    <method name="Reset"/>
+
+    <method name="GetState">
+      <arg name="state" type="i" direction="out"/>
+    </method>
+
+    <signal name="StateChanged">
+      <arg name="state" type="i"/>
+      <arg name="error" type="s"/>
+    </signal>
+
+    <method name="IsEmpty">
+      <arg name="empty" type="b" direction="out"/>
+    </method>
+
+    <method name="AddService">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="type" type="s" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="host" type="s" direction="in"/>
+      <arg name="port" type="q" direction="in"/>
+      <arg name="txt" type="aay" direction="in"/>
+    </method>
+
+    <method name="AddServiceSubtype">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="type" type="s" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="subtype" type="s" direction="in"/>
+    </method>
+
+    <method name="UpdateServiceTxt">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="type" type="s" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="txt" type="aay" direction="in"/>
+    </method>
+
+    <method name="AddAddress">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="address" type="s" direction="in"/>
+    </method>
+
+    <method name="AddRecord">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="clazz" type="q" direction="in"/>
+      <arg name="type" type="q" direction="in"/>
+      <arg name="ttl" type="u" direction="in"/>
+      <arg name="rdata" type="ay" direction="in"/>
+    </method>
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.HostNameResolver.xml b/avahi-daemon/org.freedesktop.Avahi.HostNameResolver.xml
new file mode 100644 (file)
index 0000000..0b43752
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out" />
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.HostNameResolver">
+
+    <method name="Free"/>
+
+    <signal name="Found">
+      <arg name="interface" type="i" direction="out"/>
+      <arg name="protocol" type="i" direction="out"/>
+      <arg name="name" type="s" direction="out"/>
+      <arg name="aprotocol" type="i" direction="out"/>
+      <arg name="address" type="s" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
+    </signal>
+
+    <signal name="Failure">
+      <arg name="error" type="s"/>
+    </signal>
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.RecordBrowser.xml b/avahi-daemon/org.freedesktop.Avahi.RecordBrowser.xml
new file mode 100644 (file)
index 0000000..9ba86f4
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out" />
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.RecordBrowser">
+
+    <method name="Free"/>
+
+    <signal name="ItemNew">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="name" type="s"/>
+      <arg name="clazz" type="q"/>
+      <arg name="type" type="q"/>
+      <arg name="rdata" type="ay"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="ItemRemove">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="name" type="s"/>
+      <arg name="clazz" type="q"/>
+      <arg name="type" type="q"/>
+      <arg name="rdata" type="ay"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="Failure">
+      <arg name="error" type="s"/>
+    </signal>
+
+    <signal name="AllForNow"/>
+
+    <signal name="CacheExhausted"/>
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.Server.xml b/avahi-daemon/org.freedesktop.Avahi.Server.xml
new file mode 100644 (file)
index 0000000..c291274
--- /dev/null
@@ -0,0 +1,219 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+ <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out"/>
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.Server">
+
+    <method name="GetVersionString">
+      <arg name="version" type="s" direction="out"/>
+    </method>
+
+    <method name="GetAPIVersion">
+      <arg name="version" type="u" direction="out"/>
+    </method>
+
+    <method name="GetHostName">
+      <arg name="name" type="s" direction="out"/>
+    </method>
+    <method name="SetHostName">
+      <arg name="name" type="s" direction="in"/>
+    </method>
+    <method name="GetHostNameFqdn">
+      <arg name="name" type="s" direction="out"/>
+    </method>
+    <method name="GetDomainName">
+      <arg name="name" type="s" direction="out"/>
+    </method>
+
+    <method name="IsNSSSupportAvailable">
+      <arg name="yes" type="b" direction="out"/>
+    </method>
+
+    <method name="GetState">
+      <arg name="state" type="i" direction="out"/>
+    </method>
+
+    <signal name="StateChanged">
+      <arg name="state" type="i"/>
+      <arg name="error" type="s"/>
+    </signal>
+
+    <method name="GetLocalServiceCookie">
+      <arg name="cookie" type="u" direction="out"/>
+    </method>
+
+    <method name="GetAlternativeHostName">
+      <arg name="name" type="s" direction="in"/>
+      <arg name="name" type="s" direction="out"/>
+    </method>
+
+    <method name="GetAlternativeServiceName">
+      <arg name="name" type="s" direction="in"/>
+      <arg name="name" type="s" direction="out"/>
+    </method>
+
+    <method name="GetNetworkInterfaceNameByIndex">
+      <arg name="index" type="i" direction="in"/>
+      <arg name="name" type="s" direction="out"/>
+    </method>
+    <method name="GetNetworkInterfaceIndexByName">
+      <arg name="name" type="s" direction="in"/>
+      <arg name="index" type="i" direction="out"/>
+    </method>
+
+    <method name="ResolveHostName">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="aprotocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="interface" type="i" direction="out"/>
+      <arg name="protocol" type="i" direction="out"/>
+      <arg name="name" type="s" direction="out"/>
+      <arg name="aprotocol" type="i" direction="out"/>
+      <arg name="address" type="s" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
+    </method>
+
+    <method name="ResolveAddress">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="address" type="s" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="interface" type="i" direction="out"/>
+      <arg name="protocol" type="i" direction="out"/>
+      <arg name="aprotocol" type="i" direction="out"/>
+      <arg name="address" type="s" direction="out"/>
+      <arg name="name" type="s" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
+    </method>
+
+    <method name="ResolveService">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="type" type="s" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="aprotocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="interface" type="i" direction="out"/>
+      <arg name="protocol" type="i" direction="out"/>
+      <arg name="name" type="s" direction="out"/>
+      <arg name="type" type="s" direction="out"/>
+      <arg name="domain" type="s" direction="out"/>
+      <arg name="host" type="s" direction="out"/>
+      <arg name="aprotocol" type="i" direction="out"/>
+      <arg name="address" type="s" direction="out"/>
+      <arg name="port" type="q" direction="out"/>
+      <arg name="txt" type="aay" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
+    </method>
+
+    <method name="EntryGroupNew">
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+    <method name="DomainBrowserNew">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="btype" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+    <method name="ServiceTypeBrowserNew">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+    <method name="ServiceBrowserNew">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="type" type="s" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+    <method name="ServiceResolverNew">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="type" type="s" direction="in"/>
+      <arg name="domain" type="s" direction="in"/>
+      <arg name="aprotocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+    <method name="HostNameResolverNew">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="aprotocol" type="i" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+    <method name="AddressResolverNew">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="address" type="s" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+    <method name="RecordBrowserNew">
+      <arg name="interface" type="i" direction="in"/>
+      <arg name="protocol" type="i" direction="in"/>
+      <arg name="name" type="s" direction="in"/>
+      <arg name="clazz" type="q" direction="in"/>
+      <arg name="type" type="q" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+
+      <arg name="path" type="o" direction="out"/>
+    </method>
+
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.ServiceBrowser.xml b/avahi-daemon/org.freedesktop.Avahi.ServiceBrowser.xml
new file mode 100644 (file)
index 0000000..d80298d
--- /dev/null
@@ -0,0 +1,63 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out" />
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.ServiceBrowser">
+
+    <method name="Free"/>
+
+    <signal name="ItemNew">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="name" type="s"/>
+      <arg name="type" type="s"/>
+      <arg name="domain" type="s"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="ItemRemove">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="name" type="s"/>
+      <arg name="type" type="s"/>
+      <arg name="domain" type="s"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="Failure">
+      <arg name="error" type="s"/>
+    </signal>
+
+    <signal name="AllForNow"/>
+
+    <signal name="CacheExhausted"/>
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.ServiceResolver.xml b/avahi-daemon/org.freedesktop.Avahi.ServiceResolver.xml
new file mode 100644 (file)
index 0000000..623f209
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out" />
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.ServiceResolver">
+
+    <method name="Free"/>
+
+    <signal name="Found">
+      <arg name="interface" type="i" direction="out"/>
+      <arg name="protocol" type="i" direction="out"/>
+      <arg name="name" type="s" direction="out"/>
+      <arg name="type" type="s" direction="out"/>
+      <arg name="domain" type="s" direction="out"/>
+      <arg name="host" type="s" direction="out"/>
+      <arg name="aprotocol" type="i" direction="out"/>
+      <arg name="address" type="s" direction="out"/>
+      <arg name="port" type="q" direction="out"/>
+      <arg name="txt" type="aay" direction="out"/>
+      <arg name="flags" type="u" direction="out"/>
+    </signal>
+
+    <signal name="Failure">
+      <arg name="error" type="s"/>
+    </signal>
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.ServiceTypeBrowser.xml b/avahi-daemon/org.freedesktop.Avahi.ServiceTypeBrowser.xml
new file mode 100644 (file)
index 0000000..4efec82
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
+<!DOCTYPE node SYSTEM "introspect.dtd">
+
+<!--
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+  02111-1307 USA.
+-->
+
+<node>
+
+  <interface name="org.freedesktop.DBus.Introspectable">
+    <method name="Introspect">
+      <arg name="data" type="s" direction="out" />
+    </method>
+  </interface>
+
+  <interface name="org.freedesktop.Avahi.ServiceTypeBrowser">
+
+    <method name="Free"/>
+
+    <signal name="ItemNew">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="type" type="s"/>
+      <arg name="domain" type="s"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="ItemRemove">
+      <arg name="interface" type="i"/>
+      <arg name="protocol" type="i"/>
+      <arg name="type" type="s"/>
+      <arg name="domain" type="s"/>
+      <arg name="flags" type="u"/>
+    </signal>
+
+    <signal name="Failure">
+      <arg name="error" type="s"/>
+    </signal>
+
+    <signal name="AllForNow"/>
+
+    <signal name="CacheExhausted"/>
+
+  </interface>
+</node>
diff --git a/avahi-daemon/org.freedesktop.Avahi.service b/avahi-daemon/org.freedesktop.Avahi.service
new file mode 100644 (file)
index 0000000..ebc5f31
--- /dev/null
@@ -0,0 +1,24 @@
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+[D-BUS Service]
+Name=org.freedesktop.Avahi
+SystemdService=avahi-daemon.service
+
+# This service should not be bus activated if systemd isn't running,
+# so that activation won't conflict with the init script startup.
+Exec=/bin/false
diff --git a/avahi-daemon/sd-daemon.c b/avahi-daemon/sd-daemon.c
new file mode 100644 (file)
index 0000000..cb568b5
--- /dev/null
@@ -0,0 +1,448 @@
+/*-*- Mode: C; c-basic-offset: 8 -*-*/
+
+/***
+  Copyright 2010 Lennart Poettering
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation files
+  (the "Software"), to deal in the Software without restriction,
+  including without limitation the rights to use, copy, modify, merge,
+  publish, distribute, sublicense, and/or sell copies of the Software,
+  and to permit persons to whom the Software is furnished to do so,
+  subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+***/
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/fcntl.h>
+#include <netinet/in.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "sd-daemon.h"
+
+int sd_listen_fds(int unset_environment) {
+
+#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
+        return 0;
+#else
+        int r, fd;
+        const char *e;
+        char *p = NULL;
+        unsigned long l;
+
+        if (!(e = getenv("LISTEN_PID"))) {
+                r = 0;
+                goto finish;
+        }
+
+        errno = 0;
+        l = strtoul(e, &p, 10);
+
+        if (errno != 0) {
+                r = -errno;
+                goto finish;
+        }
+
+        if (!p || *p || l <= 0) {
+                r = -EINVAL;
+                goto finish;
+        }
+
+        /* Is this for us? */
+        if (getpid() != (pid_t) l) {
+                r = 0;
+                goto finish;
+        }
+
+        if (!(e = getenv("LISTEN_FDS"))) {
+                r = 0;
+                goto finish;
+        }
+
+        errno = 0;
+        l = strtoul(e, &p, 10);
+
+        if (errno != 0) {
+                r = -errno;
+                goto finish;
+        }
+
+        if (!p || *p) {
+                r = -EINVAL;
+                goto finish;
+        }
+
+        for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) {
+                int flags;
+
+                if ((flags = fcntl(fd, F_GETFD)) < 0) {
+                        r = -errno;
+                        goto finish;
+                }
+
+                if (flags & FD_CLOEXEC)
+                        continue;
+
+                if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
+                        r = -errno;
+                        goto finish;
+                }
+        }
+
+        r = (int) l;
+
+finish:
+        if (unset_environment) {
+                unsetenv("LISTEN_PID");
+                unsetenv("LISTEN_FDS");
+        }
+
+        return r;
+#endif
+}
+
+int sd_is_fifo(int fd, const char *path) {
+        struct stat st_fd;
+
+        if (fd < 0)
+                return -EINVAL;
+
+        memset(&st_fd, 0, sizeof(st_fd));
+        if (fstat(fd, &st_fd) < 0)
+                return -errno;
+
+        if (!S_ISFIFO(st_fd.st_mode))
+                return 0;
+
+        if (path) {
+                struct stat st_path;
+
+                memset(&st_path, 0, sizeof(st_path));
+                if (fstat(fd, &st_path) < 0) {
+
+                        if (errno == ENOENT || errno == ENOTDIR)
+                                return 0;
+
+                        return -errno;
+                }
+
+                return
+                        st_path.st_dev == st_fd.st_dev &&
+                        st_path.st_ino == st_fd.st_ino;
+        }
+
+        return 1;
+}
+
+static int sd_is_socket_internal(int fd, int type, int listening) {
+        struct stat st_fd;
+
+        if (fd < 0 || type < 0)
+                return -EINVAL;
+
+        if (fstat(fd, &st_fd) < 0)
+                return -errno;
+
+        if (!S_ISSOCK(st_fd.st_mode))
+                return 0;
+
+        if (type != 0) {
+                int other_type = 0;
+                socklen_t l = sizeof(other_type);
+
+                if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0)
+                        return -errno;
+
+                if (l != sizeof(other_type))
+                        return -EINVAL;
+
+                if (other_type != type)
+                        return 0;
+        }
+
+        if (listening >= 0) {
+                int accepting = 0;
+                socklen_t l = sizeof(accepting);
+
+                if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0)
+                        return -errno;
+
+                if (l != sizeof(accepting))
+                        return -EINVAL;
+
+                if (!accepting != !listening)
+                        return 0;
+        }
+
+        return 1;
+}
+
+union sockaddr_union {
+        struct sockaddr sa;
+        struct sockaddr_in in4;
+        struct sockaddr_in6 in6;
+        struct sockaddr_un un;
+        struct sockaddr_storage storage;
+};
+
+int sd_is_socket(int fd, int family, int type, int listening) {
+        int r;
+
+        if (family < 0)
+                return -EINVAL;
+
+        if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
+                return r;
+
+        if (family > 0) {
+                union sockaddr_union sockaddr;
+                socklen_t l;
+
+                memset(&sockaddr, 0, sizeof(sockaddr));
+                l = sizeof(sockaddr);
+
+                if (getsockname(fd, &sockaddr.sa, &l) < 0)
+                        return -errno;
+
+                if (l < sizeof(sa_family_t))
+                        return -EINVAL;
+
+                return sockaddr.sa.sa_family == family;
+        }
+
+        return 1;
+}
+
+int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
+        union sockaddr_union sockaddr;
+        socklen_t l;
+        int r;
+
+        if (family != 0 && family != AF_INET && family != AF_INET6)
+                return -EINVAL;
+
+        if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
+                return r;
+
+        memset(&sockaddr, 0, sizeof(sockaddr));
+        l = sizeof(sockaddr);
+
+        if (getsockname(fd, &sockaddr.sa, &l) < 0)
+                return -errno;
+
+        if (l < sizeof(sa_family_t))
+                return -EINVAL;
+
+        if (sockaddr.sa.sa_family != AF_INET &&
+            sockaddr.sa.sa_family != AF_INET6)
+                return 0;
+
+        if (family > 0)
+                if (sockaddr.sa.sa_family != family)
+                        return 0;
+
+        if (port > 0) {
+                if (sockaddr.sa.sa_family == AF_INET) {
+                        if (l < sizeof(struct sockaddr_in))
+                                return -EINVAL;
+
+                        return htons(port) == sockaddr.in4.sin_port;
+                } else {
+                        if (l < sizeof(struct sockaddr_in6))
+                                return -EINVAL;
+
+                        return htons(port) == sockaddr.in6.sin6_port;
+                }
+        }
+
+        return 1;
+}
+
+int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
+        union sockaddr_union sockaddr;
+        socklen_t l;
+        int r;
+
+        if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
+                return r;
+
+        memset(&sockaddr, 0, sizeof(sockaddr));
+        l = sizeof(sockaddr);
+
+        if (getsockname(fd, &sockaddr.sa, &l) < 0)
+                return -errno;
+
+        if (l < sizeof(sa_family_t))
+                return -EINVAL;
+
+        if (sockaddr.sa.sa_family != AF_UNIX)
+                return 0;
+
+        if (path) {
+                if (length <= 0)
+                        length = strlen(path);
+
+                if (length <= 0)
+                        /* Unnamed socket */
+                        return l == sizeof(sa_family_t);
+
+                if (path[0])
+                        /* Normal path socket */
+                        return
+                                (l >= sizeof(sa_family_t) + length + 1) &&
+                                memcmp(path, sockaddr.un.sun_path, length+1) == 0;
+                else
+                        /* Abstract namespace socket */
+                        return
+                                (l == sizeof(sa_family_t) + length) &&
+                                memcmp(path, sockaddr.un.sun_path, length) == 0;
+        }
+
+        return 1;
+}
+
+int sd_notify(int unset_environment, const char *state) {
+#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
+        return 0;
+#else
+        int fd = -1, r;
+        struct msghdr msghdr;
+        struct iovec iovec;
+        union sockaddr_union sockaddr;
+        struct ucred *ucred;
+        union {
+                struct cmsghdr cmsghdr;
+                uint8_t buf[CMSG_SPACE(sizeof(struct ucred))];
+        } control;
+        const char *e;
+
+        if (!state) {
+                r = -EINVAL;
+                goto finish;
+        }
+
+        if (!(e = getenv("NOTIFY_SOCKET")))
+                return 0;
+
+        /* Must be an abstract socket, or an absolute path */
+        if ((e[0] != '@' && e[0] != '/') || e[1] == 0) {
+                r = -EINVAL;
+                goto finish;
+        }
+
+        if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) {
+                r = -errno;
+                goto finish;
+        }
+
+        memset(&sockaddr, 0, sizeof(sockaddr));
+        sockaddr.sa.sa_family = AF_UNIX;
+        strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path));
+
+        if (sockaddr.un.sun_path[0] == '@')
+                sockaddr.un.sun_path[0] = 0;
+
+        memset(&iovec, 0, sizeof(iovec));
+        iovec.iov_base = (char*) state;
+        iovec.iov_len = strlen(state);
+
+        memset(&control, 0, sizeof(control));
+        control.cmsghdr.cmsg_level = SOL_SOCKET;
+        control.cmsghdr.cmsg_type = SCM_CREDENTIALS;
+        control.cmsghdr.cmsg_len = CMSG_LEN(sizeof(struct ucred));
+
+        ucred = (struct ucred*) CMSG_DATA(&control.cmsghdr);
+        ucred->pid = getpid();
+        ucred->uid = getuid();
+        ucred->gid = getgid();
+
+        memset(&msghdr, 0, sizeof(msghdr));
+        msghdr.msg_name = &sockaddr;
+        msghdr.msg_namelen = sizeof(struct sockaddr_un);
+        msghdr.msg_iov = &iovec;
+        msghdr.msg_iovlen = 1;
+        msghdr.msg_control = &control;
+        msghdr.msg_controllen = control.cmsghdr.cmsg_len;
+
+        if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) {
+                r = -errno;
+                goto finish;
+        }
+
+        r = 1;
+
+finish:
+        if (unset_environment)
+                unsetenv("NOTIFY_SOCKET");
+
+        if (fd >= 0)
+                close(fd);
+
+        return r;
+#endif
+}
+
+int sd_notifyf(int unset_environment, const char *format, ...) {
+#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
+        return 0;
+#else
+        va_list ap;
+        char *p = NULL;
+        int r;
+
+        va_start(ap, format);
+        r = vasprintf(&p, format, ap);
+        va_end(ap);
+
+        if (r < 0 || !p)
+                return -ENOMEM;
+
+        r = sd_notify(unset_environment, p);
+        free(p);
+
+        return r;
+#endif
+}
+
+int sd_booted(void) {
+#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
+        return 0;
+#else
+
+        struct stat a, b;
+
+        /* We simply test whether the systemd cgroup hierarchy is
+         * mounted */
+
+        if (lstat("/cgroup", &a) < 0)
+                return 0;
+
+        if (lstat("/cgroup/systemd", &b) < 0)
+                return 0;
+
+        return a.st_dev != b.st_dev;
+#endif
+}
diff --git a/avahi-daemon/sd-daemon.h b/avahi-daemon/sd-daemon.h
new file mode 100644 (file)
index 0000000..fd6221f
--- /dev/null
@@ -0,0 +1,257 @@
+/*-*- Mode: C; c-basic-offset: 8 -*-*/
+
+#ifndef foosddaemonhfoo
+#define foosddaemonhfoo
+
+/***
+  Copyright 2010 Lennart Poettering
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation files
+  (the "Software"), to deal in the Software without restriction,
+  including without limitation the rights to use, copy, modify, merge,
+  publish, distribute, sublicense, and/or sell copies of the Software,
+  and to permit persons to whom the Software is furnished to do so,
+  subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+***/
+
+#include <sys/types.h>
+#include <inttypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+  Reference implementation of a few systemd related interfaces for
+  writing daemons. These interfaces are trivial to implement. To
+  simplify porting we provide this reference implementation.
+  Applications are welcome to reimplement the algorithms described
+  here if they do not want to include these two source files.
+
+  The following functionality is provided:
+
+  - Support for logging with log levels on stderr
+  - File descriptor passing for socket-based activation
+  - Daemon startup and status notification
+  - Detection of systemd boots
+
+  You may compile this with -DDISABLE_SYSTEMD to disable systemd
+  support. This makes all those calls NOPs that are directly related to
+  systemd (i.e. only sd_is_xxx() will stay useful).
+
+  Since this is drop-in code we don't want any of our symbols to be
+  exported in any case. Hence we declare hidden visibility for all of
+  them.
+
+  You may find an up-to-date version of these source files online:
+
+  http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h
+  http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c
+
+  This should compile on non-Linux systems, too, but with the
+  exception of the sd_is_xxx() calls all functions will become NOPs.
+
+  See sd-daemon(7) for more information.
+*/
+
+#if __GNUC__ >= 4
+#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
+#define _sd_hidden_ __attribute__ ((visibility("hidden")))
+#else
+#define _sd_printf_attr_(a,b)
+#define _sd_hidden_
+#endif
+
+/*
+  Log levels for usage on stderr:
+
+          fprintf(stderr, SD_NOTICE "Hello World!\n");
+
+  This is similar to printk() usage in the kernel.
+*/
+#define SD_EMERG   "<0>"  /* system is unusable */
+#define SD_ALERT   "<1>"  /* action must be taken immediately */
+#define SD_CRIT    "<2>"  /* critical conditions */
+#define SD_ERR     "<3>"  /* error conditions */
+#define SD_WARNING "<4>"  /* warning conditions */
+#define SD_NOTICE  "<5>"  /* normal but significant condition */
+#define SD_INFO    "<6>"  /* informational */
+#define SD_DEBUG   "<7>"  /* debug-level messages */
+
+/* The first passed file descriptor is fd 3 */
+#define SD_LISTEN_FDS_START 3
+
+/*
+  Returns how many file descriptors have been passed, or a negative
+  errno code on failure. Optionally, removes the $LISTEN_FDS and
+  $LISTEN_PID file descriptors from the environment (recommended, but
+  problematic in threaded environments). If r is the return value of
+  this function you'll find the file descriptors passed as fds
+  SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative
+  errno style error code on failure. This function call ensures that
+  the FD_CLOEXEC flag is set for the passed file descriptors, to make
+  sure they are not passed on to child processes. If FD_CLOEXEC shall
+  not be set, the caller needs to unset it after this call for all file
+  descriptors that are used.
+
+  See sd_listen_fds(3) for more information.
+*/
+int sd_listen_fds(int unset_environment) _sd_hidden_;
+
+/*
+  Helper call for identifying a passed file descriptor. Returns 1 if
+  the file descriptor is a FIFO in the file system stored under the
+  specified path, 0 otherwise. If path is NULL a path name check will
+  not be done and the call only verifies if the file descriptor
+  refers to a FIFO. Returns a negative errno style error code on
+  failure.
+
+  See sd_is_fifo(3) for more information.
+*/
+int sd_is_fifo(int fd, const char *path) _sd_hidden_;
+
+/*
+  Helper call for identifying a passed file descriptor. Returns 1 if
+  the file descriptor is a socket of the specified family (AF_INET,
+  ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If
+  family is 0 a socket family check will not be done. If type is 0 a
+  socket type check will not be done and the call only verifies if
+  the file descriptor refers to a socket. If listening is > 0 it is
+  verified that the socket is in listening mode. (i.e. listen() has
+  been called) If listening is == 0 it is verified that the socket is
+  not in listening mode. If listening is < 0 no listening mode check
+  is done. Returns a negative errno style error code on failure.
+
+  See sd_is_socket(3) for more information.
+*/
+int sd_is_socket(int fd, int family, int type, int listening) _sd_hidden_;
+
+/*
+  Helper call for identifying a passed file descriptor. Returns 1 if
+  the file descriptor is an Internet socket, of the specified family
+  (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM,
+  SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version
+  check is not done. If type is 0 a socket type check will not be
+  done. If port is 0 a socket port check will not be done. The
+  listening flag is used the same way as in sd_is_socket(). Returns a
+  negative errno style error code on failure.
+
+  See sd_is_socket_inet(3) for more information.
+*/
+int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) _sd_hidden_;
+
+/*
+  Helper call for identifying a passed file descriptor. Returns 1 if
+  the file descriptor is an AF_UNIX socket of the specified type
+  (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0
+  a socket type check will not be done. If path is NULL a socket path
+  check will not be done. For normal AF_UNIX sockets set length to
+  0. For abstract namespace sockets set length to the length of the
+  socket name (including the initial 0 byte), and pass the full
+  socket path in path (including the initial 0 byte). The listening
+  flag is used the same way as in sd_is_socket(). Returns a negative
+  errno style error code on failure.
+
+  See sd_is_socket_unix(3) for more information.
+*/
+int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) _sd_hidden_;
+
+/*
+  Informs systemd about changed daemon state. This takes a number of
+  newline seperated environment-style variable assignments in a
+  string. The following variables are known:
+
+     READY=1      Tells systemd that daemon startup is finished (only
+                  relevant for services of Type=notify). The passed
+                  argument is a boolean "1" or "0". Since there is
+                  little value in signalling non-readiness the only
+                  value daemons should send is "READY=1".
+
+     STATUS=...   Passes a single-line status string back to systemd
+                  that describes the daemon state. This is free-from
+                  and can be used for various purposes: general state
+                  feedback, fsck-like programs could pass completion
+                  percentages and failing programs could pass a human
+                  readable error message. Example: "STATUS=Completed
+                  66% of file system check..."
+
+     ERRNO=...    If a daemon fails, the errno-style error code,
+                  formatted as string. Example: "ERRNO=2" for ENOENT.
+
+     BUSERROR=... If a daemon fails, the D-Bus error-style error
+                  code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut"
+
+     MAINPID=...  The main pid of a daemon, in case systemd did not
+                  fork off the process itself. Example: "MAINPID=4711"
+
+  Daemons can choose to send additional variables. However, it is
+  recommened to prefix variable names not listed above with X_.
+
+  Returns a negative errno-style error code on failure. Returns > 0
+  if systemd could be notified, 0 if it couldn't possibly because
+  systemd is not running.
+
+  Example: When a daemon finished starting up, it could issue this
+  call to notify systemd about it:
+
+     sd_notify(0, "READY=1");
+
+  See sd_notifyf() for more complete examples.
+
+  See sd_notify(3) for more information.
+*/
+int sd_notify(int unset_environment, const char *state) _sd_hidden_;
+
+/*
+  Similar to sd_notify() but takes a format string.
+
+  Example 1: A daemon could send the following after initialization:
+
+     sd_notifyf(0, "READY=1\n"
+                   "STATUS=Processing requests...\n"
+                   "MAINPID=%lu",
+                   (unsigned long) getpid());
+
+  Example 2: A daemon could send the following shortly before
+  exiting, on failure:
+
+     sd_notifyf(0, "STATUS=Failed to start up: %s\n"
+                   "ERRNO=%i",
+                   strerror(errno),
+                   errno);
+
+  See sd_notifyf(3) for more information.
+*/
+int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3) _sd_hidden_;
+
+/*
+  Returns > 0 if the system was booted with systemd. Returns < 0 on
+  error. Returns 0 if the system was not booted with systemd. Note
+  that all of the functions above handle non-systemd boots just
+  fine. You should NOT protect them with a call to this function. Also
+  note that this function checks whether the system, not the user
+  session is controlled by systemd. However the functions above work
+  for both session and system services.
+
+  See sd_booted(3) for more information.
+*/
+int sd_booted(void) _sd_hidden_;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 09b7f65f75b96845f5bcaaab9df5fc548a650dcd..aef3555751a666e8ca5266fdb979b575d62c9e25 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -66,7 +64,7 @@ void avahi_init_proc_title(int argc, char **argv) {
     argv_size = endptr - argv_buffer[0];
 
     /* Make a copy of environ */
-    
+
     new_environ = avahi_malloc(sizeof(char*) * (i + 1));
     for (i = 0; environ[i]; i++)
         new_environ[i] = avahi_strdup(environ[i]);
@@ -75,7 +73,7 @@ void avahi_init_proc_title(int argc, char **argv) {
     environ = new_environ;
 
 #endif
-}      
+}
 
 void avahi_set_proc_title(const char *name, const char *fmt,...) {
 #ifdef HAVE_SETPROCTITLE
@@ -90,16 +88,16 @@ void avahi_set_proc_title(const char *name, const char *fmt,...) {
 #elif __linux__
     size_t l;
     va_list ap;
-    
+
     if (!argv_buffer)
         return;
-    
+
     va_start(ap, fmt);
     vsnprintf(argv_buffer[0], argv_size, fmt, ap);
     va_end(ap);
 
     l = strlen(argv_buffer[0]);
-    
+
     memset(argv_buffer[0] + l, 0, argv_size - l);
     argv_buffer[1] = NULL;
 #endif
@@ -108,6 +106,6 @@ void avahi_set_proc_title(const char *name, const char *fmt,...) {
 
     if (name)
         prctl(PR_SET_NAME, (unsigned long) name, 0, 0, 0);
-    
+
 #endif
 }
index a8f2a1ae862f14cac8c73b4b13947832ff807d64..3499e2ebd24b3c8c906b994c10c3d77e522c5b89 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foosetproctitlehfoo
 #define foosetproctitlehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index c65535a8459942e163a9cd77f2b2a751f67b9567..dfae4f1366392e22509c70950cccb4959fc960f8 100644 (file)
@@ -1,11 +1,9 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 
-<!-- $Id$ -->
-
 <!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2 of the
@@ -26,7 +24,7 @@
 
 <service-group>
 
-  <name replace-wildcards="yes">SFTP File Transfer on %h</name>
+  <name replace-wildcards="yes">%h</name>
 
   <service>
     <type>_sftp-ssh._tcp</type>
index 33e5db333f9fcd419d67e414e6b18fc3dff28110..7f755621f926a647f26905d30db2e2c88169d1d6 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -44,6 +42,7 @@
 
 #include "simple-protocol.h"
 #include "main.h"
+#include "sd-daemon.h"
 
 #ifdef ENABLE_CHROOT
 #include "chroot.h"
@@ -75,7 +74,7 @@ struct Client {
     Server *server;
 
     ClientState state;
-    
+
     int fd;
     AvahiWatch *watch;
 
@@ -87,7 +86,7 @@ struct Client {
     AvahiSDNSServerBrowser *dns_server_browser;
 
     AvahiProtocol afquery;
-    
+
     AVAHI_LLIST_FIELDS(Client, clients);
 };
 
@@ -98,7 +97,7 @@ struct Server {
     AVAHI_LLIST_HEAD(Client, clients);
 
     unsigned n_clients;
-    int bind_successful;
+    int remove_socket;
 };
 
 static Server *server = NULL;
@@ -122,7 +121,7 @@ static void client_free(Client *c) {
 
     c->server->poll_api->watch_free(c->watch);
     close(c->fd);
-    
+
     AVAHI_LLIST_REMOVE(Client, clients, c->server->clients, c);
     avahi_free(c);
 }
@@ -151,7 +150,7 @@ static void client_new(Server *s, int fd) {
 
 static void client_output(Client *c, const uint8_t*data, size_t size) {
     size_t k, m;
-    
+
     assert(c);
     assert(data);
 
@@ -170,7 +169,7 @@ static void client_output(Client *c, const uint8_t*data, size_t size) {
 static void client_output_printf(Client *c, const char *format, ...) {
     char *t;
     va_list ap;
-    
+
     va_start(ap, format);
     t = avahi_strdup_vprintf(format, ap);
     va_end(ap);
@@ -186,11 +185,11 @@ static void host_name_resolver_callback(
     AvahiResolverEvent event,
     const char *hostname,
     const AvahiAddress *a,
-    AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, 
+    AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void* userdata) {
 
     Client *c = userdata;
-    
+
     assert(c);
 
     if (event == AVAHI_RESOLVER_FAILURE)
@@ -213,9 +212,9 @@ static void address_resolver_callback(
     const char *hostname,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     Client *c = userdata;
-    
+
     assert(c);
 
     if (event == AVAHI_RESOLVER_FAILURE)
@@ -236,10 +235,10 @@ static void dns_server_browser_callback(
     uint16_t port,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     Client *c = userdata;
     char t[AVAHI_ADDRESS_STR_MAX];
-    
+
     assert(c);
 
     if (!a)
@@ -257,7 +256,7 @@ static void dns_server_browser_callback(
 
         case AVAHI_BROWSER_NEW:
         case AVAHI_BROWSER_REMOVE:
-    
+
             avahi_address_snprint(t, sizeof(t), a);
             client_output_printf(c, "%c %i %u %s %u\n", event == AVAHI_BROWSER_NEW ? '>' : '<',  interface, protocol, t, port);
             break;
@@ -314,7 +313,7 @@ static void handle_line(Client *c, const char *s) {
         avahi_log_debug(__FILE__": Got %s request for '%s'.", cmd, arg);
     } else if (strcmp(cmd, "RESOLVE-ADDRESS") == 0 && n_args == 2) {
         AvahiAddress addr;
-        
+
         if (!(avahi_address_parse(arg, AVAHI_PROTO_UNSPEC, &addr))) {
             client_output_printf(c, "%+i Failed to parse address \"%s\".\n", AVAHI_ERR_INVALID_ADDRESS, arg);
             c->state = CLIENT_DEAD;
@@ -376,7 +375,7 @@ static void handle_input(Client *c) {
 
         k = e - (char*) c->inbuf;
         *e = 0;
-        
+
         handle_line(c, c->inbuf);
         c->inbuf_length -= k + 1;
         memmove(c->inbuf, e+1, c->inbuf_length);
@@ -390,7 +389,7 @@ static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEv
 
     if ((events & AVAHI_WATCH_IN) && c->inbuf_length < sizeof(c->inbuf)) {
         ssize_t r;
-        
+
         if ((r = read(c->fd, c->inbuf + c->inbuf_length, sizeof(c->inbuf) - c->inbuf_length)) <= 0) {
             if (r < 0)
                 avahi_log_warn("read(): %s", strerror(errno));
@@ -415,7 +414,7 @@ static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEv
 
         assert((size_t) r <= c->outbuf_length);
         c->outbuf_length -= r;
-        
+
         if (c->outbuf_length)
             memmove(c->outbuf, c->outbuf + r, c->outbuf_length - r);
 
@@ -426,7 +425,7 @@ static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEv
     }
 
     c->server->poll_api->watch_update(
-        watch, 
+        watch,
         (c->outbuf_length > 0 ? AVAHI_WATCH_OUT : 0) |
         (c->inbuf_length < sizeof(c->inbuf) ? AVAHI_WATCH_IN : 0));
 }
@@ -445,59 +444,83 @@ static void server_work(AVAHI_GCC_UNUSED AvahiWatch *watch, int fd, AvahiWatchEv
             client_new(s, cfd);
     }
 }
-    
+
 int simple_protocol_setup(const AvahiPoll *poll_api) {
     struct sockaddr_un sa;
     mode_t u;
+    int n;
 
     assert(!server);
 
     server = avahi_new(Server, 1);
     server->poll_api = poll_api;
-    server->bind_successful = 0;
+    server->remove_socket = 0;
     server->fd = -1;
     server->n_clients = 0;
     AVAHI_LLIST_HEAD_INIT(Client, server->clients);
     server->watch = NULL;
-    
+
     u = umask(0000);
 
-    if ((server->fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) {
-        avahi_log_warn("socket(PF_LOCAL, SOCK_STREAM, 0): %s", strerror(errno));
+    if ((n = sd_listen_fds(1)) < 0) {
+        avahi_log_warn("Failed to acquire systemd file descriptors: %s", strerror(-n));
         goto fail;
     }
 
-    memset(&sa, 0, sizeof(sa));
-    sa.sun_family = AF_LOCAL;
-    strncpy(sa.sun_path, AVAHI_SOCKET, sizeof(sa.sun_path)-1);
-
-    /* We simply remove existing UNIX sockets under this name. The
-       Avahi daemon makes sure that it runs only once on a host,
-       therefore sockets that already exist are stale and may be
-       removed without any ill effects */
-
-    unlink(AVAHI_SOCKET);
-    
-    if (bind(server->fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
-        avahi_log_warn("bind(): %s", strerror(errno));
+    if (n > 1) {
+        avahi_log_warn("Too many systemd file descriptors passed.");
         goto fail;
     }
 
-    server->bind_successful = 1;
-    
-    if (listen(server->fd, 2) < 0) {
-        avahi_log_warn("listen(): %s", strerror(errno));
-        goto fail;
+    if (n == 1) {
+        int r;
+
+        if ((r = sd_is_socket(AF_LOCAL, SOCK_STREAM, 1, 0)) < 0) {
+            avahi_log_warn("Passed systemd file descriptor is of wrong type: %s", strerror(-r));
+            goto fail;
+        }
+
+        server->fd = SD_LISTEN_FDS_START;
+
+    } else {
+
+        if ((server->fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) {
+            avahi_log_warn("socket(AF_LOCAL, SOCK_STREAM, 0): %s", strerror(errno));
+            goto fail;
+        }
+
+        memset(&sa, 0, sizeof(sa));
+        sa.sun_family = AF_LOCAL;
+        strncpy(sa.sun_path, AVAHI_SOCKET, sizeof(sa.sun_path)-1);
+
+        /* We simply remove existing UNIX sockets under this name. The
+           Avahi daemon makes sure that it runs only once on a host,
+           therefore sockets that already exist are stale and may be
+           removed without any ill effects */
+
+        unlink(AVAHI_SOCKET);
+
+        if (bind(server->fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
+            avahi_log_warn("bind(): %s", strerror(errno));
+            goto fail;
+        }
+
+        server->remove_socket = 1;
+
+        if (listen(server->fd, SOMAXCONN) < 0) {
+            avahi_log_warn("listen(): %s", strerror(errno));
+            goto fail;
+        }
     }
 
     umask(u);
 
     server->watch = poll_api->watch_new(poll_api, server->fd, AVAHI_WATCH_IN, server_work, server);
-    
+
     return 0;
 
 fail:
-    
+
     umask(u);
     simple_protocol_shutdown();
 
@@ -508,7 +531,7 @@ void simple_protocol_shutdown(void) {
 
     if (server) {
 
-        if (server->bind_successful)
+        if (server->remove_socket)
 #ifdef ENABLE_CHROOT
             avahi_chroot_helper_unlink(AVAHI_SOCKET);
 #else
@@ -520,12 +543,12 @@ void simple_protocol_shutdown(void) {
 
         if (server->watch)
             server->poll_api->watch_free(server->watch);
-        
+
         if (server->fd >= 0)
             close(server->fd);
 
         avahi_free(server);
-        
+
         server = NULL;
     }
 }
@@ -534,7 +557,7 @@ void simple_protocol_restart_queries(void) {
     Client *c;
 
     /* Restart queries in case of local domain name changes */
-    
+
     assert(server);
 
     for (c = server->clients; c; c = c->clients_next)
@@ -543,5 +566,3 @@ void simple_protocol_restart_queries(void) {
             c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery, AVAHI_LOOKUP_USE_MULTICAST, dns_server_browser_callback, c);
         }
 }
-
-
index 1e640361b6744ae9f0214fe4b8e1b7c4f708fc7a..bcbffc33f131ce736615eba359fae2e4778ba266 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foosimpleprotocolhfoo
 #define foosimpleprotocolhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index a493444e169dfceeeabc3b37bee1f8834f1ac037..c66e0c1e69f94ce33b03d142e422fda6b151a019 100644 (file)
@@ -1,8 +1,6 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 
-<!-- $Id$ -->
-
 <!--
   This file is part of avahi.
  
index c0a59521fbf40c17124bb3902b423158d9bbacd0..34f531f4998c25610de7c6954f679741dd42003a 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -75,7 +73,7 @@ static void entry_group_callback(AvahiServer *s, AVAHI_GCC_UNUSED AvahiSEntryGro
         case AVAHI_ENTRY_GROUP_FAILURE:
             avahi_log_notice ("Failed to establish static host name \"%s\": %s.", h->host, avahi_strerror (avahi_server_errno (s)));
             break;
-        
+
         case AVAHI_ENTRY_GROUP_UNCOMMITED:
         case AVAHI_ENTRY_GROUP_REGISTERING:
             ;
@@ -84,7 +82,7 @@ static void entry_group_callback(AvahiServer *s, AVAHI_GCC_UNUSED AvahiSEntryGro
 
 static StaticHost *static_host_new(void) {
     StaticHost *s;
-    
+
     s = avahi_new(StaticHost, 1);
 
     s->group = NULL;
@@ -105,7 +103,7 @@ static void static_host_free(StaticHost *s) {
         avahi_s_entry_group_free (s->group);
 
     avahi_free(s->host);
-    
+
     avahi_free(s);
 }
 
@@ -114,7 +112,7 @@ static StaticHost *static_host_find(const char *host, const AvahiAddress *a) {
 
     assert(host);
     assert(a);
-    
+
     for (h = hosts; h; h = h->hosts_next)
         if (!strcmp(h->host, host) && !avahi_address_cmp(a, &h->address))
             return h;
@@ -136,10 +134,10 @@ static void add_static_host_to_server(StaticHost *h)
         int err;
         const AvahiServerConfig *config;
         config = avahi_server_get_config(avahi_server);
-        
+
         p = (h->address.proto == AVAHI_PROTO_INET && config->publish_a_on_ipv6) ||
             (h->address.proto == AVAHI_PROTO_INET6 && config->publish_aaaa_on_ipv4) ? AVAHI_PROTO_UNSPEC : h->address.proto;
-        
+
         if ((err = avahi_server_add_address(avahi_server, h->group, AVAHI_IF_UNSPEC, p, 0, h->host, &h->address)) < 0) {
             avahi_log_error ("Static host name %s: avahi_server_add_address failure: %s", h->host, avahi_strerror(err));
             return;
@@ -154,7 +152,7 @@ static void remove_static_host_from_server(StaticHost *h)
     if (h->group)
         avahi_s_entry_group_reset (h->group);
 }
+
 void static_hosts_add_to_server(void) {
     StaticHost *h;
 
@@ -182,7 +180,7 @@ void static_hosts_load(int in_chroot) {
     }
 
     current_iteration++;
-    
+
     while (!feof(f)) {
         unsigned int len;
         char ln[256], *s;
@@ -228,7 +226,7 @@ void static_hosts_load(int in_chroot) {
 
         /* Skip past any more spaces */
         s += strspn(s, " \t");
-        
+
         /* Anything left? */
         if (*s != 0) {
             avahi_log_error ("%s:%d: Junk on the end of the line!", filename, line);
@@ -261,7 +259,7 @@ void static_hosts_load(int in_chroot) {
 
     for (h = hosts; h; h = next) {
         next = h->hosts_next;
-        
+
         if (h->iteration != current_iteration) {
             avahi_log_info("Static hostname %s vanished, removing.", h->host);
             static_host_free(h);
@@ -269,7 +267,7 @@ void static_hosts_load(int in_chroot) {
     }
 
 fail:
-    
+
     fclose(f);
 }
 
index 2fdb0bd68716f9ece9802dbabce7fad79fefb64d..5d6399549749112178d4a6664575cbe3eb8b9ed7 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foostatichostshfoo
 #define foostatichostshfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 0c160f2d564f7efbdcd33e972e0336a6d3d383b0..588ff8ad602c59f9d4f491aaef79fcb53756079a 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index a2bc355abf1f7254d7b1ad644e405003d6b36a65..62edc36b254dc2efa726aeea49de88091be2866c 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foostaticserviceshfoo
 #define foostaticserviceshfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 542aeae6f87ffc95ea238c7b92be197d4d580789..3995c0a6da08440a17be3160fda1646c5476e78e 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
 AM_CFLAGS=-I$(top_srcdir)
 
 interfaces = \
-        avahi-discover.glade
+        avahi-discover.ui
 
 # This cool debug trap works on i386/gcc only
 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
 
-if HAVE_GTK
-if  HAVE_GLIB
+if HAVE_GTK2OR3
+if HAVE_GLIB
 bin_PROGRAMS = \
        avahi-discover-standalone
 
@@ -35,20 +33,30 @@ avahi_discover_standalone_SOURCES = \
 
 avahi_discover_standalone_CFLAGS = \
        $(AM_CFLAGS) \
-       $(GLIB20_CFLAGS) $(GTK20_CFLAGS) $(GLADE20_CFLAGS)\
        -DAVAHI_INTERFACES_DIR=\"$(interfacesdir)\"
 
 avahi_discover_standalone_LDADD = \
        $(AM_LDADD) \
        ../avahi-common/libavahi-common.la \
        ../avahi-glib/libavahi-glib.la \
-       ../avahi-core/libavahi-core.la  \
-       $(GLIB20_LIBS) $(GTK20_LIBS) $(GLADE20_LIBS)
+       ../avahi-core/libavahi-core.la
+
+if HAVE_GTK3
+avahi_discover_standalone_CFLAGS += \
+       $(GLIB30_CFLAGS) $(GTK30_CFLAGS)
+avahi_discover_standalone_LDADD += \
+       $(GLIB30_LIBS) $(GTK30_LIBS)
+else
+avahi_discover_standalone_CFLAGS += \
+       $(GLIB20_CFLAGS) $(GTK20_CFLAGS)
+avahi_discover_standalone_LDADD += \
+       $(GLIB20_LIBS) $(GTK20_LIBS)
+endif
 
 interfaces_DATA = $(interfaces)
 
 endif  # HAVE_GLIB
-else 
+else
 
 if HAVE_PYTHON_DBUS
 
@@ -58,5 +66,4 @@ endif
 endif
 
 EXTRA_DIST = \
-       $(interfaces) \
-       avahi-discover.gladep
+       $(interfaces)
diff --git a/avahi-discover-standalone/avahi-discover.glade b/avahi-discover-standalone/avahi-discover.glade
deleted file mode 100644 (file)
index bb456c2..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="main_window">
-  <property name="visible">True</property>
-  <property name="title" translatable="yes">Avahi Discovery</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="default_width">500</property>
-  <property name="default_height">400</property>
-  <property name="resizable">True</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <property name="focus_on_map">True</property>
-  <signal handler="gtk_main_quit" name="destroy" after="False"/>
-
-  <child>
-    <widget class="GtkVBox" id="vbox1">
-      <property name="border_width">12</property>
-      <property name="visible">True</property>
-      <property name="homogeneous">False</property>
-      <property name="spacing">12</property>
-
-      <child>
-       <widget class="GtkScrolledWindow" id="scrolledwindow1">
-         <property name="visible">True</property>
-         <property name="can_focus">True</property>
-         <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-         <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-         <property name="shadow_type">GTK_SHADOW_IN</property>
-         <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-         <child>
-           <widget class="GtkTreeView" id="tree_view">
-             <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="headers_visible">True</property>
-             <property name="rules_hint">False</property>
-             <property name="reorderable">False</property>
-             <property name="enable_search">True</property>
-             <property name="fixed_height_mode">False</property>
-             <property name="hover_selection">False</property>
-             <property name="hover_expand">False</property>
-             <signal name="cursor_changed" handler="on_tree_view_cursor_changed" last_modification_time="Sat, 30 Jul 2005 21:39:13 GMT"/>
-           </widget>
-         </child>
-       </widget>
-       <packing>
-         <property name="padding">0</property>
-         <property name="expand">True</property>
-         <property name="fill">True</property>
-       </packing>
-      </child>
-
-      <child>
-       <widget class="GtkLabel" id="info_label">
-         <property name="visible">True</property>
-         <property name="can_focus">True</property>
-         <property name="label" translatable="yes">&lt;i&gt;No service currently selected.&lt;/i&gt;</property>
-         <property name="use_underline">False</property>
-         <property name="use_markup">True</property>
-         <property name="justify">GTK_JUSTIFY_LEFT</property>
-         <property name="wrap">False</property>
-         <property name="selectable">True</property>
-         <property name="xalign">0</property>
-         <property name="yalign">0.5</property>
-         <property name="xpad">0</property>
-         <property name="ypad">0</property>
-         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-         <property name="width_chars">-1</property>
-         <property name="single_line_mode">False</property>
-         <property name="angle">0</property>
-       </widget>
-       <packing>
-         <property name="padding">0</property>
-         <property name="expand">False</property>
-         <property name="fill">False</property>
-       </packing>
-      </child>
-    </widget>
-  </child>
-</widget>
-
-</glade-interface>
diff --git a/avahi-discover-standalone/avahi-discover.gladep b/avahi-discover-standalone/avahi-discover.gladep
deleted file mode 100644 (file)
index a9feaa6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
-
-<glade-project>
-  <name>Avahi-discover</name>
-  <program_name>avahi-discover</program_name>
-  <gnome_support>FALSE</gnome_support>
-</glade-project>
diff --git a/avahi-discover-standalone/avahi-discover.ui b/avahi-discover-standalone/avahi-discover.ui
new file mode 100644 (file)
index 0000000..b4b72f9
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+  <object class="GtkWindow" id="main_window">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">Avahi Discovery</property>
+    <property name="type">GTK_WINDOW_TOPLEVEL</property>
+    <property name="window_position">GTK_WIN_POS_NONE</property>
+    <property name="modal">False</property>
+    <property name="default_width">500</property>
+    <property name="default_height">400</property>
+    <property name="resizable">True</property>
+    <property name="destroy_with_parent">False</property>
+    <property name="decorated">True</property>
+    <property name="skip_taskbar_hint">False</property>
+    <property name="skip_pager_hint">False</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+    <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+    <property name="focus_on_map">True</property>
+    <signal after="False" handler="gtk_main_quit" name="destroy"/>
+    <child>
+      <object class="GtkVBox" id="vbox1">
+        <property name="border_width">12</property>
+        <property name="visible">True</property>
+        <property name="homogeneous">False</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+            <property name="shadow_type">GTK_SHADOW_IN</property>
+            <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+            <child>
+              <object class="GtkTreeView" id="tree_view">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="headers_visible">True</property>
+                <property name="rules_hint">False</property>
+                <property name="reorderable">False</property>
+                <property name="enable_search">True</property>
+                <property name="fixed_height_mode">False</property>
+                <property name="hover_selection">False</property>
+                <property name="hover_expand">False</property>
+                <signal handler="on_tree_view_cursor_changed" last_modification_time="Sat, 30 Jul 2005 21:39:13 GMT" name="cursor_changed"/>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="padding">0</property>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="info_label">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="label" translatable="yes">&lt;i&gt;No service currently selected.&lt;/i&gt;</property>
+            <property name="use_underline">False</property>
+            <property name="use_markup">True</property>
+            <property name="justify">GTK_JUSTIFY_LEFT</property>
+            <property name="wrap">False</property>
+            <property name="selectable">True</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0.5</property>
+            <property name="xpad">0</property>
+            <property name="ypad">0</property>
+            <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+            <property name="width_chars">-1</property>
+            <property name="single_line_mode">False</property>
+            <property name="angle">0</property>
+          </object>
+          <packing>
+            <property name="padding">0</property>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
index 90c74f310fab874e187e43a24091dffb229dcfe8..2f000a45348526d7cfb12646fa1e2adfd5ab784f 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -31,7 +29,6 @@
 #include <unistd.h>
 
 #include <gtk/gtk.h>
-#include <glade/glade.h>
 
 #include <avahi-core/core.h>
 #include <avahi-core/lookup.h>
@@ -83,7 +80,7 @@ static struct Service *get_service(const gchar *service_type, const gchar *servi
 
     for (l = st->services; l; l = l->next) {
         struct Service *s = l->data;
-        
+
         if (s->interface == interface &&
             s->protocol == protocol &&
             avahi_domain_equal(s->service_name, service_name) &&
@@ -105,17 +102,17 @@ static void free_service(struct Service *s) {
             avahi_s_service_resolver_free(service_resolver);
             service_resolver = NULL;
         }
+
         gtk_label_set_text(info_label, "<i>Service removed</i>");
     }
-    
+
     s->service_type->services = g_list_remove(s->service_type->services, s);
 
     if ((path = gtk_tree_row_reference_get_path(s->tree_ref))) {
         gtk_tree_model_get_iter(GTK_TREE_MODEL(tree_store), &iter, path);
         gtk_tree_path_free(path);
     }
-    
+
     gtk_tree_store_remove(tree_store, &iter);
 
     gtk_tree_row_reference_free(s->tree_ref);
@@ -142,7 +139,7 @@ static void service_browser_callback(
         GtkTreePath *path, *ppath;
         gchar iface[256];
        char name[IF_NAMESIZE];
-        
+
         s = g_new(struct Service, 1);
         s->service_name = g_strdup(service_name);
         s->domain_name = g_strdup(domain_name);
@@ -150,7 +147,7 @@ static void service_browser_callback(
         s->protocol = protocol;
         s->service_type = g_hash_table_lookup(service_type_hash_table, service_type);
         g_assert(s->service_type);
-        
+
         s->service_type->services = g_list_prepend(s->service_type->services, s);
 
         ppath = gtk_tree_row_reference_get_path(s->service_type->tree_ref);
@@ -168,7 +165,7 @@ static void service_browser_callback(
         gtk_tree_view_expand_row(tree_view, ppath, FALSE);
         gtk_tree_path_free(ppath);
 
-    
+
     } else if (event == AVAHI_BROWSER_REMOVE) {
         struct Service* s;
 
@@ -186,7 +183,7 @@ static void service_type_browser_callback(
     const char *domain,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     AVAHI_GCC_UNUSED void * userdata) {
-    
+
     struct ServiceType *st;
     GtkTreePath *path;
     GtkTreeIter iter;
@@ -200,7 +197,7 @@ static void service_type_browser_callback(
     st = g_new(struct ServiceType, 1);
     st->service_type = g_strdup(service_type);
     st->services = NULL;
-    
+
     gtk_tree_store_append(tree_store, &iter, NULL);
     gtk_tree_store_set(tree_store, &iter, 0, st->service_type, 1, "", 2, NULL, -1);
 
@@ -230,7 +227,7 @@ static void update_label(struct Service *s, const gchar *hostname, const AvahiAd
         snprintf(address, sizeof(address), "<i>n/a</i>");
         txt_s = g_strdup("<i>n/a</i>");
     }
-    
+
     snprintf(t, sizeof(t),
              "<b>Service Type:</b> %s\n"
              "<b>Service Name:</b> %s\n"
@@ -254,12 +251,12 @@ static struct Service *get_service_on_cursor(void) {
     GtkTreePath *path;
     struct Service *s;
     GtkTreeIter iter;
-    
+
     gtk_tree_view_get_cursor(tree_view, &path, NULL);
 
     if (!path)
         return NULL;
-    
+
     gtk_tree_model_get_iter(GTK_TREE_MODEL(tree_store), &iter, path);
     gtk_tree_model_get(GTK_TREE_MODEL(tree_store), &iter, 2, &s, -1);
     gtk_tree_path_free(path);
@@ -279,9 +276,9 @@ static void service_resolver_callback(
     const AvahiAddress *a,
     uint16_t port,
     AvahiStringList *txt,
-    AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, 
+    AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     struct Service *s;
     g_assert(r);
 
@@ -302,7 +299,7 @@ static void service_resolver_callback(
 
 static void tree_view_on_cursor_changed(AVAHI_GCC_UNUSED GtkTreeView *tv, AVAHI_GCC_UNUSED gpointer userdata) {
     struct Service *s;
-    
+
     if (!(s = get_service_on_cursor()))
         return;
 
@@ -320,27 +317,27 @@ static gboolean main_window_on_delete_event(AVAHI_GCC_UNUSED GtkWidget *widget,
 }
 
 int main(int argc, char *argv[]) {
-    GladeXML *xml;
+    GtkBuilder *ui;
     AvahiServerConfig config;
     GtkTreeViewColumn *c;
     gint error;
     AvahiGLibPoll *poll_api;
 
     gtk_init(&argc, &argv);
-    glade_init();
 
     avahi_set_allocator(avahi_glib_allocator());
 
     poll_api = avahi_glib_poll_new(NULL, G_PRIORITY_DEFAULT);
 
-    xml = glade_xml_new(AVAHI_INTERFACES_DIR"avahi-discover.glade", NULL, NULL);
-    main_window = glade_xml_get_widget(xml, "main_window");
+    ui = gtk_builder_new();
+    gtk_builder_add_from_file(ui, AVAHI_INTERFACES_DIR"avahi-discover.ui", NULL);
+    main_window = GTK_WIDGET(gtk_builder_get_object(ui, "main_window"));
     g_signal_connect(main_window, "delete-event", (GCallback) main_window_on_delete_event, NULL);
-    
-    tree_view = GTK_TREE_VIEW(glade_xml_get_widget(xml, "tree_view"));
+
+    tree_view = GTK_TREE_VIEW(gtk_builder_get_object(ui, "tree_view"));
     g_signal_connect(GTK_WIDGET(tree_view), "cursor-changed", (GCallback) tree_view_on_cursor_changed, NULL);
 
-    info_label = GTK_LABEL(glade_xml_get_widget(xml, "info_label"));
+    info_label = GTK_LABEL(gtk_builder_get_object(ui, "info_label"));
 
     tree_store = gtk_tree_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
     gtk_tree_view_set_model(tree_view, GTK_TREE_MODEL(tree_store));
@@ -350,9 +347,9 @@ int main(int argc, char *argv[]) {
     gtk_tree_view_column_set_resizable(c = gtk_tree_view_get_column(tree_view, 0), TRUE);
     gtk_tree_view_column_set_sizing(c, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
     gtk_tree_view_column_set_expand(c, TRUE);
-    
+
     service_type_hash_table = g_hash_table_new((GHashFunc) avahi_domain_hash, (GEqualFunc) avahi_domain_equal);
-    
+
     avahi_server_config_init(&config);
     config.publish_hinfo = config.publish_addresses = config.publish_domain = config.publish_workstation = FALSE;
     server = avahi_server_new(avahi_glib_poll_get(poll_api), &config, NULL, NULL, &error);
index 581c3ce5e04c570a5689ebee9584df0a79b09379..2c6d07f2bd576aaf081fcfdd828bebcaf68583d6 100644 (file)
@@ -1 +1,2 @@
+avahi-dnsconfd.service
 avahi-dnsconfd
index d35873480362fa9dd60edb83b71d3b079b0d3b6f..4e7442996c9edbbbe7d3d704d309bf34d9cb75df 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -17,6 +15,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
+EXTRA_DIST=avahi-dnsconfd.action avahi-dnsconfd.service.in
+
 if HAVE_XML
 if HAVE_LIBDAEMON
 
@@ -33,13 +33,21 @@ AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
 
 sbin_PROGRAMS = avahi-dnsconfd
 
-avahi_dnsconfd_SOURCES = main.c 
+avahi_dnsconfd_SOURCES = main.c
 avahi_dnsconfd_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS)
 avahi_dnsconfd_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(LIBDAEMON_LIBS)
 
 pkgsysconf_SCRIPTS=avahi-dnsconfd.action
 
+%.service: %.service.in
+       $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+       avahi-dnsconfd.service
 endif
-endif
 
-EXTRA_DIST=avahi-dnsconfd.action
+CLEANFILES = $(systemdsystemunit_DATA)
+
+endif
+endif
index f7d3aa42c1ae1e22067075785306ae565bf1f4ca..f0ace51a9e7abc5a7cf7aa4cfbed0abc0bbfd556 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/sh
 
-# $Id$
-#
 # This file is part of avahi.
 # 
 # avahi is free software; you can redistribute it and/or modify it
diff --git a/avahi-dnsconfd/avahi-dnsconfd.service.in b/avahi-dnsconfd/avahi-dnsconfd.service.in
new file mode 100644 (file)
index 0000000..2db23d1
--- /dev/null
@@ -0,0 +1,30 @@
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+[Unit]
+Requires=basic.target avahi-daemon.socket avahi-daemon.service
+After=basic.target syslog.target avahi-daemon.socket
+Conflicts=shutdown.target
+
+[Service]
+Type=simple
+ExecStart=@sbindir@/avahi-dnsconfd -s
+ExecReload=@sbindir@/avahi-dnsconfd -r
+
+[Install]
+WantedBy=multi-user.target
+Also=avahi-daemon.socket
index d10374b83a858eec0aae36d8d2e986ab3b86f2ac..719fbebc46ed725ad1552a65454fb3e69d5656e5 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -72,6 +70,7 @@ static enum {
 
 static int quit = 0;
 static int daemonize = 0;
+static int use_syslog = 0;
 
 #if !HAVE_DECL_ENVIRON
 extern char **environ;
@@ -92,7 +91,7 @@ static void server_info_free(DNSServerInfo *i) {
     assert(i);
 
     avahi_free(i->address);
-    
+
     AVAHI_LLIST_REMOVE(DNSServerInfo, servers, servers, i);
     avahi_free(i);
 }
@@ -112,7 +111,7 @@ static DNSServerInfo* get_server_info(AvahiIfIndex interface, AvahiProtocol prot
 
 static DNSServerInfo* new_server_info(AvahiIfIndex interface, AvahiProtocol protocol, const char *address) {
     DNSServerInfo *i;
-    
+
     assert(address);
 
     i = avahi_new(DNSServerInfo, 1);
@@ -121,7 +120,7 @@ static DNSServerInfo* new_server_info(AvahiIfIndex interface, AvahiProtocol prot
     i->address = avahi_strdup(address);
 
     AVAHI_LLIST_PREPEND(DNSServerInfo, servers, servers, i);
-    
+
     return i;
 }
 
@@ -129,7 +128,7 @@ static int set_cloexec(int fd) {
     int n;
 
     assert(fd >= 0);
-    
+
     if ((n = fcntl(fd, F_GETFD)) < 0)
         return -1;
 
@@ -152,7 +151,7 @@ static int open_socket(void) {
         daemon_log(LOG_ERR, "fcntl(): %s", strerror(errno));
         goto fail;
     }
-    
+
     memset(&sa, 0, sizeof(sa));
     sa.sun_family = AF_UNIX;
     strncpy(sa.sun_path, AVAHI_SOCKET, sizeof(sa.sun_path)-1);
@@ -160,13 +159,13 @@ static int open_socket(void) {
 
     if (connect(fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
         daemon_log(LOG_ERR, "connect(): %s", strerror(errno));
-       daemon_log(LOG_INFO, "Failed to connect to the daemon. This probably means that you");
-       daemon_log(LOG_INFO, "didn't start avahi-daemon before avahi-dnsconfd.");
+        daemon_log(LOG_INFO, "Failed to connect to the daemon. This probably means that you");
+        daemon_log(LOG_INFO, "didn't start avahi-daemon before avahi-dnsconfd.");
         goto fail;
     }
 
     return fd;
-    
+
 fail:
     if (fd >= 0)
         close(fd);
@@ -199,7 +198,7 @@ static ssize_t loop_write(int fd, const void*data, size_t size) {
 static char *concat_dns_servers(AvahiIfIndex interface) {
     DNSServerInfo *i;
     char *r = NULL;
-    
+
     for (i = servers; i; i = i->servers_next)
         if (i->interface == interface || interface <= 0) {
             DNSServerInfo *j;
@@ -213,7 +212,7 @@ static char *concat_dns_servers(AvahiIfIndex interface) {
 
             if (j != i)
                 continue;
-            
+
             if (!r)
                 t = avahi_strdup(i->address);
             else
@@ -229,7 +228,7 @@ static char *concat_dns_servers(AvahiIfIndex interface) {
 static void set_env(const char *name, const char *value) {
     char **e;
     size_t l;
-    
+
     assert(name);
     assert(value);
 
@@ -239,7 +238,7 @@ static void set_env(const char *name, const char *value) {
         /* Search for the variable */
         if (strlen(*e) < l+1)
             continue;
-        
+
         if (strncmp(*e, name, l) != 0 || (*e)[l] != '=')
             continue;
 
@@ -260,19 +259,19 @@ static void run_script(int new, AvahiIfIndex interface, AvahiProtocol protocol,
 
     assert(interface > 0);
 
-    if (!if_indextoname(interface, name)) 
+    if (!if_indextoname(interface, name))
         return;
-    
+
     p = concat_dns_servers(interface);
     set_env(ENV_INTERFACE_DNS_SERVERS, p ? p : "");
-    avahi_free(p); 
+    avahi_free(p);
 
     p = concat_dns_servers(-1);
     set_env(ENV_DNS_SERVERS, p ? p : "");
-    avahi_free(p); 
+    avahi_free(p);
 
     set_env(ENV_INTERFACE, name);
-    
+
     snprintf(ia, sizeof(ia), "%i", (int) interface);
     snprintf(pa, sizeof(pa), "%i", (int) protocol);
 
@@ -298,8 +297,8 @@ static int new_line(const char *l) {
         AvahiProtocol protocol;
         int i_interface, i_protocol, port;
         char a[AVAHI_ADDRESS_STR_MAX];
-        
-        assert(state == BROWSING); 
+
+        assert(state == BROWSING);
 
         if (*l != '<' && *l != '>') {
             daemon_log(LOG_ERR, "Avahi sent us an invalid browsing line: %s", l);
@@ -325,7 +324,7 @@ static int new_line(const char *l) {
         } else {
             DNSServerInfo *i;
 
-            if (port == 53) 
+            if (port == 53)
                 if ((i = get_server_info(interface, protocol, a))) {
                     daemon_log(LOG_INFO, "DNS Server %s removed (interface: %i.%s)", a, interface, avahi_proto_to_string(protocol));
                     server_info_free(i);
@@ -334,13 +333,13 @@ static int new_line(const char *l) {
         }
 
     }
-    
+
     return 0;
 }
 
 static int do_connect(void) {
     int fd = -1;
-    
+
     if ((fd = open_socket()) < 0)
         goto fail;
 
@@ -355,7 +354,7 @@ static int do_connect(void) {
 fail:
     if (fd >= 0)
         close(fd);
-    
+
     return -1;
 }
 
@@ -365,7 +364,7 @@ static void free_dns_server_info_list(void) {
         AvahiProtocol protocol = servers->protocol;
         char *address = avahi_strdup(servers->address);
         server_info_free(servers);
-        
+
         run_script(0, interface, protocol, address);
         avahi_free(address);
     }
@@ -376,6 +375,7 @@ static void help(FILE *f, const char *argv0) {
             "%s [options]\n"
             "    -h --help        Show this help\n"
             "    -D --daemonize   Daemonize after startup\n"
+            "    -s --syslog      Write log messages to syslog(3) instead of STDERR\n"
             "    -k --kill        Kill a running daemon\n"
             "    -r --refresh     Request a running daemon to refresh DNS server data\n"
             "    -c --check       Return 0 if a daemon is already running\n"
@@ -385,10 +385,11 @@ static void help(FILE *f, const char *argv0) {
 
 static int parse_command_line(int argc, char *argv[]) {
     int c;
-    
+
     static const struct option long_options[] = {
         { "help",      no_argument,       NULL, 'h' },
         { "daemonize", no_argument,       NULL, 'D' },
+        { "syslog",    no_argument,       NULL, 's' },
         { "kill",      no_argument,       NULL, 'k' },
         { "version",   no_argument,       NULL, 'V' },
         { "refresh",   no_argument,       NULL, 'r' },
@@ -396,7 +397,7 @@ static int parse_command_line(int argc, char *argv[]) {
         { NULL, 0, NULL, 0 }
     };
 
-    while ((c = getopt_long(argc, argv, "hDkVrc", long_options, NULL)) >= 0) {
+    while ((c = getopt_long(argc, argv, "hDkVrcs", long_options, NULL)) >= 0) {
 
         switch(c) {
             case 'h':
@@ -405,6 +406,9 @@ static int parse_command_line(int argc, char *argv[]) {
             case 'D':
                 daemonize = 1;
                 break;
+            case 's':
+                use_syslog = 1;
+                break;
             case 'k':
                 command = DAEMON_KILL;
                 break;
@@ -426,7 +430,7 @@ static int parse_command_line(int argc, char *argv[]) {
         fprintf(stderr, "Too many arguments\n");
         return -1;
     }
-        
+
     return 0;
 }
 
@@ -436,14 +440,14 @@ static int run_daemon(void) {
     size_t buflen = 0;
 
     AVAHI_LLIST_HEAD_INIT(DNSServerInfo, servers);
-    
+
     daemon_signal_init(SIGINT, SIGTERM, SIGCHLD, SIGHUP, 0);
 
     /* Allocate some memory for our environment variables */
     putenv(avahi_strdup(ENV_INTERFACE"="));
     putenv(avahi_strdup(ENV_DNS_SERVERS"="));
     putenv(avahi_strdup(ENV_INTERFACE_DNS_SERVERS"="));
-    
+
     if ((fd = do_connect()) < 0)
         goto finish;
 
@@ -492,19 +496,19 @@ static int run_daemon(void) {
                 case SIGCHLD:
                     waitpid(-1, NULL, WNOHANG);
                     break;
-                    
+
                 case SIGHUP:
                     daemon_log(LOG_INFO, "Refreshing DNS Server list");
-                    
+
                     close(fd);
                     free_dns_server_info_list();
-                    
+
                     if ((fd = do_connect()) < 0)
                         goto finish;
-                    
+
                     break;
             }
-            
+
         } else if (FD_ISSET(fd, &rfds)) {
             ssize_t r;
             char *n;
@@ -530,27 +534,27 @@ static int run_daemon(void) {
             if (buflen >= sizeof(buf)-1) {
                 /* The incoming line is horribly long */
                 buf[sizeof(buf)-1] = 0;
-                
+
                 if (new_line(buf) < 0)
                     goto finish;
-                
+
                 buflen = 0;
             }
         }
     }
-    
+
 finish:
 
     free_dns_server_info_list();
 
     if (fd >= 0)
         close(fd);
-    
+
     daemon_signal_done();
 
     if (ret != 0 && daemonize)
         daemon_retval_send(1);
-    
+
     return ret;
 }
 
@@ -570,7 +574,7 @@ int main(int argc, char *argv[]) {
 
     daemon_pid_file_ident = daemon_log_ident = argv0;
     daemon_pid_file_proc = pid_file_proc;
-    
+
     if (parse_command_line(argc, argv) < 0)
         goto finish;
 
@@ -589,7 +593,7 @@ int main(int argc, char *argv[]) {
 
         if (daemonize) {
             daemon_retval_init();
-            
+
             if ((pid = daemon_fork()) < 0)
                 goto finish;
             else if (pid != 0) {
@@ -608,6 +612,9 @@ int main(int argc, char *argv[]) {
             /* Child */
         }
 
+        if (use_syslog || daemonize)
+            daemon_log_use = DAEMON_LOG_SYSLOG;
+
         chdir("/");
 
         if (daemon_pid_file_create() < 0) {
@@ -625,18 +632,18 @@ int main(int argc, char *argv[]) {
         r = 0;
     } else if (command == DAEMON_HELP) {
         help(stdout, argv0);
-        
+
         r = 0;
     } else if (command == DAEMON_VERSION) {
         printf("%s "PACKAGE_VERSION"\n", argv0);
-        
+
         r = 0;
     } else if (command == DAEMON_KILL) {
         if (daemon_pid_file_kill_wait(SIGTERM, 5) < 0) {
             daemon_log(LOG_WARNING, "Failed to kill daemon: %s", strerror(errno));
             goto finish;
         }
-        
+
         r = 0;
     } else if (command == DAEMON_REFRESH) {
         if (daemon_pid_file_kill(SIGHUP) < 0) {
@@ -653,7 +660,7 @@ finish:
 
     if (daemonize)
         daemon_retval_done();
-    
+
     if (wrote_pid_file)
         daemon_pid_file_remove();
 
index 12aa6f94cb36aa7fb0eeaade0a577ce2260ca291..b5d5fba1c6d266b2a6209fc9fe95831a033e827e 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-#
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 2968abcb72f34bfa605247032e6b60ca206ec13c..20ac1d17f368b221ea7c086ee9c866d20ae46760 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 675ccb579ad0645aa8c007e0d59d3617dd31c8b8..8b189d274845699d277f959dcfa7b36c870770d9 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooglibmallochfoo
 #define fooglibmallochfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 733c81f88c107fa24533ef92bdcd82fb23866535..53c668329859449f148eecade32ba88be6e5b453 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -43,7 +41,7 @@ static void callback(AvahiWatch *w, int fd, AvahiWatchEvent event, AVAHI_GCC_UNU
     if (event & AVAHI_WATCH_IN) {
         ssize_t r;
         char c;
-        
+
         if ((r = read(fd, &c, 1)) <= 0) {
             fprintf(stderr, "read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
             api->watch_free(w);
@@ -70,7 +68,7 @@ static void wakeup(AvahiTimeout *t, AVAHI_GCC_UNUSED void *userdata) {
 int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     AvahiGLibPoll *g;
     struct timeval tv;
-    
+
     g = avahi_glib_poll_new(NULL, G_PRIORITY_DEFAULT);
     assert(g);
 
@@ -86,6 +84,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
     g_main_loop_unref(loop);
 
     avahi_glib_poll_free(g);
-    
+
     return 0;
 }
index f0fd934f73b5bb0390779628e9502e4a506c0c43..5b60bbc4cfcbe6c5922547bec031f97364bcc09c 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 struct AvahiWatch {
     AvahiGLibPoll *glib_poll;
     int dead;
-    
+
     GPollFD pollfd;
     int pollfd_added;
-    
+
     AvahiWatchCallback callback;
     void *userdata;
 
@@ -51,7 +49,7 @@ struct AvahiTimeout {
 
     AvahiTimeoutCallback callback;
     void  *userdata;
-    
+
     AVAHI_LLIST_FIELDS(AvahiTimeout, timeouts);
 };
 
@@ -62,7 +60,7 @@ struct AvahiGLibPoll {
 
     gboolean timeout_req_cleanup;
     gboolean watch_req_cleanup;
-    
+
     AVAHI_LLIST_HEAD(AvahiWatch, watches);
     AVAHI_LLIST_HEAD(AvahiTimeout, timeouts);
 };
@@ -111,7 +109,7 @@ static AvahiWatchEvent map_events_from_glib(gushort events) {
 static AvahiWatch* watch_new(const AvahiPoll *api, int fd, AvahiWatchEvent events, AvahiWatchCallback callback, void *userdata) {
     AvahiWatch *w;
     AvahiGLibPoll *g;
-    
+
     assert(api);
     assert(fd >= 0);
     assert(callback);
@@ -121,7 +119,7 @@ static AvahiWatch* watch_new(const AvahiPoll *api, int fd, AvahiWatchEvent event
 
     if (!(w = avahi_new(AvahiWatch, 1)))
         return NULL;
-    
+
     w->glib_poll = g;
     w->pollfd.fd = fd;
     w->pollfd.events = map_events_to_glib(events);
@@ -160,7 +158,7 @@ static void watch_free(AvahiWatch *w) {
         g_source_remove_poll(&w->glib_poll->source, &w->pollfd);
         w->pollfd_added = FALSE;
     }
-    
+
     w->dead = TRUE;
     w->glib_poll->timeout_req_cleanup = TRUE;
 }
@@ -168,7 +166,7 @@ static void watch_free(AvahiWatch *w) {
 static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata) {
     AvahiTimeout *t;
     AvahiGLibPoll *g;
-    
+
     assert(api);
     assert(callback);
 
@@ -177,13 +175,13 @@ static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv,
 
     if (!(t = avahi_new(AvahiTimeout, 1)))
         return NULL;
-    
+
     t->glib_poll = g;
     t->dead = FALSE;
 
     if ((t->enabled = !!tv))
         t->expiry = *tv;
-        
+
     t->callback = callback;
     t->userdata = userdata;
 
@@ -195,7 +193,7 @@ static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv,
 static void timeout_update(AvahiTimeout *t, const struct timeval *tv) {
     assert(t);
     assert(!t->dead);
-    
+
     if ((t->enabled = !!tv))
         t->expiry = *tv;
 }
@@ -234,10 +232,10 @@ static AvahiTimeout* find_next_timeout(AvahiGLibPoll *g) {
     assert(g);
 
     for (t = g->timeouts; t; t = t->timeouts_next) {
-        
+
         if (t->dead || !t->enabled)
             continue;
-        
+
         if (!n || avahi_timeval_compare(&t->expiry, &n->expiry) < 0)
             n = t;
     }
@@ -266,7 +264,7 @@ static gboolean prepare_func(GSource *source, gint *timeout) {
 
     if (g->timeout_req_cleanup)
         cleanup_timeouts(g, 0);
-    
+
     if ((next_timeout = find_next_timeout(g))) {
         GTimeVal now;
         struct timeval tvnow;
@@ -275,7 +273,7 @@ static gboolean prepare_func(GSource *source, gint *timeout) {
         g_source_get_current_time(source, &now);
         tvnow.tv_sec = now.tv_sec;
         tvnow.tv_usec = now.tv_usec;
-    
+
         usec = avahi_timeval_diff(&next_timeout->expiry, &tvnow);
 
         if (usec <= 0) {
@@ -286,7 +284,7 @@ static gboolean prepare_func(GSource *source, gint *timeout) {
         *timeout = (gint) (usec / 1000);
     } else
         *timeout = -1;
-        
+
     return FALSE;
 }
 
@@ -303,7 +301,7 @@ static gboolean check_func(GSource *source) {
         g_source_get_current_time(source, &now);
         tvnow.tv_sec = now.tv_sec;
         tvnow.tv_usec = now.tv_usec;
-        
+
         if (avahi_timeval_compare(&next_timeout->expiry, &tvnow) <= 0)
             return TRUE;
     }
@@ -311,7 +309,7 @@ static gboolean check_func(GSource *source) {
     for (w = g->watches; w; w = w->watches_next)
         if (w->pollfd.revents > 0)
             return TRUE;
-    
+
     return FALSE;
 }
 
@@ -319,7 +317,7 @@ static gboolean dispatch_func(GSource *source, AVAHI_GCC_UNUSED GSourceFunc call
     AvahiGLibPoll* g = (AvahiGLibPoll*) source;
     AvahiWatch *w;
     AvahiTimeout *next_timeout;
-    
+
     g_assert(g);
 
     if ((next_timeout = find_next_timeout(g))) {
@@ -328,13 +326,13 @@ static gboolean dispatch_func(GSource *source, AVAHI_GCC_UNUSED GSourceFunc call
         g_source_get_current_time(source, &now);
         tvnow.tv_sec = now.tv_sec;
         tvnow.tv_usec = now.tv_usec;
-        
+
         if (avahi_timeval_compare(&next_timeout->expiry, &tvnow) < 0) {
             start_timeout_callback(next_timeout);
             return TRUE;
         }
     }
-    
+
     for (w = g->watches; w; w = w->watches_next)
         if (w->pollfd.revents > 0) {
             assert(w->callback);
@@ -348,7 +346,7 @@ static gboolean dispatch_func(GSource *source, AVAHI_GCC_UNUSED GSourceFunc call
 
 AvahiGLibPoll *avahi_glib_poll_new(GMainContext *context, gint priority) {
     AvahiGLibPoll *g;
-    
+
     static GSourceFuncs source_funcs = {
         prepare_func,
         check_func,
@@ -362,22 +360,22 @@ AvahiGLibPoll *avahi_glib_poll_new(GMainContext *context, gint priority) {
     g_main_context_ref(g->context = context ? context : g_main_context_default());
 
     g->api.userdata = g;
-    
+
     g->api.watch_new = watch_new;
     g->api.watch_free = watch_free;
     g->api.watch_update = watch_update;
     g->api.watch_get_events = watch_get_events;
-    
+
     g->api.timeout_new = timeout_new;
     g->api.timeout_free = timeout_free;
     g->api.timeout_update = timeout_update;
 
     g->watch_req_cleanup = FALSE;
     g->timeout_req_cleanup = FALSE;
-    
+
     AVAHI_LLIST_HEAD_INIT(AvahiWatch, g->watches);
     AVAHI_LLIST_HEAD_INIT(AvahiTimeout, g->timeouts);
-    
+
     g_source_attach(&g->source, g->context);
     g_source_set_priority(&g->source, priority);
     g_source_set_can_recurse(&g->source, FALSE);
index 78f77428d892135fe4252bceab737221f41dde88..ffc3aacc69acbd175b838feaed3ec2ee45f4b107 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooglibwatchhfoo
 #define fooglibwatchhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 1466c783bea218eb6a3e574f45cb9e075d7ae50a..402b45c2041bf8ca31ccded4402e9df411c894d6 100644 (file)
@@ -1,3 +1,5 @@
+*.typelib
+Avahi-0.6.gir
 ga-*-enumtypes.c
 ga-*-enumtypes.h
 *.o
diff --git a/avahi-gobject/AvahiCore-0.6.gir b/avahi-gobject/AvahiCore-0.6.gir
new file mode 100644 (file)
index 0000000..8b25fc1
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+            xmlns="http://www.gtk.org/introspection/core/1.0"
+            xmlns:c="http://www.gtk.org/introspection/c/1.0"
+            xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+  <namespace name="AvahiCore" version="0.6" shared-library="avahi-core">
+    <alias name="IfIndex" target="int" c:type="AvahiIfIndex"/>
+    <enumeration name="Protocol" c:type="AvahiProtocol">
+      <member name="inet"
+              value="0"
+              c:identifier="AVAHI_PROTO_INET"/>
+      <member name="inet6"
+              value="1"
+              c:identifier="AVAHI_PROTO_INET6"/>
+      <member name="unspec"
+              value="-1"
+              c:identifier="AVAHI_PROTO_UNSPEC"/>
+    </enumeration>
+    <bitfield name="PublishFlags" c:type="AvahiPublishFlags">
+      <member name="unique"
+              value="1"
+              c:identifier="AVAHI_PUBLISH_UNIQUE"/>
+      <member name="no_probe"
+              value="2"
+              c:identifier="AVAHI_PUBLISH_NO_PROBE"/>
+      <member name="no_announce"
+              value="4"
+              c:identifier="AVAHI_PUBLISH_NO_ANNOUNCE"/>
+      <member name="allow_multiple"
+              value="8"
+              c:identifier="AVAHI_PUBLISH_ALLOW_MULTIPLE"/>
+      <member name="no_reverse"
+              value="16"
+              c:identifier="AVAHI_PUBLISH_NO_reverse"/>
+      <member name="no_cookie"
+              value="32"
+              c:identifier="AVAHI_PUBLISH_NO_cookie"/>
+      <member name="update"
+              value="64"
+              c:identifier="AVAHI_PUBLISH_UPDATE"/>
+      <member name="use_wide_area"
+              value="128"
+              c:identifier="AVAHI_PUBLISH_USE_WIDE_AREA"/>
+      <member name="use_multicast"
+              value="256"
+              c:identifier="AVAHI_PUBLISH_USE_MULTICAST"/>
+    </bitfield>
+    <record name="StringList" c:type="AvahiStringList"/>
+    <record name="Address" c:type="AvahiAddress"/>
+    <record name="Client" c:type="AvahiClient"/>
+    <function name="server_get_host_name" c:identifier="avahi_server_get_host_name">
+      <return-value transfer-ownership="none">
+        <type name="utf8" c:type="char8"/>
+      </return-value>
+      <parameters>
+      </parameters>
+    </function>
+  </namespace>
+</repository>
index 15d00df0a0470d6a807c77e6cef9395c375f5a33..02f2b9483b4bbed6a5fa68bf844b50130d888999 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-#
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -22,6 +20,9 @@ AM_CFLAGS=-I$(top_srcdir)
 # This cool debug trap works on i386/gcc only
 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
 
+EXTRA_DIST = \
+       AvahiCore-0.6.gir
+
 if HAVE_GOBJECT
 if HAVE_DBUS
 
@@ -74,10 +75,10 @@ dist-hook:
        $(shell for x in $(BUILT_SOURCES); do rm -f $(distdir)/$$x ; done)
 
 signals-marshal.list: $(CORE_SOURCES) Makefile.am
-       ( cd $(srcdir) && \
+       $(AM_V_GEN)( cd $(srcdir) && \
        sed -n -e 's/.*_ga_signals_marshal_\([A-Z]*__[A-Z_]*\).*/\1/p' \
                $(CORE_SOURCES) ) \
-               | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
+               | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp && \
        if cmp -s $@.tmp $@; then \
                rm $@.tmp; \
        else \
@@ -85,15 +86,14 @@ signals-marshal.list: $(CORE_SOURCES) Makefile.am
        fi
 
 signals-marshal.h: signals-marshal.list
-       glib-genmarshal --header --prefix=_ga_signals_marshal $< > $@
+       $(AM_V_GEN)glib-genmarshal --header --prefix=_ga_signals_marshal $< > $@
 
 signals-marshal.c: signals-marshal.list
-       glib-genmarshal --body --prefix=_ga_signals_marshal $< > $@
-
+       $(AM_V_GEN)(echo "#include \"signals-marshal.h\"" ; glib-genmarshal --body --prefix=_ga_signals_marshal $< ) > $@
 
 # rules for making the glib enum objects
 %-enumtypes.h: %.h Makefile.in
-       glib-mkenums \
+       $(AM_V_GEN)glib-mkenums \
        --fhead "#ifndef __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n#define __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
        --fprod "/* enumerations from \"@filename@\" */\n" \
        --vhead "GType @enum_name@_get_type (void);\n#define $(shell echo $* | tr [:lower:]- [:upper:]_ | sed 's/_.*//')_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
@@ -101,14 +101,40 @@ signals-marshal.c: signals-marshal.list
        $< > $@
 
 %-enumtypes.c: %.h Makefile.in
-       glib-mkenums \
-       --fhead "#include <$*.h>" \
+       $(AM_V_GEN)glib-mkenums \
+       --fhead "#include <$*.h>\n#include<$*-enumtypes.h>" \
        --fprod "\n/* enumerations from \"@filename@\" */" \
        --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"     \
        --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@VALUENAME@\" }," \
        --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
        $< > $@
 
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
+if HAVE_INTROSPECTION
+introspection_sources = $(libavahi_gobject_la_SOURCES)
+
+Avahi-0.6.gir: $(lib_LTLIBRARIES)
+Avahi_0_6_gir_INCLUDES = GObject-2.0 AvahiCore-0.6
+Avahi_0_6_gir_CFLAGS = $(libavahi_gobject_la_CFLAGS)
+Avahi_0_6_gir_LIBS = $(lib_LTLIBRARIES)
+Avahi_0_6_gir_FILES = $(addprefix $(srcdir)/, $(CORE_SOURCES)) $(BUILT_SOURCES)
+Avahi_0_6_gir_SCANNERFLAGS = --strip-prefix=Ga
+INTROSPECTION_GIRS += Avahi-0.6.gir
+INTROSPECTION_INSTALL_GIRS = AvahiCore-0.6.gir $(INTROSPECTION_GIRS)
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_INSTALL_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_INSTALL_GIRS:.gir=.typelib)
+
+CLEANFILES += $(INTROSPECTION_GIRS) $(typelib_DATA)
+endif
+
 endif
 endif
 
index c4f2e3766f724dc10a6da81a2b7292a55b9af734..0f0ab74e97e1f91626a21e8df0ea2bfb46e535b3 100644 (file)
@@ -558,7 +558,7 @@ gboolean ga_entry_group_service_remove_key(GaEntryGroupService * service,
     GaEntryGroupServicePrivate *priv = (GaEntryGroupServicePrivate *) service;
     GaEntryGroupServiceEntry entry;
 
-    entry.value = key;
+    entry.value = (void*) key;
     entry.size = strlen(key);
 
     g_hash_table_remove(priv->entries, &entry);
index 4989b4b6bfc53d70cd28d5a33558bf03f3fdbf7b..7381a48b55b61b81c0539a3c277d42ac4e8a3718 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -34,7 +32,7 @@ pythonscripts = \
        avahi-bookmarks
 
 avahi-bookmarks: avahi-bookmarks.in
-       sed -e 's,@PYTHON\@,$(PYTHON),g' $< > $@
+       $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' $< > $@ && \
        chmod +x $@
 
 bin_SCRIPTS = $(pythonscripts)
index 172abb30228c983ac54aab15eef3bdf3a1b8f724..dea7bef601989218aa48e4249ea0383345e68b2d 100755 (executable)
@@ -1,7 +1,5 @@
 #!@PYTHON@
 # -*-python-*-
-# $Id$ 
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index a44a071a502cc8aa9bb4f75798bb74478f484637..454fd57efec6c1a720e5b8779804208926dc5cf6 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -21,7 +19,6 @@ AM_CFLAGS=-I$(top_srcdir)
 
 EXTRA_DIST = \
        __init__.py \
-       SimpleGladeApp.py \
        avahi-discover.in \
        avahi-discover.desktop.in.in
 
@@ -32,7 +29,7 @@ if HAVE_PYGTK
 pythonscripts =
 
 desktopdir = $(datadir)/applications
-desktop_DATA = 
+desktop_DATA =
 
 avahi_discoverdir = $(pythondir)/avahi_discover
 avahi_discover_PYTHON =
@@ -42,7 +39,7 @@ pythonscripts += \
        avahi-discover
 desktop_DATA += avahi-discover.desktop
 @INTLTOOL_DESKTOP_RULE@
-avahi_discover_PYTHON += __init__.py SimpleGladeApp.py
+avahi_discover_PYTHON += __init__.py
 endif
 
 if HAVE_DBM
@@ -50,17 +47,17 @@ pythonscripts += \
        avahi-discover
 desktop_DATA += avahi-discover.desktop
 @INTLTOOL_DESKTOP_RULE@
-avahi_discover_PYTHON += __init__.py SimpleGladeApp.py
+avahi_discover_PYTHON += __init__.py
 endif
 
 avahi-discover.desktop.in: avahi-discover.desktop.in.in
-       sed -e 's,@bindir\@,$(bindir),g' $< > $@
+       $(AM_V_GEN)sed -e 's,@bindir\@,$(bindir),g' $< > $@
 
 avahi-discover: avahi-discover.in
-       sed -e 's,@PYTHON\@,$(PYTHON),g' \
+       $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
                -e 's,@GETTEXT_PACKAGE\@,"$(GETTEXT_PACKAGE)",g' \
                -e 's,@LOCALEDIR\@,"$(datadir)/locale",g' \
-               -e 's,@interfacesdir\@,$(interfacesdir),g' $< > $@
+               -e 's,@interfacesdir\@,$(interfacesdir),g' $< > $@ && \
        chmod +x $@
 
 bin_SCRIPTS = $(pythonscripts)
diff --git a/avahi-python/avahi-discover/SimpleGladeApp.py b/avahi-python/avahi-discover/SimpleGladeApp.py
deleted file mode 100644 (file)
index 90c598c..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-"""
- SimpleGladeApp.py
- Module that provides an object oriented abstraction to pygtk and libglade.
- Copyright (C) 2004 Sandino Flores Moreno
-"""
-
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-import os
-import sys
-import re
-
-import tokenize
-import gtk
-import gtk.glade
-import weakref
-import inspect
-
-__version__ = "1.0"
-__author__ = 'Sandino "tigrux" Flores-Moreno'
-
-def bindtextdomain(app_name, locale_dir=None):
-    """    
-    Bind the domain represented by app_name to the locale directory locale_dir.
-    It has the effect of loading translations, enabling applications for different
-    languages.
-
-    app_name:
-        a domain to look for translations, tipically the name of an application.
-
-    locale_dir:
-        a directory with locales like locale_dir/lang_isocode/LC_MESSAGES/app_name.mo
-        If omitted or None, then the current binding for app_name is used.
-    """    
-    try:
-        import locale
-        import gettext
-        locale.setlocale(locale.LC_ALL, "")
-        gtk.glade.bindtextdomain(app_name, locale_dir)
-        gettext.install(app_name, locale_dir, unicode=1)
-    except (IOError,locale.Error), e:
-        print "Warning", app_name, e
-        __builtins__.__dict__["_"] = lambda x : x
-
-
-class SimpleGladeApp:
-
-    def __init__(self, path, root=None, domain=None, **kwargs):
-        """
-        Load a glade file specified by glade_filename, using root as
-        root widget and domain as the domain for translations.
-
-        If it receives extra named arguments (argname=value), then they are used
-        as attributes of the instance.
-
-        path:
-            path to a glade filename.
-            If glade_filename cannot be found, then it will be searched in the
-            same directory of the program (sys.argv[0])
-
-        root:
-            the name of the widget that is the root of the user interface,
-            usually a window or dialog (a top level widget).
-            If None or ommited, the full user interface is loaded.
-
-        domain:
-            A domain to use for loading translations.
-            If None or ommited, no translation is loaded.
-
-        **kwargs:
-            a dictionary representing the named extra arguments.
-            It is useful to set attributes of new instances, for example:
-                glade_app = SimpleGladeApp("ui.glade", foo="some value", bar="another value")
-            sets two attributes (foo and bar) to glade_app.
-        """        
-        if os.path.isfile(path):
-            self.glade_path = path
-        else:
-            glade_dir = os.path.dirname( sys.argv[0] )
-            self.glade_path = os.path.join(glade_dir, path)
-        for key, value in kwargs.items():
-            try:
-                setattr(self, key, weakref.proxy(value) )
-            except TypeError:
-                setattr(self, key, value)
-        self.glade = None
-        self.install_custom_handler(self.custom_handler)
-        self.glade = self.create_glade(self.glade_path, root, domain)
-        if root:
-            self.main_widget = self.get_widget(root)
-        else:
-            self.main_widget = None
-        self.normalize_names()
-        self.add_callbacks(self)
-        self.new()
-
-    def __repr__(self):
-        class_name = self.__class__.__name__
-        if self.main_widget:
-            root = gtk.Widget.get_name(self.main_widget)
-            repr = '%s(path="%s", root="%s")' % (class_name, self.glade_path, root)
-        else:
-            repr = '%s(path="%s")' % (class_name, self.glade_path)
-        return repr
-
-    def new(self):
-        """
-        Method called when the user interface is loaded and ready to be used.
-        At this moment, the widgets are loaded and can be refered as self.widget_name
-        """
-        pass
-
-    def add_callbacks(self, callbacks_proxy):
-        """
-        It uses the methods of callbacks_proxy as callbacks.
-        The callbacks are specified by using:
-            Properties window -> Signals tab
-            in glade-2 (or any other gui designer like gazpacho).
-
-        Methods of classes inheriting from SimpleGladeApp are used as
-        callbacks automatically.
-
-        callbacks_proxy:
-            an instance with methods as code of callbacks.
-            It means it has methods like on_button1_clicked, on_entry1_activate, etc.
-        """        
-        self.glade.signal_autoconnect(callbacks_proxy)
-
-    def normalize_names(self):
-        """
-        It is internally used to normalize the name of the widgets.
-        It means a widget named foo:vbox-dialog in glade
-        is refered self.vbox_dialog in the code.
-
-        It also sets a data "prefixes" with the list of
-        prefixes a widget has for each widget.
-        """
-        for widget in self.get_widgets():
-            widget_name = gtk.Widget.get_name(widget)
-            prefixes_name_l = widget_name.split(":")
-            prefixes = prefixes_name_l[ : -1]
-            widget_api_name = prefixes_name_l[-1]
-            widget_api_name = "_".join( re.findall(tokenize.Name, widget_api_name) )
-            gtk.Widget.set_name(widget, widget_api_name)
-            if hasattr(self, widget_api_name):
-                raise AttributeError("instance %s already has an attribute %s" % (self,widget_api_name))
-            else:
-                setattr(self, widget_api_name, widget)
-                if prefixes:
-                    gtk.Widget.set_data(widget, "prefixes", prefixes)
-
-    def add_prefix_actions(self, prefix_actions_proxy):
-        """
-        By using a gui designer (glade-2, gazpacho, etc)
-        widgets can have a prefix in theirs names
-        like foo:entry1 or foo:label3
-        It means entry1 and label3 has a prefix action named foo.
-
-        Then, prefix_actions_proxy must have a method named prefix_foo which
-        is called everytime a widget with prefix foo is found, using the found widget
-        as argument.
-
-        prefix_actions_proxy:
-            An instance with methods as prefix actions.
-            It means it has methods like prefix_foo, prefix_bar, etc.
-        """        
-        prefix_s = "prefix_"
-        prefix_pos = len(prefix_s)
-
-        is_method = lambda t : callable( t[1] )
-        is_prefix_action = lambda t : t[0].startswith(prefix_s)
-        drop_prefix = lambda (k,w): (k[prefix_pos:],w)
-
-        members_t = inspect.getmembers(prefix_actions_proxy)
-        methods_t = filter(is_method, members_t)
-        prefix_actions_t = filter(is_prefix_action, methods_t)
-        prefix_actions_d = dict( map(drop_prefix, prefix_actions_t) )
-
-        for widget in self.get_widgets():
-            prefixes = gtk.Widget.get_data(widget, "prefixes")
-            if prefixes:
-                for prefix in prefixes:
-                    if prefix in prefix_actions_d:
-                        prefix_action = prefix_actions_d[prefix]
-                        prefix_action(widget)
-
-    def custom_handler(self,
-            glade, function_name, widget_name,
-            str1, str2, int1, int2):
-        """
-        Generic handler for creating custom widgets, internally used to
-        enable custom widgets (custom widgets of glade).
-
-        The custom widgets have a creation function specified in design time.
-        Those creation functions are always called with str1,str2,int1,int2 as
-        arguments, that are values specified in design time.
-
-        Methods of classes inheriting from SimpleGladeApp are used as
-        creation functions automatically.
-
-        If a custom widget has create_foo as creation function, then the
-        method named create_foo is called with str1,str2,int1,int2 as arguments.
-        """
-        try:
-            handler = getattr(self, function_name)
-            return handler(str1, str2, int1, int2)
-        except AttributeError:
-            return None
-
-    def gtk_widget_show(self, widget, *args):
-        """
-        Predefined callback.
-        The widget is showed.
-        Equivalent to widget.show()
-        """
-        widget.show()
-
-    def gtk_widget_hide(self, widget, *args):
-        """
-        Predefined callback.
-        The widget is hidden.
-        Equivalent to widget.hide()
-        """
-        widget.hide()
-
-    def gtk_widget_grab_focus(self, widget, *args):
-        """
-        Predefined callback.
-        The widget grabs the focus.
-        Equivalent to widget.grab_focus()
-        """
-        widget.grab_focus()
-
-    def gtk_widget_destroy(self, widget, *args):
-        """
-        Predefined callback.
-        The widget is destroyed.
-        Equivalent to widget.destroy()
-        """
-        widget.destroy()
-
-    def gtk_window_activate_default(self, window, *args):
-        """
-        Predefined callback.
-        The default widget of the window is activated.
-        Equivalent to window.activate_default()
-        """
-        widget.activate_default()
-
-    def gtk_true(self, *args):
-        """
-        Predefined callback.
-        Equivalent to return True in a callback.
-        Useful for stopping propagation of signals.
-        """
-        return True
-
-    def gtk_false(self, *args):
-        """
-        Predefined callback.
-        Equivalent to return False in a callback.
-        """
-        return False
-
-    def gtk_main_quit(self, *args):
-        """
-        Predefined callback.
-        Equivalent to self.quit()
-        """
-        self.quit()
-
-    def main(self):
-        """
-        Starts the main loop of processing events.
-        The default implementation calls gtk.main()
-
-        Useful for applications that needs a non gtk main loop.
-        For example, applications based on gstreamer needs to override
-        this method with gst.main()
-
-        Do not directly call this method in your programs.
-        Use the method run() instead.
-        """
-        gtk.main()
-
-    def quit(self):
-        """
-        Quit processing events.
-        The default implementation calls gtk.main_quit()
-        
-        Useful for applications that needs a non gtk main loop.
-        For example, applications based on gstreamer needs to override
-        this method with gst.main_quit()
-        """
-        gtk.main_quit()
-
-    def run(self):
-        """
-        Starts the main loop of processing events checking for Control-C.
-
-        The default implementation checks wheter a Control-C is pressed,
-        then calls on_keyboard_interrupt().
-
-        Use this method for starting programs.
-        """
-        try:
-            self.main()
-        except KeyboardInterrupt:
-            self.on_keyboard_interrupt()
-
-    def on_keyboard_interrupt(self):
-        """
-        This method is called by the default implementation of run()
-        after a program is finished by pressing Control-C.
-        """
-        pass
-
-    def install_custom_handler(self, custom_handler):
-        gtk.glade.set_custom_handler(custom_handler)
-
-    def create_glade(self, glade_path, root, domain):
-        return gtk.glade.XML(self.glade_path, root, domain)
-
-    def get_widget(self, widget_name):
-        return self.glade.get_widget(widget_name)
-
-    def get_widgets(self):
-        return self.glade.get_widget_prefix("")        
index b2cd7d837109faedb926ad9d4865163ed0fcad6b..6f3ec7f9a26873f63adef09a5618b7fa23ea2f15 100755 (executable)
@@ -1,7 +1,5 @@
 #!@PYTHON@
 # -*-python-*-
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 055842476f006ccb7e2eee8da21731a02af6e27e..ac6b65783332b3d372f79d3951450ef2b0a1246c 100755 (executable)
@@ -1,7 +1,5 @@
 #!@PYTHON@
 # -*-python-*-
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -23,13 +21,13 @@ import os, sys
 
 try:
     import avahi, gettext, gtk, gobject, dbus, avahi.ServiceTypeDatabase
-    from avahi_discover.SimpleGladeApp import SimpleGladeApp
-    gtk.glade.bindtextdomain(@GETTEXT_PACKAGE@, @LOCALEDIR@)
-    gtk.glade.textdomain(@GETTEXT_PACKAGE@)
     _ = gettext.gettext
 except ImportError, e:
     print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus.\n Error: %s" % e
     sys.exit(1)
+except Exception, e:
+    print "Failed to initialize: %s" % e
+    sys.exit(1)
 
 
 ## !!NOTE!! ##
@@ -52,15 +50,20 @@ def error_msg(msg):
     d.run()
     d.destroy()
 
-glade_dir = "@interfacesdir@"
+ui_dir = "@interfacesdir@"
 
 service_type_db = avahi.ServiceTypeDatabase.ServiceTypeDatabase()
 
-class Main_window(SimpleGladeApp):
-    def __init__(self, path="avahi-discover.glade", root="main_window", domain=None, **kwargs):
-        path = os.path.join(glade_dir, path)
+class Main_window:
+    def __init__(self, path="avahi-discover.ui", root="main_window", domain=None, **kwargs):
+        path = os.path.join(ui_dir, path)
         gtk.window_set_default_icon_name("network-wired")
-        SimpleGladeApp.__init__(self, path, root, domain, **kwargs)
+        self.ui = gtk.Builder()
+        self.ui.add_from_file(path)
+        self.ui.connect_signals(self)
+        self.tree_view = self.ui.get_object("tree_view")
+        self.info_label = self.ui.get_object("info_label")
+        self.new()
 
     def on_tree_view_cursor_changed(self, widget, *args):
         (model, iter) = widget.get_selection().get_selected()
@@ -79,7 +82,7 @@ class Main_window(SimpleGladeApp):
         if protocol == avahi.PROTO_INET6:
             return "IPv6"
         return "n/a"
-            
+
     def siocgifname(self, interface):
         if interface <= 0:
             return "n/a"
@@ -91,14 +94,14 @@ class Main_window(SimpleGladeApp):
             return "Wide Area"
         else:
             return str(self.siocgifname(interface)) + " " + str(self.protoname(protocol))
-                        
+
     def service_resolved(self, interface, protocol, name, stype, domain, host, aprotocol, address, port, txt, flags):
         print "Service data for service '%s' of type '%s' in domain '%s' on %i.%i:" % (name, stype, domain, interface, protocol)
 
         print "\tHost %s (%s), port %i, TXT data: %s" % (host, address, port, str(avahi.txt_array_to_string_array(txt)))
 
         self.update_label(interface, protocol, name, stype, domain, host, aprotocol, address, port, avahi.txt_array_to_string_array(txt))
-        
+
     def print_error(self, err):
         error_label = "<b>Error:</b> %s" % (err)
         self.info_label.set_markup(error_label)
@@ -111,13 +114,13 @@ class Main_window(SimpleGladeApp):
             return service_type_db[stype]
         except KeyError:
             return stype
-            
+
     def new_service(self, interface, protocol, name, stype, domain, flags):
         print "Found service '%s' of type '%s' in domain '%s' on %i.%i." % (name, stype, domain, interface, protocol)
         if self.zc_ifaces.has_key((interface,protocol)) == False:
 
             ifn = self.get_interface_name(interface, protocol)
-            
+
             self.zc_ifaces[(interface,protocol)] = self.insert_row(self.treemodel, None, ifn, None,interface,protocol,None,domain)
         if self.zc_domains.has_key((interface,protocol,domain)) == False:
             self.zc_domains[(interface,protocol,domain)] = self.insert_row(self.treemodel, self.zc_ifaces[(interface,protocol)], domain,None,interface,protocol,None,domain)
@@ -151,16 +154,16 @@ class Main_window(SimpleGladeApp):
                     parent = self.treemodel.iter_parent(treeiter)
                     self.treemodel.remove(treeiter)
                     del self.zc_ifaces[(interface,protocol)]
+
     def new_service_type(self, interface, protocol, stype, domain, flags):
         global service_browsers
 
-        # Are we already browsing this domain for this type? 
+        # Are we already browsing this domain for this type?
         if service_browsers.has_key((interface, protocol, stype, domain)):
             return
-        
+
         print "Browsing for services of type '%s' in domain '%s' on %i.%i ..." % (stype, domain, interface, protocol)
-        
+
         b = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, self.server.ServiceBrowserNew(interface, protocol, stype, domain, dbus.UInt32(0))),  avahi.DBUS_INTERFACE_SERVICE_BROWSER)
         b.connect_to_signal('ItemNew', self.new_service)
         b.connect_to_signal('ItemRemove', self.remove_service)
@@ -183,7 +186,7 @@ class Main_window(SimpleGladeApp):
                 print e
                 error_msg("You should check that the avahi daemon is running.\n\nError : %s" % e)
                 sys.exit(0)
-                
+
             b.connect_to_signal('ItemNew', self.new_service_type)
 
             service_type_browsers[(interface, protocol, domain)] = b
@@ -209,7 +212,7 @@ class Main_window(SimpleGladeApp):
                 if len(tmp[0]) > 0:
                     res[tmp[0]] = tmp[1]
         return res
-                                                                            
+
 
     def update_label(self,interface, protocol, name, stype, domain, host, aprotocol, address, port, txt):
         if len(txt) != 0:
@@ -230,7 +233,6 @@ class Main_window(SimpleGladeApp):
         return myiter
 
     def new(self):
-        print "A new main_window has been created"
         self.treemodel=gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
         self.tree_view.set_model(self.treemodel)
 
@@ -249,14 +251,18 @@ class Main_window(SimpleGladeApp):
         self.zc_domains = {}
         self.zc_types = {}
         self.services_browsed = {}
-        
-        self.bus = dbus.SystemBus()
-        self.server = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)
+
+        try:
+            self.bus = dbus.SystemBus()
+            self.server = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)
+        except Exception, e:
+            print "Failed to connect to Avahi Server (Is it running?): %s" % e
+            sys.exit(1)
 
         if self.domain is None:
             # Explicitly browse .local
             self.browse_domain(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, "local")
-                        
+
             # Browse for other browsable domains
             db = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, self.server.DomainBrowserNew(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, "", avahi.DOMAIN_BROWSER_BROWSE, dbus.UInt32(0))), avahi.DBUS_INTERFACE_DOMAIN_BROWSER)
             db.connect_to_signal('ItemNew', self.new_domain)
@@ -264,13 +270,12 @@ class Main_window(SimpleGladeApp):
             # Just browse the domain the user wants us to browse
             self.browse_domain(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, domain)
 
-        
+    def gtk_main_quit(self, *args):
+        gtk.main_quit()
+
 def main():
     main_window = Main_window()
+    gtk.main()
 
-    main_window.run()
-    
 if __name__ == "__main__":
     main()
-
-                                            
index c0c9c343389065c346a5db85bd221ad116c32ed8..907c5eb133c0e23f26374381bf2a528b561b1393 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -28,12 +26,12 @@ if HAVE_GDBM
 nodist_avahi_SCRIPTS = ServiceTypeDatabase.py
 
 ServiceTypeDatabase.py: ServiceTypeDatabase.py.in
-       sed -e 's,@PYTHON\@,$(PYTHON),g' \
+       $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
                -e 's,@DBM\@,gdbm,g' \
                -e 's,@FIRST_KEY\@,key = self.db.firstkey(),g' \
                -e 's,@CHECK_KEY\@,while key is not None:,g' \
                -e 's,@NEXT_KEY\@,key = self.db.nextkey(key),g' \
-               -e 's,@pkglibdir\@,$(pkglibdir),g' $< > $@
+               -e 's,@pkglibdir\@,$(pkglibdir),g' $< > $@ && \
        chmod +x $@
 endif
 
@@ -41,12 +39,12 @@ if HAVE_DBM
 nodist_avahi_SCRIPTS = ServiceTypeDatabase.py
 
 ServiceTypeDatabase.py: ServiceTypeDatabase.py.in
-       sed -e 's,@PYTHON\@,$(PYTHON),g' \
+       $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
                -e 's,@DBM\@,dbm,g' \
                -e 's,@FIRST_KEY\@,keys = self.db.keys(),g' \
                -e 's,@CHECK_KEY\@,for key in keys:,g' \
                -e 's,@NEXT_KEY\@,,g' \
-               -e 's,@pkglibdir\@,$(pkglibdir),g' $< > $@
+               -e 's,@pkglibdir\@,$(pkglibdir),g' $< > $@ && \
        chmod +x $@
 endif
 
index d1345109cae3b378ed86cdd666868b38190f2813..8ad8d5edbd91ce21b9a467ee7b3e6bcb06313c74 100644 (file)
@@ -1,7 +1,5 @@
 #!@PYTHON@
 # -*-python-*-
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -26,6 +24,7 @@ import re
 locale.setlocale(locale.LC_ALL, '')
 
 class ServiceTypeDatabase:
+    """ServiceTypeDatabase maps service types to descriptions"""
 
     def __init__(self, filename = "@pkglibdir@/service-types.db"):
 
@@ -68,14 +67,7 @@ class ServiceTypeDatabase:
 
     def items(self):
 
-        items = []
-        @FIRST_KEY@
-        @CHECK_KEY@
-            if re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+', key) and not re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+\[.*\]', key):
-                localized_service_name = self[key]
-                items.append((key, localized_service_name))
-            @NEXT_KEY@
-        return items
+        return list(self.iteritems())
 
     def has_key(self, key):
 
@@ -96,6 +88,52 @@ class ServiceTypeDatabase:
         return False
         
 
+    def __iter__(self):
+
+        @FIRST_KEY@
+        @CHECK_KEY@
+
+            if re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+', key) and not re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+\[.*\]', key):
+                yield key
+
+            @NEXT_KEY@
+
+    def __len__(self):
+
+        count = 0
+        for _ in self:
+
+            count+=1
+
+        self.__len__ = lambda : count
+        return len(self)
+
+    def get(self, key, default=None):
+
+        if key in self:
+            return self[key]
+        else:
+            return default
+
+    def iteritems(self):
+
+        return ((key, self[key]) for key in self)
+
+    def iterkeys(self):
+
+        return self.__iter__()
+
+    def itervalues(self):
+
+        return (self[key] for key in self)
+
+    def keys(self):
+
+        return list(self)
+
+    def values(self):
+
+        return list(self.itervalues())
         
 if __name__ == "__main__":
     
@@ -107,4 +145,17 @@ if __name__ == "__main__":
     print b["_webdav._tcp"]
     print b["_webdavs._tcp"]
 
-    print b["gurki._tcp"]
+    print b.get("gurki._tcp")
+    print len(b)
+
+    for key, _ in zip(b, xrange(3)):
+
+        print key
+
+    for key, _ in zip(b.iteritems(), xrange(3)):
+
+        print key
+
+    for key, _ in zip(b.itervalues(), xrange(3)):
+
+        print key
index 81e2754ece6edbc355ec9073cf1a74bb6107c705..7b4502937a3fa5f98a5147ec131c8ce2e65c179a 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index de135958621b12b66c15df88070ceae6baf6a9dd..64356a590cab50376b28263d0f8e54f4a5acd771 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
 
 AM_CFLAGS=-I$(top_srcdir)
 
-lib_LTLIBRARIES = 
-BUILT_SOURCES = 
+lib_LTLIBRARIES =
+BUILT_SOURCES =
 
 if HAVE_QT3
 
 avahiqt3includedir=$(includedir)/avahi-qt3
 
 avahiqt3include_HEADERS = \
-       qt-watch.h 
+       qt-watch.h
 
 lib_LTLIBRARIES += \
        libavahi-qt3.la
@@ -35,10 +33,10 @@ lib_LTLIBRARIES += \
 BUILT_SOURCES += qt-watch.moc3
 
 libavahi_qt3_la_SOURCES = \
-       qt-watch.cpp 
+       qt-watch.cpp
 
 qt-watch.moc3: qt-watch.cpp
-       $(MOC_QT3) $^ > $@
+       $(AM_V_GEN)$(MOC_QT3) $^ > $@
 
 libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS) $(VISIBILITY_HIDDEN_CFLAGS)
 libavahi_qt3_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT3_LIBS)
@@ -49,7 +47,7 @@ if HAVE_QT4
 
 avahiqt4includedir=$(includedir)/avahi-qt4
 avahiqt4include_HEADERS = \
-       qt-watch.h 
+       qt-watch.h
 
 lib_LTLIBRARIES += \
        libavahi-qt4.la
@@ -57,10 +55,10 @@ lib_LTLIBRARIES += \
 BUILT_SOURCES += qt-watch.moc4
 
 libavahi_qt4_la_SOURCES = \
-       qt-watch.cpp 
+       qt-watch.cpp
 
 qt-watch.moc4: qt-watch.cpp
-       $(MOC_QT4) $^ > $@
+       $(AM_V_GEN)$(MOC_QT4) $^ > $@
 
 libavahi_qt4_la_CPPFLAGS = $(AM_CFLAGS) $(QT4_CFLAGS) -DQT4 $(VISIBILITY_HIDDEN_CFLAGS)
 libavahi_qt4_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT4_LIBS)
index f29b517d0950aa391a1b60380f3e9845ee2b8cc4..dac9dcc7ea116d0328f219ca3be1b1bd619224b1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
  
index a702a7615ee4ce53a1432b8fd6bd5e6fa1caceaf..cd7130dd6cbfe549fd7e6881f29f8a4f1e22ca99 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef QAVAHI_H
 #define QAVAHI_H
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 3025102c4cce16cf06338203756b9bb5a7d34b90..c11e97d751f23be7c6630158a78b7ea979267502 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -55,7 +53,7 @@ namespace Avahi
             this.address = address;
         }
     }
-    
+
     public class AddressResolver : ResolverBase, IDisposable
     {
         private IntPtr handle;
@@ -71,7 +69,7 @@ namespace Avahi
 
         private ArrayList foundListeners = new ArrayList ();
         private ArrayList timeoutListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_address_resolver_new (IntPtr client, int iface, Protocol proto,
                                                                  IntPtr address, LookupFlags flags,
@@ -92,7 +90,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event EventHandler Timeout
         {
             add {
@@ -155,7 +153,7 @@ namespace Avahi
                 if (handle == IntPtr.Zero)
                     client.ThrowError ();
             }
-            
+
             Utility.Free (addrPtr);
         }
 
index f8dd4edd69cf53a620b839be2a1a7dd5be620d88..aff09d9db8dd3cc21cb29055be0edd2062c5d412 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -23,7 +21,7 @@ using System.Reflection;
 using System.Runtime.CompilerServices;
 
 //
-// General Information about an assembly is controlled through the following 
+// General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 //
@@ -34,17 +32,17 @@ using System.Runtime.CompilerServices;
 [assembly: AssemblyProduct("")]
 [assembly: AssemblyCopyright("(C) 2005 James Willcox  <snorp@snorp.net>")]
 [assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]        
+[assembly: AssemblyCulture("")]
 
 //
 // Version information for an assembly consists of the following four values:
 //
 //      Major Version
-//      Minor Version 
+//      Minor Version
 //      Build Number
 //      Revision
 //
-// You can specify all the values or you can default the Revision and Build Numbers 
+// You can specify all the values or you can default the Revision and Build Numbers
 // by using the '*' as shown below:
 
 [assembly: AssemblyVersion("1.0.0")]
index ba4d59b9e7b2a343843e102fdee36a890304b417..6ccfd57a46b8f036ba84b0a4e1476139150b5440 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
     This file is part of avahi.
 
@@ -51,7 +49,7 @@ public class AvahiTest {
         if (args.State == EntryGroupState.Established) {
             DomainBrowser browser = new DomainBrowser (client);
             objects.Add (browser);
-            
+
             browser.DomainAdded += OnDomainAdded;
         }
     }
@@ -66,7 +64,7 @@ public class AvahiTest {
     {
         ServiceTypeBrowser stb = new ServiceTypeBrowser (client, domain);
         objects.Add (stb);
-        
+
         stb.CacheExhausted += OnCacheExhausted;
         stb.ServiceTypeAdded += OnServiceTypeAdded;
     }
@@ -81,7 +79,7 @@ public class AvahiTest {
         Console.WriteLine ("Got service type: " + args.ServiceType.ServiceType);
         ServiceBrowser sb = new ServiceBrowser (client, args.ServiceType.ServiceType, args.ServiceType.Domain);
         objects.Add (sb);
-        
+
         sb.ServiceAdded += OnServiceAdded;
     }
 
@@ -96,7 +94,7 @@ public class AvahiTest {
     private static void OnServiceResolved (object o, ServiceInfoArgs args)
     {
         objects.Remove (o);
-        
+
         Console.WriteLine ("Service '{0}' at {1}:{2}", args.Service.Name, args.Service.HostName, args.Service.Port);
         foreach (byte[] bytes in args.Service.Text) {
             Console.WriteLine ("Text: " + Encoding.UTF8.GetString (bytes));
@@ -117,11 +115,11 @@ public class AvahiTest {
     private static void OnAddressResolved (object o, HostAddressArgs args)
     {
         objects.Remove (o);
-        
+
         Console.WriteLine ("Resolved {0} to {1}", args.Address, args.Host);
         HostNameResolver hr = new HostNameResolver (client, args.Host);
         objects.Add (hr);
-        
+
         hr.Found += OnHostNameResolved;
     }
 
index 0a1e3a761351869c8530c818838130e7b65cc700..3af00867b3865ed56728d261f2fa9a08c41e080f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 02763d40d67be6357ef00355a39b22e1d13dcfe1..b3815b32cb5d3120bacf2b83bad89c82ae5819bf 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -35,7 +33,7 @@ namespace Avahi
         Found,
         Failure
     }
-    
+
     internal enum BrowserEvent {
         Added,
         Removed,
@@ -70,7 +68,7 @@ namespace Avahi
             this.error = error;
         }
     }
-    
+
     public enum Protocol {
         Unspecified = -1,
         IPv4 = 0,
@@ -83,7 +81,7 @@ namespace Avahi
         Running,
         Collision
     }
-    
+
     public enum ClientState {
         Registering = ServerState.Registering,
         Running = ServerState.Running,
@@ -117,7 +115,7 @@ namespace Avahi
         IgnoreUserConfig = 1,
         NoFail = 2
     }
-    
+
     public class Client : IDisposable
     {
         private IntPtr handle;
@@ -151,7 +149,7 @@ namespace Avahi
 
         [DllImport ("avahi-client")]
         private static extern int avahi_client_errno (IntPtr handle);
-        
+
         [DllImport ("avahi-common")]
         private static extern IntPtr avahi_simple_poll_new ();
 
@@ -192,7 +190,7 @@ namespace Avahi
         {
             get { return handle; }
         }
-        
+
         public string Version
         {
             get {
@@ -292,7 +290,7 @@ namespace Avahi
 
                     avahi_simple_poll_quit (spoll);
                     Monitor.Wait (this);
-                    
+
                     avahi_simple_poll_free (spoll);
                 }
             }
@@ -326,7 +324,7 @@ namespace Avahi
             IntPtr namePtr = Stdlib.malloc ((ulong) len);
             IntPtr typePtr = Stdlib.malloc ((ulong) len);
             IntPtr domainPtr = Stdlib.malloc ((ulong) len);
-            
+
             int ret = avahi_service_name_split (Utility.StringToBytes (service), namePtr, len, typePtr, len,
                                                 domainPtr, len);
 
@@ -334,7 +332,7 @@ namespace Avahi
                 Utility.Free (namePtr);
                 Utility.Free (typePtr);
                 Utility.Free (domainPtr);
-                
+
                 name = null;
                 type = null;
                 domain = null;
@@ -357,7 +355,7 @@ namespace Avahi
             if (error != ErrorCode.Ok)
                 throw new ClientException (error);
         }
-        
+
         private void OnClientCallback (IntPtr client, ClientState state, IntPtr userData)
         {
             if (StateChanged != null)
index fadcce91f2a18241b7718eb6cc638fd09304ba29..0f511accec5abbebba3a83e971b511826f6e0f59 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -95,14 +93,14 @@ namespace Avahi
             this.code = code;
         }
     }
-    
+
     public class ClientException : ApplicationException
     {
         private ErrorCode code;
 
         [DllImport ("avahi-common")]
         private static extern IntPtr avahi_strerror (ErrorCode code);
-        
+
         public ErrorCode ErrorCode
         {
             get { return code; }
@@ -110,7 +108,7 @@ namespace Avahi
 
         internal ClientException (int code) : this ((ErrorCode) code) {
         }
-        
+
         internal ClientException (ErrorCode code) : base (GetErrorString (code))
         {
             this.code = code;
index 50da54e7306fb0b1e03f8ccf3c85285ee31e165a..a1165dcc638e58086d3a8aa2ddd901b2e4841474 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -61,7 +59,7 @@ namespace Avahi
     }
 
     public delegate void DomainInfoHandler (object o, DomainInfoArgs args);
-    
+
     public class DomainBrowser : BrowserBase, IDisposable
     {
         private IntPtr handle;
@@ -76,7 +74,7 @@ namespace Avahi
 
         private ArrayList addListeners = new ArrayList ();
         private ArrayList removeListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_domain_browser_new (IntPtr client, int iface, int proto,
                                                                byte[] domain, int btype, LookupFlags flags,
@@ -97,7 +95,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event DomainInfoHandler DomainRemoved
         {
             add {
@@ -118,7 +116,7 @@ namespace Avahi
         public DomainBrowser (Client client) : this (client, -1, Protocol.Unspecified, client.DomainName,
                                                      DomainBrowserType.Browse, LookupFlags.None) {
         }
-        
+
         public DomainBrowser (Client client, int iface, Protocol proto, string domain,
                               DomainBrowserType btype, LookupFlags flags)
         {
index 02be643676bebbddcfc8c75e2fa299b090795fe0..24abae4d5222b0b4c0998b8ef9eac73d5578110e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -41,7 +39,7 @@ namespace Avahi
         UseWideArea = 128,
         UseMulticast = 256
     }
-    
+
     public enum EntryGroupState {
         Uncommited,
         Registering,
@@ -58,7 +56,7 @@ namespace Avahi
         {
             get { return state; }
         }
-        
+
         public EntryGroupStateArgs (EntryGroupState state)
         {
             this.state = state;
@@ -67,13 +65,13 @@ namespace Avahi
 
     internal delegate void EntryGroupCallback (IntPtr group, EntryGroupState state, IntPtr userdata);
     public delegate void EntryGroupStateHandler (object o, EntryGroupStateArgs args);
-    
+
     public class EntryGroup : IDisposable
     {
         private Client client;
         private IntPtr handle;
         private EntryGroupCallback cb;
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_entry_group_new (IntPtr client, EntryGroupCallback cb, IntPtr userdata);
 
@@ -114,7 +112,7 @@ namespace Avahi
         private static extern int avahi_entry_group_add_record (IntPtr group, int iface, Protocol proto,
                                                                 PublishFlags flags, byte[] name, RecordClass clazz,
                                                                 RecordType type, uint ttl, byte[] rdata, int size);
-        
+
         [DllImport ("avahi-client")]
         private static extern void avahi_entry_group_free (IntPtr group);
 
@@ -131,7 +129,7 @@ namespace Avahi
         private static extern IntPtr avahi_alternative_service_name (byte[] name);
 
         public event EntryGroupStateHandler StateChanged;
-        
+
         public EntryGroupState State
         {
             get {
@@ -149,7 +147,7 @@ namespace Avahi
                 }
             }
         }
-        
+
         public EntryGroup (Client client)
         {
             this.client = client;
@@ -245,9 +243,9 @@ namespace Avahi
                                                             Utility.StringToBytes (domain),
                                                             Utility.StringToBytes (host), port, list);
             }
-            
+
             avahi_string_list_free (list);
-            
+
             if (ret < 0) {
                 client.ThrowError ();
             }
@@ -285,7 +283,7 @@ namespace Avahi
 
             UpdateService (iface, proto, flags, name, type, domain, list);
         }
-        
+
         private void UpdateService (int iface, Protocol proto, PublishFlags flags, string name, string type,
                                     string domain, IntPtr list)
         {
index 81305fd778efd9c35b4ee3bdc7591b2e802d8de8..b9fe7f4348e8da6aac2e363efd0d70ecf36cbab6 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -49,7 +47,7 @@ namespace Avahi
 
         private ArrayList foundListeners = new ArrayList ();
         private ArrayList timeoutListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_host_name_resolver_new (IntPtr client, int iface, Protocol proto,
                                                                    byte[] hostname, Protocol aproto, LookupFlags flags,
@@ -69,7 +67,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event EventHandler Timeout
         {
             add {
index 43ab428574629f2cb5dac5a7f48830790e1ee3c6..1fdb1ca3d3f733b5642ff63f43674be69caedc9d 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -48,11 +46,11 @@ EXTRA_DIST =                                \
        $(srcdir)/gencfg.sh
 
 $(ASSEMBLY): $(AVAHISOURCES)
-       mcs -keyfile:$(srcdir)/avahi.snk -target:library -out:$@ -debug $(AVAHISOURCES) -r:Mono.Posix
+       $(AM_V_GEN)MONO_SHARED_DIR=. mcs -keyfile:$(srcdir)/avahi.snk -target:library -out:$@ -debug $(AVAHISOURCES) -r:Mono.Posix
 
 
 $(ASSEMBLY).config: $(ASSEMBLY).config.in
-       $(srcdir)/gencfg.sh $(top_builddir)/avahi-client/libavahi-client.la \
+       $(AM_V_GEN)$(srcdir)/gencfg.sh $(top_builddir)/avahi-client/libavahi-client.la \
                $(top_builddir)/avahi-common/libavahi-common.la \
                $(top_builddir)/avahi-glib/libavahi-glib.la < $< > $@
 
@@ -62,12 +60,12 @@ all: $(ASSEMBLY) $(ASSEMBLY).config
 
 if HAVE_MONODOC
 update-docs: $(ASSEMBLY)
-       $(MONODOCER) -assembly:$(ASSEMBLY) -path:en
+       $(AM_V_GEN)$(MONODOCER) -assembly:$(ASSEMBLY) -path:en
 
 avahi-sharp-docs.zip: avahi-sharp-docs.tree
 
 avahi-sharp-docs.tree: $(srcdir)/en/*/*
-       $(MDASSEMBLER) --out avahi-sharp-docs --ecma $(srcdir)/en
+       $(AM_V_GEN)$(MDASSEMBLER) --out avahi-sharp-docs --ecma $(srcdir)/en
 
 monodocdir = $(MONODOC_DIR)
 monodoc_DATA = avahi-sharp-docs.zip avahi-sharp-docs.tree avahi-sharp-docs.source
@@ -75,10 +73,10 @@ monodoc_DATA = avahi-sharp-docs.zip avahi-sharp-docs.tree avahi-sharp-docs.sourc
 endif
 
 install-data-hook: $(ASSEMBLY)
-       $(GACUTIL) /i $(ASSEMBLY) /package avahi-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir)
+       $(AM_V_GEN)MONO_SHARED_DIR=. $(GACUTIL) /i $(ASSEMBLY) /package avahi-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir)
 
 uninstall-hook: $(ASSEMBLY)
-       $(GACUTIL) /u avahi-sharp /package avahi-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir)
+       $(AM_V_GEN)MONO_SHARED_DIR=. $(GACUTIL) /u avahi-sharp /package avahi-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir)
 
 endif
 endif
index f65f8ac17b0f89fa14f45bedf501cc811b5feefe..ba5a983b9dea8bc2fbab30b32f67bfe01887a720 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: ServiceBrowser.cs 635 2005-09-26 03:57:30Z snorp $ */
-
 /***
   This file is part of avahi.
 
@@ -29,7 +27,7 @@ namespace Avahi
 {
 
     public delegate void RecordInfoHandler (object o, RecordInfoArgs args);
-    
+
     internal delegate void RecordBrowserCallback (IntPtr browser, int iface, Protocol proto, BrowserEvent bevent,
                                                   IntPtr name, ushort clazz, ushort type, IntPtr rdata, int size,
                                                   LookupResultFlags flags, IntPtr userdata);
@@ -50,7 +48,7 @@ namespace Avahi
         Aaa = 28,
         Srv = 33
     }
-    
+
     public struct RecordInfo
     {
         public int NetworkInterface;
@@ -91,7 +89,7 @@ namespace Avahi
 
         private ArrayList addListeners = new ArrayList ();
         private ArrayList removeListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_record_browser_new (IntPtr client, int iface, Protocol proto,
                                                                byte[] name, ushort clazz, ushort type,
@@ -113,7 +111,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event RecordInfoHandler RecordRemoved
         {
             add {
@@ -135,7 +133,7 @@ namespace Avahi
             this (client, -1, Protocol.Unspecified, name, RecordClass.In, type, LookupFlags.None)
         {
         }
-        
+
         public RecordBrowser (Client client, int iface, Protocol proto, string name, RecordClass clazz,
                               RecordType type, LookupFlags flags)
         {
@@ -178,7 +176,7 @@ namespace Avahi
         {
             if (client.Handle != IntPtr.Zero && handle != IntPtr.Zero &&
                 (force || (addListeners.Count == 0 && removeListeners.Count == 0))) {
-                
+
                 lock (client) {
                     avahi_record_browser_free (handle);
                     handle = IntPtr.Zero;
index 0a5a2a8d4449b31511b57ef8f69965cf9e889ac9..d546abac0c5021a5462c47680ef5625a14a882cb 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 520e339582182ef3d17d951736f512b7ae0ce7dd..5c39ad4bb8d457cfb68b7e084c0e5e46917e225b 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -30,7 +28,7 @@ namespace Avahi
     internal delegate void ServiceBrowserCallback (IntPtr browser, int iface, Protocol proto, BrowserEvent bevent,
                                                    IntPtr name, IntPtr type, IntPtr domain, LookupResultFlags flags,
                                                    IntPtr userdata);
-    
+
     public struct ServiceInfo
     {
         public int NetworkInterface;
@@ -63,7 +61,7 @@ namespace Avahi
     }
 
     public delegate void ServiceInfoHandler (object o, ServiceInfoArgs args);
-    
+
     public class ServiceBrowser : BrowserBase, IDisposable
     {
         private IntPtr handle;
@@ -78,7 +76,7 @@ namespace Avahi
 
         private ArrayList addListeners = new ArrayList ();
         private ArrayList removeListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_service_browser_new (IntPtr client, int iface, int proto, byte[] type,
                                                                 byte[] domain, LookupFlags flags,
@@ -99,7 +97,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event ServiceInfoHandler ServiceRemoved
         {
             add {
@@ -120,12 +118,12 @@ namespace Avahi
         public ServiceBrowser (Client client, string type) : this (client, type, client.DomainName)
         {
         }
-        
+
         public ServiceBrowser (Client client, string type, string domain) : this (client, -1, Protocol.Unspecified,
                                                                                   type, domain, LookupFlags.None)
         {
         }
-        
+
         public ServiceBrowser (Client client, int iface, Protocol proto, string type, string domain, LookupFlags flags)
         {
             this.client = client;
@@ -167,7 +165,7 @@ namespace Avahi
         {
             if (client.Handle != IntPtr.Zero && handle != IntPtr.Zero &&
                 (force || (addListeners.Count == 0 && removeListeners.Count == 0))) {
-                
+
                 lock (client) {
                     avahi_service_browser_free (handle);
                     handle = IntPtr.Zero;
index a32efca8b795186bf19dd429e7dcc97944823680..7f8901a177a6beefe0ae7ac5a672bf29c0c421cc 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -51,7 +49,7 @@ namespace Avahi
 
         private ArrayList foundListeners = new ArrayList ();
         private ArrayList timeoutListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_service_resolver_new (IntPtr client, int iface, Protocol proto,
                                                                  byte[] name, byte[] type, byte[] domain,
@@ -82,7 +80,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event EventHandler Timeout
         {
             add {
@@ -115,7 +113,7 @@ namespace Avahi
                                                                             GetLookupFlags (service.Flags))
         {
         }
-        
+
         public ServiceResolver (Client client, int iface, Protocol proto, string name,
                                 string type, string domain, Protocol aproto, LookupFlags flags)
         {
index 3796d602ace36118d281a6c1bd6bd8eeaa529786..e1356d00a4623cf1a2ddae808972273e6bebcafb 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -29,7 +27,7 @@ namespace Avahi
     internal delegate void ServiceTypeBrowserCallback (IntPtr browser, int iface, Protocol proto, BrowserEvent bevent,
                                                        IntPtr type, IntPtr domain, LookupResultFlags flags,
                                                        IntPtr userdata);
-    
+
     public struct ServiceTypeInfo
     {
         public int NetworkInterface;
@@ -55,7 +53,7 @@ namespace Avahi
     }
 
     public delegate void ServiceTypeInfoHandler (object o, ServiceTypeInfoArgs args);
-    
+
     public class ServiceTypeBrowser : BrowserBase, IDisposable
     {
         private IntPtr handle;
@@ -69,7 +67,7 @@ namespace Avahi
 
         private ArrayList addListeners = new ArrayList ();
         private ArrayList removeListeners = new ArrayList ();
-        
+
         [DllImport ("avahi-client")]
         private static extern IntPtr avahi_service_type_browser_new (IntPtr client, int iface, int proto,
                                                                      byte[] domain, LookupFlags flags,
@@ -90,7 +88,7 @@ namespace Avahi
                 Stop (false);
             }
         }
-        
+
         public event ServiceTypeInfoHandler ServiceTypeRemoved
         {
             add {
index 9081b011dc210a1e631ee5470021b9354f4e6221..a1d0a669ed66608069eafe0297f9533e2a0ad06e 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -45,7 +43,7 @@ namespace Avahi
         {
             if (ptr == IntPtr.Zero)
                 return null;
-            
+
             int len = strlen (ptr);
             byte[] bytes = new byte[len];
             Marshal.Copy (ptr, bytes, 0, len);
@@ -56,7 +54,7 @@ namespace Avahi
         {
             if (ptr == IntPtr.Zero)
                 return null;
-            
+
             string ret = PtrToString (ptr);
             Free (ptr);
             return ret;
@@ -100,7 +98,7 @@ namespace Avahi
         public static IPAddress PtrToAddress (IntPtr ptr)
         {
             IPAddress address = null;
-            
+
             if (ptr != IntPtr.Zero) {
                 IntPtr buf = Stdlib.malloc (256);
                 IntPtr addrPtr = avahi_address_snprint (buf, 256, ptr);
diff --git a/avahi-ui-gtk3.pc.in b/avahi-ui-gtk3.pc.in
new file mode 100644 (file)
index 0000000..27c4322
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=@libdir@
+includedir=${prefix}/include
+
+Name: avahi-ui
+Description: Avahi Multicast DNS Responder (Common GTK3 UI support)
+Requires: gtk+-3.0 avahi-client avahi-glib
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lavahi-ui-gtk3
+Cflags: -D_REENTRANT -I${includedir}
index 6183f489e29281c032b55a8a33939c740b288fb2..28ea64f82fd47d7913e090c989dc137162044f5d 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: Makefile.am 1251 2006-08-21 23:31:59Z lennart $
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -34,13 +32,13 @@ EXTRA_DIST =                                        \
        $(srcdir)/bssh.cs
 
 $(ASSEMBLY): $(AVAHISOURCES)
-       mcs -keyfile:$(top_srcdir)/avahi-sharp/avahi.snk -target:library -out:$@ -debug $(AVAHISOURCES) -pkg:gtk-sharp-2.0 -r:$(top_builddir)/avahi-sharp/avahi-sharp.dll -r:Mono.Posix
+       $(AM_V_GEN)mcs -keyfile:$(top_srcdir)/avahi-sharp/avahi.snk -target:library -out:$@ -debug $(AVAHISOURCES) -pkg:gtk-sharp-2.0 -r:$(top_builddir)/avahi-sharp/avahi-sharp.dll -r:Mono.Posix
 
 $(ASSEMBLY).config: $(ASSEMBLY).config.in
-       $(srcdir)/gencfg.sh $(top_builddir)/avahi-common/libavahi-common.la < $< > $@
+       $(AM_V_GEN)$(srcdir)/gencfg.sh $(top_builddir)/avahi-common/libavahi-common.la < $< > $@
 
 bssh.exe: $(srcdir)/bssh.cs $(ASSEMBLY)
-       mcs -out:$@ $(srcdir)/bssh.cs -r:./avahi-ui-sharp.dll -r:../avahi-sharp/avahi-sharp.dll -pkg:gtk-sharp-2.0 -r:Mono.Posix
+       $(AM_V_GEN)mcs -out:$@ $(srcdir)/bssh.cs -r:./avahi-ui-sharp.dll -r:../avahi-sharp/avahi-sharp.dll -pkg:gtk-sharp-2.0 -r:Mono.Posix
 
 if HAVE_MONO
 if HAVE_DBUS
@@ -49,12 +47,12 @@ all: $(ASSEMBLY) $(ASSEMBLY).config bssh.exe
 
 if HAVE_MONODOC
 update-docs: $(ASSEMBLY)
-       $(MONODOCER) -assembly:$(ASSEMBLY) -path:en
+       $(AM_V_GEN)$(MONODOCER) -assembly:$(ASSEMBLY) -path:en
 
 avahi-ui-sharp-docs.zip: avahi-ui-sharp-docs.tree
 
 avahi-ui-sharp-docs.tree: $(srcdir)/en/*/*
-       $(MDASSEMBLER) --out avahi-ui-sharp-docs --ecma $(srcdir)/en
+       $(AM_V_GEN)$(MDASSEMBLER) --out avahi-ui-sharp-docs --ecma $(srcdir)/en
 
 monodocdir = $(MONODOC_DIR)
 monodoc_DATA = avahi-ui-sharp-docs.zip avahi-ui-sharp-docs.tree avahi-ui-sharp-docs.source
index e0306e108f2d34cc3f3edef1ab73ef65663e5f7d..31f74799aba55f82b0fc089d765afd9463c02b6a 100644 (file)
@@ -27,13 +27,13 @@ namespace Avahi.UI
 
         [DllImport ("avahi-ui")]
         private static extern IntPtr aui_service_dialog_get_service_type (IntPtr dialog);
-        
+
         [DllImport ("avahi-ui")]
         private static extern void aui_service_dialog_set_service_type (IntPtr dialog, IntPtr type);
 
         [DllImport ("avahi-ui")]
         private static extern IntPtr aui_service_dialog_get_service_name (IntPtr dialog);
-        
+
         [DllImport ("avahi-ui")]
         private static extern void aui_service_dialog_set_service_name (IntPtr dialog, IntPtr type);
 
@@ -114,7 +114,7 @@ namespace Avahi.UI
                 for (int i = 0;;i++) {
                     if (types[i] != IntPtr.Zero)
                         break;
-                    
+
                     GLib.Marshaller.Free (types[i]);
                 }
             }
@@ -172,11 +172,11 @@ namespace Avahi.UI
             get {
                 ArrayList txtlist = new ArrayList ();
                 IntPtr txt = aui_service_dialog_get_txt_data (Raw);
-                
+
                 for (IntPtr l = txt; l != IntPtr.Zero; l = avahi_string_list_get_next (l)) {
                     IntPtr buf = avahi_string_list_get_text (l);
                     int len = avahi_string_list_get_size (l);
-                    
+
                     byte[] txtbuf = new byte[len];
                     Marshal.Copy (buf, txtbuf, 0, len);
                     txtlist.Add (txtbuf);
@@ -209,7 +209,7 @@ namespace Avahi.UI
                 aui_service_dialog_set_address_family (Raw, value);
             }
         }
-        
+
         public ServiceDialog (string title, Window parent, params object[] buttonData)
         {
             Raw = aui_service_dialog_new (title, parent == null ? IntPtr.Zero : parent.Handle,
@@ -223,7 +223,7 @@ namespace Avahi.UI
         private static IPAddress PtrToAddress (IntPtr ptr)
         {
             IPAddress address = null;
-            
+
             if (ptr != IntPtr.Zero) {
                 IntPtr buf = Stdlib.malloc (256);
                 IntPtr addrPtr = avahi_address_snprint (buf, 256, ptr);
index 003a3a66e13b76b1e89e75f0c7c425022cdf9242..fa3d4d480c5189ec67448229937feb4fca1dc9a2 100644 (file)
@@ -5,8 +5,8 @@ using Avahi.UI;
 
 public class EntryPoint {
     public static void Main () {
-        Application.Init (); 
-               
+        Application.Init ();
+
         ServiceDialog dialog = new ServiceDialog ("Choose SSH Server", null,
                                                   Stock.Cancel, ResponseType.Cancel,
                                                   Stock.Connect, ResponseType.Accept);
@@ -17,11 +17,11 @@ public class EntryPoint {
             Console.WriteLine ("Connecting to {0}:{1}", dialog.Address, dialog.Port);
 
             string user = Environment.UserName;
-            
+
             foreach (byte[] txtBytes in dialog.TxtData) {
                 string txt = System.Text.Encoding.UTF8.GetString (txtBytes);
                 string[] splitTxt = txt.Split(new char[] { '=' }, 2);
-                
+
                 if (splitTxt.Length != 2)
                     continue;
 
index ca9c2eff4e9fc639f1bc534fcb28fceaeaf517ca..9edeea96346142c9972eec4b009fd0252310b392 100644 (file)
@@ -4,7 +4,7 @@ libdir=@libdir@
 includedir=${prefix}/include
 
 Name: avahi-ui
-Description: Avahi Multicast DNS Responder (Common GTK UI support)
+Description: Avahi Multicast DNS Responder (Common GTK2 UI support)
 Requires: gtk+-2.0 avahi-client avahi-glib
 Version: @PACKAGE_VERSION@
 Libs: -L${libdir} -lavahi-ui
index 6dbbd24ae41e1bea20ee95691ea79166c2721d1e..72d60239a81a1488a3641364b0f91aef1d845735 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -23,13 +21,13 @@ AM_CFLAGS=-I$(top_srcdir) -DG_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -D
 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
 
 desktopdir = $(datadir)/applications
-desktop_DATA = 
+desktop_DATA =
 desktop_DATA_in = $(desktop_DATA_in_in:.in.in=.in)
 desktop_DATA_in_in = bssh.desktop.in.in bvnc.desktop.in.in
 
 EXTRA_DIST = $(desktop_DATA_in_in)
 
-if HAVE_GTK
+if HAVE_GTK2OR3
 AM_CFLAGS += -DGNOMELOCALEDIR=\"$(datadir)/locale\"
 if HAVE_DBUS
 if HAVE_GLIB
@@ -39,8 +37,17 @@ avahiincludedir=$(includedir)/avahi-ui
 avahiinclude_HEADERS = \
        avahi-ui.h
 
-lib_LTLIBRARIES = \
-       libavahi-ui.la 
+lib_LTLIBRARIES =
+
+if HAVE_GTK
+lib_LTLIBRARIES += \
+       libavahi-ui.la
+endif
+
+if HAVE_GTK3
+lib_LTLIBRARIES += \
+       libavahi-ui-gtk3.la
+endif
 
 libavahi_ui_la_SOURCES = \
        avahi-ui.h avahi-ui.c
@@ -48,15 +55,25 @@ libavahi_ui_la_CFLAGS = $(AM_CFLAGS) $(GTK20_CFLAGS)
 libavahi_ui_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-client/libavahi-client.la ../avahi-glib/libavahi-glib.la $(GTK20_LIBS)
 libavahi_ui_la_LDFLAGS = $(AM_LDFLAGS)  -version-info $(LIBAVAHI_UI_VERSION_INFO)
 
+libavahi_ui_gtk3_la_SOURCES = $(libavahi_ui_la_SOURCES)
+libavahi_ui_gtk3_la_CFLAGS = $(AM_CFLAGS) $(GTK30_CFLAGS)
+libavahi_ui_gtk3_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-client/libavahi-client.la ../avahi-glib/libavahi-glib.la $(GTK30_LIBS)
+libavahi_ui_gtk3_la_LDFLAGS = $(AM_LDFLAGS)  -version-info $(LIBAVAHI_UI_VERSION_INFO)
+
 if HAVE_GDBM
 libavahi_ui_la_SOURCES += ../avahi-utils/stdb.h ../avahi-utils/stdb.c
 libavahi_ui_la_CFLAGS += -DDATABASE_FILE=\"$(pkglibdir)/service-types.db\"
 libavahi_ui_la_LIBADD += -lgdbm
+
+libavahi_ui_gtk3_la_CFLAGS += -DDATABASE_FILE=\"$(pkglibdir)/service-types.db\"
+libavahi_ui_gtk3_la_LIBADD += -lgdbm
 endif
 
 if HAVE_DBM
 libavahi_ui_la_SOURCES += ../avahi-utils/stdb.h ../avahi-utils/stdb.c
 libavahi_ui_la_CFLAGS += -DDATABASE_FILE=\"$(pkglibdir)/service-types.db\"
+
+libavahi_ui_gtk3_la_CFLAGS += -DDATABASE_FILE=\"$(pkglibdir)/service-types.db\"
 endif
 
 bin_PROGRAMS = bssh
@@ -64,8 +81,14 @@ desktop_DATA += bssh.desktop bvnc.desktop
 @INTLTOOL_DESKTOP_RULE@
 
 bssh_SOURCES = bssh.c
+
+if HAVE_GTK3
+bssh_CFLAGS = $(AM_CFLAGS) $(GTK30_CFLAGS)
+bssh_LDADD = $(AM_LDADD) $(GTK30_LIBS) ../avahi-client/libavahi-client.la ../avahi-common/libavahi-common.la libavahi-ui-gtk3.la
+else
 bssh_CFLAGS = $(AM_CFLAGS) $(GTK20_CFLAGS)
 bssh_LDADD = $(AM_LDADD) $(GTK20_LIBS) ../avahi-client/libavahi-client.la ../avahi-common/libavahi-common.la libavahi-ui.la
+endif
 
 install-exec-local:
        cd $(DESTDIR)/$(bindir) && \
@@ -74,10 +97,10 @@ install-exec-local:
                $(LN_S) bssh bshell
 
 bssh.desktop.in: bssh.desktop.in.in
-       sed -e 's,@bindir\@,$(bindir),g' $< > $@
+       $(AM_V_GEN)sed -e 's,@bindir\@,$(bindir),g' $< > $@
 
 bvnc.desktop.in: bvnc.desktop.in.in
-       sed -e 's,@bindir\@,$(bindir),g' $< > $@
+       $(AM_V_GEN)sed -e 's,@bindir\@,$(bindir),g' $< > $@
 
 endif # HAVE_GLIB
 endif
index bd2b3cc1a9fe460049dc77dbf4a0b8f550803e5c..6f2fcbe5212fb34e45b0709fb53fa42da64c5741 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -30,7 +28,6 @@
 #include <net/if.h>
 
 #include <gtk/gtk.h>
-#include <glib/gi18n.h>
 
 #include <avahi-glib/glib-watch.h>
 #include <avahi-client/client.h>
@@ -131,16 +128,16 @@ static void aui_service_dialog_get_property(GObject *object, guint prop_id, GVal
 static int get_default_response(GtkDialog *dlg) {
     gint ret = GTK_RESPONSE_NONE;
 
-    if (GTK_WINDOW(dlg)->default_widget)
+    if (gtk_window_get_default_widget(GTK_WINDOW(dlg)))
         /* Use the response of the default widget, if possible */
-        ret = gtk_dialog_get_response_for_widget(dlg, GTK_WINDOW(dlg)->default_widget);
+        ret = gtk_dialog_get_response_for_widget(dlg, gtk_window_get_default_widget(GTK_WINDOW(dlg)));
 
     if (ret == GTK_RESPONSE_NONE) {
         /* Fall back to finding the first positive response */
         GList *children, *t;
         gint bad = GTK_RESPONSE_NONE;
 
-        t = children = gtk_container_get_children(GTK_CONTAINER(dlg->action_area));
+        t = children = gtk_container_get_children(GTK_CONTAINER(gtk_dialog_get_action_area(dlg)));
 
         while (t) {
             GtkWidget *child = t->data;
@@ -890,7 +887,7 @@ static void response_callback(GtkDialog *dialog, gint response, gpointer user_da
 
         gtk_widget_set_sensitive(GTK_WIDGET(dialog), FALSE);
         cursor = gdk_cursor_new(GDK_WATCH);
-        gdk_window_set_cursor(GTK_WIDGET(dialog)->window, cursor);
+        gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(dialog)), cursor);
         gdk_cursor_unref(cursor);
 
         if (!(d->priv->resolver = avahi_service_resolver_new(
@@ -992,7 +989,7 @@ static void domain_button_clicked(GtkButton *button G_GNUC_UNUSED, gpointer user
 
     vbox = gtk_vbox_new(FALSE, 8);
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
-    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(p->domain_dialog)->vbox), vbox, TRUE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(p->domain_dialog))), vbox, TRUE, TRUE, 0);
 
     p->domain_entry = gtk_entry_new();
     gtk_entry_set_max_length(GTK_ENTRY(p->domain_entry), AVAHI_DOMAIN_NAME_MAX);
@@ -1114,7 +1111,7 @@ static void aui_service_dialog_init(AuiServiceDialog *d) {
 
     vbox = gtk_vbox_new(FALSE, 8);
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
-    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), vbox, TRUE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(d))), vbox, TRUE, TRUE, 0);
 
     p->domain_label = gtk_label_new(_("Initializing..."));
     gtk_label_set_ellipsize(GTK_LABEL(p->domain_label), TRUE);
@@ -1165,8 +1162,8 @@ static void aui_service_dialog_init(AuiServiceDialog *d) {
     p->domain_button = gtk_button_new_with_mnemonic(_("_Domain..."));
     gtk_button_set_image(GTK_BUTTON(p->domain_button), gtk_image_new_from_stock(GTK_STOCK_NETWORK, GTK_ICON_SIZE_BUTTON));
     g_signal_connect(p->domain_button, "clicked", G_CALLBACK(domain_button_clicked), d);
-    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), p->domain_button, FALSE, TRUE, 0);
-    gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(GTK_DIALOG(d)->action_area), p->domain_button, TRUE);
+    gtk_box_pack_start(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, FALSE, TRUE, 0);
+    gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, TRUE);
     gtk_widget_show(p->domain_button);
 
     gtk_dialog_set_default_response(GTK_DIALOG(d), GTK_RESPONSE_ACCEPT);
index d780f83e9a8580701bb7b450d2afbe1229e012d9..aae61dcdab1850b5a245a08b5c8da68d69712697 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef fooavahiuihfoo
 #define fooavahiuihfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index e4a190ba7b02bacdf6978f5727e083e27b447b5e..491380f600f88fb87ff14572d3dd07b7496f99b8 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -31,7 +29,6 @@
 #include <getopt.h>
 
 #include <gtk/gtk.h>
-#include <glib/gi18n.h>
 
 #include <avahi-client/client.h>
 #include <avahi-common/strlst.h>
index 21993c3802cce7cb7bf6a1b560a7703649071792..1b0443cb949d7f98b729d13eb4ff8414c1f66f77 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 8cbd6d54429a09a668c41ea00cc01b43b9ff67b2..6e808a4e7e1636033233b702be406691909ea0fb 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 9c9a93c977749d225fbe45130500d7d68491e2ab..485de3a649bec19f07ede19574602d2ed1cdbfaa 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -51,7 +49,7 @@ typedef enum {
 } Command;
 
 typedef struct Config {
-    int verbose, no_fail;
+    int verbose, no_fail, no_reverse;
     Command command;
     char *name, *stype, *domain, *host;
     uint16_t port;
@@ -122,7 +120,7 @@ static int register_stuff(Config *config) {
 
     if (config->command == COMMAND_PUBLISH_ADDRESS) {
 
-        if (avahi_entry_group_add_address(entry_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, config->name, &config->address) < 0) {
+        if (avahi_entry_group_add_address(entry_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, config->no_reverse ? AVAHI_PUBLISH_NO_REVERSE : 0, config->name, &config->address) < 0) {
             fprintf(stderr, _("Failed to add address: %s\n"), avahi_strerror(avahi_client_errno(client)));
             return -1;
         }
@@ -225,6 +223,7 @@ static void help(FILE *f, const char *argv0) {
               "    -d --domain=DOMAIN   Domain to publish service in\n"
               "    -H --host=DOMAIN     Host where service resides\n"
               "       --subtype=SUBTYPE An additional subtype to register this service with\n"
+              "    -R --no-reverse      Do not publish reverse entry with address\n"
               "    -f --no-fail         Don't fail if the daemon is not available\n"),
               argv0, strstr(argv0, "service") ? "[-s]" : "-s",
               argv0, strstr(argv0, "address") ? "[-a]" : "-a");
@@ -246,6 +245,7 @@ static int parse_command_line(Config *c, const char *argv0, int argc, char *argv
         { "domain",         required_argument, NULL, 'd' },
         { "host",           required_argument, NULL, 'H' },
         { "subtype",        required_argument, NULL, ARG_SUBTYPE},
+        { "no-reverse",     no_argument,       NULL, 'R' },
         { "no-fail",        no_argument,       NULL, 'f' },
         { NULL, 0, NULL, 0 }
     };
@@ -253,12 +253,12 @@ static int parse_command_line(Config *c, const char *argv0, int argc, char *argv
     assert(c);
 
     c->command = strstr(argv0, "address") ? COMMAND_PUBLISH_ADDRESS : (strstr(argv0, "service") ? COMMAND_PUBLISH_SERVICE : COMMAND_UNSPEC);
-    c->verbose = c->no_fail = 0;
+    c->verbose = c->no_fail = c->no_reverse = 0;
     c->host = c->name = c->domain = c->stype = NULL;
     c->port = 0;
     c->txt = c->subtypes = NULL;
 
-    while ((o = getopt_long(argc, argv, "hVsavd:H:f", long_options, NULL)) >= 0) {
+    while ((o = getopt_long(argc, argv, "hVsavRd:H:f", long_options, NULL)) >= 0) {
 
         switch(o) {
             case 'h':
@@ -276,6 +276,9 @@ static int parse_command_line(Config *c, const char *argv0, int argc, char *argv
             case 'v':
                 c->verbose = 1;
                 break;
+            case 'R':
+                c->no_reverse = 1;
+                break;
             case 'd':
                 avahi_free(c->domain);
                 c->domain = avahi_strdup(optarg);
index 0077248daa7b68c98bcc2ee2271802209f15c97d..bf1730b6fce050ecf58ea0a2b2f9a16b06093ba8 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 737ca3b338b0684c6b71673e6ca3cb3d4b442e90..34fbbeb9f1f33cfa79ab7df4bd5223750e129a11 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index eb97f3843e23d2cbed39ea27b094dea5fd310a0a..b726654b3c2b51ef616c5b533d3ef285fb0c4ece 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -41,7 +39,7 @@ static AvahiWatch *watch = NULL;
 
 static int set_nonblock(int fd) {
     int n;
-    
+
     assert(fd >= 0);
 
     if ((n = fcntl(fd, F_GETFL)) < 0)
@@ -69,7 +67,7 @@ static void close_pipe_fds(void) {
 static void watch_callback(AvahiWatch *w, int fd, AvahiWatchEvent event, AVAHI_GCC_UNUSED void *userdata) {
     int s;
     ssize_t l;
-    
+
     assert(w);
     assert(fd == pipe_fds[0]);
     assert(event == AVAHI_WATCH_IN);
@@ -84,7 +82,7 @@ static void watch_callback(AvahiWatch *w, int fd, AvahiWatchEvent event, AVAHI_G
 int sigint_install(AvahiSimplePoll *spoll) {
     struct sigaction sa;
     const AvahiPoll *p;
-        
+
     assert(spoll);
     assert(!simple_poll);
     assert(pipe_fds[0] == -1 && pipe_fds[1] == -1);
@@ -106,7 +104,7 @@ int sigint_install(AvahiSimplePoll *spoll) {
         close_pipe_fds();
         return -1;
     }
-    
+
     if (sigaction(SIGTERM, &sa, &old_sigterm_sa) < 0) {
         sigaction(SIGINT, &old_sigint_sa, NULL);
         fprintf(stderr, "sigaction() failed: %s\n", strerror(errno));
@@ -117,13 +115,13 @@ int sigint_install(AvahiSimplePoll *spoll) {
     p = avahi_simple_poll_get(spoll);
     watch = p->watch_new(p, pipe_fds[0], AVAHI_WATCH_IN, watch_callback, NULL);
     assert(watch);
-              
+
     simple_poll = spoll;
     return 0;
 }
 
 void sigint_uninstall(void) {
-    
+
     if (!simple_poll)
         return;
 
index 0bc5c34e84322831cc1b8344522bc90e808a54e7..ae66fd42ffb265a2c5edecdc3321815e80b6ec8f 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foosigchfoo
 #define foosigchfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index b7a5ed3692940056e34fbb73789907131bd02aad..6602c97190587398299206fb4b0a5be2ee316b6e 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -74,10 +72,10 @@ const char* stdb_lookup(const char *name) {
 
     data.dptr = NULL;
     data.dsize = 0;
-    
+
     if ((loc = setlocale(LC_MESSAGES, NULL))) {
         char k[256];
-        
+
         snprintf(k, sizeof(k), "%s[%s]", name, loc);
         key.dptr = k;
         key.dsize = strlen(k);
@@ -91,7 +89,7 @@ const char* stdb_lookup(const char *name) {
         if (!data.dptr) {
             char l[32], *e;
             snprintf(l, sizeof(l), "%s", loc);
-            
+
             if ((e = strchr(l, '@'))) {
                 *e = 0;
                 snprintf(k, sizeof(k), "%s[%s]", name, l);
@@ -139,9 +137,9 @@ const char* stdb_lookup(const char *name) {
     avahi_free(buffer);
     buffer = avahi_strndup(data.dptr, data.dsize);
     free(data.dptr);
-    
+
     return buffer;
-    
+
 fail:
 
     return name;
@@ -169,12 +167,12 @@ void stdb_shutdown(void) {
 
 char *stdb_getent(void) {
     datum key;
-    
+
     if (init() < 0)
         return NULL;
 
     for (;;) {
-    
+
         if (!enum_key) {
 #ifdef HAVE_GDBM
             key = gdbm_firstkey(gdbm_file);
@@ -185,7 +183,7 @@ char *stdb_getent(void) {
         } else {
             key.dptr = enum_key;
             key.dsize = strlen(enum_key);
-            
+
 #ifdef HAVE_GDBM
             key = gdbm_nextkey(gdbm_file, key);
 #endif
@@ -196,10 +194,10 @@ char *stdb_getent(void) {
 
         avahi_free(enum_key);
         enum_key = NULL;
-        
+
         if (!key.dptr)
             return NULL;
-    
+
         enum_key = avahi_strndup(key.dptr, key.dsize);
         free(key.dptr);
 
index 3f8ccc0db3f703c4aa8cc3d963dbf7c52ec3fb53..d1e1a912500ca9fdcf56df016e91251461de1434 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef foostdbhfoo
 #define foostdbhfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index ada993ffa8bcd39c8dda51a9e710e4fbb114b2c2..105bdbfe86cc7fe71dd39c7adeb4c08ed3864789 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
-# $Id$
 
 # This file is part of avahi.
 #
@@ -59,4 +58,4 @@ case "$USER" in
     ;;
 esac
 
-CFLAGS="$CFLAGS -g -O0" exec ./autogen.sh $FLAGS "$@"
+CFLAGS="$CFLAGS -g -O0" exec ./autogen.sh $FLAGS "$@" --enable-qt3=no
index de8ddd7bbe42d403b2b7606b5ac63110790ed480..1012b7fb6b27f2718ae174f8d5dbf48fbe895be7 100644 (file)
@@ -1,3 +1,4 @@
+intltool.m4
 ChangeLog
 gettext.m4
 iconv.m4
index 3f88c285de81c513d29d3c53d96eae7947fd1fdd..7379965d7edb417fba591b483028f0edd3936348 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
diff --git a/common/introspection.m4 b/common/introspection.m4
new file mode 100644 (file)
index 0000000..bfc52be
--- /dev/null
@@ -0,0 +1,94 @@
+dnl -*- mode: autoconf -*-
+dnl Copyright 2009 Johan Dahlin
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+# serial 1
+
+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+[
+    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+    dnl enable/disable introspection
+    m4_if([$2], [require],
+    [dnl
+        enable_introspection=yes
+    ],[dnl
+        AC_ARG_ENABLE(introspection,
+                  AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+                                 [Enable introspection for this build]),,
+                                 [enable_introspection=auto])
+    ])dnl
+
+    AC_MSG_CHECKING([for gobject-introspection])
+
+    dnl presence/version checking
+    AS_CASE([$enable_introspection],
+    [no], [dnl
+        found_introspection="no (disabled, use --enable-introspection to enable)"
+    ],dnl
+    [yes],[dnl
+        PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+                         AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+                         found_introspection=yes,
+                         AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+    ],dnl
+    [auto],[dnl
+        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+    ],dnl
+    [dnl
+        AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+    ])dnl
+
+    AC_MSG_RESULT([$found_introspection])
+
+    INTROSPECTION_SCANNER=
+    INTROSPECTION_COMPILER=
+    INTROSPECTION_GENERATE=
+    INTROSPECTION_GIRDIR=
+    INTROSPECTION_TYPELIBDIR=
+    if test "x$found_introspection" = "xyes"; then
+       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+       INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+       INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+       INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+    fi
+    AC_SUBST(INTROSPECTION_SCANNER)
+    AC_SUBST(INTROSPECTION_COMPILER)
+    AC_SUBST(INTROSPECTION_GENERATE)
+    AC_SUBST(INTROSPECTION_GIRDIR)
+    AC_SUBST(INTROSPECTION_TYPELIBDIR)
+    AC_SUBST(INTROSPECTION_CFLAGS)
+    AC_SUBST(INTROSPECTION_LIBS)
+    AC_SUBST(INTROSPECTION_MAKEFILE)
+
+    AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+])
+
+
+dnl Usage:
+dnl   GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+
+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+[
+  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+])
+
+dnl Usage:
+dnl   GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+
+
+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+[
+  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+])
index cb6e151b123bec4f19dec5d88c97d127eb247b26..1be1f60ad09b5547c6dfdfd141d10c7dec1f8acd 100644 (file)
@@ -1,8 +1,6 @@
 # -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
-AC_PREREQ(2.57)
+AC_PREREQ(2.63)
 AC_INIT([avahi],[0.6.25],[avahi (at) lists (dot) freedesktop (dot) org])
 AC_CONFIG_SRCDIR([avahi-core/server.c])
+AC_CONFIG_MACRO_DIR([common])
 AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([foreign 1.9 -Wall])
+AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
 
 AC_SUBST(PACKAGE_URL, [http://avahi.org/])
 
@@ -42,23 +41,29 @@ AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
 AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0])
 AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
 
-if type -p stow > /dev/null && test -d /usr/local/stow ; then
-    AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
-    ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
-fi
+AC_CANONICAL_HOST
+
+AM_SILENT_RULES([yes])
+
+AC_CHECK_PROG([STOW], [stow], [yes], [no])
+
+AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
+        AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
+        ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
+])
 
 # Checks for programs.
 AC_PROG_CC
+AC_PROG_CC_C99
 AC_PROG_CXX
-AC_GNU_SOURCE
+AM_PROG_CC_C_O
+AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AC_PROG_GCC_TRADITIONAL
 
-AM_PROG_CC_C_O
-
 # -fstack-protector
 AC_ARG_ENABLE([stack-protector],
     [AS_HELP_STRING([--disable-stack-protector],
@@ -169,6 +174,7 @@ AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
 , [], [
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <net/if_dl.h>
 ])
 
 AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
@@ -301,7 +307,7 @@ test_gcc_flag() {
 # If using GCC specify some additional parameters
 if test "x$GCC" = "xyes" ; then
 
-    DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline"
+    DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -fdiagnostics-show-option -Wno-cast-qual -fno-strict-aliasing"
 
     if test "x$HAVE_NETLINK" = "xyes" ; then
         # Test whether rtnetlink.h can be included when compiled with -std=c99
@@ -350,7 +356,7 @@ AC_HEADER_SYS_WAIT
  # Solaris stuff
  AC_SEARCH_LIBS([inet_ntop],[nsl])
  AC_SEARCH_LIBS([recv],[socket])
- AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__")
+ AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__", [[#include <sys/socket.h>]])
 
 # Checks for library functions.
 AC_FUNC_MEMCMP
@@ -415,7 +421,6 @@ AM_GLIB_GNU_GETTEXT
 avahilocaledir='${prefix}/${DATADIRNAME}/locale'
 AC_SUBST(avahilocaledir)
 
-
 # Check for pkg-config manually first, as if its not installed the
 # PKG_PROG_PKG_CONFIG macro won't be defined.
 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
@@ -464,6 +469,11 @@ if test "x$HAVE_GOBJECT" = "xyes" ; then
 fi
 AM_CONDITIONAL(HAVE_GOBJECT, test "x$HAVE_GOBJECT" = "xyes")
 
+#
+# Introspection support.
+#
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+
 #
 # Check for Qt 3
 #
@@ -515,10 +525,10 @@ fi
 AM_CONDITIONAL(HAVE_QT4, test "x$HAVE_QT4" = "xyes")
 
 #
-# Check for GTK+
+# Check for GTK+ 2.0
 #
 AC_ARG_ENABLE(gtk,
-        AS_HELP_STRING([--disable-gtk],[Disable use of GTK+]),
+        AS_HELP_STRING([--disable-gtk],[Disable use of GTK+ 2]),
         [case "${enableval}" in
                 yes) HAVE_GTK=yes ;;
                 no)  HAVE_GTK=no ;;
@@ -528,17 +538,34 @@ AC_ARG_ENABLE(gtk,
 
 if test "x$HAVE_GTK" = "xyes" ; then
         # Check for GTK 2.0
-        PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ])
+        PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.14.0 ])
         AC_SUBST(GTK20_CFLAGS)
         AC_SUBST(GTK20_LIBS)
-
-        # Check for GLADE 2.0
-        PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ])
-        AC_SUBST(GLADE20_CFLAGS)
-        AC_SUBST(GLADE20_LIBS)
 fi
 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
 
+#
+# Check for GTK+ 3.0
+#
+AC_ARG_ENABLE(gtk3,
+        AS_HELP_STRING([--disable-gtk3],[Disable use of GTK+ 3]),
+        [case "${enableval}" in
+                yes) HAVE_GTK3=yes ;;
+                no)  HAVE_GTK3=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk3) ;;
+        esac],
+        [HAVE_GTK3=yes])
+
+if test "x$HAVE_GTK3" = "xyes" ; then
+        # Check for GTK 3.0
+        PKG_CHECK_MODULES(GTK30, [ gtk+-3.0 ])
+        AC_SUBST(GTK30_CFLAGS)
+        AC_SUBST(GTK30_LIBS)
+fi
+AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
+
+AM_CONDITIONAL(HAVE_GTK2OR3, test "x$HAVE_GTK3" = "xyes" -o "x$HAVE_GTK2" = "xyes" )
+
 #
 # D-Bus
 #
@@ -1046,6 +1073,15 @@ AC_ARG_ENABLE(compat-howl,
 
 AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
 
+#
+# systemd
+#
+AC_ARG_WITH([systemdsystemunitdir],
+        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+        [],
+        [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
 
 # ==========================================================================
 AC_CONFIG_FILES([
@@ -1106,7 +1142,9 @@ echo "
     CFLAGS:                                    ${CFLAGS}
     Enable GLIB:                               ${HAVE_GLIB}
     Enable GLIB GObject:                       ${HAVE_GOBJECT}
-    Enable GTK:                                ${HAVE_GTK}
+    Enable GObject Introspection:              ${found_introspection}
+    Enable GTK 2.0:                            ${HAVE_GTK}
+    Enable GTK 3.0:                            ${HAVE_GTK3}
     Enable D-Bus:                              ${HAVE_DBUS}
     With XML:                                  ${with_xml}
     Enable GDBM:                               ${HAVE_GDBM}
@@ -1128,6 +1166,7 @@ echo "
     Enable chroot():                           ${enable_chroot}
     Enable Linux inotify:                      ${have_inotify}
     Enable stack-smashing protection:          ${enable_ssp}
+    systemd unit directory:                    ${with_systemdsystemunitdir}
 "
 
 BUILD_DAEMON="no   (You need libdaemon and expat/bsdxml!)"
@@ -1158,8 +1197,13 @@ if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
    ENABLE_AUTOIPD="no   (You need libdaemon!)"
 fi
 
+HAVE_GTK2OR3=no
+if test "x$HAVE_GTK" = "xyes" -o "x$HAVE_GTK3" = "xyes" ; then
+   HAVE_GTK2OR3=yes
+fi
+
 BUILD_UI="no"
-if test "x$HAVE_GTK" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
+if test "x$HAVE_GTK2OR3" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
    BUILD_UI="yes"
 fi
 
@@ -1177,7 +1221,7 @@ echo "\
     Building avahi-python:              ${BUILD_PYTHON}
     Building libavahi-glib:             ${HAVE_GLIB}
     Building libavahi-gobject:          ${BUILD_GOBJECT}
-    Building avahi-discover-standalone: ${HAVE_GTK}
+    Building avahi-discover-standalone: ${HAVE_GTK2OR3}
     Building libavahi-qt3:              ${HAVE_QT3}
     Building libavahi-qt4:              ${HAVE_QT4}
     Building avahi-sharp:               ${HAVE_MONO}
index c29dd56ec958c36167006fec51580838d0102186..7c0844604ae1c4e37286c17543ea43732cd63557 100644 (file)
@@ -1,6 +1,5 @@
 -*-text-*-
 
-
 A terse (and incomplete) list of API changes between 0.5.2 and 0.6:
 
  * Most browsing and registration functions and their callbacks gained
@@ -73,5 +72,3 @@ A terse (and incomplete) list of API changes between 0.5.2 and 0.6:
 
  * There's now a client side AvahiRecordBrowser, and 
    avahi_entry_group_add_record().
-
-$Id$
index 050c988fa510fa86d7769c9630513f710b86a72a..01b01f2d32c65e16e513ffbd5230509675f7655e 100644 (file)
@@ -14,5 +14,3 @@ ABI/API compatibility should:
            $(includedir)/dns_sd.h
 
 -- Lennart
-
-$Id$
index 99e16dad9c52f4912a1ee80c543c854300e2937b..7a57aaa207450e4379484ccd182015567c3c3c4c 100644 (file)
@@ -1,5 +1,3 @@
-$Id$
-
 * NOTE *
 This file used to contain an overview of the DBUS API for Avahi, however
 since it was no longer up to date you should now read the XML-formatted DBUS
index eec7eb7eef884f5d80ac3203f02804966a636610..94a8366ab8f03d124be31023bc52b2a9150fe11e 100644 (file)
@@ -1,19 +1,14 @@
 Please comply with the following rules when hacking on Avahi:
 
- * When you add a new textual file to the repository please enable SVN
-   keyword expansion for it:
-       
-       svn ps svn:keywords Id foo.c
+ * Before commiting check with "git st" that all built files are ignored
+   by git. To change the list of ignored files use
 
- * Before commiting check with "svn st" that all built files are ignored
-   by svn. To change the list of ignored files         use 
-   
-       svn pe svn:ignore .
+       $VISUAL .gitignore
 
    This is similar to the ".cvsignore" file in CVS times.
 
  * Don't forget to add the autoconf config.h inclusion to all C source files:
-   
+
    #ifdef HAVE_CONFIG_H
    #include <config.h>
    #endif
@@ -42,8 +37,6 @@ Please comply with the following rules when hacking on Avahi:
    For Makefile.am, python and shell code:
 
 <snip>
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -65,8 +58,6 @@ Please comply with the following rules when hacking on Avahi:
    For C source code:
 
 <snip>
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -86,6 +77,3 @@ Please comply with the following rules when hacking on Avahi:
   USA.
 ***/
 </snip>
-
-
-$Id$
index 8feac51a5946303b245ad58d7c761067f96eb5b0..419ac3e69858be9d9021168f3580c8597a5fe23d 100644 (file)
@@ -51,5 +51,3 @@ To start the two daemons at boot time on Debian based distributions:
 
 If you plan to use avahi-autoipd you have to create the user/group
 "avahi-autoipd" much the same way as "avahi".
-
-$Id$
index 5c7db9e511415b541b2b981da3089e149ad3b658..7c452af9fe7139f1c1a989b8ae9fc6f4f6a64824 100644 (file)
@@ -6,5 +6,3 @@ situations. Therefore we recommend the usage of memory allocators that
 abort() in case of OOM. The default allocator used by Avahi does this.
 
 Eventually we will improve Avahi to deal with these things better.
-
-$Id$
index 8adc667590cff7bf05e20c45b7f3527437b6cf92..3cf1cbb74d576fccb4f70472bef0c50a7b81c97c 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -189,7 +189,7 @@ from the last release
  * Fix potential endless loop in dns label unpacking code (Closes: #84)
  * Fix bogus assertion in client-publish-service.c example
  * Mild fix to some doxygen docs for avahi-common/address.h
- * Fix passing in custom priviledged group (previously ignored setting)
+ * Fix passing in custom privileged group (previously ignored setting)
    (Closes: #85)
 
 This release is backwards compatible with Avahi 0.6.x with x < 16.
@@ -219,7 +219,7 @@ Changes:
     Windows under the name APIPA. While it is not the first implemenatation of
     this technology for Free operating systems it is clearly the most powerful
     and hopefully even the most secure. (Because it chroot()s and drops
-    priviliges and suchlike) For more information, especially about packaging
+    privileges and suchlike) For more information, especially about packaging
     this new tool for distributions, please make sure to read:
     http://avahi.org/wiki/AvahiAutoipd
     and of course the man page included in the tarball.  For the rationale for
@@ -744,5 +744,3 @@ contribution to Avahi 0.1.
 
 Cheers,
 The Avahi Team
-
-$Id$
index 75dffafe75f35c0aa2143e62f16ba8aa1c2804de..3c68c70869cc09f61505ca809c96a889b65c07d8 100644 (file)
@@ -12,11 +12,11 @@ int main(int argc, char *argv[]) {
     struct sockaddr_storage sa;
     socklen_t salen;
     uint16_t port;
-    
+
     if ((s = socket(PF_INET6, SOCK_STREAM, 0)) < 0) {
         if (errno == EAFNOSUPPORT)
             s = socket(PF_INET, SOCK_STREAM, 0);
-    
+
         if (s < 0) {
             perror("socket()");
             return 1;
@@ -44,6 +44,6 @@ int main(int argc, char *argv[]) {
     /* ... hic sunt leones ... */
 
     sleep(60);
-    
+
     return 0;
 }
index e6e66f58deecc682326600f073468539a5caaace..dbb7f007dcd39c6d2684f4ea0330843d1fe94b72 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
index de6a970b98a7109c98dc8f30e565df4181dbc561..f7ded2a7eeb9b401533f8fd60fb718bb04f8b525 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -63,9 +61,9 @@ static void resolve_callback(
 
         case AVAHI_RESOLVER_FOUND: {
             char a[AVAHI_ADDRESS_STR_MAX], *t;
-            
+
             fprintf(stderr, "Service '%s' of type '%s' in domain '%s':\n", name, type, domain);
-            
+
             avahi_address_snprint(a, sizeof(a), address);
             t = avahi_string_list_to_string(txt);
             fprintf(stderr,
@@ -85,7 +83,7 @@ static void resolve_callback(
                     !!(flags & AVAHI_LOOKUP_RESULT_WIDE_AREA),
                     !!(flags & AVAHI_LOOKUP_RESULT_MULTICAST),
                     !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
-                
+
             avahi_free(t);
         }
     }
@@ -103,7 +101,7 @@ static void browse_callback(
     const char *domain,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiClient *c = userdata;
     assert(b);
 
@@ -111,7 +109,7 @@ static void browse_callback(
 
     switch (event) {
         case AVAHI_BROWSER_FAILURE:
-            
+
             fprintf(stderr, "(Browser) %s\n", avahi_strerror(avahi_client_errno(avahi_service_browser_get_client(b))));
             avahi_simple_poll_quit(simple_poll);
             return;
@@ -126,7 +124,7 @@ static void browse_callback(
 
             if (!(avahi_service_resolver_new(c, interface, protocol, name, type, domain, AVAHI_PROTO_UNSPEC, 0, resolve_callback, c)))
                 fprintf(stderr, "Failed to resolve service '%s': %s\n", name, avahi_strerror(avahi_client_errno(c)));
-            
+
             break;
 
         case AVAHI_BROWSER_REMOVE:
@@ -171,7 +169,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
         fprintf(stderr, "Failed to create client: %s\n", avahi_strerror(error));
         goto fail;
     }
-    
+
     /* Create the service browser */
     if (!(sb = avahi_service_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_http._tcp", NULL, 0, browse_callback, client))) {
         fprintf(stderr, "Failed to create service browser: %s\n", avahi_strerror(avahi_client_errno(client)));
@@ -180,15 +178,15 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
 
     /* Run the main loop */
     avahi_simple_poll_loop(simple_poll);
-    
+
     ret = 0;
-    
+
 fail:
-    
+
     /* Cleanup things */
     if (sb)
         avahi_service_browser_free(sb);
-    
+
     if (client)
         avahi_client_free(client);
 
index 73ee01b51075cc922f1563f6bb2c120c6e75f2c8..facc965e0501296ea9bf22024188ebaf8857980a 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 53b18eeebb7936191e6561c7ebb6b6a611b6a9ad..e062e3e097737f1ed2173de06ab6419839c0fdc1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* PLEASE NOTE *
  * This file demonstrates how to use Avahi's core API, this is
  * the embeddable mDNS stack for embedded applications.
@@ -7,23 +5,23 @@
  * End user applications should *not* use this API and should use
  * the D-Bus or C APIs, please see
  * client-browse-services.c and glib-integration.c
- * 
+ *
  * I repeat, you probably do *not* want to use this example.
  */
 
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -62,7 +60,7 @@ static void resolve_callback(
     AvahiStringList *txt,
     AvahiLookupResultFlags flags,
     AVAHI_GCC_UNUSED void* userdata) {
-    
+
     assert(r);
 
     /* Called whenever a service has been resolved successfully or timed out */
@@ -74,9 +72,9 @@ static void resolve_callback(
 
         case AVAHI_RESOLVER_FOUND: {
             char a[AVAHI_ADDRESS_STR_MAX], *t;
-            
+
             fprintf(stderr, "(Resolver) Service '%s' of type '%s' in domain '%s':\n", name, type, domain);
-            
+
             avahi_address_snprint(a, sizeof(a), address);
             t = avahi_string_list_to_string(txt);
             fprintf(stderr,
@@ -97,7 +95,7 @@ static void resolve_callback(
             avahi_free(t);
         }
     }
-    
+
     avahi_s_service_resolver_free(r);
 }
 
@@ -111,7 +109,7 @@ static void browse_callback(
     const char *domain,
     AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiServer *s = userdata;
     assert(b);
 
@@ -120,7 +118,7 @@ static void browse_callback(
     switch (event) {
 
         case AVAHI_BROWSER_FAILURE:
-            
+
             fprintf(stderr, "(Browser) %s\n", avahi_strerror(avahi_server_errno(server)));
             avahi_simple_poll_quit(simple_poll);
             return;
@@ -132,10 +130,10 @@ static void browse_callback(
                function we free it. If the server is terminated before
                the callback function is called the server will free
                the resolver for us. */
-            
+
             if (!(avahi_s_service_resolver_new(s, interface, protocol, name, type, domain, AVAHI_PROTO_UNSPEC, 0, resolve_callback, s)))
                 fprintf(stderr, "Failed to resolve service '%s': %s\n", name, avahi_strerror(avahi_server_errno(s)));
-            
+
             break;
 
         case AVAHI_BROWSER_REMOVE:
@@ -175,7 +173,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
     avahi_address_parse("192.168.50.1", AVAHI_PROTO_UNSPEC, &config.wide_area_servers[0]);
     config.n_wide_area_servers = 1;
     config.enable_wide_area = 1;
-    
+
     /* Allocate a new server */
     server = avahi_server_new(avahi_simple_poll_get(simple_poll), &config, NULL, NULL, &error);
 
@@ -187,24 +185,24 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
         fprintf(stderr, "Failed to create server: %s\n", avahi_strerror(error));
         goto fail;
     }
-    
+
     /* Create the service browser */
     if (!(sb = avahi_s_service_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_http._tcp", NULL, 0, browse_callback, server))) {
         fprintf(stderr, "Failed to create service browser: %s\n", avahi_strerror(avahi_server_errno(server)));
         goto fail;
     }
-    
+
     /* Run the main loop */
     avahi_simple_poll_loop(simple_poll);
-    
+
     ret = 0;
-    
+
 fail:
-    
+
     /* Cleanup things */
     if (sb)
         avahi_s_service_browser_free(sb);
-    
+
     if (server)
         avahi_server_free(server);
 
index 6370383488462bdee0f1d848ccaced33cde72e02..a78a46447895b687b9a021c6dd5e634b3c968a91 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -48,7 +46,7 @@ static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntry
     /* Called whenever the entry group state changes */
 
     switch (state) {
-        
+
         case AVAHI_ENTRY_GROUP_ESTABLISHED:
 
             /* The entry group has been established successfully */
@@ -57,23 +55,23 @@ static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntry
 
         case AVAHI_ENTRY_GROUP_COLLISION: {
             char *n;
-            
+
             /* A service name collision happened. Let's pick a new name */
             n = avahi_alternative_service_name(name);
             avahi_free(name);
             name = n;
-            
+
             fprintf(stderr, "Service name collision, renaming service to '%s'\n", name);
-            
+
             /* And recreate the services */
             create_services(s);
             break;
         }
-            
+
         case AVAHI_ENTRY_GROUP_FAILURE :
 
             fprintf(stderr, "Entry group failure: %s\n", avahi_strerror(avahi_server_errno(s)));
-            
+
             /* Some kind of failure happened while we were registering our services */
             avahi_simple_poll_quit(simple_poll);
             break;
@@ -95,7 +93,7 @@ static void create_services(AvahiServer *s) {
             fprintf(stderr, "avahi_entry_group_new() failed: %s\n", avahi_strerror(avahi_server_errno(s)));
             goto fail;
         }
-    
+
     fprintf(stderr, "Adding service '%s'\n", name);
 
     /* Create some random TXT data */
@@ -141,7 +139,7 @@ static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UN
         case AVAHI_SERVER_RUNNING:
             /* The serve has startup successfully and registered its host
              * name on the network, so it's time to create our services */
-            
+
             if (!group)
                 create_services(s);
 
@@ -150,16 +148,16 @@ static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UN
         case AVAHI_SERVER_COLLISION: {
             char *n;
             int r;
-            
+
             /* A host name collision happened. Let's pick a new name for the server */
             n = avahi_alternative_host_name(avahi_server_get_host_name(s));
             fprintf(stderr, "Host name collision, retrying with '%s'\n", n);
             r = avahi_server_set_host_name(s, n);
             avahi_free(n);
-            
+
             if (r < 0) {
                 fprintf(stderr, "Failed to set new host name: %s\n", avahi_strerror(r));
-                
+
                 avahi_simple_poll_quit(simple_poll);
                 return;
             }
@@ -169,7 +167,7 @@ static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UN
             /* Fall through */
 
         case AVAHI_SERVER_REGISTERING:
-            
+
            /* Let's drop our registered services. When the server is back
              * in AVAHI_SERVER_RUNNING state we will register them
              * again with the new host name. */
@@ -179,9 +177,9 @@ static void server_callback(AvahiServer *s, AvahiServerState state, AVAHI_GCC_UN
             break;
 
         case AVAHI_SERVER_FAILURE:
-            
+
             /* Terminate on failure */
-            
+
             fprintf(stderr, "Server failure: %s\n", avahi_strerror(avahi_server_errno(s)));
             avahi_simple_poll_quit(simple_poll);
             break;
@@ -196,7 +194,7 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
     AvahiServer *server = NULL;
     int error;
     int ret = 1;
-    
+
     /* Initialize the pseudo-RNG */
     srand(time(NULL));
 
@@ -205,14 +203,14 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
         fprintf(stderr, "Failed to create simple poll object.\n");
         goto fail;
     }
-    
+
     name = avahi_strdup("MegaPrinter");
 
     /* Let's set the host name for this server. */
     avahi_server_config_init(&config);
     config.host_name = avahi_strdup("gurkiman");
     config.publish_workstation = 0;
-    
+
     /* Allocate a new server */
     server = avahi_server_new(avahi_simple_poll_get(simple_poll), &config, server_callback, NULL, &error);
 
@@ -227,11 +225,11 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
 
     /* Run the main loop */
     avahi_simple_poll_loop(simple_poll);
-    
+
     ret = 0;
-    
+
 fail:
-    
+
     /* Cleanup things */
 
     if (server)
@@ -241,6 +239,6 @@ fail:
         avahi_simple_poll_free(simple_poll);
 
     avahi_free(name);
-    
+
     return ret;
 }
index ab53687693f173d8213f7a3e2c3d97f98aae2f72..d2a2457999b006e2d9936f89125d352a3bf11b84 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -45,7 +43,7 @@ avahi_timeout_event_glib (void *userdata)
     GMainLoop *loop = userdata;
 
     g_message ("GLIB API Timeout reached, quitting main loop!");
-    
+
     /* Quit the application */
     g_main_loop_quit (loop);
 
@@ -121,7 +119,7 @@ main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[])
 
         goto fail;
     }
-   
+
     /* Make a call to get the version string from the daemon */
     version = avahi_client_get_version_string (client);
 
@@ -132,7 +130,7 @@ main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[])
 
         goto fail;
     }
-        
+
     g_message ("Avahi Server Version: %s", version);
 
     /* Start the GLIB Main Loop */
index d5fadda334ecdd04d37a6e7e51487601d18c604a..e5e1928a3308fe9bacb85785b6c1a0bbbd627d6b 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -17,7 +15,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
-SUBDIRS = 
+SUBDIRS =
 
 if TARGET_LFS
 SUBDIRS += lfs
index 22096b4ed16ba289d3997ff84bb9cbbca6b0cdb3..2070975de060c8896c192cf9d66b986b8a85630e 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: Makefile.am 267 2005-08-08 10:19:22Z lennart $
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 1050cb0a7325f2827ae621cdd3927e5951fe6e87..6ae252db0396a5ed7288499d5d303b35d5bc8cd8 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 667a0f62b3031b66468a5596ba021e3e16883cef..c57260e17eb2ed18ba80b2f54cbca657fa95da38 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 3c5cecc2c22592dda37e285378f7f61cbccf1c10..d01e5a46887699fd1378f06e5e4f371304a413dd 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -33,8 +31,6 @@ CLEANFILES = \
 
 org.freedesktop.avahi-daemon.plist: org.freedesktop.avahi-daemon.plist.in
        sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
-       chmod +x $@
 
 org.freedesktop.avahi-dnsconfd.plist: org.freedesktop.avahi-dnsconfd.plist.in
        sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
-       chmod +x $@
index 7991ea60ccf6f090ea23feb3f5becc501c945892..314983d916dcadbb52d9a15ce26891b03eb16395 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 30a2c2f2bba0caa0951fa8463b5185c6f04b111f..97fa1579398a8a285340412cbfefbcdce81f9537 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/sh
 
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index ac3480451faf435f73d4b79c05d65a809f2d43af..67c28735bc6fe819a4822a1bbb868091cee41506 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/sh
 
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index e18f0f6bfd54681e5bc2a73b123e752560727937..2e2f0173a53c7067501cb3669903e0dba63c1be7 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -26,9 +24,15 @@ initd_SCRIPTS = avahi-daemon avahi-dnsconfd
 CLEANFILES = avahi-daemon avahi-dnsconfd
 
 avahi-daemon: avahi-daemon.in
-       sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+       $(AM_V_GEN)sed \
+               -e 's,@sbindir\@,$(sbindir),g' \
+               -e 's,@localstatedir\@,$(localstatedir),g' \
+               $< > $@ && \
        chmod +x $@
 
 avahi-dnsconfd: avahi-dnsconfd.in
-       sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+       $(AM_V_GEN)sed \
+               -e 's,@sbindir\@,$(sbindir),g' \
+               -e 's,@localstatedir\@,$(localstatedir),g' \
+               $< > $@ && \
        chmod +x $@
index c5b32307d2f4e85c55e7761a8e7b1b40a5e975aa..b1b6124d55cec0c8163e041491108551962bcc1f 100644 (file)
@@ -1,16 +1,17 @@
-#! /bin/sh
+#!/bin/sh
 #
-# avahi-daemon:       Starts the Avahi Daemon
+# avahi-daemon: Starts the Avahi Daemon
 #
-# chkconfig: 345 24 02
+# chkconfig:   345 24 02
 # description: This is a daemon which runs on client machines to perform \
 #              Zeroconf service discovery on a network. avahi-daemon must be \
 #              running on systems  that use Avahi for service discovery. \
 #              Avahi-daemon should not be running otherwise.
 # processname: avahi-daemon
-# config:
+# pidfile:     @localstatedir@/run/avahi-daemon/pid
 
 AVAHI_BIN=@sbindir@/avahi-daemon
+AVAHI_OPTS="-D"
 
 if [ "$1" = 'status' ]; then
     test -x $AVAHI_BIN || exit 4
@@ -18,13 +19,13 @@ else
     test -x $AVAHI_BIN || exit 5
 fi
 
-OTHER_AVAHI_OPTS=""
-
 # Source function library.
 . /etc/init.d/functions
 . /etc/sysconfig/network
 
-LOCKFILE=/var/lock/subsys/avahi-daemon
+LOCKFILE=@localstatedir@/lock/subsys/avahi-daemon
+PIDFILE=@localstatedir@/run/avahi-daemon/pid
+RETVAL=0
 
 base=${0##*/}
 
@@ -36,33 +37,26 @@ start() {
        if [ -s /etc/localtime ]; then
            cp -fp /etc/localtime /etc/avahi/etc >/dev/null 2>&1
        fi;
-        $AVAHI_BIN -D
-       RETVAL=$?
-       if [ $RETVAL = 0 ]; then
-               touch $LOCKFILE
-               success $"$base startup"
-       else
-               failure $"$base startup"
-       fi
-       echo
+        daemon --pidfile=${PIDFILE} $AVAHI_BIN $AVAHI_OPTS
+        RETVAL=$?
+        echo
+        [ $RETVAL -eq 0 ] && touch ${LOCKFILE}
        return $RETVAL
 }
 
 stop() {
         echo -n $"Shutting down Avahi daemon: "
-        $AVAHI_BIN -k
-       RETVAL=$?
-       [ $RETVAL = 0 ] && success $"$base shutdown" || failure $"$base shutdown"
-       rm -f $LOCKFILE
-       echo
+        killproc -p ${PIDFILE} $AVAHI_BIN
+        RETVAL=$?
+        [ $RETVAL -eq 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
+        echo
        return $RETVAL
 }
 
 reload() {
         echo -n $"Reloading Avahi daemon... "
-        $AVAHI_BIN -r
+        killproc -p ${PIDFILE} $AVAHI_BIN -HUP
        RETVAL=$?
-       [ $RETVAL = 0 ] && success $"$base reload" || failure $"$base reload"
        echo
        return $RETVAL
 }
@@ -83,9 +77,8 @@ case "$1" in
        stop
        ;;
   status)
-        $AVAHI_BIN -c
-       RETVAL=$?
-       [ $RETVAL = 0 ] && echo $"Avahi daemon is running" || echo $"Avahi daemon is not running"
+       status -p ${PIDFILE} $AVAHI_BIN
+        RETVAL=$?
        ;;
   restart)
        restart
index de49d7f8a70e7f50489e1cbed347159fe06359a3..df8b964a9927dac7b66fa346218f85face0eefef 100644 (file)
@@ -1,16 +1,17 @@
-#! /bin/sh
+#!/bin/sh
 #
-# avahi-dnsconfd:       Starts the Avahi dns configuration daemon
+# avahi-dnsconfd: Starts the Avahi dns configuration daemon
 #
-# chkconfig: - 96 02
+# chkconfig:   - 96 02
 # description: avahi-dnsconfd connects to a running avahi-daemon and runs  the  script \
-#       /etc/avahi/dnsconf.action for each unicast DNS server that is announced \
-#       on the local LAN. This is useful for configuring unicast DNS servers in \
-#       a DHCP-like fashion with mDNS.
+#              /etc/avahi/dnsconf.action for each unicast DNS server that is announced \
+#              on the local LAN. This is useful for configuring unicast DNS servers in \
+#              a DHCP-like fashion with mDNS.
 # processname: avahi-dnsconfd
-# config:
+# pidfile:     @localstatedir@/run/avahi-dnsconfd.pid
 
 AVAHI_BIN=@sbindir@/avahi-dnsconfd
+AVAHI_OPTS="-D"
 
 if [ "$1" = 'status' ]; then
     test -x $AVAHI_BIN || exit 4
@@ -18,13 +19,13 @@ else
     test -x $AVAHI_BIN || exit 5
 fi
 
-OTHER_AVAHI_OPTS=""
-
 # Source function library.
 . /etc/init.d/functions
 . /etc/sysconfig/network
 
-LOCKFILE=/var/lock/subsys/avahi-dnsconfd
+LOCKFILE=@localstatedir@/lock/subsys/avahi-dnsconfd
+PIDFILE=@localstatedir@/run/avahi-dnsconfd.pid
+RETVAL=0
 
 base=${0##*/}
 
@@ -33,35 +34,28 @@ start() {
     [ ${NETWORKING} = "no" ] && exit 1
 
        echo -n $"Starting Avahi DNS daemon... "
-        $AVAHI_BIN -D
-       RETVAL=$?
-       if [ $RETVAL = 0 ]; then
-               touch $LOCKFILE
-               success $"$base startup"
-       else
-               failure $"$base startup"
-       fi
-       echo
-       return $RETVAL
+        daemon --pidfile=${PIDFILE} $AVAHI_BIN $AVAHI_OPTS
+        RETVAL=$?
+        echo
+        [ $RETVAL -eq 0 ] && touch ${LOCKFILE}
+        return $RETVAL
 }
 
 stop() {
         echo -n $"Shutting down Avahi DNS daemon: "
-        $AVAHI_BIN -k
-       RETVAL=$?
-       [ $RETVAL = 0 ] && success $"$base shutdown" || failure $"$base shutdown"
-       rm -f $LOCKFILE
-       echo
-       return $RETVAL
+        killproc -p ${PIDFILE} $AVAHI_BIN
+        RETVAL=$?
+        [ $RETVAL -eq 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
+        echo
+        return $RETVAL
 }
 
 reload() {
         echo -n $"Reloading Avahi DNS daemon... "
-        $AVAHI_BIN -r
-       RETVAL=$?
-       [ $RETVAL = 0 ] && success $"$base startup" || failure $"$base startup"
-       echo
-       return $RETVAL
+        killproc -p ${PIDFILE} $AVAHI_BIN -HUP
+        RETVAL=$?
+        echo
+        return $RETVAL
 }
 
 restart() {
@@ -80,9 +74,8 @@ case "$1" in
        stop
        ;;
   status)
-        $AVAHI_BIN -c
+        status -p ${PIDFILE} $AVAHI_BIN
         RETVAL=$?
-        [ $RETVAL = 0 ] && echo $"Avahi DNS daemon is running" || echo $"Avahi DNS daemon is not running"
        ;;
   restart)
        restart
index 0ee75d5bb4399bf50aeac1d1eb3221d946af93dd..c32830eb41b8fd740c97e05e0206d8c011565145 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 398e34571b0eb396612482bc020036c98e6e59e8..0d20ca6f79fbd41f090524ffed828f46c19dbb51 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -36,7 +34,7 @@ CLEANFILES = \
        avahi-dnsconfd
 
 avahi-daemon: avahi-daemon.in
-       
+
        sed -e 's,@sbindir\@,$(sbindir),g; $(NO_DBUS_DEPENDENCY)' $< > $@
        chmod +x $@
 
index 25edb2ab51803dfd62f475558b5e2881918042ce..02eefe68633c6cfe9245fdd840fbe85248449958 100644 (file)
@@ -1,5 +1,4 @@
 #!/sbin/runscript
-# $Id$
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
index 18efc0551d3d11405c21c2b761b1bc833ed4ff0b..376067eef8371cf4af80ac038133a40b0f0e87bc 100644 (file)
@@ -1,5 +1,4 @@
 #!/sbin/runscript
-# $Id$
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
index d5e33f8c1be8d1522fd0395d265078c7c0c36af0..e8386e8a56b8bb1e562bbf62b8dd1618b462705b 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 10fd4cfa8869804c699b332a514b4811b819bdba..480426be6d7a2345c1e8f5824d165eea92cb420f 100644 (file)
@@ -1,5 +1,3 @@
-# $Id: Makefile.am 838 2005-10-22 21:23:02Z lennart $
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index f285d3be39ff15405e8f9530d57cb71d9f9ef240..d81b9a246dc36f8a15da1b21fc256ab6a7f43d07 100644 (file)
@@ -17,7 +17,7 @@ test -x $AVAHI_BIN || exit 5
 . /etc/sysconfig/network
 
 # Check that networking is configured.
-[ ${NETWORKING} = "no" ] && exit 0
+[ "${NETWORKING}" = "no" ] && exit 0
 
 start() {
        echo -n $"Starting Avahi daemon: "
index 3175a15eac33ba4a6e6d1b72101af80f0ae444a6..d41538721317c64b48205772059e9abd7c2f81b1 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index acd377d36fb4c4ce2ce5bc44fc2ca0b959fc0a74..76bf2f2eb1f4a987010ea827f45568ace30bf29b 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 4da14fa2e735916f2cbf07709a31fa9d140ef6b9..ea1554d2c6d245f5934cf4ceec5e8238c9b9bf88 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index e18f0f6bfd54681e5bc2a73b123e752560727937..5624bdc67f49f19e936d72cb2567fcc920eef4d7 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index e1fd20101dc7df690bbb0125f368aef5b9258c0c..851006cf722480fba03398ea8d532f424ff74ce2 100644 (file)
@@ -37,7 +37,7 @@ case "$1" in
                ;;
        status)
                echo -n "Checking for Avahi daemon: "
-               $AVAHI_BIN -c
+               $AVAHI_BIN -c || _rc_status=3
                rc_status -v
                ;;
        *)
index 7d08828abf26982670cb9ca65221ca97f49bf0c8..d38267c02a03c8f3f754f474ea61666720401ff9 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -83,125 +81,24 @@ man_MANS += \
 endif
 endif
 
-avahi-browse.1.xml: avahi-browse.1.xml.in Makefile
-       sed -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-publish.1.xml: avahi-publish.1.xml.in Makefile
-       sed     -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-resolve.1.xml: avahi-resolve.1.xml.in Makefile
-       sed     -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-set-host-name.1.xml: avahi-set-host-name.1.xml.in Makefile
-       sed     -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-daemon.8.xml: avahi-daemon.8.xml.in Makefile
-       sed -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@servicedir\@,$(servicedir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-discover.1.xml: avahi-discover.1.xml.in Makefile
-       sed     -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-bookmarks.1.xml: avahi-bookmarks.1.xml.in Makefile
-       sed     -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-dnsconfd.8.xml: avahi-dnsconfd.8.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-daemon.conf.5.xml: avahi-daemon.conf.5.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-dnsconfd.action.8.xml: avahi-dnsconfd.action.8.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi.service.5.xml: avahi.service.5.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
+%.xml: %.xml.in Makefile
+       $(AM_V_GEN) sed -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
                -e 's,@servicedir\@,$(servicedir),g' \
                -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi.hosts.5.xml: avahi.hosts.5.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-autoipd.action.8.xml: avahi-autoipd.action.8.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-avahi-autoipd.8.xml: avahi-autoipd.8.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-
-bssh.1.xml: bssh.1.xml.in Makefile
-       sed     -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-        -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
+               -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
 
 if USE_XMLTOMAN
 
 CLEANFILES += $(man_MANS)
 
-avahi-browse.1: avahi-browse.1.xml Makefile
-       xmltoman $< > $@
-
-avahi-publish.1: avahi-publish.1.xml Makefile
-       xmltoman $< > $@
-
-avahi-resolve.1: avahi-resolve.1.xml Makefile
-       xmltoman $< > $@
-
-avahi-set-host-name.1: avahi-set-host-name.1.xml Makefile
-       xmltoman $< > $@
-
-avahi-daemon.8: avahi-daemon.8.xml Makefile
-       xmltoman $< > $@
-
-avahi-discover.1: avahi-discover.1.xml Makefile
-       xmltoman $< > $@
-
-avahi-bookmarks.1: avahi-bookmarks.1.xml Makefile
-       xmltoman $< > $@
-
-avahi-dnsconfd.8: avahi-dnsconfd.8.xml Makefile
-       xmltoman $< > $@
-
-avahi-daemon.conf.5: avahi-daemon.conf.5.xml Makefile
-       xmltoman $< > $@
-
-avahi-dnsconfd.action.8: avahi-dnsconfd.action.8.xml Makefile
-       xmltoman $< > $@
-
-avahi.service.5: avahi.service.5.xml Makefile
-       xmltoman $< > $@
-
-avahi.hosts.5: avahi.hosts.5.xml Makefile
-       xmltoman $< > $@
-
-avahi-autoipd.action.8: avahi-autoipd.action.8.xml Makefile
-       xmltoman $< > $@
+%.1: %.1.xml Makefile
+       $(AM_V_GEN)xmltoman $< > $@
 
-avahi-autoipd.8: avahi-autoipd.8.xml Makefile
-       xmltoman $< > $@
+%.5: %.5.xml Makefile
+       $(AM_V_GEN)xmltoman $< > $@
 
-bssh.1: bssh.1.xml Makefile
-       xmltoman $< > $@
+%.8: %.8.xml Makefile
+       $(AM_V_GEN)xmltoman $< > $@
 
 xmllint: $(noinst_DATA)
        for f in $(noinst_DATA) ; do \
index 2e7bb67cce5a6ad89c200838efe9fc153f9a9dde..477beb849a823ff2b8d94b100518533eb5f22184 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -31,7 +29,7 @@
       <cmd>avahi-autoipd <opt>--refresh</opt> <arg>interface</arg></cmd>
       <cmd>avahi-autoipd <opt>--check</opt> <arg>interface</arg></cmd>
        </synopsis>
-       
+
     <description>
       <p>avahi-autoipd implements IPv4LL, "Dynamic Configuration of
       IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for
@@ -56,7 +54,7 @@
 
       <p>See http://developer.apple.com/qa/qa2004/qa1357.html for more information.</p>
        </description>
-       
+
        <options>
 
          <option>
@@ -91,7 +89,7 @@
 
       <option>
         <p><opt>--no-drop-root</opt></p>
-        <optdesc><p>Don't drop root priviliges after startup. We recommend not to use this option.</p></optdesc>
+        <optdesc><p>Don't drop root privileges after startup. We recommend not to use this option.</p></optdesc>
       </option>
 
       <option>
         <p><opt>-w | --wait</opt></p>
         <optdesc><p>Wait until a IP address has been sucessfully acquired before detaching. Only valid in combination with <opt>--daemonize</opt>.</p></optdesc>
       </option>
-      
+
       <option>
         <p><opt>--force-bind</opt></p>
         <optdesc><p>Acquire an IPv4LL address, even if a routable address has been configured on the interface.</p></optdesc>
        </options>
 
     <section name="Files">
-      
+
       <p><file>@pkgsysconfdir@/avahi-autoipd.action</file>: the script to run when an IP address as been acquired or is lost.</p>
-    
+
     </section>
 
     <section name="Signals">
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="autoipd.action" section="8"/>, <manref name="dhclient" section="8"/>
 
       <p>http://avahi.org/wiki/AvahiAutoipd documents how avahi-autoipd is best packaged and integrated into distributions.</p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 1eb6750a5389bbe51661739f3f81d62f768096ce..9dea446b7687df445b38d00d5ded05736ad8f5e2 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id: avahi-autoipd.action.8.xml.in 263 2005-08-07 19:53:39Z lennart $ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -28,7 +26,7 @@
        <synopsis>
       <cmd>@pkgsysconfdir@/avahi-autoipd.action</cmd>
        </synopsis>
-       
+
     <description>
       <p><file>avahi-autoipd.action</file> is the action script that
       is called whenever an IP address has been acquired by
@@ -36,7 +34,7 @@
       script should add or remove the specified address from the
       specified network interface.</p>
        </description>
-       
+
        <section name="Parameters">
 
       <option>
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-autoipd" section="8"/>, <manref name="dhclient-script" section="8"/>, <manref name="ip" section="8"/>, <manref name="ifconfig" section="8"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 9bebd76483865e1c6938278ef3d0e702fd24771f..d863e2bb4a9a042affa6db5f294d186a9adba10c 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -28,7 +26,7 @@
        <synopsis>
       <cmd>avahi-bookmarks</cmd>
        </synopsis>
-       
+
     <description>
       <p>A web service for listing HTTP services that are announced
       via mDNS/DNS-SD using the Avahi daemon. avahi-bookmarks opens a
@@ -36,9 +34,9 @@
       returning a dynamic web site containing links to all services of
       type _http._tcp on the LAN. Point your browser to
       http://localhost:8080/ to make use of avahi-bookmarks.</p>
-      
+
        </description>
-       
+
     <options>
       <option>
         <p><opt>-p | --port=</opt> <arg>PORT</arg></p>
         locally. This option conflicts with -H.</p></optdesc>
       </option>
 
-    
+
       <option>
         <p><opt>-d | --domain</opt>=<arg>DOMAIN</arg></p>
         <optdesc><p>The domain to browse for services in.</p></optdesc>
-      </option> 
+      </option>
 
          <option>
                <p><opt>-h | --help</opt></p>
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-browse" section="1"/>, <manref name="avahi-daemon" section="8"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 90b2d35f059b0d41b7d18c3dd4f66b51cc5e76f3..b13d4fc3d2f4a16981deeeb426cdc9e1304ce722 100644 (file)
@@ -2,8 +2,6 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
 <!--
   This file is part of avahi.
 
@@ -93,7 +91,7 @@
 
          <option>
                 <p><opt>-p | --parsable</opt></p>
-               <optdesc><p>Make output easily parsable for usage in scripts. If enabled fields are seperated by semicolons (;), service names are escaped. It is recommended to combine this with <opt>--no-db-lookup</opt>.</p></optdesc>
+               <optdesc><p>Make output easily parsable for usage in scripts. If enabled fields are separated by semicolons (;), service names are escaped. It is recommended to combine this with <opt>--no-db-lookup</opt>.</p></optdesc>
          </option>
 
          <option>
index b45e8c189e3491a100ac3a57bc167ce0a594c4a2..e93fc734f90a4e026d03b526b9effa5febcdf303 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -31,7 +29,7 @@
       <cmd>avahi-daemon <opt>--reload</opt></cmd>
       <cmd>avahi-daemon <opt>--check</opt></cmd>
        </synopsis>
-       
+
     <description>
       <p>The Avahi mDNS/DNS-SD daemon implements Apple's Zeroconf
       architecture (also known as "Rendezvous" or "Bonjour"). The daemon
@@ -44,7 +42,7 @@
       (a libc NSS plugin, providing name resolution via mDNS). Finally
       there is the D-Bus interface which provides a rich object
       oriented interface to D-Bus enabled applications.</p>
-      
+
       <p>Upon startup avahi-daemon interprets its configuration file
       <file>@pkgsysconfdir@/avahi-daemon.conf</file> and reads XML
       fragments from <file>@servicedir@/*.service</file> which may
@@ -53,7 +51,7 @@
       <file>avahi-daemon.conf</file> the file
       <file>/etc/resolv.conf</file> will be read, too.</p>
        </description>
-       
+
        <options>
 
          <option>
@@ -83,7 +81,7 @@
 
       <option>
         <p><opt>--no-drop-root</opt></p>
-        <optdesc><p>Don't drop root priviliges after startup and don't require daemon to be started as root. We recommend not to use this option.</p></optdesc>
+        <optdesc><p>Don't drop root privileges after startup and don't require daemon to be started as root. We recommend not to use this option.</p></optdesc>
       </option>
 
       <option>
        </options>
 
     <section name="Files">
-      
+
       <p><file>@pkgsysconfdir@/avahi-daemon.conf</file>: the default configuration file for avahi-daemon, <manref name="avahi-daemon.conf" section="5"/> for more information.</p>
 
       <p><file>@pkgsysconfdir@/hosts</file>: additional static hostname mappings to publish in mDNS, see <manref name="avahi.hosts" section="5"/> for more information.</p>
 
       <p><file>@servicedir@/*.service</file>: static service definitions, see <manref name="avahi.service" section="5"/> for more information.</p>
-    
+
     </section>
 
     <section name="Signals">
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-daemon.conf" section="5"/>, <manref name="avahi.hosts" section="5"/>, <manref name="avahi.service" section="5"/>, <manref name="avahi-dnsconfd" section="8"/>, <manref name="avahi-set-host-name" section="1"/>
 
       <p>http://avahi.org/wiki/AvahiAndUnicastDotLocal documents the problems when using Avahi in a unicast DNS zone .local.</p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 08992fa6f69db4ff4545d5d148383307e8a583a3..62f3a9dde6f653552b08748027a5d88990d57d5c 100644 (file)
@@ -2,8 +2,6 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
 <!--
   This file is part of avahi.
 
   USA.
 -->
 
-  <manpage name="avahi-daemon.conf" section="5" desc="avahi-daemon configuration file">
-
-       <synopsis>
-      <cmd>@pkgsysconfdir@/avahi-daemon.conf</cmd>
-       </synopsis>
-
-    <description>
-      <p><file>avahi-daemon.conf</file> is the configuration file for avahi-daemon.</p>
-       </description>
-
-       <section name="Section [Server]">
-
-      <option>
-        <p><opt>host-name=</opt> Set the host name avahi-daemon tries
-        to register on the LAN. If omited defaults to the system host
-        name as set with the sethostname() system call.</p>
-      </option>
-
-      <option>
-        <p><opt>domain-name=</opt> Set the default domain name avahi-daemon
-        tries to register its host name and services on the LAN in. If
-        omitted defaults to ".local".</p>
-      </option>
-
-      <option>
-        <p><opt>browse-domains=</opt> Set a comma seperated list of
-        browsing domains (in addition to the default one and those
-        announced inside the default browsing domain). Please note
-        that the user may specify additional browsing domains on the
-        client side, either by setting $AVAHI_BROWSE_DOMAINS to a list
-        of colon seperated domains or by adding them to the XDG config
-        file <file>~/.config/avahi/browse-domains</file> (seperated by
-        newlines).</p>
-
-      </option>
-
-      <option>
-        <p><opt>use-ipv4=</opt> Takes a boolean value ("yes" or
-        "no"). If set to "no" avahi-daemon will not use IPv4
-        sockets. Default is "yes".</p>
-      </option>
-
-      <option>
-        <p><opt>use-ipv6=</opt> Takes a boolean value ("yes" or
-        "no"). If set to "no" avahi-daemon will not use IPv6
-        sockets. Default is "yes".</p>
-      </option>
-
-      <option>
-        <p><opt>allow-interfaces=</opt> Set a comma seperated list of
-        allowed network interfaces that should be used by the
-        avahi-daemon.  Other interfaces will be ignored. If set to the
-        empty list all local interfaces except loopback and
-        point-to-point will be used.</p>
-      </option>
-
-      <option>
-        <p><opt>deny-interfaces=</opt> Set a comma seperated list of
-        network interfaces that should be ignored by avahi-daemon.
-       Other not specified interfaces will be used, unless
-       <opt>allow-interfaces</opt> is set. This option takes
-       precedence over <opt>deny-interfaces</opt>.</p>
-      </option>
-
-      <option>
-        <p><opt>check-response-ttl=</opt> Takes a boolean value ("yes"
-        or "no"). If set to "yes", an additional security check is
-        activated: incoming IP packets will be ignored unless the IP
-        TTL is 255. Earlier mDNS specifications required this
-        check. Since this feature may be incompatible with newer
-        implementations of mDNS it defaults to "no". On the other hand
-        it provides extra security.</p>
-      </option>
-
-      <option>
-        <p><opt>use-iff-running=</opt> Takes a boolean value ("yes" or
-        "no"). If set to "yes" avahi-daemon monitors the IFF_RUNNING
-        flag bit which is used by some (modern) network drivers to
-        tell user space if a network cable is plugged in (in case of
-        copper ethernet), or the network card is associated with some
-        kind of network (in case of WLAN). If IFF_RUNNING is set
-        avahi-daemon will automatically announce its services on that
-        network. Unfortunately far too many network drivers do not
-        support this flag or support it in a broken way. Therefore
-        this option defaults to "no".</p>
-      </option>
-
-      <option>
-        <p><opt>enable-dbus=</opt> Takes either "yes", "no" or
-        "warn". If set to "yes" avahi-daemon connects to D-Bus,
-        offering an object oriented client API. It is only available
-        if Avahi has been compiled with <opt>--enable-dbus</opt> in
-        which case it defaults to "yes". "warn" behaves like "yes",
-        but the daemon starts up even when it fails to connect to a
-        D-Bus daemon. In addition, if the connection to the D-Bus
-        daemon is terminated we try to reconnect. (Unless we are in a
-        chroot() environment where this definitely will fail.) </p>
-      </option>
-
-      <option>
-        <p><opt>disallow-other-stacks=</opt> Takes a boolean value
-        ("yes" or "no"). If set to "yes" no other process is allowed
-        to bind to UDP port 5353. This effectively impedes other mDNS
-        stacks from running on the host. Use this as a security
-        measure to make sure that only Avahi is responsible for mDNS
-        traffic. Please note that we do not recommend running multiple
-        mDNS stacks on the same host simultaneously. This hampers
-        reliability and is a waste of resources. However, to not annoy
-        people this option defaults to "no".</p>
-      </option>
-
-      <option>
-        <p><opt>allow-point-to-point=</opt> Takes a boolean value
-        ("yes" or "no"). If set to "yes" avahi-daemon will make use of
-        interfaces with the POINTOPOINT flag set. This option defaults
-        to "no" as it might make mDNS unreliable due to usually large
-        latencies with such links and opens a potential security hole
-        by allowing mDNS access from Internet connections. Use with
-        care and YMMV!</p>
-      </option>
-
-       </section>
-
-       <section name="Section [wide-area]">
-      <option>
-        <p><opt>enable-wide-area=</opt> Takes a boolean value
-        ("yes" or "no"). Enable wide-area DNS-SD, aka
-        DNS-SD over unicast DNS. If this is enabled only domains
-        ending in .local will be resolved on mDNS, all other domains
-        are resolved via unicast DNS. If you want to maintain multiple
-        different multicast DNS domains even with this option enabled
-        we encourage you to use subdomains of .local, such as
-        "kitchen.local". This option defaults to "yes".</p>
-      </option>
-
-    </section>
-
-       <section name="Section [publish]">
-
-      <option><p><opt>disable-publishing=</opt> Takes a boolean value
-      ("yes" or "no"). If set to "yes", no record will be published by
-      Avahi, not even address records for the local host. Avahi will
-      be started in a querying-only mode. Use this is a security
-      measure. This option defaults to "no"</p></option>
-
-      <option><p><opt>disable-user-service-publishing=</opt> Takes a boolean value
-      ("yes" or "no"). If set to "yes", Avahi will still publish
-      address records and suchlike but will not allow user
-      applications to publish services. Use this is a security
-      measure. This option defaults to "no"</p></option>
-
-      <option>
-        <p><opt>add-service-cookie=</opt> Takes a boolean value ("yes"
-        or "no"). If set to "yes" an implicit TXT entry will be added
-        to all locally registered services, containing a cookie value
-        which is chosen randomly on daemon startup. This can be used
-        to detect if two services on two different
-        interfaces/protocols are actually identical. Defaults to
-        "no".</p>
-      </option>
-
-      <option>
-        <p><opt>publish-addresses=</opt> Takes a boolean value ("yes"
-        or "no"). If set to "yes" avahi-daemon will register mDNS
-        address records for all local IP addresses. Unless you want to
-        use avahi-daemon exclusively for browsing it's recommended to
-        enable this. If you plan to register local services you need
-        to enable this option. Defaults to "yes".</p>
-      </option>
-
-      <option>
-        <p><opt>publish-hinfo=</opt> Takes a boolean value ("yes" or
-        "no"). If set to "yes" avahi-daemon will register an mDNS
-        HINFO record on all interfaces which contains information
-        about the local operating system and CPU, which might be
-        useful for administrative purposes. This is recommended by the
-        mDNS specification but not required. For the sake of privacy
-        you might choose to disable this feature. Defaults to
-        "yes."</p>
-      </option>
-
-      <option>
-        <p><opt>publish-workstation=</opt> Takes a boolean value
-        ("yes" or "no"). If set to "yes" avahi-daemon will register a
-        service of type "_workstation._tcp" on the local LAN. This
-        might be useful for administrative purposes (i.e. browse for
-        all PCs on the LAN), but is not required or recommended by any
-        specification. Newer MacOS X releases register a service of
-        this type. Defaults to "yes".</p>
-      </option>
-
-      <option>
-        <p><opt>publish-domain=</opt> Takes a boolean value ("yes" or
-        "no"). If set to "yes" avahi-daemon will announce the locally
-        used domain name (see above) for browsing by other
-        hosts. Defaults to "yes".</p>
-      </option>
-
-      <option>
-        <p><opt>publish-dns-servers=</opt> Takes a comma seperated
-        list of IP addresses for unicast DNS servers. You can use this
-        to announce unicast DNS servers via mDNS. When used in
-        conjunction with avahi-dnsconfd on the client
-        side this allows DHCP-like configuration of unicast DNS
-        servers.</p>
-      </option>
-
-      <option>
-        <p><opt>publish-resolv-conf-dns-servers=</opt> Takes a boolean
-        value ("yes" or "no"). If set to "yes" avahi-daemon will
-        publish the unicast DNS servers specified in
-        <file>/etc/resolv.conf</file> in addition to those specified
-        with <opt>publish-dns-servers</opt>. Send avahi-daemon a
-        SIGHUP to have it reload this file. Defaults to "no".</p>
-      </option>
-
-      <option>
-        <p><opt>publish-aaaa-on-ipv4=</opt> Takes a boolean value
-        ("yes" or "no"). If set to "yes" avahi-daemon will publish an
-        IPv6 AAAA record via IPv4, i.e. the local IPv6 addresses can be
-        resolved using an IPv4 transport. Only useful when IPv4 is
-        enabled with <opt>use-ipv4=true</opt>. Defaults to "yes".</p>
-      </option>
-
-      <option>
-        <p><opt>publish-a-on-ipv6=</opt> Takes a boolean value
-        ("yes" or "no"). If set to "yes" avahi-daemon will publish an
-        IPv4 A record via IPv6, i.e. the local IPv4 addresses can be
-        resolved using an IPv6 transport. Only useful when IPv6 is
-        enabled with <opt>use-ipv6=true</opt>. Defaults to "no".</p>
-      </option>
-
-    </section>
-
-       <section name="Section [reflector]">
-      <option>
-        <p><opt>enable-reflector=</opt> Takes a boolean value ("yes"
-        or "no"). If set to "yes" avahi-daemon will reflect incoming
-        mDNS requests to all local network interfaces, effectively
-        allowing clients to browse mDNS/DNS-SD services on all
-        networks connected to the gateway. The gateway is somewhat
-        intelligent and should work with all kinds of mDNS traffic,
-        though some functionality is lost (specifically the unicast
-        reply bit, which is used rarely anyway). Make sure to not run
-        multiple reflectors between the same networks, this might
-        cause them to play Ping Pong with mDNS packets. Defaults to
-        "no".</p>
-      </option>
-
-      <option>
-        <p><opt>reflect-ipv=</opt> Takes a boolean value ("yes" or
-        "no"). If set to "yes" and <opt>enable-reflector</opt> is
-        enabled, avahi-daemon will forward mDNS traffic between IPv4
-        and IPv6, which is usually not recommended. Defaults to "no".</p>
-      </option>
-    </section>
-
-    <section name="Section [rlimits]">
-      <p>This section is used to define system resource limits for the
-      daemon. See <manref section="2" name="setrlimit"/> for more
-      information. If any of the options is not specified in the configuration
-      file, avahi-daemon does not change it from the system
-      defaults.</p>
-
-
-      <option>
-        <p><opt>rlimit-as=</opt> Value in bytes for RLIMIT_AS (maximum size of the process's virtual memory). Sensible values are heavily system dependent.</p>
-      </option>
-
-      <option>
-        <p><opt>rlimit-core=</opt> Value in bytes for RLIMIT_CORE (maximum core file size). Unless you want to debug avahi-daemon, it is safe to set this to 0.</p>
-      </option>
-
-      <option>
-        <p><opt>rlimit-data=</opt> Value in bytes for RLIMIT_DATA (maximum size of the process's data segment). Sensible values are heavily system dependent.</p>
-      </option>
-
-      <option>
-        <p><opt>rlimit-fsize=</opt> Value for RLIMIT_FSIZE (maximum size of files the process may create). Since avahi-daemon shouldn't write any files to disk, it is safe to set this to 0.</p>
-      </option>
-
-      <option>
-        <p><opt>rlimit-nofile=</opt> Value for RLIMIT_NOFILE (open file descriptors). avahi-daemon shouldn't need more than 15 to 20 open file descriptors concurrently.</p>
-      </option>
-
-      <option>
-        <p><opt>rlimit-stack=</opt> Value in bytes for RLIMIT_STACK (maximum size of the process stack). Sensible values are heavily system dependent.</p>
-      </option>
-
-      <option>
-        <p><opt>rlimit-nproc=</opt> Value for RLIMIT_NPROC (number of process of user). avahi-daemon forks of a helper process on systems where <manref name="chroot" section="2"/> is available. Therefore this value should not be set below 2.</p>
-      </option>
-
-    </section>
-
-       <section name="Authors">
-         <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
-         available from <url href="@PACKAGE_URL@"/></p>
-       </section>
-
-       <section name="See also">
-         <p>
-        <manref name="avahi-daemon" section="8"/>, <manref name="avahi-dnsconfd" section="8"/>
-         </p>
-       </section>
-
-       <section name="Comments">
-         <p>This man page was written using <manref name="xml2man" section="1"
-                 href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
-       </section>
-
-  </manpage>
+<manpage name="avahi-daemon.conf" section="5" desc="avahi-daemon configuration file">
+
+  <synopsis>
+    <cmd>@pkgsysconfdir@/avahi-daemon.conf</cmd>
+  </synopsis>
+
+  <description>
+    <p><file>avahi-daemon.conf</file> is the configuration file for avahi-daemon.</p>
+  </description>
+
+  <section name="Section [Server]">
+
+    <option>
+      <p><opt>host-name=</opt> Set the host name avahi-daemon tries
+      to register on the LAN. If omited defaults to the system host
+      name as set with the sethostname() system call.</p>
+    </option>
+
+    <option>
+      <p><opt>domain-name=</opt> Set the default domain name avahi-daemon
+      tries to register its host name and services on the LAN in. If
+      omitted defaults to ".local".</p>
+    </option>
+
+    <option>
+      <p><opt>browse-domains=</opt> Set a comma separated list of
+      browsing domains (in addition to the default one and those
+      announced inside the default browsing domain). Please note
+      that the user may specify additional browsing domains on the
+      client side, either by setting $AVAHI_BROWSE_DOMAINS to a list
+      of colon separated domains or by adding them to the XDG config
+      file <file>~/.config/avahi/browse-domains</file> (separated by
+      newlines).</p>
+
+    </option>
+
+    <option>
+      <p><opt>use-ipv4=</opt> Takes a boolean value ("yes" or
+      "no"). If set to "no" avahi-daemon will not use IPv4
+      sockets. Default is "yes".</p>
+    </option>
+
+    <option>
+      <p><opt>use-ipv6=</opt> Takes a boolean value ("yes" or
+      "no"). If set to "no" avahi-daemon will not use IPv6
+      sockets. Default is "yes".</p>
+    </option>
+
+    <option>
+      <p><opt>allow-interfaces=</opt> Set a comma separated list of
+      allowed network interfaces that should be used by the
+      avahi-daemon. Traffic on other interfaces will be ignored. If
+      set to an empty list all local interfaces except loopback and
+      point-to-point will be used.</p>
+    </option>
+
+    <option>
+      <p><opt>deny-interfaces=</opt> Set a comma separated list of
+      network interfaces that should be ignored by avahi-daemon.
+      Other not specified interfaces will be used, unless
+      <opt>allow-interfaces=</opt> is set. This option takes
+      precedence over <opt>allow-interfaces=</opt>.</p>
+    </option>
+
+    <option>
+      <p><opt>check-response-ttl=</opt> Takes a boolean value ("yes"
+      or "no"). If set to "yes", an additional security check is
+      activated: incoming IP packets will be ignored unless the IP
+      TTL is 255. Earlier mDNS specifications required this
+      check. Since this feature may be incompatible with newer
+      implementations of mDNS it defaults to "no". On the other hand
+      it provides extra security.</p>
+    </option>
+
+    <option>
+      <p><opt>use-iff-running=</opt> Takes a boolean value ("yes" or
+      "no"). If set to "yes" avahi-daemon monitors the IFF_RUNNING
+      flag bit which is used by some (modern) network drivers to
+      tell user space if a network cable is plugged in (in case of
+      copper ethernet), or the network card is associated with some
+      kind of network (in case of WLAN). If IFF_RUNNING is set
+      avahi-daemon will automatically announce its services on that
+      network. Unfortunately far too many network drivers do not
+      support this flag or support it in a broken way. Therefore
+      this option defaults to "no".</p>
+    </option>
+
+    <option>
+      <p><opt>enable-dbus=</opt> Takes either "yes", "no" or
+      "warn". If set to "yes" avahi-daemon connects to D-Bus,
+      offering an object oriented client API. It is only available
+      if Avahi has been compiled with <opt>--enable-dbus</opt> in
+      which case it defaults to "yes". "warn" behaves like "yes",
+      but the daemon starts up even when it fails to connect to a
+      D-Bus daemon. In addition, if the connection to the D-Bus
+      daemon is terminated we try to reconnect. (Unless we are in a
+      chroot() environment where this definitely will fail.) </p>
+    </option>
+
+    <option>
+      <p><opt>disallow-other-stacks=</opt> Takes a boolean value
+      ("yes" or "no"). If set to "yes" no other process is allowed
+      to bind to UDP port 5353. This effectively impedes other mDNS
+      stacks from running on the host. Use this as a security
+      measure to make sure that only Avahi is responsible for mDNS
+      traffic. Please note that we do not recommend running multiple
+      mDNS stacks on the same host simultaneously. This hampers
+      reliability and is a waste of resources. However, to not annoy
+      people this option defaults to "no".</p>
+    </option>
+
+    <option>
+      <p><opt>allow-point-to-point=</opt> Takes a boolean value
+      ("yes" or "no"). If set to "yes" avahi-daemon will make use of
+      interfaces with the POINTOPOINT flag set. This option defaults
+      to "no" as it might make mDNS unreliable due to usually large
+      latencies with such links and opens a potential security hole
+      by allowing mDNS access from Internet connections. Use with
+      care and YMMV!</p>
+    </option>
+
+    <option>
+      <p><opt>cache-entries-max=</opt> Takes an unsigned integer
+      specifying how many resource records are cached per
+      interface. Bigger values allow mDNS work correctly in large LANs
+      but also increase memory consumption.</p>
+    </option>
+
+    <option>
+      <p><opt>clients-max=</opt> Takes an unsigned integer. The
+      maximum number of concurrent D-Bus clients allowed. If the
+      maximum number is reached further clients will be refused until
+      at least one existing client disconnects.</p>
+    </option>
+
+    <option>
+      <p><opt>objects-per-client-max=</opt> Takes an unsigned
+      integer. The maximum number of objects (entry groups, browsers,
+      resolvers) that may be registered per client at a time. If the
+      maximum number is reached further object creation will be
+      refused until at least one object is freed.</p>
+    </option>
+
+    <option>
+      <p><opt>entries-per-entry-group-max=</opt> Takes an unsigned
+      integer. The maximum number of entries (resource records) per
+      entry group at a time. If the maximum number is reached further
+      resource records may not be added to an entry group.</p>
+    </option>
+
+  </section>
+
+  <section name="Section [wide-area]">
+    <option>
+      <p><opt>enable-wide-area=</opt> Takes a boolean value
+      ("yes" or "no"). Enable wide-area DNS-SD, aka
+      DNS-SD over unicast DNS. If this is enabled only domains
+      ending in .local will be resolved on mDNS, all other domains
+      are resolved via unicast DNS. If you want to maintain multiple
+      different multicast DNS domains even with this option enabled
+      we encourage you to use subdomains of .local, such as
+      "kitchen.local". This option defaults to "yes".</p>
+    </option>
+
+  </section>
+
+  <section name="Section [publish]">
+
+    <option><p><opt>disable-publishing=</opt> Takes a boolean value
+    ("yes" or "no"). If set to "yes", no record will be published by
+    Avahi, not even address records for the local host. Avahi will
+    be started in a querying-only mode. Use this is a security
+    measure. This option defaults to "no"</p></option>
+
+    <option><p><opt>disable-user-service-publishing=</opt> Takes a boolean value
+    ("yes" or "no"). If set to "yes", Avahi will still publish
+    address records and suchlike but will not allow user
+    applications to publish services. Use this is a security
+    measure. This option defaults to "no"</p></option>
+
+    <option>
+      <p><opt>add-service-cookie=</opt> Takes a boolean value ("yes"
+      or "no"). If set to "yes" an implicit TXT entry will be added
+      to all locally registered services, containing a cookie value
+      which is chosen randomly on daemon startup. This can be used
+      to detect if two services on two different
+      interfaces/protocols are actually identical. Defaults to
+      "no".</p>
+    </option>
+
+    <option>
+      <p><opt>publish-addresses=</opt> Takes a boolean value ("yes"
+      or "no"). If set to "yes" avahi-daemon will register mDNS
+      address records for all local IP addresses. Unless you want to
+      use avahi-daemon exclusively for browsing it's recommended to
+      enable this. If you plan to register local services you need
+      to enable this option. Defaults to "yes".</p>
+    </option>
+
+    <option>
+      <p><opt>publish-hinfo=</opt> Takes a boolean value ("yes" or
+      "no"). If set to "yes" avahi-daemon will register an mDNS
+      HINFO record on all interfaces which contains information
+      about the local operating system and CPU, which might be
+      useful for administrative purposes. This is recommended by the
+      mDNS specification but not required. For the sake of privacy
+      you might choose to disable this feature. Defaults to
+      "yes."</p>
+    </option>
+
+    <option>
+      <p><opt>publish-workstation=</opt> Takes a boolean value
+      ("yes" or "no"). If set to "yes" avahi-daemon will register a
+      service of type "_workstation._tcp" on the local LAN. This
+      might be useful for administrative purposes (i.e. browse for
+      all PCs on the LAN), but is not required or recommended by any
+      specification. Newer MacOS X releases register a service of
+      this type. Defaults to "yes".</p>
+    </option>
+
+    <option>
+      <p><opt>publish-domain=</opt> Takes a boolean value ("yes" or
+      "no"). If set to "yes" avahi-daemon will announce the locally
+      used domain name (see above) for browsing by other
+      hosts. Defaults to "yes".</p>
+    </option>
+
+    <option>
+      <p><opt>publish-dns-servers=</opt> Takes a comma separated
+      list of IP addresses for unicast DNS servers. You can use this
+      to announce unicast DNS servers via mDNS. When used in
+      conjunction with avahi-dnsconfd on the client
+      side this allows DHCP-like configuration of unicast DNS
+      servers.</p>
+    </option>
+
+    <option>
+      <p><opt>publish-resolv-conf-dns-servers=</opt> Takes a boolean
+      value ("yes" or "no"). If set to "yes" avahi-daemon will
+      publish the unicast DNS servers specified in
+      <file>/etc/resolv.conf</file> in addition to those specified
+      with <opt>publish-dns-servers</opt>. Send avahi-daemon a
+      SIGHUP to have it reload this file. Defaults to "no".</p>
+    </option>
+
+    <option>
+      <p><opt>publish-aaaa-on-ipv4=</opt> Takes a boolean value
+      ("yes" or "no"). If set to "yes" avahi-daemon will publish an
+      IPv6 AAAA record via IPv4, i.e. the local IPv6 addresses can be
+      resolved using an IPv4 transport. Only useful when IPv4 is
+      enabled with <opt>use-ipv4=true</opt>. Defaults to "yes".</p>
+    </option>
+
+    <option>
+      <p><opt>publish-a-on-ipv6=</opt> Takes a boolean value
+      ("yes" or "no"). If set to "yes" avahi-daemon will publish an
+      IPv4 A record via IPv6, i.e. the local IPv4 addresses can be
+      resolved using an IPv6 transport. Only useful when IPv6 is
+      enabled with <opt>use-ipv6=true</opt>. Defaults to "no".</p>
+    </option>
+
+  </section>
+
+  <section name="Section [reflector]">
+    <option>
+      <p><opt>enable-reflector=</opt> Takes a boolean value ("yes"
+      or "no"). If set to "yes" avahi-daemon will reflect incoming
+      mDNS requests to all local network interfaces, effectively
+      allowing clients to browse mDNS/DNS-SD services on all
+      networks connected to the gateway. The gateway is somewhat
+      intelligent and should work with all kinds of mDNS traffic,
+      though some functionality is lost (specifically the unicast
+      reply bit, which is used rarely anyway). Make sure to not run
+      multiple reflectors between the same networks, this might
+      cause them to play Ping Pong with mDNS packets. Defaults to
+      "no".</p>
+    </option>
+
+    <option>
+      <p><opt>reflect-ipv=</opt> Takes a boolean value ("yes" or
+      "no"). If set to "yes" and <opt>enable-reflector</opt> is
+      enabled, avahi-daemon will forward mDNS traffic between IPv4
+      and IPv6, which is usually not recommended. Defaults to "no".</p>
+    </option>
+  </section>
+
+  <section name="Section [rlimits]">
+    <p>This section is used to define system resource limits for the
+    daemon. See <manref section="2" name="setrlimit"/> for more
+    information. If any of the options is not specified in the configuration
+    file, avahi-daemon does not change it from the system
+    defaults.</p>
+
+    <option>
+      <p><opt>rlimit-as=</opt> Value in bytes for RLIMIT_AS (maximum size of the process's virtual memory). Sensible values are heavily system dependent.</p>
+    </option>
+
+    <option>
+      <p><opt>rlimit-core=</opt> Value in bytes for RLIMIT_CORE (maximum core file size). Unless you want to debug avahi-daemon, it is safe to set this to 0.</p>
+    </option>
+
+    <option>
+      <p><opt>rlimit-data=</opt> Value in bytes for RLIMIT_DATA (maximum size of the process's data segment). Sensible values are heavily system dependent.</p>
+    </option>
+
+    <option>
+      <p><opt>rlimit-fsize=</opt> Value for RLIMIT_FSIZE (maximum size of files the process may create). Since avahi-daemon shouldn't write any files to disk, it is safe to set this to 0.</p>
+    </option>
+
+    <option>
+      <p><opt>rlimit-nofile=</opt> Value for RLIMIT_NOFILE (open file descriptors). avahi-daemon shouldn't need more than 15 to 20 open file descriptors concurrently.</p>
+    </option>
+
+    <option>
+      <p><opt>rlimit-stack=</opt> Value in bytes for RLIMIT_STACK (maximum size of the process stack). Sensible values are heavily system dependent.</p>
+    </option>
+
+    <option>
+      <p><opt>rlimit-nproc=</opt> Value for RLIMIT_NPROC (number of process of user). avahi-daemon forks of a helper process on systems where <manref name="chroot" section="2"/> is available. Therefore this value should not be set below 2.</p>
+    </option>
+
+  </section>
+
+  <section name="Authors">
+    <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
+    available from <url href="@PACKAGE_URL@"/></p>
+  </section>
+
+  <section name="See also">
+    <p>
+      <manref name="avahi-daemon" section="8"/>, <manref name="avahi-dnsconfd" section="8"/>
+    </p>
+  </section>
+
+  <section name="Comments">
+    <p>This man page was written using <manref name="xml2man" section="1"
+    href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
+  </section>
+
+</manpage>
index 5d4f8787da618f2feedb1689008067c468c491dc..e311f1fc01152b0304e33c13f68f41226c3d7f60 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
        <synopsis>
       <cmd>avahi-discover</cmd>
        </synopsis>
-       
+
     <description>
       <p>Show a real-time graphical browse list for mDNS/DNS-SD
       network services running on the local LAN using the Avahi
       daemon.</p>
-      
+
        </description>
-       
+
        <options>
 
       <p>avahi-discover takes no command line arguments at the moment.</p>
 
     </options>
-       
+
        <section name="Authors">
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-daemon" section="8"/>, <manref name="avahi-browse" section="1"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index c74e1bab93f93887effc7692db7fbe48d5447904..e01ab44a43c7277ec7225014897d10a8452f2688 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -31,7 +29,7 @@
       <cmd>avahi-dnsconfd <opt>--refresh</opt></cmd>
       <cmd>avahi-dnsconfd <opt>--check</opt></cmd>
        </synopsis>
-       
+
     <description>
       <p>avahi-dnsconfd connects to a running avahi-daemon and runs
       the script <file>@pkgsysconfdir@/dnsconfd.action</file> for each unicast DNS
@@ -39,7 +37,7 @@
       configuring unicast DNS servers in a DHCP-like fashion with
       mDNS.</p>
        </description>
-       
+
        <options>
 
          <option>
                <optdesc><p>Daemonize after startup and redirect log messages to syslog.</p></optdesc>
          </option>
 
+      <option>
+        <p><opt>-s | --syslog</opt></p>
+        <optdesc><p>Log to syslog instead of STDERR. Implied by <opt>--daemonize</opt>.</p></optdesc>
+      </option>
+
          <option>
                <p><opt>-k | --kill</opt></p>
                <optdesc><p>Kill an already running avahi-dnsconfd. (equivalent to sending a SIGTERM)</p></optdesc>
@@ -75,9 +78,9 @@
        </options>
 
     <section name="Files">
-      
+
       <p><file>@pkgsysconfdir@/avahi-dnsconfd.action</file>: the script to run when a DNS server is found or removed.</p>
-    
+
     </section>
 
     <section name="Signals">
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-daemon" section="8"/>, <manref name="avahi-dnsconfd.action" section="8"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 68114226945e148aae87fdcb64b926d71d95bb6f..f4ae37ebb5334c1e1359bb9e229c0a599b0f35fc 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -28,7 +26,7 @@
        <synopsis>
       <cmd>@pkgsysconfdir@/avahi-dnsconfd.action</cmd>
        </synopsis>
-       
+
     <description>
       <p><file>avahi-dnsconfd.action</file> is the action script that
       is called whenever a new unicast DNS server is found or
@@ -36,7 +34,7 @@
       with avahi patches <file>/etc/resolv.conf</file> to reflect the
       changed unicast DNS server configuration.</p>
        </description>
-       
+
        <section name="Parameters">
 
       <option>
@@ -61,7 +59,7 @@
       <option>
         <p><opt>AVAHI_INTERFACE</opt> Contains the textual interface name the corresponds with argv[3]. (e.g. "eth0")</p>
       </option>
-      
+
       <option><p><opt>AVAHI_INTERFACE_DNS_SERVERS</opt> Contains a
       list of all DNS servers that avahi-dnsconfd found on the
       interface <opt>$AVAHI_INTERFACE</opt>, separated by
       DNS server that avahi-dnsconfd found on all interfaces,
       separated by spaces.</p></option>
 
-    </section>  
+    </section>
 
        <section name="Authors">
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-dnsconfd" section="8"/>, <manref name="avahi-daemon" section="8"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 5ab476a9e27efc8f9a8d6832a2d305af629f5504..bb8dbda9c1526e04b222e822c552e56be85dce31 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
       <cmd>avahi-publish -a [<arg>options</arg>] <arg>host name</arg> <arg>address</arg></cmd>
       <cmd>avahi-publish-address [<arg>options</arg>] <arg>host name</arg> <arg>address</arg></cmd>
        </synopsis>
-       
+
     <description>
       <p>Register an mDNS/DNS-SD service or host name/address mapping using the Avahi daemon.</p>
        </description>
-       
+
        <options>
 
       <p>When calling in service registration mode, specify a DNS-SD
@@ -45,7 +43,7 @@
       command line. When calling in address/host name registration
       mode specify a fully qualified host name and an address (IPv4 or
       IPv6).</p>
-         
+
          <option>
         <p><opt>-s | --service</opt></p>
         <optdesc><p>Register a service. avahi-publish-service is equivalent to avahi-publish -s.</p></optdesc>
          </option>
 
        </options>
-       
+
        <section name="Authors">
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-resolve" section="1"/>, <manref
         name="avahi-daemon" section="8"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 3f9bbc6e371c809e9115e74ec566d80d3d4865ac..e444cb94c7026d4e662196cc3931f21a856f0e9e 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
       <cmd>avahi-resolve --address <arg>address ...</arg></cmd>
       <cmd>avahi-resolve-address <arg>address ...</arg></cmd>
        </synopsis>
-       
+
     <description>
       <p>Resolve one or more mDNS/DNS host name(s) to IP address(es) (and vice versa) using the Avahi daemon.</p>
        </description>
-       
+
        <options>
-      
+
       <p>When passing -n, specify one or more fully qualified mDNS/DNS host name(s)
       (e.g. "foo.local") to resolve into IP addresses on the
       command line. When passing -a, specify one or more IP address
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
-        <manref name="avahi-publish-address" section="1"/>, 
+        <manref name="avahi-publish-address" section="1"/>,
         <manref
         name="avahi-daemon" section="8"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index a49db102f84c3a64079bb0d9d45ecbfbb309240c..407bbe712d28485f66db36a23a4d625e70140c6d 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
        <synopsis>
       <cmd>avahi-set-host-name <arg>host-name</arg></cmd>
        </synopsis>
-       
+
     <description>
       <p>Set the mDNS host name of a currently running Avahi
       daemon. The effect of this operation is not persistent across
       daemon restarts. This operation is usually privileged.</p>
        </description>
-       
+
        <options>
-      
+
       <option>
         <p><opt>-v | --verbose</opt></p>
         <optdesc><p>Enable verbose mode.</p></optdesc>
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-daemon" section="8"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man" section="1"
                  href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
        </section>
-       
+
   </manpage>
index 5a925475e91e12c0b2723a9d123ac22647492b7e..eff284891efb72bbb9491c209f378fea1e2a1c60 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -28,7 +26,7 @@
        <synopsis>
       <cmd>@pkgsysconfdir@/hosts</cmd>
        </synopsis>
-       
+
     <description>
       <p><file>@pkgsysconfdir@/hosts</file> is a file which may be used
       to define static host name to IP address mappings for multicast
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-daemon" section="8"/>, <manref name="avahi.service" section="5"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man"
          section="1" href="http://masqmail.cx/xml2man/"/> by Oliver
          Kurth.</p>
        </section>
-       
+
   </manpage>
index 00059037e881b28e1161d59f3c05fef065fb4cb0..6598617e2413253a989924c9cdad84202c160f07 100644 (file)
@@ -2,21 +2,19 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
        <synopsis>
       <cmd>@servicedir@/*.service</cmd>
        </synopsis>
-       
+
     <description> <p><file>@servicedir@/*.service</file> are XML
       fragments containing static DNS-SD service data. Every service
       file can contain multiple service definitions which share the
       same name. This is useful for publishing service data for
       services which implement multiple protocols. (i.e. a printer
       implementing _ipp._tcp and _printer._tcp)</p> </description>
-       
+
        <section name="XML Tags">
-      
+
       <option>
         <p><opt>&lt;service-group&gt;</opt> The document tag of avahi
         service files. Should contain one <opt>&lt;name&gt;</opt> and one or more
          <p>The Avahi Developers &lt;@PACKAGE_BUGREPORT@&gt;; Avahi is
          available from <url href="@PACKAGE_URL@"/></p>
        </section>
-       
+
        <section name="See also">
          <p>
         <manref name="avahi-daemon" section="8"/>, <manref name="avahi.hosts" section="5"/>
          </p>
        </section>
-       
+
        <section name="Comments">
          <p>This man page was written using <manref name="xml2man"
          section="1" href="http://masqmail.cx/xml2man/"/> by Oliver
          Kurth.</p>
        </section>
-       
+
   </manpage>
index 2a3fdcf1f5909e720419fbb4da3bb53d32ff1f0d..6df640d0994447ed05075626cd90f4bfbf9eed0b 100644 (file)
@@ -2,8 +2,6 @@
 <!DOCTYPE manpage SYSTEM "xmltoman.dtd">
 <?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
 
-<!-- $Id$ -->
-
 <!--
   This file is part of avahi.
 
index 4c80847bd061f7310538da6232f5b5d7a6cc1db6..6b3235bbb2705fe1acb121730f70d3ce421bca49 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
index 50158dc641e6c451e36b55b6822619c23813b3fd..968dd5f326635f0bb86af7bc52900b352bb6f2d3 100644 (file)
@@ -1,6 +1,4 @@
-<!-- $Id$ -->
-
-<!-- 
+<!--
   This file is part of avahi.
 
   avahi is free software; you can redistribute it and/or modify it under
@@ -15,7 +13,7 @@
 
   You should have received a copy of the GNU General Public License
   along with avahi; if not, write to the Free Software Foundation,
-  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 
+  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 -->
 
 <!ELEMENT manpage (synopsis | description | section | options | seealso)*>
index 96c9d81e93cffa93e287a4723d86d9b0c22e34d7..1a344c2ac2b59468480a0d864395a2413039fcda 100644 (file)
@@ -19,8 +19,6 @@
   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 
 -->
 
-<!-- $Id$ -->
-
 <xsl:output method="xml" version="1.0" encoding="iso-8859-15" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes"/>
 
 <xsl:template match="/manpage">
index f3e48ded501971814f83d909d887ea8a859ea22e..9e9a0cc648788497965c29ea0d591ebcb0801247 100644 (file)
@@ -1,6 +1,6 @@
 # List of source files which contain translatable strings.
 avahi-common/error.c
-avahi-discover-standalone/avahi-discover.glade
+[type: gettext/glade]avahi-discover-standalone/avahi-discover.ui
 avahi-python/avahi-discover/avahi-discover.desktop.in.in
 avahi-ui/avahi-ui.c
 avahi-ui/bssh.c
index 90541bbec53d193fcebda6daa2710a9f4a2d5647..ce6337d6f2b8a8ef23fd76e96dfbf4e8d747d275 100644 (file)
@@ -1,4 +1,3 @@
-avahi-discover-standalone/avahi-discover.glade
 avahi-ui/bssh.desktop.in
 avahi-ui/bvnc.desktop.in
 tests/c-plus-plus-test-gen.py
index 60fda4524d8cc3087c793ab4fd95a3172e17213d..fa1bd404619169f33156c9cedb890d8b1de5f800 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -29,12 +27,12 @@ noinst_SCRIPTS=build-db
 pkglib_DATA+=service-types.db
 
 build-db: build-db.in
-       sed -e 's,@PYTHON\@,$(PYTHON),g' \
-           -e 's,@DBM\@,gdbm,g' $< > $@
+       $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
+           -e 's,@DBM\@,gdbm,g' $< > $@ && \
        chmod +x $@
 
 service-types.db: service-types build-db
-       $(PYTHON) build-db $< $@.coming
+       $(AM_V_GEN)$(PYTHON) build-db $< $@.coming && \
        mv $@.coming $@
 
 CLEANFILES = service-types.db build-db
@@ -46,16 +44,16 @@ noinst_SCRIPTS=build-db
 pkglib_DATA+=service-types.db.pag service-types.db.dir
 
 build-db: build-db.in
-       sed -e 's,@PYTHON\@,$(PYTHON),g' \
-           -e 's,@DBM\@,dbm,g' $< > $@
+       $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
+           -e 's,@DBM\@,dbm,g' $< > $@ && \
        chmod +x $@
 
 service-types.db.pag: service-types.db
-       mv service-types.db.coming.pag service-types.db.pag
+       $(AM_V_GEN)mv service-types.db.coming.pag service-types.db.pag
 service-types.db.dir: service-types.db
-       mv service-types.db.coming.dir service-types.db.dir
+       $(AM_V_GEN)mv service-types.db.coming.dir service-types.db.dir
 service-types.db: service-types build-db
-       $(PYTHON) build-db $< $@.coming
+       $(AM_V_GEN)$(PYTHON) build-db $< $@.coming && \
        if test -f "$@.coming"; then mv $@.coming $@; fi
 
 CLEANFILES = service-types.db* build-db
index 44f606894092e17314bab47c3045c2538a1c8955..4cda425374a79198f294e9aa53ae6b0a3710da05 100755 (executable)
@@ -1,7 +1,5 @@
 #!@PYTHON@
 # -*-python-*-
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
index 97e6858c4309e2bdbe60b60235f1aacb830209b0..0e9d7cc1f6dd7ce01c6202d58dea265ff396198c 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -22,7 +20,7 @@
 # available database unless its license is known and compatible with
 # our project! The database available on
 #
-#         http://www.dns-sd.org/ServiceTypes.html 
+#         http://www.dns-sd.org/ServiceTypes.html
 #
 # is not a source that complies with the criterion!
 
@@ -86,6 +84,10 @@ _sftp-ssh._tcp:SFTP File Transfer
 _apt._tcp:APT Package Repository
 _apt._tcp[it]:APT - Repository dei Pacchetti
 
+_odisk._tcp:DVD or CD Sharing
+
+_adisk._tcp:Apple TimeMachine
+
 
 # Remote machine access
 
@@ -94,7 +96,7 @@ _ssh._tcp[de]:SSH-Fernzugriff
 _ssh._tcp[it]:SSH Terminale remoto
 
 _rfb._tcp:VNC Remote Access
-_rfb._tcp[it]:Controllo remoto VNC 
+_rfb._tcp[it]:Controllo remoto VNC
 
 _telnet._tcp:Telnet Remote Terminal
 _telnet._tcp[it]:Telnet Terminale Remoto
@@ -103,6 +105,7 @@ _timbuktu._tcp:Timbuktu Remote Desktop Control
 
 _net-assistant._udp:Apple Net Assistant
 
+_udisks-ssh._tcp:Remote Disk Management
 
 # Mail
 
@@ -149,6 +152,8 @@ _pulse-source._tcp:PulseAudio Sound Source
 
 _mpd._tcp:Music Player Daemon
 
+_remote-jukebox._tcp:Remote Jukebox
+
 # DAAP share provided by iTunes on behalf of an iPod Touch
 _touch-able._tcp:iPod Touch Music Library
 
@@ -192,6 +197,8 @@ _distcc._tcp:Distributed Compiler
 _distcc._tcp[de]:Verteilter Compiler
 _distcc._tcp[it]:Compilatore Distribuito
 
+_bzr._tcp:Bazaar
+
 
 # Vendor specific
 
@@ -205,6 +212,8 @@ _acrobatSRV._tcp:Adobe Acrobat
 
 _adobe-vc._tcp:Adobe Version Cue
 
+_home-sharing._tcp:Apple Home Sharing
+
 
 # Other
 
@@ -216,3 +225,7 @@ _tp._tcp:Thousand Parsec Server
 _tps._tcp:Thousand Parsec Server (Secure)
 _tp-http._tcp:Thousand Parsec Server (HTTP Tunnel)
 _tp-https._tcp:Thousand Parsec Server (Secure HTTP Tunnel)
+
+_shifter._tcp:Window Shifter
+
+_libvirt._tcp:Virtual Machine Manager
index c91cea44fca58009b5434203e49b2d818a779fca..e28b0b721af8e3074af3e818c0ad7489a1c207b0 100644 (file)
@@ -1,7 +1,5 @@
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
index 46d67627cebedd6b0091c544eb34decb413ea676..a2836f06cd9ebba916944c78eb6e9f3f550ceb40 100755 (executable)
@@ -1,9 +1,7 @@
 #!/usr/bin/python
 
-# $Id$
-#
 # This file is part of avahi.
-# 
+#
 # avahi is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as
 # published by the Free Software Foundation; either version 2 of the
@@ -31,21 +29,19 @@ def print_includes(dir):
         print "#include <%s/%s>" % (dir, f)
 
 
-print """/* $Id$ */
-
-/***
+print """/***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
index 947aa444ef23e0e84f793204539d87b48e945765..ad7a529443bc4bb9ab4dc2ea2a9e7219eea6e08c 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.