SCCS-vsn: usr.bin/tip/cmds.c 4.5
SCCS-vsn: usr.bin/tip/aculib/dn11.c 4.6
SCCS-vsn: usr.bin/tip/remcap.c 4.4
SCCS-vsn: usr.bin/tip/tip.c 4.5
SCCS-vsn: usr.bin/tip/tip.h 4.4
-/* dn11.c 4.5 81/06/21 */
+/* dn11.c 4.6 81/07/11 */
if (boolean(value(VERBOSE)))
printf("\nstarting call...");
if ((dn = open(acu, 1)) < 0) {
if (boolean(value(VERBOSE)))
printf("\nstarting call...");
if ((dn = open(acu, 1)) < 0) {
printf("line busy...");
else
printf("acu open error...");
printf("line busy...");
else
printf("acu open error...");
signal(SIGQUIT, SIG_IGN);
sleep(2);
nw = write(dn, num, lt = strlen(num));
signal(SIGQUIT, SIG_IGN);
sleep(2);
nw = write(dn, num, lt = strlen(num));
- if (nw != lt) {
- printf("dn11 write failed...");
- exit(1);
- }
- exit(0);
}
/*
* open line - will return on carrier
*/
}
/*
* open line - will return on carrier
*/
- FD = open(DV, 2);
- if (FD < 0) {
+ if ((FD = open(DV, 2)) < 0) {
if (errno == EIO)
printf("lost carrier...");
else
if (errno == EIO)
printf("lost carrier...");
else
-/* cmds.c 4.4 81/06/09 */
+/* cmds.c 4.5 81/07/11 */
#include "tip.h"
/*
* tip
#include "tip.h"
/*
* tip
disconnect();
printf("\r\n[EOT]\r\n");
delock(uucplock);
disconnect();
printf("\r\n[EOT]\r\n");
delock(uucplock);
-#ifdef VMUNIX
- ioctl(0, TIOCSETD, (char *)&odisc);
-#endif
-/* remcap.c 4.3 81/05/21 */
+/* remcap.c 4.4 81/07/11 */
/* Copyright (c) 1979 Regents of the University of California */
/* Copyright (c) 1979 Regents of the University of California */
#define MAXHOP 32 /* max number of tc= indirections */
#include <ctype.h>
#define MAXHOP 32 /* max number of tc= indirections */
#include <ctype.h>
-/* tip.c 4.4 81/06/16 */
+/* tip.c 4.5 81/07/11 */
/*
* tip - Unix link to other systems
* tip [-v] [-speed] system-name
/*
* tip - Unix link to other systems
* tip [-v] [-speed] system-name
1200, 1800, 2400, 4800, 9600, 19200, -1
};
1200, 1800, 2400, 4800, 9600, 19200, -1
};
+#ifdef VMUNIX
+int disc = OTTYDISC; /* tip normally runs this way */
+#endif
+
int intprompt();
int timeout();
static int cleanup();
int intprompt();
int timeout();
static int cleanup();
{
char *system = NOSTR;
register int i;
{
char *system = NOSTR;
register int i;
-#ifdef VMUNIX
- int disc;
-#endif
else
printf("%s: unknown option\n", argv[i]);
}
else
printf("%s: unknown option\n", argv[i]);
}
- if ((arg.sg_ispeed = speed(number(value(BAUDRATE)))) == NULL) {
+ if ((i = speed(number(value(BAUDRATE)))) == NULL) {
printf("tip: bad baud rate %d\n", number(value(BAUDRATE)));
delock(uucplock);
exit(3);
}
printf("tip: bad baud rate %d\n", number(value(BAUDRATE)));
delock(uucplock);
exit(3);
}
+ /*
+ * Hardwired connections require the
+ * line speed set before they make any transmissions
+ * (this is particularly true of things like a DF03-AC)
+ */
+ if (HW)
+ ttysetup(i);
if (p = connect()) {
printf("\07%s\n[EOT]\n", p);
delock(uucplock);
exit(1);
}
if (p = connect()) {
printf("\07%s\n[EOT]\n", p);
delock(uucplock);
exit(1);
}
- arg.sg_ospeed = arg.sg_ispeed;
+ if (!HW)
+ ttysetup(i);
+
- * NOTE that remote side runs in TANDEM mode,
- * if the host doesn't honor X-ON/X-OFF with default
- * start/stop chars, the remote description must be
- * extended and tchars will have to be set up here.
- * If the host doesn't honor TANDEM mode, then watch
- * out, as you'll get garbage.
+ * Set up local tty state
- arg.sg_flags = RAW | TANDEM;
- ioctl(FD, TIOCSETP, &arg);
-
- ioctl(0, TIOCGETP, &defarg); /* store initial status */
- ioctl(0, TIOCGETC, &defchars);
+ ioctl(0, TIOCGETP, (char *)&defarg);
+ ioctl(0, TIOCGETC, (char *)&defchars);
+ ioctl(0, TIOCGETD, (char *)&odisc);
arg = defarg;
arg.sg_flags = ANYP | CBREAK;
tchars = defchars;
tchars.t_intrc = tchars.t_quitc = -1;
raw();
arg = defarg;
arg.sg_flags = ANYP | CBREAK;
tchars = defchars;
tchars.t_intrc = tchars.t_quitc = -1;
raw();
-#ifdef VMUNIX
- ioctl(0, TIOCGETD, (char *)&odisc);
- disc = OTTYDISC;
- ioctl(0, TIOCSETD, (char *)&disc);
-#endif
pipe(fildes); pipe(repdes);
signal(SIGALRM, timeout);
pipe(fildes); pipe(repdes);
signal(SIGALRM, timeout);
{
ioctl(0, TIOCSETP, &arg);
ioctl(0, TIOCSETC, &tchars);
{
ioctl(0, TIOCSETP, &arg);
ioctl(0, TIOCSETC, &tchars);
+#ifdef VMUNIX
+ ioctl(0, TIOCSETD, (char *)&disc);
+#endif
- ioctl(0, TIOCSETP, &defarg);
- ioctl(0, TIOCSETC, &defchars);
+#ifdef VMUNIX
+ ioctl(0, TIOCSETD, (char *)&odisc);
+#endif
+ ioctl(0, TIOCSETP, (char *)&defarg);
+ ioctl(0, TIOCSETC, (char *)&defchars);
p->e_flags&EXP ? '*': ' ', p->e_help);
}
}
p->e_flags&EXP ? '*': ' ', p->e_help);
}
}
+
+/*
+ * Set up the "remote" tty's state
+ */
+static
+ttysetup(speed)
+{
+#ifdef VMUNIX
+ unsigned bits = LDECCTQ;
+#endif
+
+ arg.sg_ispeed = arg.sg_ospeed = speed;
+ arg.sg_flags = TANDEM|RAW;
+ ioctl(FD, TIOCSETP, (char *)&arg);
+#ifdef VMUNIX
+ ioctl(FD, TIOCLBIS, (char *)&bits);
+#endif
+}
-/* tip.h 4.3 81/06/16 */
+/* tip.h 4.4 81/07/11 */
/*
* tip - terminal interface program
*
/*
* tip - terminal interface program
*
#ifdef VMUNIX
int odisc; /* initial tty line discipline */
#ifdef VMUNIX
int odisc; /* initial tty line discipline */
+extern int disc; /* current tty discpline */
#endif
extern char *ctrl();
#endif
extern char *ctrl();