[fa.info-vax] IP/TCP without EUNICE

info-vax@ucbvax.ARPA (10/18/84)

From: Roy <MARANTZ@RUTGERS.ARPA>

We recently bought (and I installed) IP/TCP from Wollongong but not
EUNICE.  I'd like to write some code (LPR and LPD) but don't really want
to buy EUNICE to do it.  Can anyone tell me how to write (in PASCAL
or Macro) code to interface to a small part of the Wollongong software?
I think it should be possible to talk directly to their drivers, but
can't really find info about it.  Thanks and please respond directly to
me since I don't read this list often.

Roy
-------

info-vax@ucbvax.ARPA (10/18/84)

From: David L. Kashtan <KASHTAN@SRI-IU>

As the person who originaly wrote the network code, I have been asked by
several people who do not have EUNICE but would like to access the network
from VMS how to do so.  The following is a very simple MACRO program that
does just that -- it should provide basically what you need to write programs
to connect to servers on other machines.  To create your own server, look in
the file ETC:SERVERS.DAT and see how a server like SMTP is described.  Just
add a new entry for your server (you should only have to change the service
name, the TCP port number and the program to run).  When the master server
process starts your program as a server the network connection will be on
SYS$INPUT:.  You just have to $ASSIGN it and then do READVBLK/WRITEVBLK
$QIOs to read/write the network.  Joe Sventek at LBL (j@lbl-csam) has
written a much more detailed document describing how to access the network
from FORTRAN.  Hope this helps you,
David
P.S.  I have got, written in "C" (and a bit of MACRO), a VMS printer
	SYMBIONT that does network spooling and a fake device driver
	to use as the network line printer.  What this does, is make
	it look like there is a local line printer -- but then all the
	data queued to the printer (or created as a SPOOL file by using
	this fake printer device) is spooled over the net to a particular
	printer server.  There are probably still a few bugs left in it,
	but it should make a good start towards what you want.
-----

	.LIBRARY	/SYS$LIBRARY:STARLET/
	$IODEF

;
;	Define network I/O function codes
;
IO$_SOCKET	= IO$_ACCESS ! <0 @ IO$S_FCODE>	;Create a socket
IO$_CONNECT	= IO$_ACCESS ! <4 @ IO$S_FCODE>	;Connect to foreign host


;
;	Define network access constants
;
AF_INET		= 2				;INTERNET socket (stream=TCP)
SOCK_STREAM	= 1				;Stream socket (TCP)

;
;	Test program to connect to given port on given host
;
dev:	.ascid	/INET0:/
chan:	.blkw	1
iosb:	.blkw	4
buf:	.blkb	100
; Socket structure -- used to describe the foreign host/port we
; will connect to
socket:	.word	AF_INET			;Protocol (TCP)
port:	.word	23			;Port # (e.g. telnet = 23)
address:.byte	10,5,0,2		;Host address (sri-iu = 10.5.0.2)
	.long	0,0			;unused

	.entry	test,^m<>
;
;	Assign a new internet device
;
	$assign_s	devnam=dev,chan=chan
	blbc	r0,exit
;
;	Create a TCP socket
;
	$qiow_s		func = #IO$_SOCKET, iosb=iosb, chan = chan,-
				p1 = @#AF_INET, -	;silly qio macro
				p2=#SOCK_STREAM		;   expects p1 address
	blbc	r0,exit
	blbc	iosb,exit
;
;	Flip the port bytes to network order
;
	movb	port,r0
	movb	port+1,port
	movb	r0,port+1
;
;	Connect to remote host
;
	$qiow_s		func = #IO$_CONNECT, chan = chan, iosb=iosb,-
				p1 = socket, p2 = #16	; p2 = size of socket
	blbc	r0,exit
	blbc	iosb,exit
;
;	Now you can IO$_READVBLK/IO$_WRITEVBLK to read/write to the
;	network.
;
	$qiow_s		func = #IO$_READVBLK, chan = chan, iosb=iosb,-
				p1 = buf, p2=#100
	blbc	r0,exit
	blbc	iosb,exit
;
;	When done, deassign the channel and you are all finished
;
	$dassgn_s	chan = chan

exit:	ret
	.end	test

-------

info-vax@ucbvax.ARPA (10/18/84)

From: Roy <MARANTZ@RUTGERS.ARPA>

Thanks for the info, it will be a real big help.

Roy
-------