[net.unix] calling non-unix systems AND dial

jmg@dolphy.UUCP (Intergalactic Psychic Police Of Uranus) (10/02/85)

*** help ***

In my struggle to put out an esoteric art magazine called, "The Act",
which is about 'performance art', I have found a typesetter who will
allow files to be downloaded straight to his typesetter. (The files
must be loaded with macros very similar to troff...)  My problem
is to figure out how to send files to him.

As far as I understand things, cu, ct and uucp won't work because the
typesetter isn't running UNIX, but a proprietary system put out
by Compugraphic.  My first question is, am I correct in thinking cu,
ct & uucp are of no use to me?

My second question, presumes that they are of no value to me:
I have written a utility that dials a number, fiddles with the parity
and character size so the typesetter is happy, prompts the user about
which files to send, and sends em.  The code uses dial(3)
which is supplied with system 5...unfortunately, I can't get it to work...
that is, dial(3) has an option to look in the L-devices file and
select whatever device it can (the 'line' pointer in the CALL structure
is set to NULL).  Invariably, dial(3) fails and returns an error that
indicates "requested device not known", that is dial(3) returns -9.
Now, I never requested anything other than for dial(3) to find a device
for itself, so it's generating its own error?...  What is wrong?
There are devices in the 'L-devices' file...  though on our 3b2/300 Sys5.2
there originally was no 'L-devices', but a 'Devices' file for uucp, instead.
I merely copied Devices to L-devices which I believe is sufficient.
(Also, I've been doing this work as root, so no permission problems...)

Code fragment (one sbrtn) follows...

Thank you,
jeffrey greenberg


/* dial a computer given the telephone number and the line attributes
 */
#include <dial.h>

dialit( telno, t)
char *telno;
struct termio *t;
{
	CALL call;

	/* Put in the passed arguments
	 */
	call.attr = t;		/* line attributes for new dialed line */
	call.telno = telno;	/* telephone number to dial */

	/* Put in what we want
	 */
	call.baud = 0;		/* dependent on the line found */
	call.speed = 1200;	/* desire 1200 baud (high speed modem)... */
	call.line = 0;		/* let dial(3) select what it can */
	call.modem = 0;		/* depends on 'line' above */
	
	printf("Dialing %s...\n",telno);
	out_fd = dial( &call );

	/* See if call succeeded
	 */
	if( out_fd >= 0 ) {
		printf("Connected!\n");
		return;
	}

	/* Something's wrong.  Cleanup, print error and exit.
	 */
	undial( out_fd );
	switch( out_fd ) {
	case INTRPT:
		pexit("Interrupt Occurred");
		break;
	case D_HUNG:
		pexit("Dialer hung (no return from write)");
		break;
	case NO_ANS:
		pexit("Wouldn't answer within 10 seconds");
		break;
	case ILL_BD:
		pexit("Illegal baud-rate");
		break;
	case A_PROB:
		pexit("ACU problem (open() failure)");
		break;
	case L_PROB:
		pexit("Line problem (open() failure)");
		break;
	case NO_Ldv:
		pexit("Can't open LDEVS file");
		break;
	case DV_NT_A:
		pexit("Requested device not available");
		break;
	case DV_NT_K:
		pexit("Requested device not known");
		break;
	case NO_BD_A:
		pexit("No device available at requested baud");
		break;
	case NO_BD_K:
		pexit("No device known at requested baud");
		break;
	default:
		printf("Got unknown error %d when dialing\n",out_fd);
		pexit("UNKNOWN ERROR WHEN DIALING????");
		break;
	}
}

Thank you,

jeffrey greenberg
212-966-1334
allegra!phri!dolphy!jmg

rdg@hpfcla.UUCP (10/11/85)

# Written  6:27 pm  Oct  1, 1985 by jmg@dolphy.UUCP in net.unix
# In Real Life: Intergalactic Psychic Police Of Uranus at Lesbian Vampires Of Sodom Corp.
# Subject: calling non-unix systems AND dial(3) problems....
*** help ***
......
jeffrey greenberg
212-966-1334
allegra!phri!dolphy!jmg
# End of text from net.unix on hpfcdc.UUCP


Try the "~$" command in CU: it lets you fork a subshell, and it sends
the output of that shell to the remote system. So, depending on the
remote system, you might be able to use something like "~$cat file"
to send a file.


Rob Gardner                     {ihnp4,hplabs,hpbbn}!hpfcla!rdg
Hewlett Packard                 or hpfcla!rdg@hplabs
Fort Collins, Co. 80525

david@varian.UUCP (David Brown) (10/18/85)

> 
> Try the "~$" command in CU: it lets you fork a subshell, and it sends
> the output of that shell to the remote system. So, depending on the
> remote system, you might be able to use something like "~$cat file"
> to send a file.
> 

Yes, I find the ~$ command extremely useful -- I can send files to almost
any system with it.  I made a modified version of cat that sends only
a carriage return at the end of a line instead of CR/LF and has a command
line option to specify delays between characters (I had to use setbuf(3)
to turn off stdio buffering) -- this does a pretty good job of emulating
a human typist.

HOWEVER!!  On 4.2BSD, the cu command has been replaced with a link to
tip, which does not have this function (though it does have something
similar in the opposite direction -- ~| pipes the output from a remote
command to a local UNIX process).  Has anyone modified tip (or kermit)
to restore this function?   Or is there some other way to achieve the
same results?

I tried compiling the v7 cu on 4.2bsd -- it worked OK to connect, but
when I tried using ~$, nothing happened.  I didn't have any time to 
explore deeper, but this is a function I dearly miss.

Besides transferring files to systems with no transfer mechanism (e.g. 
kermit), I find it useful for sending setup commands to our TriData
Oz Guardian modems (these modems have a dialback capability so I'm
always adding new passwords and phone numbers) -- I put the commands
into a file, disable logins on the modem port, use cu to talk to the
modem, and use ~$ to send the file to each modem.

-- 
	David Brown	 (415) 945-2199
	Varian Instruments 2700 Mitchell Dr.  Walnut Creek, Ca. 94598
	{zehntel,dual,amd,fortune,rtech,lll-crg}!varian!david