[comp.sys.sun] kermit from SunOS to ethernet

faulkner%jmullins@husc6.harvard.edu (Don Faulkner) (04/25/89)

contact!umb!gplan@husc6.harvard.edu (George A. Planansky) writes:

George> Kermit asks for a "line", being a /dev/tty#, to get out of a Unix machine.
George> Our Unix machines have no available serial ports, as we connect to them
George> via their ethernet controllers.

George> Thus I can use the Unix telnet command to connect to a modem interactively, 

George> QUESTION:  how can I get to an ethernet address, with kermit, from Unix?

try PTY's, like:
==================================================
#include <stdio.h>
#include <fcntl.h>

main ()
{   char ttyp_name [200], pty_name [200], pty_let;
    int pty_index, pty_fildes, telnet_pid;

    pty_fildes = -1;
    for (pty_index = 0; pty_fildes < 0; pty_index++)  {
	pty_let = (pty_index < 10) ? (pty_index + '0') : 
	    (pty_index + 'a' - 10);
	sprintf (pty_name, "/dev/ptyp%c", pty_let);
	pty_fildes = open (pty_name, O_RDWR);
    }
    if (pty_fildes < 0)  {
	perror ("No ptyp? opened because");
	exit (1);
    }
    fprintf (stderr, 
        "PseudoTeletype pair is /dev/ttyp%c and /dev/ptyp%c\n",
	pty_let, pty_let);
    if (!(telnet_pid = fork ())) {
	close (0);
	close (1);
	close (2);
	dup2 (pty_fildes, 0);
	dup2 (pty_fildes, 1);
	dup2 (pty_fildes, 2);
	execlp ("telnet", "telnet", "localhost", NULL);
	perror ("EXECLP to telnet failed because");
	exit (1);
    }
    close (pty_fildes);
    sprintf (ttyp_name, "/dev/ttyp%c", pty_let);
fprintf (stderr, "Running:  \"%s\" \"%s\" \"%s\"\n",
    "kermit" ,"-l", ttyp_name);

    execlp ("kermit" ,"kermit", "-l", ttyp_name, "-b", "9600", 
        NULL);
    perror ("EXECLP to kermit failed because");
    exit (1);
}
==================================================
--

 Don Faulkner                                       
 Building 1, Room 803
 Harvard University, School of Public Health
 665 Huntington Avenue
 Boston, MA  02115

 ARPA:      faulkner%jmullins@harvard.harvard.edu                
 BITNET:    faulkner@harvard
 Telephone: (617) 732-2297

dpk@morgan.com (Douglas P. Kingston) (04/25/89)

Regarding: Using kermit through a modem on a terminal server

We modified kermit to do just that.  It was fairly straight forward.

I can send the modified file to those that would like it, but I would
prefer to feed it back to Columbia.  Can somebody tell me who at Columbia
to mail this change to?

-Doug-

PS.  Our work was based on the following version of ckutio.c:
     char *ckxv = "Unix tty I/O, 4E(045), 14 Sep 87";

dpk@morgan.com (Douglas P. Kingston) (05/09/89)

I have posted changes for 19200Kbaud and TCP/IP terminal server support.

-Doug-