mirror of
https://repo.or.cz/socat.git
synced 2024-12-22 23:42:34 +00:00
Added option rawer for pty
This commit is contained in:
parent
8e58611133
commit
5c822eb3ef
6 changed files with 24 additions and 4 deletions
3
CHANGES
3
CHANGES
|
@ -325,6 +325,9 @@ new features:
|
||||||
Added support for methods TLSv1, TLSv1.1, TLSv1.2, and DTLS1
|
Added support for methods TLSv1, TLSv1.1, TLSv1.2, and DTLS1
|
||||||
Tests: OPENSSL_METHOD_*
|
Tests: OPENSSL_METHOD_*
|
||||||
|
|
||||||
|
Added a new option termios-rawer for ptys.
|
||||||
|
Thanks to Christian Vogelgsang for pointing me to this requirement
|
||||||
|
|
||||||
docu
|
docu
|
||||||
minor corrections in docu (thanks to Paggas)
|
minor corrections in docu (thanks to Paggas)
|
||||||
|
|
||||||
|
|
5
test.sh
5
test.sh
|
@ -189,8 +189,9 @@ case "$UNAME" in
|
||||||
# PTYOPTS2=
|
# PTYOPTS2=
|
||||||
# ;;
|
# ;;
|
||||||
*)
|
*)
|
||||||
PTYOPTS="echo=0,opost=0"
|
#PTYOPTS="echo=0,opost=0"
|
||||||
PTYOPTS2="raw,echo=0"
|
#PTYOPTS2="raw,echo=0"
|
||||||
|
PTYOPTS2="rawer"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* source: xio-termios.c */
|
/* source: xio-termios.c */
|
||||||
/* Copyright Gerhard Rieger 2001-2012 */
|
/* Copyright Gerhard Rieger */
|
||||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||||
|
|
||||||
/* this file contains the source for terminal I/O options */
|
/* this file contains the source for terminal I/O options */
|
||||||
|
@ -268,6 +268,8 @@ const struct optdesc opt_veol2 = { "veol2", "eol2", OPT_VEOL2, GROUP_TER
|
||||||
|
|
||||||
const struct optdesc opt_raw = { "raw", NULL, OPT_RAW, GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
|
const struct optdesc opt_raw = { "raw", NULL, OPT_RAW, GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
|
||||||
const struct optdesc opt_sane = { "sane", NULL, OPT_SANE, GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
|
const struct optdesc opt_sane = { "sane", NULL, OPT_SANE, GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
|
||||||
|
const struct optdesc opt_termios_cfmakeraw = { "termios-cfmakeraw", "cfmakeraw", OPT_TERMIOS_CFMAKERAW, GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
|
||||||
|
const struct optdesc opt_termios_rawer = { "termios-rawer", "rawer", OPT_TERMIOS_RAWER, GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
|
||||||
|
|
||||||
#ifdef HAVE_TERMIOS_ISPEED
|
#ifdef HAVE_TERMIOS_ISPEED
|
||||||
#if defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
|
#if defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* source: xio-termios.h */
|
/* source: xio-termios.h */
|
||||||
/* Copyright Gerhard Rieger 2001-2008 */
|
/* Copyright Gerhard Rieger */
|
||||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||||
|
|
||||||
#ifndef __xio_termios_h_included
|
#ifndef __xio_termios_h_included
|
||||||
|
@ -138,6 +138,9 @@ extern const struct optdesc opt_sane;
|
||||||
extern const struct optdesc opt_ispeed;
|
extern const struct optdesc opt_ispeed;
|
||||||
extern const struct optdesc opt_ospeed;
|
extern const struct optdesc opt_ospeed;
|
||||||
|
|
||||||
|
extern const struct optdesc opt_termios_cfmakeraw;
|
||||||
|
extern const struct optdesc opt_termios_rawer;
|
||||||
|
|
||||||
#if _WITH_TERMIOS /* otherwise tcflag_t might be reported undefined */
|
#if _WITH_TERMIOS /* otherwise tcflag_t might be reported undefined */
|
||||||
extern int xiotermios_setflag(int fd, int word, tcflag_t mask);
|
extern int xiotermios_setflag(int fd, int word, tcflag_t mask);
|
||||||
extern int xiotermios_clrflag(int fd, int word, tcflag_t mask);
|
extern int xiotermios_clrflag(int fd, int word, tcflag_t mask);
|
||||||
|
|
|
@ -1595,6 +1595,8 @@ const struct optname optionnames[] = {
|
||||||
IF_IPAPP ("tcpwrapper", &opt_tcpwrappers)
|
IF_IPAPP ("tcpwrapper", &opt_tcpwrappers)
|
||||||
IF_IPAPP ("tcpwrappers", &opt_tcpwrappers)
|
IF_IPAPP ("tcpwrappers", &opt_tcpwrappers)
|
||||||
#endif
|
#endif
|
||||||
|
IF_TERMIOS("termios-cfmakeraw", &opt_termios_cfmakeraw)
|
||||||
|
IF_TERMIOS("termios-rawer", &opt_termios_rawer)
|
||||||
#ifdef O_TEXT
|
#ifdef O_TEXT
|
||||||
IF_ANY ("text", &opt_o_text)
|
IF_ANY ("text", &opt_o_text)
|
||||||
#endif
|
#endif
|
||||||
|
@ -3638,6 +3640,13 @@ int applyopts(int fd, struct opt *opts, enum e_phase phase) {
|
||||||
termarg.c_cc[VMIN] = 1;
|
termarg.c_cc[VMIN] = 1;
|
||||||
termarg.c_cc[VTIME] = 0;
|
termarg.c_cc[VTIME] = 0;
|
||||||
break;
|
break;
|
||||||
|
case OPT_TERMIOS_RAWER:
|
||||||
|
termarg.c_iflag = 0;
|
||||||
|
termarg.c_oflag = 0;
|
||||||
|
termarg.c_lflag = 0;
|
||||||
|
termarg.c_cc[VMIN] = 1;
|
||||||
|
termarg.c_cc[VTIME] = 0;
|
||||||
|
break;
|
||||||
case OPT_SANE:
|
case OPT_SANE:
|
||||||
/* cread -ignbrk brkint -inlcr -igncr icrnl
|
/* cread -ignbrk brkint -inlcr -igncr icrnl
|
||||||
-ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl
|
-ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl
|
||||||
|
|
|
@ -794,6 +794,8 @@ enum e_optcode {
|
||||||
#ifdef TCP_WINDOW_CLAMP
|
#ifdef TCP_WINDOW_CLAMP
|
||||||
OPT_TCP_WINDOW_CLAMP, /* Linux 2.4.0 */
|
OPT_TCP_WINDOW_CLAMP, /* Linux 2.4.0 */
|
||||||
#endif
|
#endif
|
||||||
|
OPT_TERMIOS_CFMAKERAW, /* termios.cfmakeraw() */
|
||||||
|
OPT_TERMIOS_RAWER,
|
||||||
OPT_TIOCSCTTY,
|
OPT_TIOCSCTTY,
|
||||||
OPT_TOSTOP, /* termios.c_lflag */
|
OPT_TOSTOP, /* termios.c_lflag */
|
||||||
OPT_TUN_DEVICE, /* tun: /dev/net/tun ... */
|
OPT_TUN_DEVICE, /* tun: /dev/net/tun ... */
|
||||||
|
|
Loading…
Reference in a new issue