1 ;;; zeroconf.el --- Service browser using Avahi.
3 ;; Copyright (C) 2008 Free Software Foundation, Inc.
5 ;; Author: Michael Albinus <michael.albinus@gmx.de>
6 ;; Keywords: comm, hardware
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, see
22 ;; <http://www.gnu.org/licenses/>.
26 ;; This package provides an interface to the Avahi, the zeroconf
27 ;; daemon under GNU/Linux. The communication mean with Avahi is
30 ;; In order to activate this package, you must add the following code
33 ;; (require 'zeroconf)
34 ;; (zeroconf-init "dns-sd.org")
36 ;; "dns-sd.org" is an example the domain you wish to resolve services
37 ;; for. It can also be nil or "", which means the default local
40 ;; The `zeroconf-init' function installs several handlers, which are
41 ;; activated by D-Bus signals sent from the Avahi daemon.
42 ;; Immediately, when a service is added or removed in the domain, a
43 ;; corresponding handler in Emacs is called.
48 ;; The main purpose of zeroconf is service discovery. This means,
49 ;; that services are detected as soon as they appear or disappear in a
50 ;; given domain. A service is offered by a network device. It is
51 ;; assigned to a service type.
53 ;; In order to see all offered service types of the initialized
54 ;; domain, you can call
56 ;; (zeroconf-list-service-types)
58 ;; Service types are described at <http://www.dns-sd.org/ServiceTypes.html>.
59 ;; Detected services for a given service type, let's say "_ipp._tcp",
62 ;; (zeroconf-list-services "_ipp._tcp")
64 ;; It is possible to register an own handler (function) to be called
65 ;; when a service has been added or removed in the domain. The
66 ;; service type "_ipp._tcp" is used for printer services supporting
67 ;; the Internet Printing Protocol.
69 ;; (defun my-add-printer (service)
70 ;; (message "Printer `%s' detected" (zeroconf-service-name service)))
72 ;; (defun my-remove-printer (service)
73 ;; (message "Printer `%s' removed" (zeroconf-service-name service)))
75 ;; (zeroconf-service-add-hook "_ipp._tcp" :new 'my-add-printer)
76 ;; (zeroconf-service-add-hook "_ipp._tcp" :removed 'my-remove-printer)
78 ;; There are several functions returning information about a service,
79 ;; see the doc string of `zeroconf-service-add-hook'.
84 ;; The function `zeroconf-publish-service' publishes a new service to
85 ;; the Avahi daemon. Although the domain, where to the service is
86 ;; published, can be specified by this function, it is usally the
87 ;; default domain "local" (also written as nil or "").
89 ;; (zeroconf-publish-service
90 ;; "Example service" ;; Service name.
91 ;; "_example._tcp" ;; Service type.
92 ;; nil ;; Default domain ("local").
93 ;; nil ;; Default host (concat (getenv "HOST") ".local").
94 ;; 111 ;; Port number of the host, the service is offered.
95 ;; "1.2.3.4" ;; IPv4 address of the host.
96 ;; '("version=1.0" ;; TXT fields describing the service.
99 ;; The lifetime of a published service is the lifetime of Emacs.
103 ;; Pacify byte-compiler. D-Bus support in the Emacs core can be
104 ;; disabled with configuration option "--without-dbus". Declare used
105 ;; subroutines and variables of `dbus' therefore.
109 (declare-function dbus-call-method "dbusbind.c")
110 (declare-function dbus-register-signal "dbusbind.c")
115 (defvar zeroconf-debug nil
116 "Write messages during service discovery")
118 (defconst zeroconf-service-avahi "org.freedesktop.Avahi"
119 "The D-Bus name used to talk to Avahi.")
121 (defconst zeroconf-path-avahi "/"
122 "The D-Bus root object path used to talk to Avahi.")
124 (defvar zeroconf-path-avahi-service-type-browser nil
125 "The D-Bus object path used to talk to the Avahi service type browser.")
127 (defvar zeroconf-path-avahi-service-browser-hash (make-hash-table :test 'equal)
128 "The D-Bus object paths used to talk to the Avahi service browser.")
130 (defvar zeroconf-path-avahi-service-resolver-hash (make-hash-table :test 'equal)
131 "The D-Bus object paths used to talk to the Avahi service resolver.")
133 ;; Methods: "Free", "Commit", "Reset", "GetState", "IsEmpty",
134 ;; "AddService", "AddServiceSubtype", "UpdateServiceTxt", "AddAddress"
136 ;; Signals: "StateChanged".
137 (defconst zeroconf-interface-avahi-entry-group
138 (concat zeroconf-service-avahi ".EntryGroup")
139 "The D-Bus entry group interface exported by Avahi.")
141 ;; Methods: "GetVersionString", "GetAPIVersion", "GetHostName",
142 ;; "SetHostName", "GetHostNameFqdn", "GetDomainName",
143 ;; "IsNSSSupportAvailable", "GetState", "GetLocalServiceCookie",
144 ;; "GetAlternativeHostName", "GetAlternativeServiceName",
145 ;; "GetNetworkInterfaceNameByIndex", "GetNetworkInterfaceIndexByName",
146 ;; "ResolveHostName", "ResolveAddress", "ResolveService",
147 ;; "EntryGroupNew", "DomainBrowserNew", "ServiceTypeBrowserNew",
148 ;; "ServiceBrowserNew", "ServiceResolverNew", "HostNameResolverNew",
149 ;; "AddressResolverNew" and "RecordBrowserNew".
150 ;; Signals: "StateChanged".
151 (defconst zeroconf-interface-avahi-server
152 (concat zeroconf-service-avahi ".Server")
153 "The D-Bus server interface exported by Avahi.")
156 ;; Signals: "ItemNew", "ItemRemove", "CacheExhausted", "AllForNow" and
158 (defconst zeroconf-interface-avahi-service-type-browser
159 (concat zeroconf-service-avahi ".ServiceTypeBrowser")
160 "The D-Bus service type browser interface exported by Avahi.")
163 ;; Signals: "ItemNew", "ItemRemove", "CacheExhausted", "AllForNow" and
165 (defconst zeroconf-interface-avahi-service-browser
166 (concat zeroconf-service-avahi ".ServiceBrowser")
167 "The D-Bus service browser interface exported by Avahi.")
170 ;; Available signals are "Found" and "Failure".
171 (defconst zeroconf-interface-avahi-service-resolver
172 (concat zeroconf-service-avahi ".ServiceResolver")
173 "The D-Bus service resolver interface exported by Avahi.")
175 (defconst zeroconf-avahi-interface-unspec -1
176 "Wildcard Avahi interface spec.")
178 (defconst zeroconf-avahi-protocol-unspec -1
179 "Wildcard Avahi protocol spec.")
181 (defconst zeroconf-avahi-protocol-inet4 0
182 "Avahi INET4 address protocol family.")
184 (defconst zeroconf-avahi-protocol-inet6 1
185 "Avahi INET6 address protocol family.")
187 (defconst zeroconf-avahi-domain-unspec ""
188 "Empty Avahi domain.")
190 (defvar zeroconf-avahi-current-domain zeroconf-avahi-domain-unspec
191 "Domain name services are resolved for.")
193 (defconst zeroconf-avahi-flags-unspec 0
197 ;;; Services retrieval.
199 (defvar zeroconf-services-hash (make-hash-table :test 'equal)
200 "Hash table of discovered Avahi services.
202 The key of an entry is the concatenation of the service name and
203 service type of a discovered service. The value is the service
204 itself. The format of a service is
206 \(INTERFACE PROTOCOL NAME TYPE DOMAIN FLAGS\)
208 The INTERFACE is a number, which represents the network interface
209 the service is located at. The corresponding network interface
210 name, like \"eth0\", can be retrieved with the function
211 `zeroconf-get-interface-name'.
213 PROTOCOL describes the used network protocol family the service
214 can be accessed. `zeroconf-avahi-protocol-inet4' means INET4,
215 `zeroconf-avahi-protocol-inet6' means INET6. An unspecified
216 protocol family is coded with `zeroconf-avahi-protocol-unspec'.
218 NAME is the string the service is known at Avahi. A service can
219 be known under the same name for different service types.
221 Each TYPE stands for a discovered service type of Avahi. The
222 format is described in RFC 2782. It is of the form
224 \"_APPLICATION-PROTOCOL._TRANSPORT-PROTOCOL\".
226 TRANSPORT-PROTOCOL must be either \"tcp\" or \"udp\".
227 APPLICATION-PROTOCOL must be a protocol name as specified in URL
228 `http://www.dns-sd.org/ServiceTypes.html'. Typical service types
229 are \"_workstation._tcp\" or \"_printer._tcp\".
231 DOMAIN is the domain name the service is registered in, like \"local\".
233 FLAGS, an integer, is used inside Avahi. When publishing a
234 service (see `zeroconf-publish-service', the flag 0 is used.")
236 (defvar zeroconf-resolved-services-hash (make-hash-table :test 'equal)
237 "Hash table of resolved Avahi services.
238 The key of an entry is the concatenation of the service name and
239 service type of a resolved service. The value is the service
240 itself. The format of a service is
242 \(INTERFACE PROTOCOL NAME TYPE DOMAIN HOST APROTOCOL ADDRESS PORT TXT FLAGS\)
244 INTERFACE, PROTOCOL, NAME, TYPE, DOMAIN and FLAGS have the same
245 meaning as in `zeroconf-services-hash'.
247 HOST is the host name the service is registered. It is a fully
248 qualified name, i.e., it contains DOMAIN.
250 APROTOCOL stands for the network protocol family ADDRESS is
251 encoded (`zeroconf-avahi-protocol-inet4' means INET4,
252 `zeroconf-avahi-protocol-inet6' means INET6). It can be
253 different from PROTOCOL, when an adrress resolution has been
254 requested for another protocol family but the default one.
256 ADDRESS is the service address, encoded according to the
257 APROTOCOL network protocol family. PORT is the corresponding
258 port the service can be reached on ADDRESS.
260 TXT is an array of strings, describing additional attributes of
261 the service. Usually, every string is a key=value pair. The
262 supported keys depend on the service type.")
264 (defun zeroconf-list-service-names ()
265 "Returns all discovered Avahi service names as list."
268 (lambda (key value) (add-to-list 'result (zeroconf-service-name value)))
269 zeroconf-services-hash)
272 (defun zeroconf-list-service-types ()
273 "Returns all discovered Avahi service types as list."
276 (lambda (key value) (add-to-list 'result (zeroconf-service-type value)))
277 zeroconf-services-hash)
280 (defun zeroconf-list-services (type)
281 "Returns all discovered Avahi services for a given service type TYPE.
282 The service type is one of the returned values of
283 `zeroconf-list-service-types'. The return value is a list
284 \(SERVICE1 SERVICE2 ...\). See `zeroconf-services-hash' for the
289 (when (equal type (zeroconf-service-type value))
290 (add-to-list 'result value)))
291 zeroconf-services-hash)
294 (defvar zeroconf-service-added-hooks-hash (make-hash-table :test 'equal)
295 "Hash table of hooks for newly added services.
296 The key of an entry is a service type.")
298 (defvar zeroconf-service-removed-hooks-hash (make-hash-table :test 'equal)
299 "Hash table of hooks for removed services.
300 The key of an entry is a service type.")
302 (defun zeroconf-service-add-hook (type event function)
303 "Add FUNCTION to the hook of service type TYPE.
305 EVENT must be either :new or :removed, indicating whether
306 FUNCTION shall be called when a new service has been newly
307 detected, or removed.
309 FUNCTION must accept one argument SERVICE, which identifies the
310 new service. Initially, when EVENT is :new, FUNCTION is called
311 for all already detected services of service type TYPE.
313 The attributes of SERVICE can be retrieved via the functions
315 `zeroconf-service-interface'
316 `zeroconf-service-protocol'
317 `zeroconf-service-name'
318 `zeroconf-service-type'
319 `zeroconf-service-domain'
320 `zeroconf-service-flags'
321 `zeroconf-service-host'
322 `zeroconf-service-aprotocol'
323 `zeroconf-service-address'
324 `zeroconf-service-port'
325 `zeroconf-service-txt'"
329 (let ((l-hook (gethash type zeroconf-service-added-hooks-hash nil)))
330 (add-hook 'l-hook function)
331 (puthash type l-hook zeroconf-service-added-hooks-hash)
332 (dolist (service (zeroconf-list-services type))
333 (funcall function service))))
334 ((equal event :removed)
335 (let ((l-hook (gethash type zeroconf-service-removed-hooks-hash nil)))
336 (add-hook 'l-hook function)
337 (puthash type l-hook zeroconf-service-removed-hooks-hash)))
338 (t (error "EVENT must be either `:new' or `:removed'."))))
340 (defun zeroconf-get-host ()
341 "Returns the local host name as string."
343 :system zeroconf-service-avahi zeroconf-path-avahi
344 zeroconf-interface-avahi-server "GetHostName"))
346 (defun zeroconf-get-domain ()
347 "Returns the domain name as string."
349 :system zeroconf-service-avahi zeroconf-path-avahi
350 zeroconf-interface-avahi-server "GetDomainName"))
352 (defun zeroconf-get-host-domain ()
353 "Returns the local host name FQDN as string."
355 :system zeroconf-service-avahi zeroconf-path-avahi
356 zeroconf-interface-avahi-server "GetHostNameFqdn"))
358 (defun zeroconf-get-interface-name (number)
359 "Return the interface name of internal interface NUMBER."
361 :system zeroconf-service-avahi zeroconf-path-avahi
362 zeroconf-interface-avahi-server "GetNetworkInterfaceNameByIndex"
365 (defun zeroconf-get-interface-number (name)
366 "Return the internal interface number of interface NAME."
368 :system zeroconf-service-avahi zeroconf-path-avahi
369 zeroconf-interface-avahi-server "GetNetworkInterfaceIndexByName"
372 (defun zeroconf-get-service (name type)
373 "Return the service description of service NAME as list.
374 NAME must be a string. The service must be of service type
375 TYPE. The resulting list has the format
377 \(INTERFACE PROTOCOL NAME TYPE DOMAIN FLAGS\)."
378 ;; Due to the service browser, all known services are kept in
379 ;; `zeroconf-services-hash'.
380 (gethash (concat name "/" type) zeroconf-services-hash nil))
382 (defun zeroconf-resolve-service (service)
383 "Return all service attributes SERVICE as list.
384 NAME must be a string. The service must be of service type
385 TYPE. The resulting list has the format
387 \(INTERFACE PROTOCOL NAME TYPE DOMAIN HOST APROTOCOL ADDRESS PORT TXT FLAGS\)."
388 (let* ((name (zeroconf-service-name service))
389 (type (zeroconf-service-type service))
390 (key (concat name "/" type)))
393 ;; Check whether we know this service already.
394 (gethash key zeroconf-resolved-services-hash nil)
396 ;; Resolve the service. We don't propagate D-Bus errors.
400 :system zeroconf-service-avahi zeroconf-path-avahi
401 zeroconf-interface-avahi-server "ResolveService"
402 zeroconf-avahi-interface-unspec
403 zeroconf-avahi-protocol-unspec
405 zeroconf-avahi-current-domain
406 zeroconf-avahi-protocol-unspec
407 zeroconf-avahi-flags-unspec))
408 (elt (nth 9 result))) ;; TXT.
409 ;; The TXT field has the signature "aay". Transform to "as".
411 (setcar elt (apply 'string (car elt)))
412 (setq elt (cdr elt)))
414 (when nil ;; We discard it, no use so far.
415 ;; Register a service resolver.
416 (let ((object-path (zeroconf-register-service-resolver name type)))
417 ;; Register the signals.
418 (dolist (member '("Found" "Failure"))
419 (dbus-register-signal
420 :system zeroconf-service-avahi object-path
421 zeroconf-interface-avahi-service-resolver member
422 'zeroconf-service-resolver-handler)))
425 ;; Return the resolved service.
426 (puthash key result zeroconf-resolved-services-hash))))))
428 (defun zeroconf-service-interface (service)
429 "Return the internal interface number of SERVICE."
432 (defun zeroconf-service-protocol (service)
433 "Return the protocol number of SERVICE."
436 (defun zeroconf-service-name (service)
437 "Return the service name of SERVICE."
440 (defun zeroconf-service-type (service)
441 "Return the type name of SERVICE."
444 (defun zeroconf-service-domain (service)
445 "Return the domain name of SERVICE."
448 (defun zeroconf-service-flags (service)
449 "Return the flags of SERVICE."
452 (defun zeroconf-service-host (service)
453 "Return the host name of SERVICE."
454 (nth 5 (zeroconf-resolve-service service)))
456 (defun zeroconf-service-aprotocol (service)
457 "Return the aprotocol number of SERVICE."
458 (nth 6 (zeroconf-resolve-service service)))
460 (defun zeroconf-service-address (service)
461 "Return the IP address of SERVICE."
462 (nth 7 (zeroconf-resolve-service service)))
464 (defun zeroconf-service-port (service)
465 "Return the port number of SERVICE."
466 (nth 8 (zeroconf-resolve-service service)))
468 (defun zeroconf-service-txt (service)
469 "Return the text strings of SERVICE."
470 (nth 9 (zeroconf-resolve-service service)))
473 ;;; Services signalling.
475 ;; Register for the service type browser. Service registrations will
476 ;; happen in `zeroconf-service-type-browser-handler', when there is an
477 ;; "ItemNew" signal from the service type browser.
478 (defun zeroconf-init (&optional domain)
479 "Instantiate an Avahi service type browser for domain DOMAIN.
480 DOMAIN is a string, like \"dns-sd.org\" or \"local\". When
481 DOMAIN is nil, the local domain is used."
482 (when (and (or (null domain) (stringp domain))
483 (dbus-ping :system zeroconf-service-avahi)
485 :system zeroconf-service-avahi zeroconf-path-avahi
486 zeroconf-interface-avahi-server "IsNSSSupportAvailable"))
488 ;; Reset all stored values.
489 (setq zeroconf-path-avahi-service-type-browser nil
490 zeroconf-avahi-current-domain (or domain
491 zeroconf-avahi-domain-unspec))
492 (clrhash zeroconf-path-avahi-service-browser-hash)
493 (clrhash zeroconf-path-avahi-service-resolver-hash)
494 (clrhash zeroconf-services-hash)
495 (clrhash zeroconf-resolved-services-hash)
496 (clrhash zeroconf-service-added-hooks-hash)
497 (clrhash zeroconf-service-removed-hooks-hash)
499 ;; Register a service type browser.
500 (let ((object-path (zeroconf-register-service-type-browser)))
501 ;; Register the signals.
502 (dolist (member '("ItemNew" "ItemRemove" "Failure"))
503 (dbus-register-signal
504 :system zeroconf-service-avahi object-path
505 zeroconf-interface-avahi-service-type-browser member
506 'zeroconf-service-type-browser-handler)))
508 ;; Register state changed signal.
509 (dbus-register-signal
510 :system zeroconf-service-avahi zeroconf-path-avahi
511 zeroconf-interface-avahi-service-type-browser "StateChanged"
512 'zeroconf-service-type-browser-handler)))
514 (defun zeroconf-register-service-type-browser ()
515 "Register a service type browser at the Avahi daemon."
516 (or zeroconf-path-avahi-service-type-browser
517 (setq zeroconf-path-avahi-service-type-browser
519 :system zeroconf-service-avahi zeroconf-path-avahi
520 zeroconf-interface-avahi-server "ServiceTypeBrowserNew"
521 zeroconf-avahi-interface-unspec
522 zeroconf-avahi-protocol-unspec
523 zeroconf-avahi-current-domain
524 zeroconf-avahi-flags-unspec))))
526 (defun zeroconf-service-type-browser-handler (&rest val)
527 "Registered service type browser handler at the Avahi daemon."
529 (message "zeroconf-service-type-browser-handler: %s %S"
530 (dbus-event-member-name last-input-event) val))
532 ((string-equal (dbus-event-member-name last-input-event) "ItemNew")
533 ;; Parameters: (interface protocol type domain flags)
534 ;; Register a service browser.
535 (let ((object-path (zeroconf-register-service-browser (nth-value 2 val))))
536 ;; Register the signals.
537 (dolist (member '("ItemNew" "ItemRemove" "Failure"))
538 (dbus-register-signal
539 :system zeroconf-service-avahi object-path
540 zeroconf-interface-avahi-service-browser member
541 'zeroconf-service-browser-handler))))))
543 (defun zeroconf-register-service-browser (type)
544 "Register a service browser at the Avahi daemon."
545 (or (gethash type zeroconf-path-avahi-service-browser-hash nil)
548 :system zeroconf-service-avahi zeroconf-path-avahi
549 zeroconf-interface-avahi-server "ServiceBrowserNew"
550 zeroconf-avahi-interface-unspec
551 zeroconf-avahi-protocol-unspec
553 zeroconf-avahi-current-domain
554 zeroconf-avahi-flags-unspec)
555 zeroconf-path-avahi-service-browser-hash)))
557 (defun zeroconf-service-browser-handler (&rest val)
558 "Registered service browser handler at the Avahi daemon."
559 ;; Parameters: (interface protocol name type domain flags)
561 (message "zeroconf-service-browser-handler: %s %S"
562 (dbus-event-member-name last-input-event) val))
563 (let* ((name (zeroconf-service-name val))
564 (type (zeroconf-service-type val))
565 (key (concat name "/" type))
566 (ahook (gethash type zeroconf-service-added-hooks-hash nil))
567 (rhook (gethash type zeroconf-service-removed-hooks-hash nil)))
569 ((string-equal (dbus-event-member-name last-input-event) "ItemNew")
571 (puthash key val zeroconf-services-hash)
572 (run-hook-with-args 'ahook val))
574 ((string-equal (dbus-event-member-name last-input-event) "ItemRemove")
575 ;; Remove the service.
576 (remhash key zeroconf-services-hash)
577 (remhash key zeroconf-resolved-services-hash)
578 (run-hook-with-args 'rhook val)))))
580 (defun zeroconf-register-service-resolver (name type)
581 "Register a service resolver at the Avahi daemon."
582 (let ((key (concat name "/" type)))
583 (or (gethash key zeroconf-path-avahi-service-resolver-hash nil)
586 :system zeroconf-service-avahi zeroconf-path-avahi
587 zeroconf-interface-avahi-server "ServiceResolverNew"
588 zeroconf-avahi-interface-unspec
589 zeroconf-avahi-protocol-unspec
591 zeroconf-avahi-current-domain
592 zeroconf-avahi-protocol-unspec
593 zeroconf-avahi-flags-unspec)
594 zeroconf-resolved-services-hash))))
596 (defun zeroconf-service-resolver-handler (&rest val)
597 "Registered service resolver handler at the Avahi daemon."
598 ;; Parameters: (interface protocol name type domain host aprotocol
599 ;; address port txt flags)
600 ;; The "TXT" field has the signature "aay". Transform to "as".
601 (let ((elt (nth 9 val)))
603 (setcar elt (apply 'string (car elt)))
604 (setq elt (cdr elt))))
606 (message "zeroconf-service-resolver-handler: %s %S"
607 (dbus-event-member-name last-input-event) val))
609 ;; A new service has been detected. Add it to
610 ;; `zeroconf-resolved-services-hash'.
611 ((string-equal (dbus-event-member-name last-input-event) "Found")
613 (concat (zeroconf-service-name val) "/" (zeroconf-service-type val))
614 val zeroconf-resolved-services-hash))))
617 ;;; Services publishing.
619 (defun zeroconf-publish-service (name type domain host port address txt)
620 "Publish a service at the Avahi daemon.
621 For the description of arguments, see `zeroconf-resolved-services-hash'."
622 ;; NAME and TYPE must not be empty.
623 (when (zerop (length name))
624 (error "Invalid argument NAME: %s" name))
625 (when (zerop (length type))
626 (error "Invalid argument TYPE: %s" type))
628 ;; Set default values for DOMAIN, HOST and PORT.
629 (when (zerop (length domain))
630 (setq domain (zeroconf-get-domain)))
631 (when (zerop (length host))
632 (setq host (zeroconf-get-host-domain)))
636 ;; Create an entry in the daemon.
639 :system zeroconf-service-avahi zeroconf-path-avahi
640 zeroconf-interface-avahi-server "EntryGroupNew"))
643 ;; The TXT field has the signature "as". Transform to "aay".
648 (dolist (elt1 (string-to-list elt) (append '(:array) args))
649 (setq args (append args (list :byte elt1)))))))
653 :system zeroconf-service-avahi object-path
654 zeroconf-interface-avahi-entry-group "AddService"
655 zeroconf-avahi-interface-unspec
656 zeroconf-avahi-protocol-unspec
657 zeroconf-avahi-flags-unspec
658 name type domain host :uint16 port (append '(:array) result))
661 (unless (zerop (length address))
663 :system zeroconf-service-avahi object-path
664 zeroconf-interface-avahi-entry-group "AddAddress"
665 zeroconf-avahi-interface-unspec
666 zeroconf-avahi-protocol-unspec
667 zeroconf-avahi-flags-unspec
670 ;; Make it persistent in the daemon.
672 :system zeroconf-service-avahi object-path
673 zeroconf-interface-avahi-entry-group "Commit")))
677 ;; arch-tag: ea578165-7fa8-44f4-90f0-de3940aec69f
678 ;;; zeroconf.el ends here