lpinfo -v lists discovered printers. It does this by running cups-deviced, which in turns runs each backend from /usr/lib/cups/backend with no arguments. As per backend(7), backends will print information about discovered devices to standard out. cups-deviced can also be run by hand:

ipp backend

Doesn't do discovery itself, but printers can be discovered by running ippfind:

This asks Avahi to list services of several recognized types (_ipp.tcp, _printer.tcp, &c).

When it is time to print to this URL, the ipp backend ends up calling httpAddrGetList (via backendLookup) which uses getaddrinfo to resolve the host from the URL. So if the system resolver can't handle mDNS then CUPS won't be able to connect to that printer.

dnssd backend

Perhaps for that reason, CUPS prefers the dnssd backend:

This queries Avahi for services of several recognized types, coalescing duplicates by priority and then by type, which is why _pdl-datastream._tcp is chosen over the alternatives--it has a higher value in the cups_devtype_t enum.

When it is time to print to such a URL, the dnssd backend resolves it to a real url (with the scheme determined by the service type), and then runs the appropriate backend to handle the job.


CategoryTechnote

robots.org.uk: CUPSURLDiscovery (last edited 2017-03-14 15:17:15 by sam)

© Sam Morris <sam@robots.org.uk>.
Content may be distributed and modified providing this notice is preserved.