summaryrefslogtreecommitdiffstats
path: root/avahi-daemon
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-01-20 22:56:11 +0000
committerLennart Poettering <lennart@poettering.net>2006-01-20 22:56:11 +0000
commite614891d38cae63957d0bfc00d34ecdbad4f8322 (patch)
tree55336f0efd0999e0ed17bec823470844587fe65c /avahi-daemon
parent7d59b3ba820c19488b0637b5dd9798deb68fb0dc (diff)
* add new API function avahi_nss_support()
* add new DBUS method Server.IsNSSSupportAvailable() * add support for IsNSSSupportAvailabke() to avahi-bookmarks git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1092 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon')
-rw-r--r--avahi-daemon/Makefile.am9
-rw-r--r--avahi-daemon/Server.introspect4
-rw-r--r--avahi-daemon/dbus-protocol.c8
-rw-r--r--avahi-daemon/main.c6
-rw-r--r--avahi-daemon/main.h2
5 files changed, 27 insertions, 2 deletions
diff --git a/avahi-daemon/Makefile.am b/avahi-daemon/Makefile.am
index ffcfa58..e1d64a4 100644
--- a/avahi-daemon/Makefile.am
+++ b/avahi-daemon/Makefile.am
@@ -100,12 +100,17 @@ avahi_daemon_SOURCES += \
dbus-sync-host-name-resolver.c \
dbus-sync-service-resolver.c \
dbus-record-browser.c \
- ../avahi-common/dbus.c ../avahi-common/dbus.h \
- ../avahi-common/dbus-watch-glue.c ../avahi-common/dbus-watch-glue.h
+ ../avahi-common/dbus.c ../avahi-common/dbus.h \
+ ../avahi-common/dbus-watch-glue.c ../avahi-common/dbus-watch-glue.h \
+ ../avahi-client/check-nss.c
avahi_daemon_LDADD += \
$(DBUS_LIBS)
+if HAVE_DLOPEN
+avahi_daemon_LDADD += -ldl
+endif
+
avahi_daemon_CFLAGS += $(DBUS_CFLAGS)
dbusservice_DATA = avahi-dbus.conf
diff --git a/avahi-daemon/Server.introspect b/avahi-daemon/Server.introspect
index 5a3f88b..6635618 100644
--- a/avahi-daemon/Server.introspect
+++ b/avahi-daemon/Server.introspect
@@ -51,6 +51,10 @@
<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>
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index f14e746..2e3fd2f 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -251,6 +251,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
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");
+ goto fail;
+ }
+
+ 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))) {
diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c
index da19868..8327200 100644
--- a/avahi-daemon/main.c
+++ b/avahi-daemon/main.c
@@ -75,6 +75,7 @@
AvahiServer *avahi_server = NULL;
AvahiSimplePoll *simple_poll_api = NULL;
static char *argv0 = NULL;
+int nss_support = 0;
typedef enum {
DAEMON_RUN,
@@ -697,6 +698,8 @@ static void signal_callback(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AVAHI_GC
}
}
+/* Imported from ../avahi-client/nss-check.c */
+int avahi_nss_support(void);
static int run_server(DaemonConfig *c) {
int r = -1;
@@ -707,6 +710,9 @@ static int run_server(DaemonConfig *c) {
assert(c);
+ if (!(nss_support = avahi_nss_support()))
+ avahi_log_warn("WARNING: No NSS support for mDNS detected, consider installing nss-mdns!");
+
if (!(simple_poll_api = avahi_simple_poll_new())) {
avahi_log_error("Failed to create main loop object.");
goto finish;
diff --git a/avahi-daemon/main.h b/avahi-daemon/main.h
index 951b5f6..77af0d0 100644
--- a/avahi-daemon/main.h
+++ b/avahi-daemon/main.h
@@ -28,4 +28,6 @@
extern AvahiServer *avahi_server;
extern AvahiSimplePoll *simple_poll_api;
+extern int nss_support;
+
#endif