ttyfd
ttyopen(struct ttyfd *tf)
ttyread(struct ttyfd *tf)
ttywrite(struct ttyfd *tf, unsigned char wb)
struct ttyfd tty;
disestablish_ppp(ttyfd);
(void) close(ttyfd); /* tty interface to the ppp device */
ttyfd = pty_slave;
ttyfd = -1;
ttyfd = 0;
if ((ttyfd = sys_extra_fd()) < 0)
ttyfd = open(devnam, O_NONBLOCK | O_RDWR);
if (ttyfd >= 0)
if ((fdflags = fcntl(ttyfd, F_GETFL)) == -1
|| fcntl(ttyfd, F_SETFL, fdflags & ~O_NONBLOCK) < 0)
if (fstat(ttyfd, &statbuf) < 0
|| fchmod(ttyfd, statbuf.st_mode & ~(S_IWGRP | S_IWOTH)) < 0) {
set_up_tty(ttyfd, ((connector != NULL && connector[0] != '\0')
real_ttyfd = ttyfd;
ttyfd = pty_slave;
if (!start_charshunt(ttyfd, ttyfd))
if (device_script(initializer, ttyfd, ttyfd, 0, "init") < 0) {
if (device_script(connector, ttyfd, ttyfd, 0, "connect") < 0) {
if (device_script(welcomer, ttyfd, ttyfd, 0, "welcome") < 0)
fd_ppp = establish_ppp(ttyfd);
disestablish_ppp(ttyfd);
if (device_script(disconnect_script, ttyfd, ttyfd, 0,
int ttyfd; /* Serial port file descriptor */
extern int ttyfd; /* Serial device file descriptor */
if (ttyfd == -1) {
getbits(ttyfd, devnam, strptr);
(fdmuxid = ioctl(pppfd, I_LINK, (void *)ttyfd)) == -1)