From: thomas@lkg.dec.com (Matt Thomas)
Cc: DAVISM@kcgl1.eng.ohio-state.edu
Subject: Re: DECnet object specification under DEC UNIX
Date: 1995/06/19 [thread overview]
Message-ID: <3s4kbs$2vi@alfabx.lkg.dec.com> (raw)
In-Reply-To: 3s4c81$5sg@charm.magnus.acs.ohio-state.edu
In article <3s4c81$5sg@charm.magnus.acs.ohio-state.edu>, DAVISM@kcgl1.eng.ohio-state.edu (Mike Davis, Chief of Operations -- ECR6) writes:
|>
|> We have a DEC UNIX 3.2a system running with DECnet/OSI (using LNO) so
|>that we can communicate via DECnet Phase IV with a couple VMS systems. We
|>need to be able to invoke a network object from the DEC UNIX box which will
|>run on a remote VMS system. Is this possible, using the DEC-supplied
|>DECnet/OSI tools? I tried what would be obvious to a VMS-speaking user (like
|>me ;-):
You'll need to write a small program to do this.
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifdef DNA
#include <netosi/dna.h>
#else
#include <netdnet/dn.h>
#endif
#include <sysexits.h>
char buf[256];
#ifndef DEFAULT_OBJECT
#define DEFAULT_OBJECT "FOO"
#endif
main(argc, argv)
int argc;
char *argv[];
{
#ifdef DNA
DnaError_t err;
DnaArgument_p args;
#else
int fd;
#endif
int len;
char *cp;
if (cp = strrchr(argv[0],'/'))
cp++;
else
cp = argv[0];
if (argc != 2 && argc != 3) {
fprintf(stderr, "usage: %s nodename [object]\n", cp);
exit(EX_USAGE);
}
#ifdef DNA
args = dnaNewArg();
args->DnaArgStrNodename = argv[1];
args->DnaArgStrDestEnduser = (argc == 3 ? argv[2] : DEFAULT_OBJECT);
if (!dnaConnectNodename(args)) {
args->DnaArgExtraText = argv[1];
dnaPerror(args);
exit(EX_UNAVAILABLE);
}
while( (len = read(args->DnaArgPort, buf, sizeof(buf))) >= 0 ) {
if (len == 0 && dnaEof(args))
break;
buf[len] = '\0';
puts(buf);
}
dnaClosePort(args);
#else
fd = dnet_conn(argv[1], (argc == 3 ? argv[2] : DEFAULT_OBJECT), SOCK_SEQPACKET, NULL, 0, NULL, NULL);
if( fd < 0 ) {
nerror(argv[1]);
exit(EX_UNAVAILABLE);
}
while( (len = read(fd, buf, sizeof(buf))) >= 0 ) {
if (len == 0 && dnet_eof(fd))
break;
buf[len] = '\0';
puts(buf);
}
close(fd);
#endif
exit(EX_OK);
}
--
Matt Thomas Internet: thomas@lkg.dec.com
U*X Networking WWW URL: http://ftp.dec.com/%7Ethomas/
Digital Equipment Corporation Disclaimer: This message reflects my
Littleton, MA own warped views, etc.
prev parent reply other threads:[~1995-06-19 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-06-19 4:00 DECnet object specification under DEC UNIX Mike Davis, Chief of Operations -- ECR6
1995-06-19 4:00 ` Matt Thomas [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox