home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / vmsnet / sources / games / 437 < prev    next >
Encoding:
Text File  |  1992-11-18  |  7.4 KB  |  213 lines

  1. 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
  2. Newsgroups: vmsnet.sources.games
  3. Subject: Re: Vmsnetrek: Wollingong vs. Multinet
  4. Message-ID: <18NOV199210092352@acad3.alaska.edu>
  5. From: fxmlk@acad3.alaska.edu (KIENENBERGER MIKE L)
  6. Date: Wed, 18 Nov 1992 18:09:00 GMT
  7. Sender: news@raven.alaska.edu (USENET News System)
  8. References: <1992Nov13.140910.1@acad2.alaska.edu> <1992Nov15.163205.3985@arizona.edu> 
  9.  <1992Nov15.151913.1@acad2.alaska.edu> <1992Nov16.111116.1@slacvx.slac.stanford.edu>
  10. Distribution: world,local
  11. Organization: University of Alaska - Fairbanks
  12. News-Software: VAX/VMS VNEWS 1.41.UAC
  13. Nntp-Posting-Host: acad3.alaska.edu
  14. Lines: 197
  15.  
  16. In article <1992Nov16.111116.1@slacvx.slac.stanford.edu>,
  17. fairfield@slacvx.slac.stanford.edu writes...
  18. >    OK, is there a version compatible with TGV's Multinet?  Barring that,
  19. >can you point us to the Wollingong-specific mod's so that we can make the
  20. >corresponding changes for Multinet?
  21.  
  22. In article <1992Nov17.173630@acad2.alaska.edu>,
  23. asdmf@acad2.alaska.edu responds...
  24. >Ok, now what you then will need to do is Change it in the link.com where it 
  25. >starts linking the executable to your multinet library specifics...
  26. >Where ever your Multinet Library is, just replace the Twg$tcp:[netdist.lib]
  27. >stuff..
  28.  
  29. Sorry. It's not going to be near that easy.  Last time I played
  30. with Wollengong/Multinet/UCX porting (about two years ago) I believe that
  31. Multinet will run Wollengong-compiled code IF you only use numeric addresses,
  32. and the Wollengong code was not linked using shared libraries.  This could
  33. have changed by now though and they could be totally incompatible.
  34.  
  35. I had developed a header file which (at the time) would allow code to
  36. be compiled under Wollengong, Multinet, or UCX.  However it was incomplete
  37. for some functions due to the fact that I had no need of those
  38. functions for my project.  The header file I used (158 lines) follows.
  39. I suspect you will probably need more included files.  The Uwho project
  40. also used my header files as a start for porting uwho to vax/vms.
  41. You might check with that group.  They may have a better version of the
  42. header file by now and they may know other problems which you may have
  43. to deal with.  I can also answer questions and look over pieces of
  44. well-commented code if you like, but I don't have time to be an active
  45. member of any porting project right now.
  46.  
  47. =============================================================================
  48. -Mike Kienenberger                       FXMLK@ALASKA           (BITNet)
  49.  Academic Computing                      FXMLK@acad3.alaska.edu (Internet)
  50.  University of Alaska-Fairbanks
  51.  "I'm a computer programmer....<link><link><kludge><kludge> say-no-more!"
  52.  
  53. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=Code Begins=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  54.  
  55. /*
  56.     Here's the routines I use to compile TCP/IP applications under
  57.     VAX/VMS.  This supports Wollengong, UCX, and Multinet packages.
  58.     Note that these packages do change over the years.  (Wollengong
  59.     used to use different libraries.)  I just added a theoretical
  60.     UNIX definition.
  61.     
  62.     I've tried to keep the code as close to bsd socket code as possible,
  63.     but it's not always possible.
  64.     For example, the "read", "write", and "close" functions have
  65.     different names under different packages.  I've adopted the "netread",
  66.     "netwrite", and "netclose" standard used by Wollengong.  These
  67.     are redefined to the appropriate commands for each package.
  68.     
  69.     Code to gethostbyname() is different for Wollengong.
  70.     select() doesn't work with all versions.
  71.     
  72.     This code is NOT complete.  I did not need a lot of bsd socket
  73.     functions, thus I did not incorporate them into this file.
  74.     
  75.     This file was used during Jan 1991.  Some information may no longer
  76.     be current.
  77.     
  78.     If you find any mistakes, please let me know.
  79.     If you find out (or already know how) to set up similar definitions
  80.     for
  81.         CMU-TEK
  82.         FUSION
  83.         EXOS
  84.         or any other VAX/VMS TCP/IP protocol, please let me know!
  85.         
  86.     -Mike Kienenberger
  87.     FSMLK1@acad3.alaska.edu        Internet
  88.     FSMLK1@ALASKA            Bitnet
  89. */
  90.  
  91.  
  92. /*==========================================================================*/
  93. /* First, the definitions */
  94. #ifdef WOLLENGONG
  95. /* 
  96.     Compiling instructions
  97.         $ define sys twg$tcp:[netdist.include.sys]
  98.         $ define vms twg$tcp:[netdist.include.vms]
  99.         $ cc/define=wollengong client
  100.         $ link client,tcp$lib:twglib/lib,sys$input/opt
  101.         sys$share:vaxcrtl/share
  102.  (The sys$share goes on the line immediately after typing the link command.
  103.   The entire ",sys$input/opt<return>sys$share:vaxcrtl/share" is optional.)
  104. */
  105.  
  106. #include <sys/types.h>
  107. #include <sys/socket.h>
  108. #include <netdb.h>
  109.  
  110. /* End of WOLLENGONG def */
  111. #elif MULTINET
  112. /* 
  113.     Compiling instructions
  114.         $ define sys multinet_root:[multinet.include.sys]
  115.         $ define vms multinet_root:[multinet.include.vms]
  116.         $ define multi multinet_root:[multinet.include]
  117.         $ cc/define=multinet client
  118.         $ link client,sys$input/opt
  119.         sys$share:vaxcrtl/share
  120.         multinet:multinet_socket_library/share
  121.        <control-z>
  122.  (The sys$share goes on the line immediately after typing the link command.
  123.   The entire ",sys$input/opt<return>sys$share:vaxcrtl/share" is optional.)
  124. */
  125.  
  126. #include <sys/types.h>
  127. #include <sys/socket.h>
  128. #include <multi/netdb.h>
  129.  
  130. #define netclose socket_close
  131. /* the following may be incorrect */
  132. #define netread socket_read
  133. #define netwrite socket_write
  134.  
  135. /* End of MULTINET def */
  136. #elif UCX
  137. /* 
  138.     Compiling instructions
  139.         $ cc/define=ucx client
  140.         $ link client,sys$library:ucx$ipc/lib,sys$input/opt
  141.         sys$share:vaxcrtl/share
  142.  (The sys$share goes on the line immediately after typing the link command.
  143.   The entire ",sys$input/opt<return>sys$share:vaxcrtl/share" is optional.)
  144. */
  145.  
  146. #include <types.h>
  147. #include <socket.h>
  148. #include <netdb.h>
  149.  
  150. #define netclose close
  151. #define netread read
  152. #define netwrite write
  153.  
  154. /* End of UCX def */
  155. #elif BSD
  156. /* 
  157.     Theoretical!!!!!!!  (Never tried)
  158.  
  159.     Compiling instructions
  160.         $ cc -DBSD -o client client.c
  161. */
  162.  
  163. #include <sys/types.h>
  164. #include <sys/socket.h>
  165. #include <netdb.h>
  166.  
  167. #define netclose close
  168. #define netread read
  169. #define netwrite write
  170.  
  171. /* End of UNIX def */
  172. #else
  173. ( Client will not compile at all, unless you define either WOLLENGONG,
  174. MULTINET,
  175.  or UCX)        $ cc/define=<tcpIp-type> client
  176. /* End of TCP/IP specifics */
  177. #endif
  178. /*==========================================================================*/
  179.  
  180.  
  181. /*==========================================================================*/
  182. /* the following code must be used to find a host name */
  183.  
  184.     struct sockaddr_in sin;
  185.     struct hostent *hostentry, *gethostbyname();
  186.     unsigned long rhost();
  187.     char **hostname;
  188.  
  189.     char hm[256];    /* contains the name of the host to connect to */
  190.     int port;        /* contains the port to connect to */
  191.  
  192. #ifdef WOLLENGONG
  193.     hostname = (char **) malloc(sizeof hm);
  194.     *hostname = hm;
  195.     if ((sin.sin_addr.s_addr = rhost (hostname)) == -1)
  196.     {
  197.         printf ("%s: unknown host\n", hm);
  198.         exit (1);
  199.     }
  200.     strcpy(hm,*hostname);
  201. #else
  202.     if ((hostentry = gethostbyname(hm)) == NULL)
  203.     {
  204.         printf ("%s: unknown host\n", hm);
  205.         exit (1);
  206.     }
  207.     memcpy((void *) &sin.sin_addr, (void *) hostentry->h_addr,
  208.            (size_t) hostentry->h_length);
  209. #endif
  210.     sin.sin_family = AF_INET;
  211.     sin.sin_port = htons (port);
  212. /*==========================================================================*/
  213.