NETWORK COMUNICATION ROUTINES (CLIENT/SERVER) 1 GENERAL INFORMATION This group of programs grew out of a need to access, from a remote DECnet node, any of four print queues using any of several print forms. Our facility uses a DECnet network consisting of twelve MicroVAX I's and one VAX 11/780. The majority of our users are connected directly to a MicroVAX I; however, most (and originally all) of our printers are connected to the 780. A DEC software resident (Mr. Tony Wilson) wrote the original REMOTEPRINT.COM - NETPRINT.COM client/server routines. This gave MicroVAX users full access to the print queues on the 780 and even handled print job accounting. These routines were subsequently modified to enable access to print queues on other DECnet nodes (we bought some serial port printers for certain of the MicroVAXen). To date this is still limited to VMS and MicroVMS systems. (I have begun a program, REMOTEPRINT.C, to give our Ultrix-32m users access to these same VMS print queues.) After repeated grumblings about the lack of a 24 hour battery backed up clock in the MicroVAXen, one of my users asked me, "Why can't the MicroVAX ask the 780 what time it is?" I then wrote SENDTIME.COM - SETTIME.COM which runs during the startup of a VMS MicroVAX to set the system time. (The startup time prompt can be disabled in VMS 4.4 and later.) Next came SETTIME.C which does the same thing for the Ultrix MicroVAXen. The following paragraphs will detail installation and use instructions for each of the programs in this group. I hope they are as well received by your user population as they have been here. 2 NETPRINT.COM 2.1 Installation This VMS command procedure must reside in the default DECnet acount of any node which is intended to support remote access to its print queues. It is accessed through the network object "TASK" (i.e. "TASK=NETPRINT"). One modification will be required if your users on the remote (client) node to node have an identically named account on the local (server) node. This procedure attempts to submit the print job under the name of the remote node user, thus allowing the print to be properly "charged" by the system accounting. If the remote user does not have an account on the local node the print command will fail Page 2 and the resulting error message will be returned to the remote process. The easiest fix for this is the delete the "/USER='USERNAME'" portion of the print command. Original: $ 'PRINTCMD'/Note="Remote print job from ''JOBNAME'"/USER='USERNAME' New: $ 'PRINTCMD'/Note="Remote print job from ''JOBNAME'" Each server node must also contain the FORMNAMES.DAT file which must reside in the SYS$MANAGER directory (unless appropriate changes are made in REMOTEPRINT.COM). A sample FORMNAMES.DAT is included on this tape and is reproduced here. LASER (LETTER or WIDE) LASER1 (LETTER or WIDE) LASER2 (LETTER or WIDE) LCA0 NARROW LCB0 DEFAULT SYS$PRINT DEFAULT The first twenty characters of each line are used to identify a print queue. The remainder of the line contains the available forms for that queue. This file is used by REMOTEPRINT.COM in two ways: (1) it is typed on the terminal screen to show the user what queues and forms are available; and (2) it is used to validate queue and form requests. 2.2 Use If this procedure is called by anything other than a network process, it will exit with an appropriate error message. It can only be invoked by the "TASK=NETPRINT" form in a command issued by a node running DECnet VAX. 2.3 Other Comments As written, this procedure also maintains a NETPRINT.LOG file in the decnet account. This logfile chronicles all uses of REMOTEPRINT.COM and was included to provide info on who was using the utility and how often. Page 3 3 REMOTEPRINT.COM 3.1 Installation This VMS command procedure may reside in any directory of the DECnet (client) node which is to have access to the print queues of another node. An appropriate symbol should be set up in SYLOGIN to reference it. Certain local symbols in the procedure are installation specific and are explained here: Def_queue = "FORCE::SYS$PRINT" Defines the default DECnet node and print queue to be used if the user does not specify one. Our site is somewhat geographically separated and, therefore different nodes have different defaults to minimize walking distance to pick up one's printouts. Printnodes = "*FORCE*CHEWIE*C3PO*" Defines those remote nodes which support the REMOTEPRINT/NETPRINT operation. 3.2 Use The procedure is fully prompting. Passing a single question mark (?) as the first parameter will print a short command format message which describes the use of each parameter. The fifth parameter, "other qualifiers", is only accessable through the command line (it will not be prompted for) and allows the user to include any additional qualifiers which will be recognized by the print command on the remote (server) node. 3.3 Other Comments If the name or location of the FORMNAMES.DAT file were changed during the installation on the server node, make the corresponding changes in REMOTEPRINT.COM. This procedure has been so well received by our users that it is installed on every node in our system. It is often used by users who are local to the node where the print job is being sent. NETPRINT.LOG shows that often REMOTEPRINT is used to print a job when print/que= would have done just as well. Page 4 4 SENDTIME.COM 4.1 Installation This VMS command procedure must reside in the default DECnet account of any node which is subject to receive a request for system time from a remote node. It is accessed through the network object "TASK" (i.e. "TASK=SENDTIME") or through the network object "SENDTIME". It recognizes requests from either a VMS or an ULTRIX client and responds with a datetime string which is formatted according to the requirements of the clients operating system (i.e. dd-mmm-yyyy HH:MM for VMS and yymmddHHMM for Ultrix). 4.2 Use If this procedure is called by anything other than a network process, it will exit with an appropriate error message. It can only be invoked by the "TASK=SENDTIME" form in a command issued by a node running DECnet VAX or a call to dnet_conn("remote_node_name", "SENDTIME", 0, 0, 0, 0, 0) by a program running on a node which has DECnet-ULTRIX. 4.3 Other Comments Additional operating system support could be added by checking for the proper received string, performing the necessary formatting on the current local system time, and outputing the resulting datetime string. 5 SETTIME.COM 5.1 Installation This VMS command procedure may reside in any directory of the VMS DECnet (client) node which is to request current time from a server node. It should be called by SYSTARTUP.COM after the network is running. (If STARTNET.COM is submitted by SYSTARTUP as a batch job, care must be taken that the network is in fact up before SETTIME.COM is called.) 5.2 Use While this procedure may be invoked at any time by any properly privileged process, it is usually only invoked at boottime by a Page 5 reference in SYSTARTUP.COM. It uses the "TASK=SENDTIME" form to kick off the server procedure on the remote node. Should the network communications portion of this procedure fail for any reason, the procedure will prompt on the startup console terminal (i.e. OPA0:) for the date and time. 5.3 Other Comments Should the network portion of this procedure fail, the prompting approximates the normal startup time prompt; however, it will not accept anything short of day, month, year, hour, and minute. It will not be satisfied with a date only and fill in midnight as the default time. 6 SETTIME.C 6.1 Installation This program may reside in any directory of the Ultrix DECnet (client) node which is to request current time from a server node (/etc is suggested). It should be called by rc.local after the network is running. In our installation a sleep of forty-five seconds is placed between the network startup and this call to give the network time to wake up and to allow time for the console logging messages from DECnet to get out of the way. The portion of rc.local for our MicroVAX I looks like this: {line which starts decnet} sleep 45 /etc/settime force /dev/console {rest of rc.local} The parameter is the DECnet node name of the server node where SENDTIME exists. The input and output redirection is required in case the network link fails and the program has to request the time from the operator at the startup console device (/dev/console for our MicroVAXen). 6.2 Use CAUTION This program should not be executed on a a system which is up and running multiuser. Resetting the system time in such a circumstance can crash the Page 6 system. This program should be tested either in single user mode or by rebooting the system. This program should not be executed interactively except in single user mode. 6.3 Other Comments I have not experimented with how late in rc.local that this program can be successfully called. It may be possible to leave out the sleep time if the program is called later in the startup. 7 FUTURE PLANS 7.1 REMOTEPRINT.C I mentioned before that I have begun work on an Ultrix client program which works with NETPRINT.COM. This will give users on Ultrix MicroVAXen direct use of the VMS print queues instead of the dcp; dlogin; print/que= sequence. I hope to complete this by January 1988. 7.2 NETPRINT.C I have an idea for an Ultrix server program to allow remote nodes, both Ultrix and VMS, to access the print capability of the Ultrix nodes which have printers attached. Since this will have to parallel the operation of my VMS NETPRINT.COM, I have to figure out what to do with the queue and form specifications from the remoteprint client program. Any suggestions? 7.3 SENDTIME.C While of little or no use to our current site, this Ultrix server companion to the client settime program seems necessary to a well rounded package. I have no definite plans right now to develop this, but, I am thinking about it. 7.4 And Who Knows What Else? If you have any comments or questions about these programs/procedures or ideas/similar works of your own please contact me at the following address. Page 7 Commanding General (886) Marine Corps Logistics Base Albany, GA 31704-5000 ATTN:Dave Smith