Function: tramp-zeroconf-parse-device-names

tramp-zeroconf-parse-device-names is a byte-compiled function defined in tramp-gvfs.el.gz.

Signature

(tramp-zeroconf-parse-device-names SERVICE)

Documentation

Return a list of (user host) tuples allowed to access.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-gvfs.el.gz
;; D-Bus zeroconf functions.

(defun tramp-zeroconf-parse-device-names (service)
  "Return a list of (user host) tuples allowed to access."
  (mapcar
   (lambda (x)
     (let ((host (zeroconf-service-host x))
	   (port (zeroconf-service-port x))
	   (text (zeroconf-service-txt x))
	   user)
       (when port
	 (setq host (format "%s%s%d" host tramp-prefix-port-regexp port)))
       ;; A user is marked in a TXT field like "u=guest".
       (while text
	 (when (string-match "u=\\(.+\\)$" (car text))
	   (setq user (match-string 1 (car text))))
	 (setq text (cdr text)))
       (list user host)))
   (zeroconf-list-services service)))