static char sccsid
[] = "@(#)v831.c 4.5 (Berkeley) %G%";
* Routines for dialing up on Vadic 831
int status
, pid
, connected
= 1;
if (boolean(value(VERBOSE
)))
printf("\nstarting call...");
printf ("(acu=%s)\n", acu
);
if ((AC
= open(acu
, O_RDWR
)) < 0) {
printf("acu open error...");
signal(SIGALRM
, alarmtr
);
timelim
= 5 * strlen(num
);
alarm(timelim
< 30 ? 30 : timelim
);
if ((child
= fork()) == 0) {
* ignore this stuff for aborts
signal(SIGALRM
, SIG_IGN
);
signal(SIGQUIT
, SIG_IGN
);
exit(dialit(num
, acu
) != 'A');
* open line - will return on carrier
if ((FD
= open(DV
, O_RDWR
)) < 0) {
printf("(after open, errno=%d)\n", errno
);
printf("lost carrier...");
printf("dialup line open failed...");
signal(SIGALRM
, SIG_DFL
);
while ((pid
= wait(&status
)) != child
&& pid
!= -1)
* Insurance, for some reason we don't seem to be
printf("[disconnect: FD=%d]\n", FD
);
ioctl(FD
, TIOCGETP
, &cntrl
);
cntrl
.sg_ispeed
= cntrl
.sg_ospeed
= 0;
ioctl(FD
, TIOCSETP
, &cntrl
);
ioctl(FD
, TIOCNXCL
, (struct sgttyb
*)NULL
);
printf("[abort: AC=%d]\n", AC
);
ioctl(FD
, TIOCNXCL
, (struct sgttyb
*)NULL
);
* Sigh, this probably must be changed at each site.
#define pc(x) (c = x, write(AC,&c,1))
register struct vaconfig
*vp
;
phonenum
= sanitize(phonenum
);
printf ("(dial phonenum=%s)\n", phonenum
);
if (*phonenum
== '<' && phonenum
[1] == 0)
for (vp
= vaconfig
; vp
->vc_name
; vp
++)
if (strcmp(vp
->vc_name
, acu
) == 0)
printf("Unable to locate dialer (%s)\n", acu
);
ioctl(AC
, TIOCGETP
, &cntrl
);
cntrl
.sg_ispeed
= cntrl
.sg_ospeed
= B2400
;
cntrl
.sg_flags
= RAW
| EVENP
| ODDP
;
ioctl(AC
, TIOCSETP
, &cntrl
);
ioctl(AC
, TIOCFLUSH
, &two
);
while (*phonenum
&& *phonenum
!= '<')
printf("read %d chars, char=%c, errno %d\n", i
, c
, errno
);
if (c
== 'B' || c
== 'G') {
printf("abort response=%c\n", cc
);
printf("dialit: returns %c\n", c
);
for (cp
= buf
; *s
; s
++) {
if (!isdigit(*s
) && *s
== '<' && *s
!= '_')