From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a79b1767ad6d2b69 X-Google-Attributes: gidfee84,public From: thomas@lkg.dec.com (Matt Thomas) Subject: Re: DECnet object specification under DEC UNIX Date: 1995/06/19 Message-ID: <3s4kbs$2vi@alfabx.lkg.dec.com>#1/1 X-Deja-AN: 104728536 distribution: world sender: thomas@netrix.lkg.dec.com (Matt Thomas) references: <3s4c81$5sg@charm.magnus.acs.ohio-state.edu> cc: DAVISM@kcgl1.eng.ohio-state.edu organization: Digital Equipment Corporation reply-to: thomas@lkg.dec.com newsgroups: comp.unix.osf.osf1 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 #include #include #include #include #ifdef DNA #include #else #include #endif #include 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.