From e7b43fa419ded4170f2cf3f12cc4765753d4c298 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 6 Aug 2019 12:21:19 -0400 Subject: Initial public version. --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..028229e --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +printer-browser.py +================== + +Small program to browse the local network for printers via +Apple-flavored mDNS (Bonjour), massage the data slightly, and write +it out in DNS master file format. + +Changes made to the data: + +* We strip off the `.local.` suffix, because we want to append the + local zone `$ORIGIN` when we drop this text into a master file. + +* We remove the adminurl property, because we don't generally want our + users trying to reconfigure our printers anyway. + +The target audience for this is the IETF meeting network, but this +might conceivably be useful whenever trying to make AirPrint work +across multiple network segments. + +Most of the work is done by two external packages: `zeroconf` and +`dnspython`. Both of these are available from PyPi, as well as from +various OS-specific packaging systems. + +In theory this code is Python-version-agnostic, and should run under +either Python 2 or Python 3. + +Current usage as of this writing (run with `--help` for latest): + +``` +usage: printer_browser.py [-h] [-q] [-o OUTPUT] + [--browse-timeout BROWSE_TIMEOUT] + [--query-timeout QUERY_TIMEOUT] [--keep-adminurl] + [mdns_type [mdns_type ...]] + +Browse for printers on the local net, dump DNS records for inclusion in a DNS +zone in master file format. + +positional arguments: + mdns_type mDNS types for which to browse (default: + ['_ipp._tcp.local.', '_pdl-datastream._tcp.local.']) + +optional arguments: + -h, --help show this help message and exit + -q, --quiet omit comments from generated master file text + (default: False) + -o OUTPUT, --output OUTPUT + where to write master file text (default: -) + --browse-timeout BROWSE_TIMEOUT + timeout in seconds while browsing for printers + (default: 5) + --query-timeout QUERY_TIMEOUT + timeout in seconds to retrieve printer data (default: + 3) + --keep-adminurl keep adminurl property in generated DNS data (default: + False) +``` -- cgit v1.2.3