On Apr 19, 2011, at 7:44 AM, Arnaud Quette wrote:

Author: aquette
Date: Tue Apr 19 11:43:46 2011
New Revision: 2974
URL: http://trac.networkupstools.org/projects/nut/changeset/2974

...
+void scan_nut_avahi()
+{
+       printf("Scanning NUT bus (DNS-SD method):\n");
+
+       /* Check avahi-browse code:
+        * 
http://git.0pointer.de/?p=avahi.git;a=tree;f=avahi-utils;h=5655a104964258e7be32ada78794f73beb84e0dd;hb=HEAD
+        *
+        * Example service publication (counterpart of the above):
+ * $ avahi-publish -s nut _upsd._tcp 3493 txtvers=1 protovers=1.0.0 type=standalone
+        */
+}

Just some thoughts:

It's been a while since I last looked at the DNS-SD spec, but we might want to use either "_nut._tcp" (following the IANA reserved port name) or "_nut_upsd._tcp" because there is at least one other "upsd" in Debian alone.

Also, there are XML files that we can create in the Avahi configuration directory to publish that information. This might be easier than adding avahi-publish to all of the various startup script types that distributions have these days.

If you don't want to pull all of the Avahi library code into the scanner, many systems have the "avahi-browse" command-line tool.

_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev

Reply via email to