CUPS
- the print spooler that wants to print via IPP-over-USB.ippusb_manager
- service that helps establish communication between the print spooler and ippusb_bridge
. Developed specifically for IPP-over-USB printing in Chromium OS.ippusb_bridge
- Chromium OS system service that proxies HTTP traffic over USB to an IPP-over-USB printer.ippusb://<VID>_<PID>/ipp/print
.ippusb://
scheme.lpadmin
and to the ipp
backend.ippusb://
scheme, then CUPS sends a request to ippusb_manager
to broker a socket for communication with the printer by way of ippusb_bridge
.ippusb://
scheme is specific to Chromium OS.ippusb://
scheme in CUPS configuration etc. on-device, but rewrite the URI to use the ipp://
scheme before communicating with the printer.CUPS
and ippusb_bridge
./run/ippusb/ippusb_manager.sock
./run/ippusb/<VID>_<PID>.sock
and /run/ippusb/<VID>_<PID>_keep_alive.sock
, andippusb_bridge
, checked by sending a keep-alive message on the latter socket.CUPS
with the basename of the socket over which it can communicate with ippusb_bridge
.ippusb_manager
to ippusb_bridge
to preempt the latter from its timed idle exit.ippusb_manager
listens for an explicit acknowledgement before declaring ippusb_bridge
alive and reusing the extant sockets.ippusb_manager
tries to wait for the sockets to disappear (i.e. for ippusb_bridge
to exit) before spawning a new instance.ippusb_manager
, as mentioned above.ippusb_bridge
receives a keep-alive from ippusb_manager
, it resets the idle timer in anticipation of imminent activity.CUPS
and the printer via USB.ippusb
connection for a given printer. HTTP requests over the connection are handled one at a time.ippusb
interfaces on the printer until exit.ippusb_manager
and ippusb_bridge
are run from inside minijail instances and retain their own seccomp filters.ippusb_manager
forks ippusb_bridge
, the manager‘s seccomp filter must be a superset of ippusb_bridge’s.(WRT ippusb_manager) why Unix sockets; why not D-Bus?
We didn't consider D-Bus at the time. The messages are quite simple and CUPS
already had code for dealing with Unix sockets.
Can a user plug in more than one USB printer?
Yes, as long as they do not appear to be the same (i.e. present identical VIDs and PIDs). We opine that this is an uncommon enough use case to be an issue.
Can ippusb_manager and ippusb_bridge have multiple clients?
Preliminary testing indicates that this should work. Sockets are connection-oriented, and an instance of ippusb_bridge
is spawned for each connected ippusb
printer.
Producing overview_diagram.png from overview_diagram.dot
To generate the overview diagram for the .dot definition, run the following commands:
dot -Tpng overview_diagram.dot -o overview_diagram.png
convert overview_diagram.png -colorspace gray -quality 91 overview_diagram.png
Note: This documentation is only accessible to Google employees.
See the design doc for information about the overall design and how ippusb_manager
fits into it.
For some discussion of why we migrated to ippusb_bridge
(from ippusbxd
as discussed in the design doc), see go/ippusb-bridge-design.
This repository contains the following subdirectories:
Subdirectory | Description |
---|---|
etc/init | Upstart config files for launching ippusb_manager |
fuzzers | Source files for ippusb_manager fuzzers |
seccomp | Seccomp Policy files for restricting syscalls |
udev/ | udev rules for setting group permissions on ipp-usb printers |