Metadata-Version: 2.4
Name: papyrium-advertiser-mdns
Version: 0.1.0
Summary: Announces Papyrium printers on the local network with multicast DNS (Bonjour, Avahi).
Author-email: Robert Smallshire <robert@smallshire.org.uk>
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: papyrium-core>=0.1.0
Requires-Dist: ifaddr>=0.2
Requires-Dist: zeroconf>=0.151
Dynamic: license-file

# papyrium-advertiser-mdns

Announces Papyrium printers on the local network with multicast DNS, the
way Bonjour and Avahi announce network printers, so senders such as a
Centronics-to-network bridge can find them without being told an address.

A raw TCP printer is announced as a `_pdl-datastream._tcp` service, the
type Apple's Bonjour Printing specification gives for raw port printing,
so it appears like any other network printer. Its TXT record follows that
specification's keys and says it is a Papyrium printer:

```
txtvers=1
qtotal=1
ty=Brother M-1109 (Papyrium)
product=(Brother M-1109)
note=Papyrium virtual printer
usb_MFG=Brother
usb_MDL=M-1109
usb_CMD=ESCP9
uuid=<the printer's UUID>
```

A client looking only for Papyrium printers can match "Papyrium" in `ty`
or `note`, or in the instance name, and can recognise a particular printer
by its `uuid` across renames and restarts.

There is no `_papyrium` DNS-SD subtype. python-zeroconf indexes a service
under a single type, so a service registered under the subtype answers only
browses for the subtype: once its announcements end, browsers of the plain
`_pdl-datastream._tcp` type, such as printer dialogs and CUPS, no longer
find it (python-zeroconf issues 1287 and 1093). Appearing as an ordinary
printer matters more, so the plain type is used, and the TXT record is how
a client tells Papyrium apart.

Only endpoints the network can reach are announced; an unspecified address
stands for every address of its family on this machine except loopback.
The services name their own host, `papyrium-<8 hex digits>.local.`, so
Papyrium never answers for the machine's own name. If the printer's name is
taken, a free variant is chosen and the name actually registered is
logged.

Registered as `mdns` on the `papyrium.advertiser` axis. It uses
[python-zeroconf](https://github.com/python-zeroconf/python-zeroconf),
which is licensed LGPL-2.1-or-later, unmodified as an ordinary dependency;
anyone distributing a bundle that includes it must meet the LGPL's terms
for that library.
