public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Howard Chu <hyc@symas.com>
To: linux-kernel <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 0/2] tty: add EXTPROC support for LINEMODE
Date: Tue, 15 Jun 2010 11:08:16 -0700	[thread overview]
Message-ID: <4C17C190.1020000@symas.com> (raw)
In-Reply-To: <4C12E4B7.4020900@symas.com>

Paraphrased from the 1989 BSD patch by David Borman @ cray.com:

     These are the changes needed for the kernel to support
     LINEMODE in the server.

     There is a new bit in the termios local flag word, EXTPROC.
     When this bit is set, several aspects of the terminal driver
     are disabled.  Input line editing, character echo, and mapping
     of signals are all disabled.  This allows the telnetd to turn
     off these functions when in linemode, but still keep track of
     what state the user wants the terminal to be in.

     New ioctl:
         TIOCSIG         Generate a signal to processes in the
                         current process group of the pty.

     There is a new mode for packet driver, the TIOCPKT_IOCTL bit.
     When packet mode is turned on in the pty, and the EXTPROC bit
     is set, then whenever the state of the pty is changed, the
     next read on the master side of the pty will have the TIOCPKT_IOCTL
     bit set, and the data will be the contents of a struct termios.
     This allows the process on the server side of the pty to know
     when the state of the terminal has changed, and what the new
     state is.

Since the original BSD patches accompanied the source code for telnet I've 
left that reference here, but obviously the feature is useful for any remote 
terminal protocol, including ssh.

The corresponding feature has existed in the BSD tty driver since 1989. For 
historical reference, a good copy of the relevant files can be found here:

http://anonsvn.mit.edu/viewvc/krb5/trunk/src/appl/telnet/?pathrev=17741

Signed-off-by: Howard Chu <hyc@symas.com>

---
Howard Chu (2):
   Add EXTPROC tty support for Telnet LINEMODE
   Add arch-specific EXTPROC definitions

  arch/alpha/include/asm/ioctls.h     |    2 ++
  arch/alpha/include/asm/termbits.h   |    1 +
  arch/arm/include/asm/ioctls.h       |    2 ++
  arch/arm/include/asm/termbits.h     |    1 +
  arch/avr32/include/asm/ioctls.h     |    2 ++
  arch/avr32/include/asm/termbits.h   |    1 +
  arch/cris/include/asm/ioctls.h      |    2 ++
  arch/cris/include/asm/termbits.h    |    1 +
  arch/frv/include/asm/ioctls.h       |    2 ++
  arch/frv/include/asm/termbits.h     |    1 +
  arch/h8300/include/asm/ioctls.h     |    2 ++
  arch/h8300/include/asm/termbits.h   |    1 +
  arch/ia64/include/asm/ioctls.h      |    2 ++
  arch/ia64/include/asm/termbits.h    |    1 +
  arch/m32r/include/asm/ioctls.h      |    2 ++
  arch/m32r/include/asm/termbits.h    |    1 +
  arch/m68k/include/asm/ioctls.h      |    2 ++
  arch/m68k/include/asm/termbits.h    |    1 +
  arch/mips/include/asm/ioctls.h      |    3 ++-
  arch/mips/include/asm/termbits.h    |    1 +
  arch/mn10300/include/asm/ioctls.h   |    2 ++
  arch/mn10300/include/asm/termbits.h |    1 +
  arch/parisc/include/asm/ioctls.h    |    2 ++
  arch/parisc/include/asm/termbits.h  |    1 +
  arch/powerpc/include/asm/ioctls.h   |    2 ++
  arch/powerpc/include/asm/termbits.h |    1 +
  arch/s390/include/asm/ioctls.h      |    2 ++
  arch/sh/include/asm/ioctls.h        |    2 ++
  arch/sparc/include/asm/ioctls.h     |    2 ++
  arch/sparc/include/asm/termbits.h   |    1 +
  arch/xtensa/include/asm/ioctls.h    |    2 ++
  arch/xtensa/include/asm/termbits.h  |    1 +
  drivers/char/n_tty.c                |   25 ++++++++++++++++++++++---
  drivers/char/pty.c                  |   13 +++++++++++++
  drivers/char/tty_ioctl.c            |   18 ++++++++++++------
  fs/compat_ioctl.c                   |    1 +
  include/asm-generic/ioctls.h        |    2 ++
  include/asm-generic/termbits.h      |    1 +
  include/linux/tty.h                 |    1 +
  39 files changed, 101 insertions(+), 10 deletions(-)

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

  reply	other threads:[~2010-06-15 18:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-11 10:18 EXTPROC, telnetd LINEMODE, revisited Howard Chu
2010-06-11 10:41 ` Andi Kleen
2010-06-11 11:17   ` Howard Chu
2010-06-11 20:22     ` Howard Chu
2010-06-12  1:36     ` [PATCH] " Howard Chu
2010-06-15 18:08       ` Howard Chu [this message]
2010-06-15 18:10         ` [PATCH 1/2] tty: add EXTPROC support for LINEMODE Howard Chu
2010-06-15 18:13           ` [PATCH 2/2] tty: Add arch-specific EXTPROC definitions Howard Chu
2010-06-15 18:35         ` [PATCH 0/2] tty: add EXTPROC support for LINEMODE Greg KH
2010-06-15 18:46           ` Howard Chu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C17C190.1020000@symas.com \
    --to=hyc@symas.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox