linux-decnet-commit Mailing List for DECnet for Linux (Page 23)
Brought to you by:
chrissie_c,
ph3-der-loewe
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(20) |
Feb
(27) |
Mar
(25) |
Apr
(12) |
May
(2) |
Jun
(6) |
Jul
(36) |
Aug
(12) |
Sep
(12) |
Oct
(16) |
Nov
(5) |
Dec
(5) |
2003 |
Jan
(8) |
Feb
(9) |
Mar
(25) |
Apr
(18) |
May
(29) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(10) |
Oct
(5) |
Nov
(3) |
Dec
(9) |
2004 |
Jan
(17) |
Feb
|
Mar
(9) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(2) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(5) |
Feb
|
Mar
(13) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(13) |
Oct
(83) |
Nov
(2) |
Dec
|
2006 |
Jan
(21) |
Feb
(1) |
Mar
(32) |
Apr
(31) |
May
(3) |
Jun
(1) |
Jul
|
Aug
(7) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(13) |
2007 |
Jan
(1) |
Feb
(7) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2008 |
Jan
(4) |
Feb
(13) |
Mar
(24) |
Apr
(18) |
May
(10) |
Jun
|
Jul
|
Aug
(40) |
Sep
(72) |
Oct
(61) |
Nov
(9) |
Dec
(2) |
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(41) |
Aug
(28) |
Sep
(2) |
Oct
(5) |
Nov
(4) |
Dec
|
2011 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Patrick C. <pa...@us...> - 2005-10-25 07:31:18
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/vms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7037/vms Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/vms added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:31:18
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/solaris In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7037/solaris Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/solaris added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:31:18
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7037/win32 Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/win32 added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:31:18
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7037/macosx Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/macosx added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:31:18
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/macos9 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7037/macos9 Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/macos9 added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:31:17
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/tru64 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7037/tru64 Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/tru64 added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:30:04
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6820/linux Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/linux added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:30:04
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6820/src Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata/src added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-25 07:29:34
|
Update of /cvsroot/linux-decnet/dnprogs/libvaxdata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6772/libvaxdata Log Message: Directory /cvsroot/linux-decnet/dnprogs/libvaxdata added to the repository |
From: Patrick C. <pa...@us...> - 2005-10-24 09:14:19
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21695 Modified Files: tty.c Log Message: Don't throw away partial escape sequences Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** tty.c 22 Oct 2005 10:08:41 -0000 1.17 --- tty.c 24 Oct 2005 09:14:00 -0000 1.18 *************** *** 381,385 **** send_input_buffer(SEND_FLAG_VALID_ESCAPE); reading = 0; ! return 0; } --- 381,385 ---- send_input_buffer(SEND_FLAG_VALID_ESCAPE); reading = 0; ! continue; } |
From: Patrick C. <pa...@us...> - 2005-10-24 08:32:59
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12628 Modified Files: Makefile Log Message: Build dnlogin Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** Makefile 1 Sep 2005 09:28:01 -0000 1.24 --- Makefile 24 Oct 2005 08:32:52 -0000 1.25 *************** *** 10,14 **** SUBDIRS=include libdnet libdaemon libdap librms fal dndir dnsubmit dndel \ ! dncopy apps dntask mail phone dnetd dnroute scripts all: --- 10,14 ---- SUBDIRS=include libdnet libdaemon libdap librms fal dndir dnsubmit dndel \ ! dncopy apps dntask dnlogin mail phone dnetd dnroute scripts all: |
From: Patrick C. <pa...@us...> - 2005-10-22 14:34:31
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25903 Modified Files: found.c Log Message: Cope with SIGPIPE Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** found.c 22 Oct 2005 10:08:41 -0000 1.13 --- found.c 22 Oct 2005 14:34:17 -0000 1.14 *************** *** 166,173 **** int ptr = 0; ! if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT)) <= 0) { if (len == -1 && errno == EAGAIN) return 0; if (len < 0 && errno != EINVAL)/* Shurely shome mishtake */ --- 166,176 ---- int ptr = 0; ! if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT|MSG_NOSIGNAL)) <= 0) { if (len == -1 && errno == EAGAIN) return 0; + /* Remote end shut down */ + if (len == -1 && errno == EPIPE) + return -1; if (len < 0 && errno != EINVAL)/* Shurely shome mishtake */ |
From: Patrick C. <pa...@us...> - 2005-10-22 13:53:53
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17423 Modified Files: README Removed Files: BUGS Log Message: Update doc Index: README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** README 16 Jul 2002 10:21:31 -0000 1.1 --- README 22 Oct 2005 13:53:46 -0000 1.2 *************** *** 1,5 **** ! This is a proposed replacement for the rather unwieldy sethost program. ! It is nowhere near finished yet (though help would be appreciated!) and ! therefore is not built as part of the package. The principle is that found.c implements the foundation protocol in found.txt --- 1,5 ---- ! This is a replacement for the rather unwieldy sethost program. It is pretty much ! in a usable state now (though only tested to VMS), any additions/fixes/bug ! reports are welcom. The principle is that found.c implements the foundation protocol in found.txt --- BUGS DELETED --- |
From: Patrick C. <pa...@us...> - 2005-10-22 11:02:41
|
Update of /cvsroot/linux-decnet/dnprogs/dapfs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17301 Modified Files: dapfs.com Log Message: Updated dapfs.com DECnet object. I've not got round to doing the client end though, sorry Index: dapfs.com =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dapfs/dapfs.com,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dapfs.com 13 Oct 2005 09:50:23 -0000 1.1 --- dapfs.com 22 Oct 2005 11:02:32 -0000 1.2 *************** *** 11,18 **** $! ------------------------------------------- $! 1) copy dapfs.com to SYS$SYSTEM: $! ! $! 2) define the dapfs object in the DECnet database $! ! $! $ MCR NCP DEFINE OBJECT DAPFS NUMBER 0 FILE SYS$SYSTEM:LINUXDIR.COM $! $ MCR NCP SET OBJECT DAPFS ALL $! --- 11,19 ---- $! ------------------------------------------- $! 1) copy dapfs.com to SYS$SYSTEM: + $! 2) set prot=w:re SYS$SYSTEM:DAPFS.COM $! ! $! 3) define the dapfs object in the DECnet database $! ! $! $ MCR NCP DEFINE OBJECT DAPFS NUMBER 0 FILE SYS$SYSTEM:DAPFS.COM $! $ MCR NCP SET OBJECT DAPFS ALL $! *************** *** 20,25 **** $! $! 1) copy dapfs.com to SYS$SYSTEM $! ! $! 2) define the dapfs object in the DECnet database $! $! $ mcr ncl create node 0 session control application dapfs --- 21,27 ---- $! $! 1) copy dapfs.com to SYS$SYSTEM + $! 2) set prot=w:re SYS$SYSTEM:DAPFS.COM $! ! $! 3) define the dapfs object in the DECnet database $! $! $ mcr ncl create node 0 session control application dapfs *************** *** 27,31 **** $! addresses = {name=dapfs}, image name = sys$system:dapfs.com $! ! $! 3) edit and include preceding commands into: $! SYS$MANAGER:NET$STARTUP_APPLICATIONS.NCL $! --- 29,33 ---- $! addresses = {name=dapfs}, image name = sys$system:dapfs.com $! ! $! 4) edit and include preceding commands into: $! SYS$MANAGER:NET$STARTUP_APPLICATIONS.NCL $! *************** *** 33,42 **** $ if f$mode() .nes. "NETWORK" then exit $! ! $ open/read/write dapfs sys$net ! $ read/prompt=""/time_out=5/error=out dapfs operation ! $ read/prompt=""/time_out=5/error=out dapfs dirname $! $ if operation .eqs. "CREATE" then $goto create_op $ if operation .eqs. "STATFS" then $goto statfs_op $ set file/prot=(o:rwed) 'dirname' $ delete/nolog 'dirname' --- 35,46 ---- $ if f$mode() .nes. "NETWORK" then exit $! ! $ open/read/write dapfs sys$net ! $ read/prompt=""/time_out=5/error=out dapfs command ! $ operation=f$edit(f$element(0, " ", command),"UPCASE") ! $ dirname=f$element(1, " ", command) $! $ if operation .eqs. "CREATE" then $goto create_op $ if operation .eqs. "STATFS" then $goto statfs_op + $ if operation .nes. "REMOVE" then $goto dir_error $ set file/prot=(o:rwed) 'dirname' $ delete/nolog 'dirname' *************** *** 55,59 **** $! $statfs_op: ! $! TODO PJC $dir_error: $ write dapfs "ERROR" --- 59,68 ---- $! $statfs_op: ! $! ! $ freeK=f$getdvi("sys$disk", "FREEBLOCKS")/2 ! $ maxK=f$getdvi("sys$disk", "MAXBLOCK")/2 ! $ write dapfs "''freeK', ''maxk'" ! $ goto out ! $! $dir_error: $ write dapfs "ERROR" |
From: Patrick C. <pa...@us...> - 2005-10-22 11:01:57
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17048/apps Modified Files: sethost.1 Log Message: What the BBC calls "cross-promotion" Index: sethost.1 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/sethost.1,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** sethost.1 23 Jan 2001 11:48:23 -0000 1.2 --- sethost.1 22 Oct 2005 11:01:35 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- This application implements the CTERM protocol over DECnet for connecting to a remote DECnet host emulating a DEC VT100 terminal. + .br + dnlogin is a replacement for sethost with more compatibility features. |
From: Patrick C. <pa...@us...> - 2005-10-22 11:01:57
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17048/dnlogin Modified Files: dnlogin.1 Log Message: What the BBC calls "cross-promotion" Index: dnlogin.1 =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.1,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnlogin.1 21 Oct 2005 14:40:24 -0000 1.1 --- dnlogin.1 22 Oct 2005 11:01:35 -0000 1.2 *************** *** 20,23 **** --- 20,25 ---- This application implements the CTERM protocol over DECnet for connecting to a remote DECnet host. It expects to be run from a VT100-compatible terminal. + .br + dnlogin is a replacement for the old "sethost" program. |
From: Patrick C. <pa...@us...> - 2005-10-22 10:59:17
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16045 Modified Files: cterm.c Log Message: Characteristics for recognise escape override READ when EE=0 Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** cterm.c 22 Oct 2005 10:08:41 -0000 1.17 --- cterm.c 22 Oct 2005 10:59:02 -0000 1.18 *************** *** 204,208 **** if (ZZ==1) tty_set_terminators(buf+ptr, term_len); if (ZZ==2) tty_set_default_terminators(); ! if (EE) old_esc_state = tty_set_escape_proc(EE-1); tty_allow_edit(!(DDD==2)); tty_set_uppercase(II==2); --- 204,209 ---- if (ZZ==1) tty_set_terminators(buf+ptr, term_len); if (ZZ==2) tty_set_default_terminators(); ! if (EE) tty_set_escape_proc(EE-1); ! else tty_set_escape_proc(han_char.input_escseq_recognition); tty_allow_edit(!(DDD==2)); tty_set_uppercase(II==2); |
From: Patrick C. <pa...@us...> - 2005-10-22 10:58:25
|
Update of /cvsroot/linux-decnet/dnprogs/apps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15932 Modified Files: ctermd.c Log Message: Set Interpret-escape Index: ctermd.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/apps/ctermd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ctermd.c 2 Mar 2002 11:08:04 -0000 1.5 --- ctermd.c 22 Oct 2005 10:58:17 -0000 1.6 *************** *** 180,184 **** char cterm_stread_msg[] = { 0x09,0x00,0x31,0x00, 0x02, ! 0x40,0x4A,0x01, 0xa0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, --- 180,184 ---- char cterm_stread_msg[] = { 0x09,0x00,0x31,0x00, 0x02, ! 0x40,0x4A,0x02, 0xa0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, |
From: Patrick C. <pa...@us...> - 2005-10-22 10:09:20
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7224 Modified Files: cterm.c dnlogin.c dnlogin.h found.c tty.c Log Message: Re-indent. Add some manifest constants to replace some magic numbers. Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** cterm.c 21 Oct 2005 18:14:31 -0000 1.16 --- cterm.c 22 Oct 2005 10:08:41 -0000 1.17 *************** *** 13,18 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> --- 13,18 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** [...1117 lines suppressed...] int cterm_send_input(char *buf, int len, int term_pos, int flags) { ! char newbuf[len+9]; ! if (debug & 2) fprintf(stderr, "CTERM: sending input data: len=%d\n", ! len); ! ! newbuf[0] = CTERM_MSG_READ_DATA; ! newbuf[1] = flags; ! newbuf[2] = 0; // low-water 1 ! newbuf[3] = 0; // low-water 2 ! newbuf[4] = 0; // vert pos ! newbuf[5] = 0; // horiz pos ! newbuf[6] = term_pos; ! newbuf[7] = term_pos << 8; ! memcpy(newbuf+8, buf, len); ! return found_common_write(newbuf, len+8); } Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** dnlogin.c 21 Oct 2005 18:14:32 -0000 1.11 --- dnlogin.c 22 Oct 2005 10:08:41 -0000 1.12 *************** *** 11,16 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> --- 11,16 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> *************** *** 43,105 **** static int mainloop(void) { ! while (!finished) ! { ! char inbuf[1024]; ! struct timeval tv; ! int res; ! ! tv.tv_usec = 0; ! tv.tv_sec = char_timeout; ! ! fd_set in_set; ! FD_ZERO(&in_set); ! FD_SET(termfd, &in_set); ! FD_SET(found_getsockfd(), &in_set); ! ! if ( (res=select(FD_SETSIZE, &in_set, NULL, NULL, timeout_valid?&tv:NULL)) < 0) ! { ! break; ! } ! ! if (res == 0 && timeout_valid && tv.tv_sec == 0 && tv.tv_usec == 0) { ! tty_timeout(); ! } ! timeout_valid = 0; ! ! /* Read from keyboard */ ! if (FD_ISSET(termfd, &in_set)) ! { ! int len; ! if ( (len=read(termfd, inbuf, sizeof(inbuf))) <= 0) ! { ! perror("read tty"); ! break; ! } ! tty_process_terminal(inbuf, len); } ! ! if (found_read() == -1) ! break; ! } ! write(termfd, "\n", 1); ! return 0; } static void set_exit_char(char *string) { ! int newchar = 0; ! if (string[0] == '^') ! { ! newchar = toupper(string[1]) - '@'; ! } ! else ! newchar = strtol(string, NULL, 0); // Just a number ! ! // Make sure it's resaonable ! if (newchar > 0 && newchar < 256) ! exit_char = newchar; } --- 43,105 ---- static int mainloop(void) { ! while (!finished) { ! char inbuf[1024]; ! struct timeval tv; ! int res; ! ! tv.tv_usec = 0; ! tv.tv_sec = char_timeout; ! ! fd_set in_set; ! FD_ZERO(&in_set); ! FD_SET(termfd, &in_set); ! FD_SET(found_getsockfd(), &in_set); ! ! if ( (res=select(FD_SETSIZE, &in_set, NULL, NULL, timeout_valid?&tv:NULL)) < 0) ! { ! break; ! } ! ! if (res == 0 && timeout_valid && tv.tv_sec == 0 && tv.tv_usec == 0) ! { ! tty_timeout(); ! } ! timeout_valid = 0; ! ! /* Read from keyboard */ ! if (FD_ISSET(termfd, &in_set)) ! { ! int len; ! ! if ( (len=read(termfd, inbuf, sizeof(inbuf))) <= 0) ! { ! perror("read tty"); ! break; ! } ! tty_process_terminal(inbuf, len); ! } ! if (found_read() == -1) ! break; } ! write(termfd, "\n", 1); ! return 0; } static void set_exit_char(char *string) { ! int newchar = 0; ! if (string[0] == '^') ! { ! newchar = toupper(string[1]) - '@'; ! } ! else ! newchar = strtol(string, NULL, 0); // Just a number ! ! // Make sure it's resaonable ! if (newchar > 0 && newchar < 256) ! exit_char = newchar; } *************** *** 107,119 **** static void usage(char *prog, FILE * f) { ! fprintf(f, "\nUsage: %s [OPTIONS] node\n\n", prog); ! fprintf(f, "\nOptions:\n"); ! fprintf(f, " -? -h display this help message\n"); ! fprintf(f, " -V show version number\n"); ! fprintf(f, " -e <char> set exit char\n"); ! fprintf(f, " -d <mask> debug information\n"); ! fprintf(f, "\n"); } --- 107,119 ---- static void usage(char *prog, FILE * f) { ! fprintf(f, "\nUsage: %s [OPTIONS] node\n\n", prog); ! fprintf(f, "\nOptions:\n"); ! fprintf(f, " -? -h display this help message\n"); ! fprintf(f, " -V show version number\n"); ! fprintf(f, " -e <char> set exit char\n"); ! fprintf(f, " -d <mask> debug information\n"); ! fprintf(f, "\n"); } *************** *** 121,179 **** int main(int argc, char *argv[]) { ! struct sigaction sa; ! sigset_t ss; ! int opt; ! char *nodename; ! ! // Deal with command-line arguments. ! opterr = 0; ! optind = 0; ! while ((opt = getopt(argc, argv, "?Vhd:te:")) != EOF) ! { ! switch (opt) ! { ! case 'h': ! usage(argv[0], stdout); ! exit(0); ! ! case '?': ! usage(argv[0], stderr); ! exit(0); ! ! case 'V': ! printf("\ndnlogin from dnprogs version %s\n\n", VERSION); ! exit(1); ! break; ! ! case 'e': ! set_exit_char(optarg); ! break; ! ! case 'd': ! debug = atoi(optarg); ! break; ! } ! } ! ! if (optind >= argc) ! { ! usage(argv[0], stderr); ! exit(2); ! } ! ! send_input = cterm_send_input; ! send_oob = cterm_send_oob; ! rahead_change = cterm_rahead_change; ! if (found_setup_link(argv[optind], DNOBJECT_CTERM, cterm_process_network) == 0) ! { ! tty_setup("/dev/fd/0", 1); ! mainloop(); ! tty_setup(NULL, 0); ! } ! else ! { ! return 2; ! } ! return 0; } --- 121,179 ---- int main(int argc, char *argv[]) { ! struct sigaction sa; ! sigset_t ss; ! int opt; ! char *nodename; ! ! // Deal with command-line arguments. ! opterr = 0; ! optind = 0; ! while ((opt = getopt(argc, argv, "?Vhd:te:")) != EOF) ! { ! switch (opt) ! { ! case 'h': ! usage(argv[0], stdout); ! exit(0); ! ! case '?': ! usage(argv[0], stderr); ! exit(0); ! ! case 'V': ! printf("\ndnlogin from dnprogs version %s\n\n", VERSION); ! exit(1); ! break; ! ! case 'e': ! set_exit_char(optarg); ! break; ! ! case 'd': ! debug = atoi(optarg); ! break; ! } ! } ! ! if (optind >= argc) ! { ! usage(argv[0], stderr); ! exit(2); ! } ! ! send_input = cterm_send_input; ! send_oob = cterm_send_oob; ! rahead_change = cterm_rahead_change; ! if (found_setup_link(argv[optind], DNOBJECT_CTERM, cterm_process_network) == 0) ! { ! tty_setup("/dev/fd/0", 1); ! mainloop(); ! tty_setup(NULL, 0); ! } ! else ! { ! return 2; ! } ! return 0; } Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** dnlogin.h 21 Oct 2005 18:14:32 -0000 1.15 --- dnlogin.h 22 Oct 2005 10:08:41 -0000 1.16 *************** *** 52,57 **** --- 52,76 ---- extern int (*send_input)(char *buf, int len, int term_pos, int flags); extern int (*send_oob)(char, int); + extern void (*rahead_change)(int count); /* Global variables */ extern int debug; + + /* Send flags: + * These are actuall CTERM Read-Data flags (p62) + */ + #define SEND_FLAG_TERMINATOR 0 + #define SEND_FLAG_VALID_ESCAPE 1 + #define SEND_FLAG_INVALID_ESCAPE 2 + #define SEND_FLAG_OUT_OF_BAND 3 + #define SEND_FLAG_BUFFER_FULL 4 + #define SEND_FLAG_TIMEOUT 5 + #define SEND_FLAG_UNREAD 6 + #define SEND_FLAG_UNDERFLOW 7 + #define SEND_FLAG_ABSENTEE_TOKEN 8 + #define SEND_FLAG_VPOS_CHANGE 9 + #define SEND_FLAG_LINE_BREAK 10 + #define SEND_FLAG_FRAMING_ERROR 11 + #define SEND_FLAG_PARITY_ERROR 12 + #define SEND_FLAG_OVERRUN 13 Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** found.c 21 Oct 2005 14:35:37 -0000 1.12 --- found.c 22 Oct 2005 10:08:41 -0000 1.13 *************** *** 11,16 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> --- 11,16 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> *************** *** 46,81 **** static const char *hosttype[] = { ! "RT-11", ! "RSTS/E", ! "RSX-11S", ! "RSX-11M", ! "RSX-11D", ! "IAS", ! "VMS", ! "TOPS-20", ! "TOPS-10", ! "OS8", ! "RTS-8", ! "RSX-11M+", ! "DEC Unix", "??14", "??15", "??16", "??17", ! "Ultrix-32", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "Unix-dni" }; --- 46,81 ---- static const char *hosttype[] = { ! "RT-11", ! "RSTS/E", ! "RSX-11S", ! "RSX-11M", ! "RSX-11D", ! "IAS", ! "VMS", ! "TOPS-20", ! "TOPS-10", ! "OS8", ! "RTS-8", ! "RSX-11M+", ! "DEC Unix", "??14", "??15", "??16", "??17", ! "Ultrix-32", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "", "", ! "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ! "Unix-dni" }; *************** *** 84,90 **** struct common_header { ! char msg; ! char pad; ! unsigned short len; }; --- 84,90 ---- struct common_header { ! char msg; ! char pad; ! unsigned short len; }; *************** *** 95,115 **** static int send_bindaccept(void) { ! int wrote; ! char bindacc_msg[] = ! { ! FOUND_MSG_BINDACCEPT, ! 2,4,0, /* Version triplet */ ! 7,0, /* OS = VMS */ ! 0x10, /* We talk terminal protocol */ ! 0, /* Empty rev string */ ! }; ! ! wrote = write(sockfd, bindacc_msg, sizeof(bindacc_msg)); ! if (wrote != sizeof(bindacc_msg)) ! { ! fprintf(stderr, "%s\n", found_connerror()); ! return -1; ! } ! return 0; } --- 95,115 ---- static int send_bindaccept(void) { ! int wrote; ! char bindacc_msg[] = ! { ! FOUND_MSG_BINDACCEPT, ! 2,4,0, /* Version triplet */ ! 7,0, /* OS = VMS */ ! 0x10, /* We talk terminal protocol */ ! 0, /* Empty rev string */ ! }; ! ! wrote = write(sockfd, bindacc_msg, sizeof(bindacc_msg)); ! if (wrote != sizeof(bindacc_msg)) ! { ! fprintf(stderr, "%s\n", found_connerror()); ! return -1; ! } ! return 0; } *************** *** 117,121 **** int found_getsockfd() { ! return sockfd; } --- 117,121 ---- int found_getsockfd() { ! return sockfd; } *************** *** 123,239 **** int found_common_write(char *buf, int len) { ! struct iovec vectors[2]; ! struct msghdr msg; ! struct common_header header; ! ! if (debug) fprintf(stderr, "FOUND: sending %d bytes\n", len); ! if (debug & 8) ! { ! int i; ! ! for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)buf[i]); ! fprintf(stderr, "\n\n"); ! } ! ! ! memset(&msg, 0, sizeof(msg)); ! vectors[0].iov_base = (void *)&header; ! vectors[0].iov_len = sizeof(header); ! vectors[1].iov_base = buf; ! vectors[1].iov_len = len; ! ! msg.msg_name = NULL; ! msg.msg_namelen = 0; ! msg.msg_iovlen = 2; ! msg.msg_iov = vectors; ! msg.msg_flags = 0; ! ! header.msg = FOUND_MSG_COMMONDATA; ! header.pad = 0; ! header.len = dn_htons(len); ! if (debug & 1) ! fprintf(stderr, "FOUND: sending common message %d bytes:\n", len); ! return sendmsg(sockfd, &msg, MSG_EOR); } int found_read() { ! int len; ! char inbuf[1024]; ! int ptr = 0; ! ! if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT)) <= 0) ! { ! if (len == -1 && errno == EAGAIN) ! return 0; ! ! if (len < 0 && errno != EINVAL)/* Shurely shome mishtake */ ! fprintf(stderr, "%s\n", strerror(errno)); ! return -1; ! } ! ! if (debug & 1) ! fprintf(stderr, "FOUND: got message %d bytes:\n", len); ! if (debug & 8) ! { ! int i; ! ! for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)inbuf[i]); ! fprintf(stderr, "\n\n"); ! } ! ! ! /* Dispatch foundation messages */ ! switch (inbuf[0]) ! { ! case FOUND_MSG_BIND: ! if (debug) ! printf("connected to %s host\n", hosttype[inbuf[4]-1]); ! return send_bindaccept(); ! ! case FOUND_MSG_UNBIND: ! if (debug) ! printf("Unbind from host. reason = %d\n", inbuf[1]); ! return -1; ! case FOUND_MSG_ENTERMODE: ! { ! char nomode_msg[] = {0x8}; ! if (debug) ! fprintf(stderr, "FOUND: Request to enter mode = %d\n", inbuf[1]); ! write(sockfd, nomode_msg, sizeof(nomode_msg)); ! return 0; } - /* Common data goes straight to the terminal processor */ - case FOUND_MSG_COMMONDATA: - { - int ptr = 2; - while (ptr < len) - { - int msglen = inbuf[ptr] | inbuf[ptr+1]<<8; if (debug) ! fprintf(stderr, "FOUND: commondata: %d bytes\n",msglen); ! ptr += 2; ! terminal_processor(inbuf+ptr, msglen); ! ptr += msglen; ! } } break; ! case 2: /* Reserved */ ! break; ! default: ! fprintf(stderr, "Unknown foundation services message %d received\n", ! inbuf[0]); ! } ! return 0; } --- 123,239 ---- int found_common_write(char *buf, int len) { ! struct iovec vectors[2]; ! struct msghdr msg; ! struct common_header header; ! ! if (debug) fprintf(stderr, "FOUND: sending %d bytes\n", len); ! if (debug & 8) ! { ! int i; ! ! for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)buf[i]); ! fprintf(stderr, "\n\n"); ! } ! ! memset(&msg, 0, sizeof(msg)); ! vectors[0].iov_base = (void *)&header; ! vectors[0].iov_len = sizeof(header); ! vectors[1].iov_base = buf; ! vectors[1].iov_len = len; ! ! msg.msg_name = NULL; ! msg.msg_namelen = 0; ! msg.msg_iovlen = 2; ! msg.msg_iov = vectors; ! msg.msg_flags = 0; ! ! header.msg = FOUND_MSG_COMMONDATA; ! header.pad = 0; ! header.len = dn_htons(len); ! if (debug & 1) ! fprintf(stderr, "FOUND: sending common message %d bytes:\n", len); ! ! return sendmsg(sockfd, &msg, MSG_EOR); } int found_read() { ! int len; ! char inbuf[1024]; ! int ptr = 0; ! ! if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT)) <= 0) ! { ! if (len == -1 && errno == EAGAIN) ! return 0; ! ! if (len < 0 && errno != EINVAL)/* Shurely shome mishtake */ ! fprintf(stderr, "%s\n", strerror(errno)); ! return -1; ! } ! if (debug & 1) ! fprintf(stderr, "FOUND: got message %d bytes:\n", len); ! if (debug & 8) ! { ! int i; ! ! for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)inbuf[i]); ! fprintf(stderr, "\n\n"); } + /* Dispatch foundation messages */ + switch (inbuf[0]) + { + case FOUND_MSG_BIND: + if (debug) + printf("connected to %s host\n", hosttype[inbuf[4]-1]); + return send_bindaccept(); + + case FOUND_MSG_UNBIND: + if (debug) + printf("Unbind from host. reason = %d\n", inbuf[1]); + return -1; + + case FOUND_MSG_ENTERMODE: + { + char nomode_msg[] = {0x8}; if (debug) ! fprintf(stderr, "FOUND: Request to enter mode = %d\n", inbuf[1]); ! write(sockfd, nomode_msg, sizeof(nomode_msg)); ! return 0; ! } ! /* Common data goes straight to the terminal processor */ ! case FOUND_MSG_COMMONDATA: ! { ! int ptr = 2; ! while (ptr < len) ! { ! int msglen = inbuf[ptr] | inbuf[ptr+1]<<8; ! ! if (debug) ! fprintf(stderr, "FOUND: commondata: %d bytes\n",msglen); ! ! ptr += 2; ! terminal_processor(inbuf+ptr, msglen); ! ptr += msglen; ! } } break; ! case 2: /* Reserved */ ! break; ! default: ! fprintf(stderr, "Unknown foundation services message %d received\n", ! inbuf[0]); ! } ! return 0; } *************** *** 241,277 **** int found_setup_link(char *node, int object, int (*processor)(char *, int)) { ! struct nodeent *np; ! struct sockaddr_dn sockaddr; ! if ( (np=getnodebyname(node)) == NULL) ! { ! printf("Unknown node name %s\n",node); ! return -1; ! } ! ! ! if ((sockfd = socket(AF_DECnet, SOCK_SEQPACKET, DNPROTO_NSP)) == -1) ! { ! perror("socket"); ! return -1; ! } ! ! sockaddr.sdn_family = AF_DECnet; ! sockaddr.sdn_flags = 0x00; ! sockaddr.sdn_objnum = object; ! ! sockaddr.sdn_objnamel = 0x00; ! sockaddr.sdn_add.a_len = 0x02; ! ! memcpy(sockaddr.sdn_add.a_addr, np->n_addr, 2); ! ! if (connect(sockfd, (struct sockaddr *) &sockaddr, sizeof(sockaddr)) < 0) ! { ! fprintf(stderr, "Cannot connect to %s: %s\n", node, found_connerror()); ! return -1; ! } ! terminal_processor = processor; ! return 0; } --- 241,277 ---- int found_setup_link(char *node, int object, int (*processor)(char *, int)) { ! struct nodeent *np; ! struct sockaddr_dn sockaddr; ! if ( (np=getnodebyname(node)) == NULL) ! { ! printf("Unknown node name %s\n",node); ! return -1; ! } ! ! ! if ((sockfd = socket(AF_DECnet, SOCK_SEQPACKET, DNPROTO_NSP)) == -1) ! { ! perror("socket"); ! return -1; ! } ! ! sockaddr.sdn_family = AF_DECnet; ! sockaddr.sdn_flags = 0x00; ! sockaddr.sdn_objnum = object; ! ! sockaddr.sdn_objnamel = 0x00; ! sockaddr.sdn_add.a_len = 0x02; ! ! memcpy(sockaddr.sdn_add.a_addr, np->n_addr, 2); ! ! if (connect(sockfd, (struct sockaddr *) &sockaddr, sizeof(sockaddr)) < 0) ! { ! fprintf(stderr, "Cannot connect to %s: %s\n", node, found_connerror()); ! return -1; ! } ! terminal_processor = processor; ! return 0; } *************** *** 280,340 **** char *found_connerror() { ! int saved_errno = errno; #ifdef DSO_DISDATA ! struct optdata_dn optdata; ! unsigned int len = sizeof(optdata); ! char *msg; ! ! if (getsockopt(sockfd, DNPROTO_NSP, DSO_CONDATA, ! &optdata, &len) == -1) ! { ! return strerror(saved_errno); ! } ! // Turn the rejection reason into text ! switch (optdata.opt_status) ! { ! case DNSTAT_REJECTED: msg="Rejected by object"; ! break; ! case DNSTAT_RESOURCES: msg="No resources available"; ! break; ! case DNSTAT_NODENAME: msg="Unrecognised node name"; ! break; ! case DNSTAT_LOCNODESHUT: msg="Local Node is shut down"; ! break; ! case DNSTAT_OBJECT: msg="Unrecognised object"; ! break; ! case DNSTAT_OBJNAMEFORMAT: msg="Invalid object name format"; ! break; ! case DNSTAT_TOOBUSY: msg="Object too busy"; ! break; ! case DNSTAT_NODENAMEFORMAT: msg="Invalid node name format"; ! break; ! case DNSTAT_REMNODESHUT: msg="Remote Node is shut down"; ! break; ! case DNSTAT_ACCCONTROL: msg="Login information invalid at remote node"; ! break; ! case DNSTAT_NORESPONSE: msg="No response from object"; ! break; ! case DNSTAT_NODEUNREACH: msg="Node Unreachable"; ! break; ! case DNSTAT_MANAGEMENT: msg="Abort by management/third party"; ! break; ! case DNSTAT_ABORTOBJECT: msg="Remote object aborted the link"; ! break; ! case DNSTAT_NODERESOURCES: msg="Node does not have sufficient resources for a new link"; ! break; ! case DNSTAT_OBJRESOURCES: msg="Object does not have sufficient resources for a new link"; ! break; ! case DNSTAT_BADACCOUNT: msg="The Account field in unacceptable"; ! break; ! case DNSTAT_TOOLONG: msg="A field in the access control message was too long"; ! break; ! default: msg=strerror(saved_errno); ! break; ! } ! return msg; #else ! return strerror(saved_errno); #endif } --- 280,340 ---- char *found_connerror() { ! int saved_errno = errno; #ifdef DSO_DISDATA ! struct optdata_dn optdata; ! unsigned int len = sizeof(optdata); ! char *msg; ! ! if (getsockopt(sockfd, DNPROTO_NSP, DSO_CONDATA, ! &optdata, &len) == -1) ! { ! return strerror(saved_errno); ! } ! // Turn the rejection reason into text ! switch (optdata.opt_status) ! { ! case DNSTAT_REJECTED: msg="Rejected by object"; ! break; ! case DNSTAT_RESOURCES: msg="No resources available"; ! break; ! case DNSTAT_NODENAME: msg="Unrecognised node name"; ! break; ! case DNSTAT_LOCNODESHUT: msg="Local Node is shut down"; ! break; ! case DNSTAT_OBJECT: msg="Unrecognised object"; ! break; ! case DNSTAT_OBJNAMEFORMAT: msg="Invalid object name format"; ! break; ! case DNSTAT_TOOBUSY: msg="Object too busy"; ! break; ! case DNSTAT_NODENAMEFORMAT: msg="Invalid node name format"; ! break; ! case DNSTAT_REMNODESHUT: msg="Remote Node is shut down"; ! break; ! case DNSTAT_ACCCONTROL: msg="Login information invalid at remote node"; ! break; ! case DNSTAT_NORESPONSE: msg="No response from object"; ! break; ! case DNSTAT_NODEUNREACH: msg="Node Unreachable"; ! break; ! case DNSTAT_MANAGEMENT: msg="Abort by management/third party"; ! break; ! case DNSTAT_ABORTOBJECT: msg="Remote object aborted the link"; ! break; ! case DNSTAT_NODERESOURCES: msg="Node does not have sufficient resources for a new link"; ! break; ! case DNSTAT_OBJRESOURCES: msg="Object does not have sufficient resources for a new link"; ! break; ! case DNSTAT_BADACCOUNT: msg="The Account field in unacceptable"; ! break; ! case DNSTAT_TOOLONG: msg="A field in the access control message was too long"; ! break; ! default: msg=strerror(saved_errno); ! break; ! } ! return msg; #else ! return strerror(saved_errno); #endif } Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** tty.c 21 Oct 2005 18:14:32 -0000 1.16 --- tty.c 22 Oct 2005 10:08:41 -0000 1.17 *************** *** 11,16 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> --- 11,16 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ #include <stdio.h> *************** *** 73,86 **** static void send_input_buffer(int flags) { ! char buf[1024]; ! memcpy(buf, input_buf, input_len); ! // Assumes the terminator (CR) is the last char... ! send_input(buf, input_len, input_len-1, flags); ! input_len = input_pos = 0; ! reading = 0; ! echo = 1; ! interpret_escape = 0; } --- 73,86 ---- static void send_input_buffer(int flags) { ! char buf[1024]; ! memcpy(buf, input_buf, input_len); ! // Assumes the terminator (CR) is the last char... ! send_input(buf, input_len, input_len-1, flags); ! input_len = input_pos = 0; ! reading = 0; ! echo = 1; ! interpret_escape = 0; } *************** *** 90,94 **** if (debug & 4) fprintf(stderr, "TTY: timeout\n"); ! send_input_buffer(5); } --- 90,94 ---- if (debug & 4) fprintf(stderr, "TTY: timeout\n"); ! send_input_buffer(SEND_FLAG_TIMEOUT); } *************** *** 96,107 **** int tty_write(char *buf, int len) { ! if (discard) ! return len; ! if (len == 1 && *buf == 0) ! return len; ! write(termfd, buf, len); ! last_char = buf[len-1]; ! return len; } --- 96,107 ---- int tty_write(char *buf, int len) { ! if (discard) ! return len; ! if (len == 1 && *buf == 0) ! return len; ! write(termfd, buf, len); ! last_char = buf[len-1]; ! return len; } *************** *** 116,120 **** void tty_set_noecho() { ! echo = 0; } --- 116,120 ---- void tty_set_noecho() { ! echo = 0; } *************** *** 149,235 **** void tty_echo_terminator(int a) { ! if (debug & 4) ! fprintf(stderr, "TTY: echo terminators = %d\n", a); ! echo_terminator = a; } void tty_set_default_terminators() { ! if (debug & 4) ! fprintf(stderr, "TTY: set default terminators\n"); ! /* All control chars except ^R ^U ^W, BS & HT */ ! /* ie 18, 21, 23, 8, 9 */ ! /* PJC: also remove ^A(1) ^E(5) ^X(29) for line-editting.. CHECK!! */ ! memset(terminators, 0, sizeof(terminators)); ! ! terminators[0] = 0xDD; ! terminators[1] = 0xFC; ! terminators[2] = 0x5B; ! terminators[3] = 0xDF; } void tty_set_terminators(char *buf, int len) { ! if (debug & 4) { ! int i; ! fprintf(stderr, "TTY: set terminators... %d bytes\n", len); ! fprintf(stderr, "TTY: terms: "); ! for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", buf[i]); ! fprintf(stderr, "\n"); ! } ! memset(terminators, 0, sizeof(terminators)); ! memcpy(terminators, buf, len); } void tty_start_read(char *prompt, int len, int promptlen) { ! int i; ! if (debug & 4) ! fprintf(stderr, "TTY: start_read promptlen = %d, maxlen=%d\n", ! promptlen, len); ! if (promptlen) write(termfd, prompt, promptlen); ! if (len < 0) len = sizeof(input_buf); ! ! /* Save the actual prompt in one buffer and the prefilled ! data in the input buffer */ ! memcpy(prompt_buf, prompt, promptlen); ! prompt_len = promptlen; ! ! /* Work out the position of the cursor after the prompt (which may contain CRLF chars ) */ ! line_start_pos = 0; ! for (i = 0; i<prompt_len; i++) ! if (prompt_buf[i] >= ' ') ! line_start_pos++; ! ! /* Prefilled data (eg a recalled command) */ ! memcpy(input_buf, prompt+promptlen, len-promptlen); ! input_len = len-promptlen; ! input_pos = input_len; ! write(termfd, input_buf, input_len); ! ! max_read_len = len; ! ! /* Now add in any typeahead */ ! if (rahead_len) ! { ! int copylen = rahead_len; ! if (debug & 4) ! fprintf(stderr, "TTY: readahead = %d bytes\n", rahead_len); ! /* Don't overflow the input buffer */ ! if (input_len + copylen > sizeof(input_buf)) ! copylen = sizeof(input_buf)-input_len; ! ! memcpy(input_buf+input_len, rahead_buf, copylen); ! tty_write(rahead_buf, copylen); ! input_len += copylen; ! input_pos += copylen; ! rahead_len = 0; ! } ! reading = 1; } --- 149,235 ---- void tty_echo_terminator(int a) { ! if (debug & 4) ! fprintf(stderr, "TTY: echo terminators = %d\n", a); ! echo_terminator = a; } void tty_set_default_terminators() { ! if (debug & 4) ! fprintf(stderr, "TTY: set default terminators\n"); ! /* All control chars except ^R ^U ^W, BS & HT */ ! /* ie 18, 21, 23, 8, 9 */ ! /* PJC: also remove ^A(1) ^E(5) ^X(29) for line-editting.. CHECK!! */ ! memset(terminators, 0, sizeof(terminators)); ! ! terminators[0] = 0xDD; ! terminators[1] = 0xFC; ! terminators[2] = 0x5B; ! terminators[3] = 0xDF; } void tty_set_terminators(char *buf, int len) { ! if (debug & 4) { ! int i; ! fprintf(stderr, "TTY: set terminators... %d bytes\n", len); ! fprintf(stderr, "TTY: terms: "); ! for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", buf[i]); ! fprintf(stderr, "\n"); ! } ! memset(terminators, 0, sizeof(terminators)); ! memcpy(terminators, buf, len); } void tty_start_read(char *prompt, int len, int promptlen) { ! int i; if (debug & 4) ! fprintf(stderr, "TTY: start_read promptlen = %d, maxlen=%d\n", ! promptlen, len); ! if (promptlen) write(termfd, prompt, promptlen); ! if (len < 0) len = sizeof(input_buf); ! ! /* Save the actual prompt in one buffer and the prefilled ! data in the input buffer */ ! memcpy(prompt_buf, prompt, promptlen); ! prompt_len = promptlen; ! ! /* Work out the position of the cursor after the prompt (which may contain CRLF chars ) */ ! line_start_pos = 0; ! for (i = 0; i<prompt_len; i++) ! if (prompt_buf[i] >= ' ') ! line_start_pos++; ! ! /* Prefilled data (eg a recalled command) */ ! memcpy(input_buf, prompt+promptlen, len-promptlen); ! input_len = len-promptlen; ! input_pos = input_len; ! write(termfd, input_buf, input_len); ! max_read_len = len; ! ! /* Now add in any typeahead */ ! if (rahead_len) ! { ! int copylen = rahead_len; ! ! if (debug & 4) ! fprintf(stderr, "TTY: readahead = %d bytes\n", rahead_len); ! ! /* Don't overflow the input buffer */ ! if (input_len + copylen > sizeof(input_buf)) ! copylen = sizeof(input_buf)-input_len; ! ! memcpy(input_buf+input_len, rahead_buf, copylen); ! tty_write(rahead_buf, copylen); ! input_len += copylen; ! input_pos += copylen; ! rahead_len = 0; ! } ! reading = 1; } *************** *** 242,251 **** void tty_clear_typeahead() { ! rahead_len = 0; } void tty_set_maxlen(unsigned short len) { ! max_read_len = len; } --- 242,251 ---- void tty_clear_typeahead() { ! rahead_len = 0; } void tty_set_maxlen(unsigned short len) { ! max_read_len = len; } *************** *** 253,302 **** int tty_setup(char *name, int setup) { ! struct termios new_term; ! static struct termios old_term; ! if (setup) ! { ! termfd = open(name, O_RDWR); ! ! tcgetattr(termfd, &old_term); ! new_term = old_term; ! ! new_term.c_iflag &= ~BRKINT; ! new_term.c_iflag |= IGNBRK; ! new_term.c_lflag &= ~ISIG; ! new_term.c_oflag &= ~ONLCR; ! new_term.c_cc[VMIN] = 1; ! new_term.c_cc[VTIME] = 0; ! new_term.c_lflag &= ~ICANON; ! new_term.c_lflag &= ~(ECHO | ECHOCTL | ECHONL); ! tcsetattr(termfd, TCSANOW, &new_term); ! } ! else ! { ! tcsetattr(termfd, TCSANOW, &old_term); ! close(termfd); ! } ! return 0; } static short is_terminator(char c) { ! short termind, msk, aux; ! termind = c / 8; ! aux = c % 8; ! msk = (1 << aux); ! ! if (debug & 4) ! fprintf(stderr, "TTY: is_terminator: %d: (byte=%x, msk=%x) %s\n", c, terminators[termind],msk, ! (terminators[termind] & msk)?"Yes":"No"); ! ! if (terminators[termind] & msk) ! { ! return 1; ! } ! return 0; } --- 253,302 ---- int tty_setup(char *name, int setup) { ! struct termios new_term; ! static struct termios old_term; ! ! if (setup) ! { ! termfd = open(name, O_RDWR); ! ! tcgetattr(termfd, &old_term); ! new_term = old_term; ! new_term.c_iflag &= ~BRKINT; ! new_term.c_iflag |= IGNBRK; ! new_term.c_oflag &= ~ONLCR; ! new_term.c_cc[VMIN] = 1; ! new_term.c_cc[VTIME] = 0; ! new_term.c_lflag &= ~ICANON; ! new_term.c_lflag &= ~ISIG; ! new_term.c_lflag &= ~(ECHO | ECHOCTL | ECHONL); ! tcsetattr(termfd, TCSANOW, &new_term); ! } ! else ! { ! tcsetattr(termfd, TCSANOW, &old_term); ! close(termfd); ! } ! return 0; } static short is_terminator(char c) { ! short termind, msk, aux; ! termind = c / 8; ! aux = c % 8; ! msk = (1 << aux); ! ! if (debug & 4) ! fprintf(stderr, "TTY: is_terminator: %d: (byte=%x, msk=%x) %s\n", c, terminators[termind],msk, ! (terminators[termind] & msk)?"Yes":"No"); ! ! if (terminators[termind] & msk) ! { ! return 1; ! } ! return 0; } *************** *** 304,308 **** static void erase_eol(void) { ! write(termfd, "\033[0K", 4); } --- 304,308 ---- static void erase_eol(void) { ! write(termfd, "\033[0K", 4); } *************** *** 310,317 **** static void move_cursor_abs(int hpos) { ! char buf[32]; ! sprintf(buf, "\r\033[%dC", hpos); ! write(termfd, buf, strlen(buf)); } --- 310,317 ---- static void move_cursor_abs(int hpos) { ! char buf[32]; ! sprintf(buf, "\r\033[%dC", hpos); ! write(termfd, buf, strlen(buf)); } *************** *** 319,323 **** void tty_send_unread() { ! send_input_buffer(0); } --- 319,323 ---- void tty_send_unread() { ! send_input_buffer(SEND_FLAG_UNREAD); } *************** *** 336,520 **** int tty_process_terminal(char *buf, int len) { ! int i; ! for (i=0; i<len; i++) ! { ! if (buf[i] == exit_char) { ! finished = 1; ! return 0; ! } ! /* Swap LF for CR */ ! //PJC: is this right?? ! if (buf[i] == '\n') ! buf[i] = '\r'; ! /* Check for OOB */ ! if (char_attr[(int)buf[i]] & 3) ! { ! int oob_discard = (char_attr[(int)buf[i]]>>2)&1; ! ! send_oob(buf[i], oob_discard); ! if (oob_discard) { ! input_len = input_pos = 0; ! } ! continue; ! } ! /* Is it ESCAPE ? */ ! if (buf[i] == ESC && esc_len == 0 && interpret_escape) ! { ! esc_buf[esc_len++] = buf[i]; ! continue; ! } ! /* Terminators */ ! if (!esc_len && is_terminator(buf[i])) ! { ! if (echo_terminator) ! { ! tty_write(&buf[i], 1); ! } ! input_buf[input_len++] = buf[i]; ! send_input_buffer(1); ! reading = 0; ! return 0; ! } ! /* Still processing escape sequence */ ! if (esc_len) ! { ! esc_buf[esc_len++] = buf[i]; ! if (isalpha(buf[i]) || buf[i] == '~') ! { ! int esc_done = 0; ! if (allow_edit) { ! /* Process escape sequences */ ! if (strncmp(esc_buf, "\033[C", 3) == 0) /* Cursor RIGHT */ { ! if (input_pos < input_len) { ! input_pos++; ! if (echo) tty_write(esc_buf, esc_len); } ! esc_done = 1; } ! if (strncmp(esc_buf, "\033[D", 3) == 0) /* Cursor LEFT */ { if (input_pos > 0) { input_pos--; ! if (echo) tty_write(esc_buf, esc_len); } - esc_done = 1; } } ! /* If we didn't process it above, then just send it to ! the host on the end of whatever is also in the buffer */ ! if (!esc_done) { ! memcpy(input_buf+input_len, esc_buf, esc_len); ! send_input(input_buf, input_len+esc_len, input_len, 1); ! echo = 1; ! } ! esc_len = 0; ! } ! continue; ! } ! /* Process non-terminator control chars */ ! if ((buf[i] < ' ' || buf[i] == DEL) && allow_edit) ! { ! switch (buf[i]) ! { ! case CTRL_B: // Up a line ! break; ! case CTRL_X: // delete input line ! case CTRL_U: // delete input line ! move_cursor_abs(line_start_pos); ! if (echo) erase_eol(); ! input_pos = input_len = 0; ! break; ! case CTRL_H: // back to start of line ! if (echo) move_cursor_abs(line_start_pos); ! input_pos = 0; ! break; ! case CTRL_E: // Move to end of line ! if (echo) move_cursor_abs(input_len+line_start_pos); ! input_pos = input_len; ! break; ! case CTRL_A: /* switch overstrike/insert mode */ ! insert_mode = ~insert_mode; ! break; ! case CTRL_W: /* redraw */ ! redraw_input_line(); ! break; ! case CTRL_M: ! input_buf[input_len++] = buf[i]; ! send_input_buffer(1); ! input_len = input_pos = 0; ! reading = 0; ! case CTRL_O: ! // TODO echo "output on/off" ! discard = ~discard; ! break; ! case DEL: ! if (input_pos > 0) ! { ! input_pos--; ! input_len--; ! if (echo) write(termfd, "\033[D \033[D", 7); ! if (input_pos != input_len) ! { ! memmove(input_buf+input_pos, input_buf+input_pos+1, input_len-input_pos); ! redraw_input_line(); ! } ! break; } - } - continue; - } - - /* Read not active, store in the read ahead buffer */ - if (!reading) - { - if (rahead_len == 0) - rahead_change(1); /* tell CTERM */ ! if (rahead_len < sizeof(rahead_buf)) ! rahead_buf[rahead_len++] = buf[i]; ! continue; ! } ! ! if (convert_uppercase) ! buf[i] &= 0x5F; ! /* echo if req'd, insert will redraw the whole line */ ! if (echo && !insert_mode) ! tty_write(&buf[i], 1); ! if (insert_mode && input_len > input_pos) ! { ! memmove(input_buf+input_pos+1, input_buf+input_pos, input_len-input_pos); ! input_len++; ! } ! input_buf[input_pos++] = buf[i]; ! if (input_len < input_pos) ! input_len = input_pos; ! if (insert_mode) ! redraw_input_line(); ! if (input_len >= max_read_len) ! { ! send_input_buffer(4); } ! } ! return 0; } --- 336,520 ---- int tty_process_terminal(char *buf, int len) { ! int i; ! for (i=0; i<len; i++) { ! if (buf[i] == exit_char) ! { ! finished = 1; ! return 0; ! } ! /* Swap LF for CR */ ! //PJC: is this right?? ! if (buf[i] == '\n') ! buf[i] = '\r'; ! /* Check for OOB */ ! if (char_attr[(int)buf[i]] & 3) { ! int oob_discard = (char_attr[(int)buf[i]]>>2)&1; ! send_oob(buf[i], oob_discard); ! if (oob_discard) ! { ! input_len = input_pos = 0; ! } ! continue; ! } ! /* Is it ESCAPE ? */ ! if (buf[i] == ESC && esc_len == 0 && interpret_escape) ! { ! esc_buf[esc_len++] = buf[i]; ! continue; ! } ! /* Terminators */ ! if (!esc_len && is_terminator(buf[i])) ! { ! if (echo_terminator) ! { ! tty_write(&buf[i], 1); ! } ! input_buf[input_len++] = buf[i]; ! send_input_buffer(SEND_FLAG_VALID_ESCAPE); ! reading = 0; ! return 0; ! } ! /* Still processing escape sequence */ ! if (esc_len) { ! esc_buf[esc_len++] = buf[i]; ! if (isalpha(buf[i]) || buf[i] == '~') { ! int esc_done = 0; ! ! if (allow_edit) { ! /* Process escape sequences */ ! if (strncmp(esc_buf, "\033[C", 3) == 0) /* Cursor RIGHT */ ! { ! if (input_pos < input_len) ! { ! input_pos++; ! if (echo) tty_write(esc_buf, esc_len); ! } ! esc_done = 1; ! } ! if (strncmp(esc_buf, "\033[D", 3) == 0) /* Cursor LEFT */ ! { ! if (input_pos > 0) ! { ! input_pos--; ! if (echo) tty_write(esc_buf, esc_len); ! } ! esc_done = 1; ! } } ! ! /* If we didn't process it above, then just send it to ! the host on the end of whatever is also in the buffer */ ! if (!esc_done) ! { ! memcpy(input_buf+input_len, esc_buf, esc_len); ! send_input(input_buf, input_len+esc_len, input_len, SEND_FLAG_VALID_ESCAPE); ! echo = 1; ! } ! esc_len = 0; } ! continue; ! } ! ! /* Process non-terminator control chars */ ! if ((buf[i] < ' ' || buf[i] == DEL) && allow_edit) ! { ! switch (buf[i]) { + case CTRL_B: // Up a line + break; + case CTRL_X: // delete input line + case CTRL_U: // delete input line + move_cursor_abs(line_start_pos); + if (echo) erase_eol(); + input_pos = input_len = 0; + break; + case CTRL_H: // back to start of line + if (echo) move_cursor_abs(line_start_pos); + input_pos = 0; + break; + case CTRL_E: // Move to end of line + if (echo) move_cursor_abs(input_len+line_start_pos); + input_pos = input_len; + break; + case CTRL_A: /* switch overstrike/insert mode */ + insert_mode = ~insert_mode; + break; + case CTRL_W: /* redraw */ + redraw_input_line(); + break; + case CTRL_M: + input_buf[input_len++] = buf[i]; + send_input_buffer(SEND_FLAG_TERMINATOR); + input_len = input_pos = 0; + reading = 0; + case CTRL_O: + // TODO echo "output on/off" + discard = ~discard; + break; + case DEL: if (input_pos > 0) { input_pos--; ! input_len--; ! if (echo) write(termfd, "\033[D \033[D", 7); ! if (input_pos != input_len) ! { ! memmove(input_buf+input_pos, input_buf+input_pos+1, input_len-input_pos); ! redraw_input_line(); ! } ! break; } } + continue; } ! /* Read not active, store in the read ahead buffer */ ! if (!reading) { ! if (rahead_len == 0) ! rahead_change(1); /* tell CTERM */ ! if (rahead_len < sizeof(rahead_buf)) ! rahead_buf[rahead_len++] = buf[i]; ! continue; } ! if (convert_uppercase) ! buf[i] &= 0x5F; ! /* echo if req'd, insert will redraw the whole line */ ! if (echo && !insert_mode) ! tty_write(&buf[i], 1); ! if (insert_mode && input_len > input_pos) ! { ! memmove(input_buf+input_pos+1, input_buf+input_pos, input_len-input_pos); ! input_len++; ! } ! input_buf[input_pos++] = buf[i]; ! if (input_len < input_pos) ! input_len = input_pos; ! if (insert_mode) ! redraw_input_line(); ! if (input_len >= max_read_len) ! { ! send_input_buffer(SEND_FLAG_BUFFER_FULL); ! } } ! return 0; } |
From: Patrick C. <pa...@us...> - 2005-10-21 18:14:42
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20944 Modified Files: cterm.c dnlogin.c dnlogin.h tty.c Log Message: Fix readaheadand add readahead status message Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** cterm.c 21 Oct 2005 16:26:37 -0000 1.15 --- cterm.c 21 Oct 2005 18:14:31 -0000 1.16 *************** *** 729,730 **** --- 729,743 ---- return found_common_write(newbuf, len+8); } + + void cterm_rahead_change(int count) + { + char newbuf[2]; + + if (han_char.input_count_state) + { + newbuf[0] = CTERM_MSG_INPUT_STATE; + newbuf[1] = count; + + found_common_write(newbuf, 2); + } + } Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** dnlogin.c 21 Oct 2005 14:35:37 -0000 1.10 --- dnlogin.c 21 Oct 2005 18:14:32 -0000 1.11 *************** *** 164,167 **** --- 164,168 ---- send_input = cterm_send_input; send_oob = cterm_send_oob; + rahead_change = cterm_rahead_change; if (found_setup_link(argv[optind], DNOBJECT_CTERM, cterm_process_network) == 0) { Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** dnlogin.h 21 Oct 2005 16:26:37 -0000 1.14 --- dnlogin.h 21 Oct 2005 18:14:32 -0000 1.15 *************** *** 27,30 **** --- 27,31 ---- extern int cterm_send_oob(char, int); extern int cterm_process_network(char *buf, int len); + extern void cterm_rahead_change(int count); /* TTY routines */ Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** tty.c 21 Oct 2005 16:26:37 -0000 1.15 --- tty.c 21 Oct 2005 18:14:32 -0000 1.16 *************** *** 67,72 **** /* Output processors */ ! int (*send_input)(char *buf, int len, int term_pos, int flags); ! int (*send_oob)(char oobchar, int discard); static void send_input_buffer(int flags) --- 67,73 ---- /* Output processors */ ! int (*send_input)(char *buf, int len, int term_pos, int flags); ! int (*send_oob)(char oobchar, int discard); ! void (*rahead_change)(int count); static void send_input_buffer(int flags) *************** *** 225,230 **** memcpy(input_buf+input_len, rahead_buf, copylen); ! tty_write(rahead_buf, rahead_len); input_len += copylen; rahead_len = 0; } --- 226,232 ---- memcpy(input_buf+input_len, rahead_buf, copylen); ! tty_write(rahead_buf, copylen); input_len += copylen; + input_pos += copylen; rahead_len = 0; } *************** *** 479,493 **** } - if (convert_uppercase) - buf[i] &= 0x5F; - /* Read not active, store in the read ahead buffer */ if (!reading) { ! if (rahead_len < sizeof(rahead_buf)) ! rahead_buf[rahead_len++] = buf[i]; continue; } /* echo if req'd, insert will redraw the whole line */ if (echo && !insert_mode) --- 481,498 ---- } /* Read not active, store in the read ahead buffer */ if (!reading) { ! if (rahead_len == 0) ! rahead_change(1); /* tell CTERM */ ! ! if (rahead_len < sizeof(rahead_buf)) ! rahead_buf[rahead_len++] = buf[i]; continue; } + if (convert_uppercase) + buf[i] &= 0x5F; + /* echo if req'd, insert will redraw the whole line */ if (echo && !insert_mode) |
From: Patrick C. <pa...@us...> - 2005-10-21 16:26:45
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27049 Modified Files: cterm.c dnlogin.h tty.c Added Files: BUGS Log Message: Respond to CHECK-INPUT as "show cluster" needs it. --- NEW FILE: BUGS --- This is a list of visible problems when using dnlogin. Most should be fixed when allthe features are in place but some may need some reverse engineering. - show cluster/conf doesn't allow keyboard input (except ^Y) Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** cterm.c 21 Oct 2005 15:34:04 -0000 1.14 --- cterm.c 21 Oct 2005 16:26:37 -0000 1.15 *************** *** 601,605 **** static int cterm_process_check_input(char *buf, int len) ! {return len;} static int cterm_process_input_count(char *buf, int len) --- 601,617 ---- static int cterm_process_check_input(char *buf, int len) ! { ! unsigned short count = tty_get_input_count(); ! char newbuf[4]; ! ! newbuf[0] = CTERM_MSG_INPUT_COUNT; ! newbuf[1] = 0; ! newbuf[2] = count & 0xFF; ! newbuf[3] = (count >> 8) & 0xFF; ! ! found_common_write(newbuf, 4); ! ! return len; ! } static int cterm_process_input_count(char *buf, int len) Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** dnlogin.h 21 Oct 2005 15:34:04 -0000 1.13 --- dnlogin.h 21 Oct 2005 16:26:37 -0000 1.14 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2002-2005 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 47,50 **** --- 47,51 ---- extern void tty_allow_edit(int onoff); extern void tty_format_cr(void); + extern int tty_get_input_count(void); extern int (*send_input)(char *buf, int len, int term_pos, int flags); Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** tty.c 21 Oct 2005 15:34:04 -0000 1.14 --- tty.c 21 Oct 2005 16:26:37 -0000 1.15 *************** *** 141,144 **** --- 141,149 ---- } + int tty_get_input_count(void) + { + return input_len+rahead_len; + } + void tty_echo_terminator(int a) { *************** *** 220,223 **** --- 225,229 ---- memcpy(input_buf+input_len, rahead_buf, copylen); + tty_write(rahead_buf, rahead_len); input_len += copylen; rahead_len = 0; |
From: Patrick C. <pa...@us...> - 2005-10-21 15:34:20
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12933 Modified Files: cterm.c dnlogin.h tty.c Log Message: Honour LF formatting Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** cterm.c 21 Oct 2005 14:35:37 -0000 1.13 --- cterm.c 21 Oct 2005 15:34:04 -0000 1.14 *************** *** 199,202 **** --- 199,204 ---- if (flags & 4) tty_clear_typeahead(); if (flags & 0x800) tty_set_noecho(); + if (flags & 0x8 && buf[ptr+1] != '\n') + tty_format_cr(); if (ZZ==1) tty_set_terminators(buf+ptr, term_len); Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** dnlogin.h 21 Oct 2005 12:13:17 -0000 1.12 --- dnlogin.h 21 Oct 2005 15:34:04 -0000 1.13 *************** *** 46,49 **** --- 46,50 ---- extern void tty_set_uppercase(int onoff); extern void tty_allow_edit(int onoff); + extern void tty_format_cr(void); extern int (*send_input)(char *buf, int len, int term_pos, int flags); Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** tty.c 21 Oct 2005 15:03:06 -0000 1.13 --- tty.c 21 Oct 2005 15:34:04 -0000 1.14 *************** *** 60,63 **** --- 60,64 ---- static int allow_edit = 0; static int convert_uppercase = 0; + static char last_char; /* in dnlogin.c */ *************** *** 96,104 **** if (discard) return len; ! write(termfd, buf, len); return len; } void tty_set_noecho() { --- 97,116 ---- if (discard) return len; ! ! if (len == 1 && *buf == 0) ! return len; write(termfd, buf, len); + last_char = buf[len-1]; return len; } + void tty_format_cr() + { + char lf = '\n'; + + if (last_char == '\r') + write(termfd, &lf, 1); + } + void tty_set_noecho() { *************** *** 356,360 **** if (echo_terminator) { ! write(termfd, &buf[i], 1); } input_buf[input_len++] = buf[i]; --- 368,372 ---- if (echo_terminator) { ! tty_write(&buf[i], 1); } input_buf[input_len++] = buf[i]; *************** *** 380,384 **** { input_pos++; ! if (echo) write(termfd, esc_buf, esc_len); } esc_done = 1; --- 392,396 ---- { input_pos++; ! if (echo) tty_write(esc_buf, esc_len); } esc_done = 1; *************** *** 389,393 **** { input_pos--; ! if (echo) write(termfd, esc_buf, esc_len); } esc_done = 1; --- 401,405 ---- { input_pos--; ! if (echo) tty_write(esc_buf, esc_len); } esc_done = 1; *************** *** 474,478 **** /* echo if req'd, insert will redraw the whole line */ if (echo && !insert_mode) ! write(termfd, &buf[i], 1); if (insert_mode && input_len > input_pos) --- 486,490 ---- /* echo if req'd, insert will redraw the whole line */ if (echo && !insert_mode) ! tty_write(&buf[i], 1); if (insert_mode && input_len > input_pos) |
From: Patrick C. <pa...@us...> - 2005-10-21 15:03:13
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318 Modified Files: tty.c Log Message: Treat NL correctly Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** tty.c 21 Oct 2005 14:35:38 -0000 1.12 --- tty.c 21 Oct 2005 15:03:06 -0000 1.13 *************** *** 96,100 **** if (discard) return len; ! write(termfd, buf, len); return len; --- 96,100 ---- if (discard) return len; ! write(termfd, buf, len); return len; *************** *** 246,249 **** --- 246,250 ---- new_term.c_iflag |= IGNBRK; new_term.c_lflag &= ~ISIG; + new_term.c_oflag &= ~ONLCR; new_term.c_cc[VMIN] = 1; new_term.c_cc[VTIME] = 0; |
From: Patrick C. <pa...@us...> - 2005-10-21 14:43:33
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31304/debian Modified Files: dnet-progs.files Log Message: Add dnlogin to package Index: dnet-progs.files =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-progs.files,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** dnet-progs.files 5 May 2003 08:31:40 -0000 1.3 --- dnet-progs.files 21 Oct 2005 14:43:25 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- ./usr/bin/sethost ./usr/bin/dnping + ./usr/bin/dnlogin ./usr/bin/dntask ./usr/bin/phone *************** *** 35,38 **** --- 36,40 ---- ./usr/share/man/man1/sethost.1 ./usr/share/man/man1/dnping.1 + ./usr/share/man/man1/dnlogin.1 ./usr/share/man/man1/dntype.1 ./usr/share/man/man1/dnprint.1 |
From: Patrick C. <pa...@us...> - 2005-10-21 14:43:33
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31304 Modified Files: rpm.spec Log Message: Add dnlogin to package Index: rpm.spec =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/rpm.spec,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** rpm.spec 1 Sep 2005 09:28:01 -0000 1.8 --- rpm.spec 21 Oct 2005 14:43:25 -0000 1.9 *************** *** 29,32 **** --- 29,33 ---- %%PREFIX%%/bin/sethost %%PREFIX%%/bin/dnping + %%PREFIX%%/bin/dnlogin %%PREFIX%%/bin/phone %%PREFIX%%/sbin/ctermd *************** *** 51,54 **** --- 52,56 ---- %%PREFIX%%/man/man1/sethost.1 %%PREFIX%%/man/man1/dnping.1 + %%PREFIX%%/man/man1/dnlogin.1 %%PREFIX%%/man/man3/dnet_addr.3 %%PREFIX%%/man/man3/dnet_conn.3 |