[net.unix-wizards] 4.2 tip CONNECT features

z@rocksvax.UUCP (Jim Ziobro) (07/11/85)

I noticed that 4.2 tip had an extra command "~C" to connect a program to the
remote line.  As it was it wasn't very useful since file descriptors 4 and 5 
were the remote line after fork.  I changed it so the remote line is file
descriptors 0 and 1 and it seems to open up a whole world of possibilities.

It really seems like this is the logical thing to do.  Has anyone else played
with this section of tip?  We have already hacked tip to "put" and "take"
files to a VMS system and are working on some other systems.  A lot of
ugly hacks to tip could potentially be avoided by using the connect feature.

-- 
//Z\\
James M. Ziobro
Ziobro.Henr@Xerox.COM
{rochester,amd,sunybcs,allegra}!rocksvax!z

gamiddleton@thunder.UUCP (Guy Middleton) (07/12/85)

In article <1286@rocksvax.UUCP> z@rocksvax.UUCP (Jim Ziobro) writes:
>I noticed that 4.2 tip had an extra command "~C" to connect a program to the
>remote line. ... ...
>
>Has anyone else played with this section of tip?

We have here, sort of.  One of the problems with Kermit is that it knows
nothing about dialers (nor should it; we already have two programs on 4.2bsd
(uucp and tip) that do, and that's quite enough).  I gave Kermit another
command-line option (I called it 'T'), which told it that it had been called
with the "~C" command of tip.  That way, tip takes care of the dialer, and
the LCK file.  The modification to Kermit was quite minor.
-- 
	Guy Middleton, Lakehead University, Thunder Bay, Ont.
	..{allegra,clyde,decvax,utcsrgv}!watmath!thunder!gamiddleton
	..ihnp4!mmm!thunder!gamiddleton

edwards@h-sc1.UUCP (william edwards) (07/14/85)

The recent versions of C-Kermit from Columbia will dial a
couple of kinds of modems, Hayes included.  

					Bill Edwards
					Harvard University

					edwards@harvard.ARPA

z@rocksvax.UUCP (Jim Ziobro) (07/19/85)

> I noticed that 4.2 tip had an extra command "~C" to connect a program to the
> remote line.  As it was it wasn't very useful since file descriptors 4 and 5 
> were the remote line after fork.  I changed it so the remote line is file
> descriptors 0 and 1 and it seems to open up a whole world of possibilities.
>
Here are the changes.  Really only 3 lines of code changed.  The line
numbers will probably be different for your version since our version has
been hacked tremendously.  Also remember to add -DCONNECT to CFLAGS in
the Makefile.


*** cmds.c	Fri Jul 19 15:19:29 1985
--- cmds.c.CKP	Thu Jul 18 16:44:12 1985
***************
*** 1,5
  #ifndef lint
! static char *RCSid = "$Header: cmds.c,v 1.7 85/07/18 21:13:18 z Exp $";
  #endif
  
  /*

--- 1,5 -----
  #ifndef lint
! static char *RCSid = "$Header: cmds.c,v 1.6 85/07/18 16:42:25 root Exp $";
  #endif
  
  /*
***************
*** 4,13
  
  /*
   * $Log:	cmds.c,v $
-  * Revision 1.7  85/07/18  21:13:18  z
-  * Changed consh() [~C command] to connect remote tty to stdin and stdout
-  * of command.
-  * 
   * Revision 1.6  85/07/18  16:42:25  root
   * 1) Added a XMODEM hack and associated stuff for that
   * 

--- 4,9 -----
  
  /*
   * $Log:	cmds.c,v $
   * Revision 1.6  85/07/18  16:42:25  root
   * 1) Added a XMODEM hack and associated stuff for that
   * 
***************
*** 462,469
  #ifdef CONNECT
  /*
   * Fork a program with:
!  *  0 <-> remote tty in
!  *  1 <-> remote tty out
   *  2 <-> local tty out
   */
  consh(c)

--- 458,465 -----
  #ifdef CONNECT
  /*
   * Fork a program with:
!  *  0 <-> local tty in
!  *  1 <-> local tty out
   *  2 <-> local tty out
   *  3 <-> remote tty in
   *  4 <-> remote tty out
***************
*** 465,470
   *  0 <-> remote tty in
   *  1 <-> remote tty out
   *  2 <-> local tty out
   */
  consh(c)
  {

--- 461,468 -----
   *  0 <-> local tty in
   *  1 <-> local tty out
   *  2 <-> local tty out
+  *  3 <-> remote tty in
+  *  4 <-> remote tty out
   */
  consh(c)
  {
***************
*** 493,501
  	} else {
  		register int i;
  
! 		dup2(FD, 1);
! 		dup2(3, 0);
! 		for (i = 3; i < 20; i++)
  			close(i);
  		signal(SIGINT, SIG_DFL);
  		signal(SIGQUIT, SIG_DFL);

--- 491,499 -----
  	} else {
  		register int i;
  
! 		dup2(FD, 3);
! 		dup2(3, 4);
! 		for (i = 5; i < 20; i++)
  			close(i);
  		signal(SIGINT, SIG_DFL);
  		signal(SIGQUIT, SIG_DFL);
-- 
//Z\\
James M. Ziobro
Ziobro.Henr@Xerox.COM
{rochester,amd,sunybcs,allegra}!rocksvax!z