From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 18304 invoked from network); 25 May 1999 21:48:39 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 25 May 1999 21:48:39 -0000 Received: from fireware.int.newport.com (fireware.int.newport.com [205.143.195.66]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id RAA19199 for ; Tue, 25 May 1999 17:06:51 -0400 Received: (qmail 30535 invoked from network); 25 May 1999 20:55:46 -0000 Received: from unknown (HELO irvsql01.int.newport.com) (10.25.1.22) by 10.25.1.1 with SMTP; 25 May 1999 20:55:46 -0000 Received: from Phantom.newport.com (10.25.1.21 [10.25.1.21]) by irvsql01.int.newport.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id K0L85C4R; Tue, 25 May 1999 14:10:49 -0700 Sender: rdong@Phantom.newport.com To: axp-list@redhat.com Subject: Kermit? From: Rui-Tao Dong Date: 25 May 1999 14:02:26 -0700 Message-ID: I have a not quite dead (floppyless and diskless) UDB and I am trying to make it a dedicated firewall for my cable modem. I need a terminal program to talk to serial console. Has anyone got Kermit working? I got the (very old) rpm from Columbia, but it crashes on connect. I am having a hard time compiling it. Does anyone have an RPM? Or has any suggestion on a better terminal program? I tried to roll my own, but without much luck. -- Regards, Rui-Tao (x679) /* Usage link /dev/cua0 */ #include #include #include #include #define BUFSIZE 1024 void copy_bytes(int in_fd, int out_fd) { char buf[BUFSIZE]; int rbytes; if ( (rbytes=read(in_fd, buf, BUFSIZE)) > 0 ) { int wbytes; char* buf_p=buf; fprintf(stderr, "Reading %d bytes from %d.\n", rbytes, in_fd); while (buf_p < buf+rbytes) { int wsize=rbytes+buf-buf_p; wbytes=write(out_fd, buf_p, wsize); fprintf(stderr, "Writing %d bytes to %d.\n", wbytes, out_fd); buf_p += wbytes; } if (wbytes < 0) { perror("write"); exit(-1); } } else if (rbytes < 0) { perror("read"); exit(-1); } } int main(int argc, char** argv) { int fd; fd_set read_set; /* Initialize the file descriptor set. */ if (argc !=2) { fprintf(stderr, "Using %s device-file.\n", argv[0]); return -1; } if ((fd=open(argv[1], O_RDWR)) < 0) { perror("open"); return -1; } FD_ZERO (&read_set); FD_SET (fd, &read_set); FD_SET (0, &read_set); while (1) { if ( select(FD_SETSIZE, &read_set, NULL, NULL, NULL) < 0 ) { perror("select"); return -1; } if ( FD_ISSET(fd, &read_set)) { copy_bytes(fd, 1); } else if (FD_ISSET(0, &read_set)) { copy_bytes(0, fd); } else { return -1; } } close(fd); return 0; }