Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/7/84; site ucbvax.ARPA Path: utzoo!linus!decvax!ucbvax!info-vax From: info-vax@ucbvax.ARPA Newsgroups: fa.info-vax Subject: Re: IP/TCP without EUNICE Message-ID: <2651@ucbvax.ARPA> Date: Thu, 18-Oct-84 03:34:46 EDT Article-I.D.: ucbvax.2651 Posted: Thu Oct 18 03:34:46 1984 Date-Received: Fri, 19-Oct-84 05:39:50 EDT Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 100 From: David L. KashtanAs 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 -------