From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 724 invoked from network); 25 May 1999 23:40:34 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 25 May 1999 23:40:34 -0000 Received: from mail2.wn.net (mail2.wn.net [206.190.223.5]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id SAA26913 for ; Tue, 25 May 1999 18:58:45 -0400 Received: from alphalinux.org (206.190.210.27) by mail2.wn.net (Worldmail 1.3.167) for axp-list@redhat.com; 25 May 1999 18:51:12 -0400 Sender: ppetrakis@mail.redhat.com Message-ID: <374B2B2B.FB795CE3@alphalinux.org> Date: Tue, 25 May 1999 18:58:51 -0400 From: Peter Petrakis Organization: AlphaLinux Organization X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.3.0 alpha) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Kermit? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Have you tried using minicom yet? Peter Rui-Tao Dong wrote: > > 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; > } > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com -- www.alphalinux.org Peter Petrakis Warrior/Engineer ppetrakis@alphalinux.org "Oh my God! They killed Xena! You bastards!!" " Who the hell are you!? Name's Ash Housewares..."