TTY RPL interface :: Design
===========================

RPL-style TTY logging has been split up into multiple stages, to allow most of
the components to be Kernel modules or Userspace applications.

First Stage - Kernel Patch

        The first step in capturing the data off a tty is directly in the
        kernel, within drivers/char/tty_io.c. Five variable function
        pointers -- rpl_qopen, rpl_qread, rpl_qwrite, rpl_qclose and
        rpl_qioctl -- are exported for module hook-up.

Second Stage - Kernel Module

        The 2nd stage consists of the functions behind rpl_qopen, etc. They
        copy the data captured by the tty driver to a buffer within the module,
        so that rpl_qopen() can return ASAP and the tty driver can continue.

Third Stage - Userspace Gate

        A device file and corresponding functions to read from the mentioned
        buffer make up the 3rd stage.

Fourth Stage - Userspace Daemon

        A userspace daemon reads, evaluates and stores the data retrieved via
        /dev/misc/rpl (or any other device the 3rd stage creates).

I think the setup is good as it is because:

        - only the real necessary stuff is compiled _into_ the Kernel,
          everything else goes as a module
        - you can replace a module (and thus,
          the way 2nd and 3rd stage interact,
          3rd and 4th stage communicate)
          within a running system
        - user memory can be swapped out if is not used,
          Kernel memory is not swapped
        - you have all your favorite libraries in userspace
