[net.bugs.4bsd] 4.2 BSD bugs in tip

phil@sequel.UUCP (10/31/83)

4.2 BSD tip program has bugs in how it supports ventel modems.  The version
of tip with 4.1c assumed the modem was set to "echo" while the 4.2 release
assumes "no echo".  In addition, the code that checks for legal phone numbers
would not allow you to use either an '&' or '%' which are needed for the ventel.
I have included my diffs to tip/acu.c and tip/aculib/ventel.c that make it
work with the ventel (with echo on) and allow '&' and '%' in phone numbers.
Also I rearranged the code somewhat to make dialing faster (and used <..> mode).
Cheers..

% diff old.acu.c acu.c
66c66
< 			for (phnum = cp; any(*cp, "0123456789-*=K"); cp++)
---
> 			for (phnum = cp; any(*cp, "0123456789-*=K&%"); cp++)
101c101
< 			for (phnum = cp; any(*cp, "0123456789-*="); cp++)
---
> 			for (phnum = cp; any(*cp, "0123456789-*=&%"); cp++)
% diff old.ventel.c ventel.c
7c7
<  * The Ventel is expected to be strapped for "no echo".
---
>  * The Ventel is expected to be strapped for "echo".
16a17,25
> #define uucpdelay(num,denom) busyloop(CPUSPEED*num/denom)
> #define CPUSPEED 1000000	/* VAX 780 is 1MIPS */
> #define	DELAY(n)	{ register long N = (n); while (--N > 0); }
> 
> busyloop(n)
> {
> 	DELAY(n);
> }
> 
40,45c49,53
< 	echo("#k$\r$\n$D$I$A$L$:$ ");
< 	for (cp = num; *cp; cp++) {
< 		sleep(1);
< 		write(FD, cp, 1);
< 	}
< 	echo("\r$\n");
---
> 	write(FD, "<K", 2);
> 	write(FD, num, strlen(num));
> 	write(FD, ">", 1);
> 	if (gobble('\n') && gobble('\n') && gobble('\007'))
> 		echo("\r$\n");
125,128d132
< #ifdef notdef
< 		if (boolean(value(VERBOSE)))
< 			putchar(c);
< #endif
146,156d149
< 	/*
< 	 * Toggle DTR to force anyone off that might have left
< 	 * the modem connected, and insure a consistent state
< 	 * to start from.
< 	 *
< 	 * If you don't have the ioctl calls to diddle directly
< 	 * with DTR, you can always try setting the baud rate to 0.
< 	 */
< 	ioctl(FD, TIOCCDTR, 0);
< 	sleep(2);
< 	ioctl(FD, TIOCSDTR, 0);
164c157
< 		sleep(1);
---
> 		uucpdelay(1,10);	/* sleep .1 sec */
166c159,161
< 		sleep(3);
---
> 		uucpdelay(1,10);	/* sleep .1 sec */
> 		ioctl(fd, TIOCFLUSH, (struct sgttyb *)0);
> 		uucpdelay(1,10);	/* sleep .1 sec */
177a173,184
> 		/*
> 	 	* Toggle DTR to force anyone off that might have left
> 	 	* the modem connected, and insure a consistent state.
> 	 	*
> 	 	* If you don't have the ioctl calls to diddle directly
> 	 	* with DTR, you can always try setting the baud rate to 0.
> 	 	*/
> 		if (already == 0) {
> 			ioctl(FD, TIOCCDTR, 0);
> 			sleep(2);
> 			ioctl(FD, TIOCSDTR, 0);
> 		}
-- 
	Phil Hochstetler (503) 627-9811
	Sequent Computer Systems
	...!sequent!phil