home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!think.com!yale.edu!yale!gumby!destroyer!cs.ubc.ca!bcsystems!spruce.pfc.forestry.ca!news.u.washington.edu!raven.alaska.edu!acad3.alaska.edu!fxmlk
- Newsgroups: vmsnet.sources.games
- Subject: Re: Vmsnetrek: Wollingong vs. Multinet
- Message-ID: <18NOV199210092352@acad3.alaska.edu>
- From: fxmlk@acad3.alaska.edu (KIENENBERGER MIKE L)
- Date: Wed, 18 Nov 1992 18:09:00 GMT
- Sender: news@raven.alaska.edu (USENET News System)
- References: <1992Nov13.140910.1@acad2.alaska.edu> <1992Nov15.163205.3985@arizona.edu>
- <1992Nov15.151913.1@acad2.alaska.edu> <1992Nov16.111116.1@slacvx.slac.stanford.edu>
- Distribution: world,local
- Organization: University of Alaska - Fairbanks
- News-Software: VAX/VMS VNEWS 1.41.UAC
- Nntp-Posting-Host: acad3.alaska.edu
- Lines: 197
-
- In article <1992Nov16.111116.1@slacvx.slac.stanford.edu>,
- fairfield@slacvx.slac.stanford.edu writes...
- > OK, is there a version compatible with TGV's Multinet? Barring that,
- >can you point us to the Wollingong-specific mod's so that we can make the
- >corresponding changes for Multinet?
-
- In article <1992Nov17.173630@acad2.alaska.edu>,
- asdmf@acad2.alaska.edu responds...
- >Ok, now what you then will need to do is Change it in the link.com where it
- >starts linking the executable to your multinet library specifics...
- >Where ever your Multinet Library is, just replace the Twg$tcp:[netdist.lib]
- >stuff..
-
- Sorry. It's not going to be near that easy. Last time I played
- with Wollengong/Multinet/UCX porting (about two years ago) I believe that
- Multinet will run Wollengong-compiled code IF you only use numeric addresses,
- and the Wollengong code was not linked using shared libraries. This could
- have changed by now though and they could be totally incompatible.
-
- I had developed a header file which (at the time) would allow code to
- be compiled under Wollengong, Multinet, or UCX. However it was incomplete
- for some functions due to the fact that I had no need of those
- functions for my project. The header file I used (158 lines) follows.
- I suspect you will probably need more included files. The Uwho project
- also used my header files as a start for porting uwho to vax/vms.
- You might check with that group. They may have a better version of the
- header file by now and they may know other problems which you may have
- to deal with. I can also answer questions and look over pieces of
- well-commented code if you like, but I don't have time to be an active
- member of any porting project right now.
-
- =============================================================================
- -Mike Kienenberger FXMLK@ALASKA (BITNet)
- Academic Computing FXMLK@acad3.alaska.edu (Internet)
- University of Alaska-Fairbanks
- "I'm a computer programmer....<link><link><kludge><kludge> say-no-more!"
-
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Code Begins=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
- /*
- Here's the routines I use to compile TCP/IP applications under
- VAX/VMS. This supports Wollengong, UCX, and Multinet packages.
- Note that these packages do change over the years. (Wollengong
- used to use different libraries.) I just added a theoretical
- UNIX definition.
-
- I've tried to keep the code as close to bsd socket code as possible,
- but it's not always possible.
- For example, the "read", "write", and "close" functions have
- different names under different packages. I've adopted the "netread",
- "netwrite", and "netclose" standard used by Wollengong. These
- are redefined to the appropriate commands for each package.
-
- Code to gethostbyname() is different for Wollengong.
- select() doesn't work with all versions.
-
- This code is NOT complete. I did not need a lot of bsd socket
- functions, thus I did not incorporate them into this file.
-
- This file was used during Jan 1991. Some information may no longer
- be current.
-
- If you find any mistakes, please let me know.
- If you find out (or already know how) to set up similar definitions
- for
- CMU-TEK
- FUSION
- EXOS
- or any other VAX/VMS TCP/IP protocol, please let me know!
-
- -Mike Kienenberger
- FSMLK1@acad3.alaska.edu Internet
- FSMLK1@ALASKA Bitnet
- */
-
-
- /*==========================================================================*/
- /* First, the definitions */
- #ifdef WOLLENGONG
- /*
- Compiling instructions
- $ define sys twg$tcp:[netdist.include.sys]
- $ define vms twg$tcp:[netdist.include.vms]
- $ cc/define=wollengong client
- $ link client,tcp$lib:twglib/lib,sys$input/opt
- sys$share:vaxcrtl/share
- (The sys$share goes on the line immediately after typing the link command.
- The entire ",sys$input/opt<return>sys$share:vaxcrtl/share" is optional.)
- */
-
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
-
- /* End of WOLLENGONG def */
- #elif MULTINET
- /*
- Compiling instructions
- $ define sys multinet_root:[multinet.include.sys]
- $ define vms multinet_root:[multinet.include.vms]
- $ define multi multinet_root:[multinet.include]
- $ cc/define=multinet client
- $ link client,sys$input/opt
- sys$share:vaxcrtl/share
- multinet:multinet_socket_library/share
- <control-z>
- (The sys$share goes on the line immediately after typing the link command.
- The entire ",sys$input/opt<return>sys$share:vaxcrtl/share" is optional.)
- */
-
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <multi/netdb.h>
-
- #define netclose socket_close
- /* the following may be incorrect */
- #define netread socket_read
- #define netwrite socket_write
-
- /* End of MULTINET def */
- #elif UCX
- /*
- Compiling instructions
- $ cc/define=ucx client
- $ link client,sys$library:ucx$ipc/lib,sys$input/opt
- sys$share:vaxcrtl/share
- (The sys$share goes on the line immediately after typing the link command.
- The entire ",sys$input/opt<return>sys$share:vaxcrtl/share" is optional.)
- */
-
- #include <types.h>
- #include <socket.h>
- #include <netdb.h>
-
- #define netclose close
- #define netread read
- #define netwrite write
-
- /* End of UCX def */
- #elif BSD
- /*
- Theoretical!!!!!!! (Never tried)
-
- Compiling instructions
- $ cc -DBSD -o client client.c
- */
-
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
-
- #define netclose close
- #define netread read
- #define netwrite write
-
- /* End of UNIX def */
- #else
- ( Client will not compile at all, unless you define either WOLLENGONG,
- MULTINET,
- or UCX) $ cc/define=<tcpIp-type> client
- /* End of TCP/IP specifics */
- #endif
- /*==========================================================================*/
-
-
- /*==========================================================================*/
- /* the following code must be used to find a host name */
-
- struct sockaddr_in sin;
- struct hostent *hostentry, *gethostbyname();
- unsigned long rhost();
- char **hostname;
-
- char hm[256]; /* contains the name of the host to connect to */
- int port; /* contains the port to connect to */
-
- #ifdef WOLLENGONG
- hostname = (char **) malloc(sizeof hm);
- *hostname = hm;
- if ((sin.sin_addr.s_addr = rhost (hostname)) == -1)
- {
- printf ("%s: unknown host\n", hm);
- exit (1);
- }
- strcpy(hm,*hostname);
- #else
- if ((hostentry = gethostbyname(hm)) == NULL)
- {
- printf ("%s: unknown host\n", hm);
- exit (1);
- }
- memcpy((void *) &sin.sin_addr, (void *) hostentry->h_addr,
- (size_t) hostentry->h_length);
- #endif
- sin.sin_family = AF_INET;
- sin.sin_port = htons (port);
- /*==========================================================================*/
-