home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume27 / archie / part01 next >
Encoding:
Text File  |  1992-01-13  |  61.1 KB  |  2,076 lines

  1. Newsgroups: comp.sources.misc
  2. From: brendan@cs.widener.edu (Brendan Kehoe)
  3. Subject:  v27i079:  archie - A client to query the Archie FTP databases, v1.3.1, Part01/06
  4. Message-ID: <csm-v27i079=archie.094136@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: abc42fd86121dbba4e24001589b06925
  6. Date: Mon, 13 Jan 1992 15:42:18 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: brendan@cs.widener.edu (Brendan Kehoe)
  10. Posting-number: Volume 27, Issue 79
  11. Archive-name: archie/part01
  12. Environment: UNIX, VMS
  13. Supersedes: archie: Volume 26, Issue 46-50
  14.  
  15. [Last changed 01/09/92 v1.3]
  16.  
  17. Enclosed  you'll find a Prospero client for the archie service. It'll
  18. let you query the archie databases without actually using an interactive
  19. process on the remote server's machine (e.g. archie.ans.net), resulting
  20. in a MUCH better response time.  It also helps lessen the load on the 
  21. archie server itself.
  22.  
  23.  What's Archie?  It's a system that will let you check a database containing
  24. thousands of entries for the files that're available at FTP sites around
  25. the world.
  26.  
  27.  This is a third child of Clifford Neuman's Prospero project.  It's really
  28. the Archie client that's included in the prospero stuff, but I've taken out
  29. everything that's unnecessary for this client to work.  (Aka, you don't
  30. have to build all of Prospero to get the Archie client.)  Khun Yee Fung
  31. wrote an archie client in Perl, and George Ferguson has written a client
  32. for use with XWindows, based in part upon this code.
  33.  
  34.  Using the Archie Prospero interface in its true form will probably be of
  35. interest---check out the file `Prospero' for an example of its interface.
  36. If you find it intriguing, you should probably get the full prospero kit
  37. from the University of Washington on cs.washington.edu in pub/prospero.tar.Z.
  38.  
  39.  Suffice to say, there are now a number of ways to query Archie without
  40. bogging a server down with your logins.
  41.  
  42.  Check out the man page (or archie.doc, if you're using VMS or DOS)
  43. for instructions on how to use this archie client.
  44.  
  45.  Please check to make sure you don't have "archie" aliased or modified
  46. in some way to do a telnet or rlogin (which you may've done before
  47. this command-line ability came into being).
  48.  
  49.  If Archie consistently hangs (at different times of day with
  50. different queries), it's possible that your site has UDP traffic on
  51. ports > 1000 blocked, for security reasons.  Type `make udptest' to
  52. check---if it prints out the date, the Archie server is probably down;
  53. if it doesn't print out the date, either Widener's computer is down
  54. (God forbid ;-) ) or you do indeed have UDP blocked.  See your system
  55. administrator in this case.  If the problem persists and haven't the
  56. vaguest, then write me describing the situation and what machine/OS
  57. you're using.
  58.  
  59.  Write to archie-l@cs.mcgill.ca with questions about Archie itself.
  60.  Write to info-prospero@isi.edu about the Prospero protocol.
  61.  Write to brendan@cs.widener.edu with questions about this specific package.
  62. -----------
  63. #! /bin/sh
  64. # This is a shell archive.  Remove anything before this line, then unpack
  65. # it by saving it into a file and typing "sh file".  To overwrite existing
  66. # files, type "sh file -c".  You can also feed this as standard input via
  67. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  68. # will see the following message at the end:
  69. #        "End of archive 1 (of 6)."
  70. # Contents:  Prospero README README.dos archie.lnk atalloc.c
  71. #   copyright.h get_pauth.c makefile.cut makefile.dos makefile.os2
  72. #   msdos msdos/cutcp.h patchlevel.h pauthent.h pcompat.h pmachine.h
  73. #   pprot.h ptalloc.c rdgram.h regex.h stcopy.c udp.c vl_comp.c vms
  74. #   vms.h vms/fd.h vms/in.h vms/multi.opt vms/pseudos.h vms/signal.h
  75. #   vms/socket.h vms/time.h vms/types.h vms/ucx.opt vms/woll.opt
  76. # Wrapped by brendan@ashley on Fri Jan 10 13:21:46 1992
  77. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  78. if test -f 'Prospero' -a "${1}" != "-c" ; then 
  79.   echo shar: Will not clobber existing file \"'Prospero'\"
  80. else
  81. echo shar: Extracting \"'Prospero'\" \(1409 characters\)
  82. sed "s/^X//" >'Prospero' <<'END_OF_FILE'
  83. XProspero also allows users to access Archie as if it were part of a
  84. Xfile system.  Here is an example of how Prospero can be used to access
  85. XArchie in this manner.
  86. X
  87. X  Script started on Mon Jul  1 22:36:42 1991
  88. X  % source /home/ftp/archie/pfs/bin/vfsetup.source
  89. X  % vfsetup guest
  90. X  % venable
  91. X  % cd /archive-sites/archie/regex
  92. X  % cd prospero (This command specifies the query)
  93. X  % ls -l
  94. X  total 0
  95. X  -r--r--r--   0 -               0 -            info-prospero.arc
  96. X  dr-xr-xr-x   0 -               0 -            prospero
  97. X  dr-xr-xr-x   0 -               0 -            prospero-papers
  98. X  -r--r--r--   0 -               0 -            prospero.arc
  99. X  -r--r--r--   0 -               0 -            prospero.tar.Z
  100. X  (Note that the "vls" command could have been used)
  101. X  (to show where the files were actually stored    )
  102. X  % ls prospero (list a result if it is a directory)
  103. X  prog.tar.Z      prospero.tar.Z
  104. X  % cat info-prospero.arc  (The file is automatically retrieved and displayed)
  105. X  >From bcn@n1dmm  Tue Dec  4 02:33:36 1990
  106. X  Received: from n1dmm.cs.washington.edu by june.cs.washington.edu (5.64/7.0jh)
  107. X          id AA24763; Tue, 4 Dec 90 02:33:36 -0800
  108. X  Received: by n1dmm.cs.washington.edu (5.64/7.0h)
  109. X          id AA08497; Tue, 4 Dec 90 02:33:31 -0800
  110. X  Date: Tue, 4 Dec 90 02:33:31 -0800
  111. X  From: bcn@cs.washington.edu (Clifford Neuman)
  112. X  ...
  113. X  % vdisable
  114. X  % exit
  115. X  script done on Mon Jul  1 22:39:33 1991
  116. END_OF_FILE
  117. if test 1409 -ne `wc -c <'Prospero'`; then
  118.     echo shar: \"'Prospero'\" unpacked with wrong size!
  119. fi
  120. # end of 'Prospero'
  121. fi
  122. if test -f 'README' -a "${1}" != "-c" ; then 
  123.   echo shar: Will not clobber existing file \"'README'\"
  124. else
  125. echo shar: Extracting \"'README'\" \(2404 characters\)
  126. sed "s/^X//" >'README' <<'END_OF_FILE'
  127. X[Last changed 01/09/92 v1.3]
  128. X
  129. X Enclosed you'll find a Prospero client for the archie service.  It'll
  130. Xlet you query the archie databases without actually using an
  131. Xinteractive process on the remote server's machine (e.g. archie.ans.net),
  132. Xresulting in a MUCH better response time.  It also helps lessen the
  133. Xload on the archie server itself.
  134. X
  135. X What's Archie?  It's a system that will let you check a database containing
  136. Xthousands of entries for the files that're available at FTP sites around
  137. Xthe world.
  138. X
  139. X This is a third child of Clifford Neuman's Prospero project.  It's really
  140. Xthe Archie client that's included in the prospero stuff, but I've taken out
  141. Xeverything that's unnecessary for this client to work.  (Aka, you don't
  142. Xhave to build all of Prospero to get the Archie client.)  Khun Yee Fung
  143. Xwrote an archie client in Perl, and George Ferguson has written a client
  144. Xfor use with XWindows, based in part upon this code.
  145. X
  146. X Using the Archie Prospero interface in its true form will probably be of
  147. Xinterest---check out the file `Prospero' for an example of its interface.
  148. XIf you find it intriguing, you should probably get the full prospero kit
  149. Xfrom the University of Washington on cs.washington.edu in pub/prospero.tar.Z.
  150. X
  151. X Suffice to say, there are now a number of ways to query Archie without
  152. Xbogging a server down with your logins.
  153. X
  154. X Check out the man page (or archie.doc, if you're using VMS or DOS)
  155. Xfor instructions on how to use this archie client.
  156. X
  157. X Please check to make sure you don't have "archie" aliased or modified
  158. Xin some way to do a telnet or rlogin (which you may've done before
  159. Xthis command-line ability came into being).
  160. X
  161. X If Archie consistently hangs (at different times of day with
  162. Xdifferent queries), it's possible that your site has UDP traffic on
  163. Xports > 1000 blocked, for security reasons.  Type `make udptest' to
  164. Xcheck---if it prints out the date, the Archie server is probably down;
  165. Xif it doesn't print out the date, either Widener's computer is down
  166. X(God forbid ;-) ) or you do indeed have UDP blocked.  See your system
  167. Xadministrator in this case.  If the problem persists and haven't the
  168. Xvaguest, then write me describing the situation and what machine/OS
  169. Xyou're using.
  170. X
  171. X Write to archie-l@cs.mcgill.ca with questions about Archie itself.
  172. X Write to info-prospero@isi.edu about the Prospero protocol.
  173. X Write to brendan@cs.widener.edu with questions about this specific package.
  174. END_OF_FILE
  175. if test 2404 -ne `wc -c <'README'`; then
  176.     echo shar: \"'README'\" unpacked with wrong size!
  177. fi
  178. # end of 'README'
  179. fi
  180. if test -f 'README.dos' -a "${1}" != "-c" ; then 
  181.   echo shar: Will not clobber existing file \"'README.dos'\"
  182. else
  183. echo shar: Extracting \"'README.dos'\" \(10680 characters\)
  184. sed "s/^X//" >'README.dos' <<'END_OF_FILE'
  185. X11/22/91  Readme.dos -- Readme file for CUTCP DOS version of Archie.
  186. X
  187. X--
  188. XThis version requires the use of a `standard' NCSA or CUTCP compatible
  189. XCONFIG.TEL file.  If you are running NCSA telnet or CUTCP/CUTE telnet,
  190. Xyou should be able to run this program without modification.
  191. X
  192. XAs with all CUTCP programs, you may set a DOS environment variable to
  193. Xpoint to the location of your config.tel file.
  194. X
  195. X    set CONFIGTEL=C:\net\config.tel
  196. X
  197. XYou may also set the $CUTCPnn dos environment variables to include other
  198. X'local' information (such as client IP address on a Novell lan).
  199. X
  200. XThis version has been compiled with the US (archie.sura.net) Prospero/Archie
  201. Xserver as the default. This may not be appropriate for your location. Here's
  202. Xhow to change it.
  203. X
  204. X
  205. X    1. Run the archie program with the -L argument to list known
  206. X       archie/prospero servers.
  207. X
  208. X    2. Select the server name that is closest to your site. For this example
  209. X       we'll pick archie.funet.fi
  210. X
  211. X    3. Edit your config.tel file and add the following lines at the end
  212. X       of the file.
  213. X
  214. X            name=archie
  215. X            host=archie.funet.fi    # actually substitute your select
  216. X                        # server name here
  217. X
  218. X    4. If you happen to know the IP address of the server, you may also
  219. X       add the appropriate
  220. X
  221. X            hostip=<insert IP address here>
  222. X
  223. X    5. If you don't enter an IP address, archie will perform a DNS lookup
  224. X       use the domain nameserver information that is in your config.tel 
  225. X       file.
  226. X
  227. X
  228. XAn additional command line option (-H) has been added (vs -h) to allow the
  229. Xuser to specify the config.tel file location on the command line. 
  230. X
  231. X    archie -H c:\net\config.tel emacs
  232. X
  233. XDuring a search, you may press the <ESCAPE> key to abort the query.
  234. X
  235. X
  236. X
  237. XIf you have problems, try running archie with the -D9 option (debug).
  238. X
  239. XAs usual, bugs/comments to:
  240. X
  241. X        cutcp-bugs@omnigate.clarkson.edu
  242. X
  243. XBrad Clements, Sr. Network Engineer
  244. XEducational Resources Center
  245. XClarkson University 
  246. XPotsdam, NY 13699
  247. X
  248. Xbkc@draco.erc.clarkson.edu
  249. X
  250. X-----------
  251. XSample Config.tel file 
  252. X------------------------------
  253. X#  Example host file for ARCHIE/ CUTCP version
  254. X#  11/21/91
  255. X#
  256. X#      Bugs to  cutcp-bugs@omnigate.clarkson.edu
  257. X
  258. X#---------------------------------------------------------------------------#
  259. X#                                        #
  260. X#** ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION **#
  261. X#                                        #
  262. X#   This sample config.tel file contains every single option that you could #
  263. X#   possibly use. Its meant as an example only. Please Please PLEASE don't  #
  264. X#   use all these options in your working config.tel file, just the ones    #
  265. X#   that you actually need. Many options can be left out, the default action#
  266. X#   (if defined) is shown in parens () next to the option.             #
  267. X#                                        #
  268. X#                         Thank you for your support                #
  269. X#---------------------------------------------------------------------------#
  270. X
  271. X#
  272. X#  This example file is for my=bootp, in which case the following items are
  273. X#  determined from the bootp server: (and are thus commented out in this file)
  274. X#       1. This machine's IP Address
  275. X#       2. The network NETMASK
  276. X#       3. The default gateway (one or more)
  277. X#       4. Nameservers (one or more)
  278. X#       5. The domain search list (if this clients hostname is in the bootp packet)
  279. X#
  280. X#  Your BOOTP server needs to be RFC 1048 compliant for this to work
  281. X#  
  282. X#  If you have nameservers, gateways or a domainslist already specified
  283. X#  in this file, then the file's entry takes precedence.
  284. X#  Extra gateways and nameservers will be added by BOOTP if found, however.
  285. X#----------------------------------------------------------------------------
  286. X#  You can set a DOS environment variable  CONFIGTEL to point to this file
  287. X#  then you don't need batch files or the -h option.
  288. X#
  289. X#       C> set CONFIGTEL=C:\net\myconfig.tel
  290. X#
  291. X#  You may also use environment variables to include config.tel options,
  292. X#  such as:
  293. X#    C> set $CUTCP1=myip~197.001.42.98;netmask~255.255.252.0
  294. X#    C> set $CUTCP2=name~x;hostip~128.163.298.2
  295. X#
  296. X#  and so on up to $CUTCP99. Note that you use a tilde (~) instead of (=)
  297. X#  in the dos set command because two ='s are not allowed by Dos.
  298. X#
  299. X#  Additionally, there is a new config.tel option called include= which
  300. X#  allows the nesting (up to 3) configuration files deep.
  301. X#
  302. X#
  303. X#  You can use these new options on networks to make your configuration job
  304. X#  easier. CUTCP always opens config.tel files as read-only, so you can mark
  305. X#  your files as sharable, read only. Also, you can use the include= command
  306. X#  in a $CUTCP environment variable, and on the command line.
  307. X
  308. X#  *Note* that you can not include a machine specific parameter before
  309. X#  name=default... This used to work in old versions, but is strictly
  310. X#  enforced in this version.
  311. X# --------------------------------------------------------------------------  
  312. X#  This file is free form
  313. X#  Separators are any char <33 and :;=
  314. X#
  315. X#  The form is keyword=value for each parameter.
  316. X#  The first set of parameters refer to the whole program's defaults.
  317. X#  These parameter values can be in any order.
  318. X#  Following this are the individual machine specs.
  319. X#
  320. X
  321. Xmyip=128.153.28.65                      #  (bootp)
  322. X                #  myip types are:
  323. X                                #  bootp        - sends out a BOOTP request for your IP
  324. X                                #  rarp         - Uses reverse ARp to get your IP
  325. X                                #  xx.yy.zz.qq  - your IP address
  326. X
  327. Xvjc=no                # (no)
  328. X                # set  vjc=yes if you're running slip and
  329. X                # you want to use Van Jacobson TCP header
  330. X                # compression
  331. X
  332. Xsplayc=no            # (no) ack. splay compression w/ vjc.. don't
  333. X                # use it, not standard, development option only
  334. X
  335. Xmyname=userid            # put your userid here, used for Rlogin
  336. X                # PC-NFS version ignores this value and uses the name
  337. X                # that you specified to your pcnfsd.
  338. X
  339. Xnetmask=255.255.252.0           #  needed if not using BOOTP. 
  340. X                                #  otherwise not needed because Bootp gets your netmask
  341. X                #  for you
  342. X
  343. Xhardware=packet            # (packet)
  344. X                                # harware choices
  345. X                                #  3com         - 3com 3c501
  346. X                                #  3c523        - 3com 3c523
  347. X                                #  wd800        - Western Digitial 800E
  348. X                                #  nicpc        - 
  349. X                                #  nicps        -
  350. X                                #  ni5210       - Micom Interlan NI5210 card
  351. X                                #  packet       - FTP packet Driver spec 
  352. X                                # (currently only Ethernet and Slip class devices are supported)
  353. X
  354. Xinterrupt=2                     # hardware IRQ interrupt
  355. Xaddress=0                       # (0)
  356. X                # base memory address or packet driver class
  357. X                                # if using packet driver (0 == default == ethernet)
  358. X                                # or class=6 for slip
  359. X
  360. Xioaddr=0                        # (0)
  361. X                # I/O address  or packet int vector if using packet driver
  362. X                                # If = 0 and packet driver, telbin looks for first
  363. X                                # packet driver found between 60H and 7FH
  364. X
  365. Xnoarpme=yes            # Don't arp for myself before running? (no)
  366. X                # if yes, inhibits the initial arp request
  367. X                # for this IP address. However, if yes, won't
  368. X                # warn you if another user is using this IP
  369. X                # address. For some token ring systems, you'll
  370. X                # need noarpme=yes.
  371. X
  372. Xinclude="nul"            # if you want to include another file as part
  373. X                # of this one (you can nest up to three includes)
  374. X                # otherwise, don't use this option
  375. X
  376. Xdomaintime=4            # domain name lookup timeout (first retry)
  377. Xdomainretry=4            # domain name max number of retries 
  378. Xdomainslist="clarkson.edu,aux.clarkson.edu" # domain name search path
  379. X                                # domain name lookup will attach each of these
  380. X                                # comma seperated suffixes to
  381. X                                # the end of the name you are looking for to
  382. X                                # discover the full name and IP address.
  383. X                                # so, looking for x tries x.clarkson.edu and x.aux.clarkson.edu then just x
  384. X                                # unless you use  x.  which ONLY looks for x
  385. X
  386. X    ## Also, the fewer suffixes in the domainslist
  387. X    ## the less time you will have to wait if you mis-type an entry.
  388. X    ## Finally, try not to use a suffix like   .  or .edu or .com this will
  389. X    ## waste a lot of time looking for a bogus host name if you mis-type an entry.
  390. X
  391. X## ----------------------------------------------------------------- ##
  392. X##   BEGIN MACHINE SPECIFIC PARAMETERS...                 ##
  393. X## ----------------------------------------------------------------- ##
  394. Xname=default            # default entry sets defaults for all following
  395. X                # machines.
  396. X
  397. Xarptime=10            # arp timeout in seconds
  398. X                #
  399. X
  400. Xretrans=1                       # starting retransmit time out in ticks
  401. X                #   1/18ths of sec MAX 100, min 1
  402. X
  403. Xmtu=1024                        # maximum transmit unit in bytes
  404. X                #   outgoing packet size, MAX=1500
  405. X
  406. Xmaxseg=1024            # largest segment we can receive
  407. X                #   whatever the hardware can take, MAX=4096
  408. Xrwin=2048                       # most bytes we can receive without ACK
  409. X                #   =TCP window size, MAX=4096
  410. X
  411. Xcontime=20                      # timeout in seconds to try connection
  412. X                #   before returning error to user
  413. X
  414. X#  Following are individual machine specifications
  415. X#  Gateways are used in order that they appear in the file
  416. X#  Nameservers rotate, #1, #2, #3, #1, #2 when a request fails
  417. X#
  418. X
  419. X# ********************************************************************* ###
  420. X# Note: If you are using BOOTP above for myip=, then you do not need
  421. X#       to enter a default gateway, nameserver, netmask etc (unless you want to)
  422. X#       only IF your BOOTP server is rfc_1048 compliant. (Ask your Net Manager)
  423. X#       You can use both bootp and entries here, in which case the entries in
  424. X#       this file over-ride what BOOTP discovers. (however, bootp nameservers
  425. X#       and gateways are ADDED to this file's list of entries
  426. X# ********************************************************************* ####
  427. X
  428. X#  Below this line, most of the communication parameters are obtained
  429. X#  from the "default" host entry.  Those parameters listed for a host 
  430. X#  override the default host values.
  431. X#
  432. X#  These are examples, replace them with the correct values for your site.
  433. X#name=mynameserver
  434. X#host=omnigate.clarkson.edu
  435. X#hostip=197.001.4.2
  436. X#nameserver=1
  437. X
  438. X#name=backupserver
  439. X#host=clutx.clarkson.edu
  440. X#hostip=197.001.4.3
  441. X#nameserver=2
  442. X
  443. X#name=lastserver
  444. X#host=n2ngw.nyser.net
  445. X#hostip=128.145.198.2
  446. X#nameserver=3
  447. X
  448. X#name=mygateway
  449. X#host=nysernet.clarkson.edu
  450. X#hostip=197.001.4.1
  451. X#gateway=1
  452. X
  453. X
  454. Xname=archie
  455. Xhost=archie.funet.fi
  456. END_OF_FILE
  457. if test 10680 -ne `wc -c <'README.dos'`; then
  458.     echo shar: \"'README.dos'\" unpacked with wrong size!
  459. fi
  460. # end of 'README.dos'
  461. fi
  462. if test -f 'archie.lnk' -a "${1}" != "-c" ; then 
  463.   echo shar: Will not clobber existing file \"'archie.lnk'\"
  464. else
  465. echo shar: Extracting \"'archie.lnk'\" \(237 characters\)
  466. sed "s/^X//" >'archie.lnk' <<'END_OF_FILE'
  467. Xaquery.lo archie.lo atalloc.lo dirsend.lo+
  468. XGet_pauth.lo get_vdir.lo perrmesg.lo procquery.lo+
  469. Xptalloc.lo regex.lo stcopy.lo support.lo+
  470. Xvlalloc.lo vl_comp.lo
  471. Xarchie.unp
  472. Xarchie/map/noi/co/li/stack:45000
  473. Xlsocket lnetlib lconfig lpc llibce
  474. END_OF_FILE
  475. if test 237 -ne `wc -c <'archie.lnk'`; then
  476.     echo shar: \"'archie.lnk'\" unpacked with wrong size!
  477. fi
  478. # end of 'archie.lnk'
  479. fi
  480. if test -f 'atalloc.c' -a "${1}" != "-c" ; then 
  481.   echo shar: Will not clobber existing file \"'atalloc.c'\"
  482. else
  483. echo shar: Extracting \"'atalloc.c'\" \(1819 characters\)
  484. sed "s/^X//" >'atalloc.c' <<'END_OF_FILE'
  485. X/*
  486. X * Copyright (c) 1989, 1990 by the University of Washington
  487. X *
  488. X * For copying and distribution information, please see the file
  489. X * <copyright.h>.
  490. X */
  491. X
  492. X#include <copyright.h>
  493. X#include <stdio.h>
  494. X
  495. X#include <pfs.h>
  496. X#include <pmachine.h> /* for correct definition of ZERO */
  497. X
  498. Xstatic PATTRIB    lfree = NULL;
  499. Xint        pattrib_count = 0;
  500. Xint        pattrib_max = 0;
  501. X
  502. X/*
  503. X * atalloc - allocate and initialize vlink structure
  504. X *
  505. X *    ATALLOC returns a pointer to an initialized structure of type
  506. X *    PATTRIB.  If it is unable to allocate such a structure, it
  507. X *    returns NULL.
  508. X */
  509. XPATTRIB
  510. Xatalloc()
  511. X    {
  512. X    PATTRIB    at;
  513. X    if(lfree) {
  514. X        at = lfree;
  515. X        lfree = lfree->next;
  516. X    }
  517. X    else {
  518. X        at = (PATTRIB) malloc(sizeof(PATTRIB_ST));
  519. X        if (!at) return(NULL);
  520. X        pattrib_max++;
  521. X    }
  522. X
  523. X    pattrib_count++;
  524. X
  525. X    ZERO(at);
  526. X    /* Initialize and fill in default values; all items are
  527. X       0 [or NULL] save precedence */
  528. X    at->precedence = ATR_PREC_OBJECT;
  529. X
  530. X    return(at);
  531. X    }
  532. X
  533. X/*
  534. X * atfree - free a PATTRIB structure
  535. X *
  536. X *    ATFREE takes a pointer to a PATTRRIB structure and adds it to
  537. X *    the free list for later reuse.
  538. X */
  539. Xvoid
  540. Xatfree(at)
  541. X    PATTRIB    at;
  542. X    {
  543. X    if(at->aname) stfree(at->aname);
  544. X
  545. X    if((strcmp(at->avtype,"ASCII") == 0) && at->value.ascii) 
  546. X        stfree(at->value.ascii);
  547. X    if((strcmp(at->avtype,"LINK") == 0) && at->value.link) 
  548. X        vlfree(at->value.link);
  549. X    
  550. X    if(at->avtype) stfree(at->avtype);
  551. X
  552. X    at->next = lfree;
  553. X    at->previous = NULL;
  554. X    lfree = at;
  555. X    pattrib_count--;
  556. X    }
  557. X
  558. X/*
  559. X * atlfree - free a PATTRIB structure
  560. X *
  561. X *    ATLFREE takes a pointer to a PATTRIB structure frees it and any linked
  562. X *    PATTRIB structures.  It is used to free an entrie list of PATTRIB
  563. X *    structures.
  564. X */
  565. Xvoid
  566. Xatlfree(at)
  567. X    PATTRIB    at;
  568. X    {
  569. X    PATTRIB    nxt;
  570. X
  571. X    while(at != NULL) {
  572. X        nxt = at->next;
  573. X        atfree(at);
  574. X        at = nxt;
  575. X    }
  576. X    }
  577. X
  578. END_OF_FILE
  579. if test 1819 -ne `wc -c <'atalloc.c'`; then
  580.     echo shar: \"'atalloc.c'\" unpacked with wrong size!
  581. fi
  582. # end of 'atalloc.c'
  583. fi
  584. if test -f 'copyright.h' -a "${1}" != "-c" ; then 
  585.   echo shar: Will not clobber existing file \"'copyright.h'\"
  586. else
  587. echo shar: Extracting \"'copyright.h'\" \(896 characters\)
  588. sed "s/^X//" >'copyright.h' <<'END_OF_FILE'
  589. X/* 
  590. X  Copyright (c) 1989, 1990, 1991 by the University of Washington
  591. X
  592. X  Permission to use, copy, modify, and distribute this software and its
  593. X  documentation for non-commercial purposes and without fee is hereby
  594. X  granted, provided that the above copyright notice appear in all copies
  595. X  and that both the copyright notice and this permission notice appear in
  596. X  supporting documentation, and that the name of the University of
  597. X  Washington not be used in advertising or publicity pertaining to
  598. X  distribution of the software without specific, written prior
  599. X  permission.  The University of Washington makes no representations
  600. X  about the suitability of this software for any purpose.  It is
  601. X  provided "as is" without express or implied warranty.
  602. X
  603. X  Prospero was written by Clifford Neuman (bcn@isi.edu).
  604. X
  605. X  Questions concerning this software should be directed to 
  606. X  info-prospero@isi.edu.
  607. X
  608. X  */
  609. END_OF_FILE
  610. if test 896 -ne `wc -c <'copyright.h'`; then
  611.     echo shar: \"'copyright.h'\" unpacked with wrong size!
  612. fi
  613. # end of 'copyright.h'
  614. fi
  615. if test -f 'get_pauth.c' -a "${1}" != "-c" ; then 
  616.   echo shar: Will not clobber existing file \"'get_pauth.c'\"
  617. else
  618. echo shar: Extracting \"'get_pauth.c'\" \(2267 characters\)
  619. sed "s/^X//" >'get_pauth.c' <<'END_OF_FILE'
  620. X/*
  621. X * Copyright (c) 1989, 1990 by the University of Washington
  622. X *
  623. X * For copying and distribution information, please see the file
  624. X * <copyright.h>.
  625. X *
  626. X * v1.2.2 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
  627. X * v1.2.1 - 09/17/91 (bpk) - added BULL & USG stuff, thanks to Jim Sillas
  628. X * v1.2.0 - 09/17/91 (bpk) - fixed it up (thanks to synful)
  629. X * v1.1.1 - 08/30/91 (bpk) - added VMS support
  630. X */
  631. X
  632. X#include <copyright.h>
  633. X#include <stdio.h>
  634. X#ifndef VMS
  635. X# include <sys/types.h> /* this may/will define FD_SET etc */
  636. X# include <pmachine.h>
  637. X#endif
  638. X
  639. X#ifdef NEED_STRING_H
  640. X# include <string.h>
  641. X#else
  642. X# include <strings.h>
  643. X#endif
  644. X
  645. X#ifndef VMS
  646. X# if defined(MSDOS) && !defined(OS2)
  647. X#  ifndef CUTCP
  648. X#   include <rwconf.h>
  649. X#  endif
  650. X# else
  651. X#  include <pwd.h>
  652. X# endif
  653. X#else
  654. X# include <jpidef.h>
  655. X# include <vms.h>
  656. X#endif
  657. X
  658. X#include <pcompat.h>
  659. X#include <pauthent.h>
  660. X
  661. XPAUTH
  662. Xget_pauth(type)
  663. X    int        type;
  664. X    {
  665. X    static PAUTH_ST   no_auth_st;
  666. X    static PAUTH          no_auth = NULL;
  667. X#if !defined(VMS) && !defined(MSDOS) || defined(OS2)
  668. X    struct passwd *whoiampw;
  669. X#else
  670. X    char username[13];
  671. X    unsigned short usernamelen;
  672. X    struct {
  673. X        unsigned short buflen;
  674. X        unsigned short itmcod;
  675. X        char *bufadr;
  676. X        unsigned short *retlenadr;
  677. X        unsigned long null;
  678. X    } jpi_itemlist;
  679. X#endif
  680. X
  681. X    if(no_auth == NULL) {
  682. X        no_auth = &no_auth_st;
  683. X        strcpy(no_auth->auth_type,"UNAUTHENTICATED");
  684. X
  685. X        /* find out who we are */
  686. X#ifndef VMS
  687. X#if defined(MSDOS) && !defined(OS2)
  688. X#ifndef CUTCP
  689. X        if (!getconf("general", "user", no_auth->authenticator, 250)
  690. X        || (strlen (no_auth->authenticator) == 0))
  691. X#endif
  692. X          strcpy(no_auth->authenticator,"nobody");
  693. X#else /* not MSDOS */
  694. X        DISABLE_PFS(whoiampw = getpwuid(getuid()));
  695. X        if (whoiampw == 0) strcpy(no_auth->authenticator,"nobody");
  696. X        else strcpy(no_auth->authenticator, whoiampw->pw_name);
  697. X#endif /* not MSDOS */
  698. X#else
  699. X        jpi_itemlist.buflen = sizeof(username);
  700. X        jpi_itemlist.itmcod = JPI$_USERNAME;
  701. X        jpi_itemlist.bufadr = &username;
  702. X        jpi_itemlist.retlenadr = &usernamelen;
  703. X        jpi_itemlist.null = 0;
  704. X        if (SYS$GETJPI(0, 0, 0, &jpi_itemlist, 0, 0, 0) & 0x1)
  705. X        {
  706. X        username[usernamelen] = 0;
  707. X        strcpy(no_auth->authenticator, username);
  708. X        } else
  709. X        strcpy(no_auth->authenticator, "nobody");
  710. X#endif
  711. X    }
  712. X    return(no_auth);
  713. X    }
  714. END_OF_FILE
  715. if test 2267 -ne `wc -c <'get_pauth.c'`; then
  716.     echo shar: \"'get_pauth.c'\" unpacked with wrong size!
  717. fi
  718. # end of 'get_pauth.c'
  719. fi
  720. if test -f 'makefile.cut' -a "${1}" != "-c" ; then 
  721.   echo shar: Will not clobber existing file \"'makefile.cut'\"
  722. else
  723. echo shar: Extracting \"'makefile.cut'\" \(762 characters\)
  724. sed "s/^X//" >'makefile.cut' <<'END_OF_FILE'
  725. X#
  726. X# CUTCP/CUTE BC++ version 11/22/91 bkc@omnigate.clarkson.edu
  727. X# Last changed: 12/03/91 1.2.1
  728. X#
  729. X# Makefile for the minimal build for an archie Prospero client.
  730. X#.INCLUDE ../../../builtins
  731. X
  732. XOBJS    = aquery.obj    archie.obj    atalloc.obj \ 
  733. X      get_pauth.obj    get_vdir.obj    perrmesg.obj    procquery.obj    \
  734. X      ptalloc.obj    regex.obj    stcopy.obj    support.obj\
  735. X      vlalloc.obj    vl_comp.obj     dirsend.obj    misc.obj
  736. X
  737. X# dirsend.obj
  738. X
  739. XHDRS    = archie.h    pmachine.h    pcompat.h
  740. X
  741. XDEFINES    = -DDEBUG -DCUTCP
  742. X
  743. XCFLAGS= -ml -r -v $(DEFINES) -I.
  744. XLFLAGS= /P/m/s
  745. XCC = bccx
  746. X
  747. XEXE    = archie.exe
  748. X
  749. Xall: $(EXE)
  750. X
  751. X$(OBJS): $(HDRS)
  752. X
  753. X.c.obj:
  754. X    $(CC)  $(CFLAGS) -c $<
  755. X
  756. X$(EXE): $(OBJS) Makefile 
  757. X    tlink $(LFLAGS) @&&!
  758. Xc0l $(OBJS)
  759. X!,archie,archie,@&&!
  760. Xlib\tcp lib\sess lib\enet lib\vjc lib\over cl
  761. X!
  762. X
  763. Xclean:
  764. X    +-del *.obj
  765. END_OF_FILE
  766. if test 762 -ne `wc -c <'makefile.cut'`; then
  767.     echo shar: \"'makefile.cut'\" unpacked with wrong size!
  768. fi
  769. # end of 'makefile.cut'
  770. fi
  771. if test -f 'makefile.dos' -a "${1}" != "-c" ; then 
  772.   echo shar: Will not clobber existing file \"'makefile.dos'\"
  773. else
  774. echo shar: Extracting \"'makefile.dos'\" \(592 characters\)
  775. sed "s/^X//" >'makefile.dos' <<'END_OF_FILE'
  776. X#
  777. X# Last changed: 11/20/91, v1.2
  778. X#
  779. X# Makefile for the minimal build for an archie Prospero client.
  780. X#.INCLUDE ../../../builtins
  781. X
  782. XOBJS    = aquery.lo    archie.lo    atalloc.lo    dirsend.lo    \
  783. X      get_pauth.lo    get_vdir.lo    perrmesg.lo    procquery.lo    \
  784. X      ptalloc.lo    regex.lo    stcopy.lo    support.lo    \
  785. X      vlalloc.lo    vl_comp.lo
  786. XHDRS    = archie.h    pmachine.h    pcompat.h
  787. X
  788. XDEFINES    = -DDEBUG -DNOREGEX -DUSG
  789. X
  790. XCFLAGS    = -Oeclgsz -Gs -Zi -W4 -I. $(DEFINES)
  791. X
  792. XEXE    = archie.exe
  793. X
  794. Xall: $(EXE)
  795. X
  796. X$(OBJS): $(HDRS)
  797. X
  798. X$(EXE): $(OBJS) Makefile archie.lnk
  799. X    link @archie.lnk
  800. X    exepack archie.unp archie.exe
  801. X
  802. Xclean:
  803. X    +-del *.lo
  804. X    +-del *.exe
  805. X
  806. END_OF_FILE
  807. if test 592 -ne `wc -c <'makefile.dos'`; then
  808.     echo shar: \"'makefile.dos'\" unpacked with wrong size!
  809. fi
  810. # end of 'makefile.dos'
  811. fi
  812. if test -f 'makefile.os2' -a "${1}" != "-c" ; then 
  813.   echo shar: Will not clobber existing file \"'makefile.os2'\"
  814. else
  815. echo shar: Extracting \"'makefile.os2'\" \(800 characters\)
  816. sed "s/^X//" >'makefile.os2' <<'END_OF_FILE'
  817. X#
  818. X# Last changed: 11/20/91, v1.2
  819. X#
  820. X# Makefile for the minimal build for an archie Prospero client.
  821. X.INCLUDE ../../../builtins
  822. X
  823. XOBJS    = aquery.obj    archie.obj    atalloc.obj    dirsend.obj    \
  824. X      get_pauth.obj    get_vdir.obj    perrmesg.obj    procquery.obj    \
  825. X      ptalloc.obj    regex.obj    stcopy.obj    support.obj    \
  826. X      vlalloc.obj    vl_comp.obj
  827. XHDRS    = archie.h    pmachine.h    pcompat.h
  828. X
  829. XDEFINES    = -DDEBUG -DNOREGEX
  830. X
  831. XIFLAGS    = -I. -I../../../include $(DEFINES)
  832. X
  833. XLFLAGS     = /stack:30000/nod/noe/noi/map/CO
  834. XLIBS    = pctcp bsd ftpcrt socket os2
  835. XEXE    = archie.exe
  836. X
  837. Xall: $(EXE)
  838. X
  839. Xinstall: $(EXE)
  840. X    cp $[m,*.exe,$**] ..\..\..\bin
  841. X    @touch install
  842. X
  843. X$(OBJS): $(HDRS)
  844. X
  845. X$(EXE): $(OBJS) Makefile
  846. X    $(LD) $(LFLAGS) $(L_DEBUG) <@<
  847. X$[s,"+ \n",$[m,*.obj,$**]]
  848. X$*
  849. X$*
  850. X$(LIBS)
  851. X
  852. X<
  853. X    +markexe lfns $@
  854. X    +markexe windowcompat $@
  855. X
  856. Xclean:
  857. X    +-del *.obj
  858. X    +-del *.exe
  859. X
  860. END_OF_FILE
  861. if test 800 -ne `wc -c <'makefile.os2'`; then
  862.     echo shar: \"'makefile.os2'\" unpacked with wrong size!
  863. fi
  864. # end of 'makefile.os2'
  865. fi
  866. if test ! -d 'msdos' ; then
  867.     echo shar: Creating directory \"'msdos'\"
  868.     mkdir 'msdos'
  869. fi
  870. if test -f 'msdos/cutcp.h' -a "${1}" != "-c" ; then 
  871.   echo shar: Will not clobber existing file \"'msdos/cutcp.h'\"
  872. else
  873. echo shar: Extracting \"'msdos/cutcp.h'\" \(1146 characters\)
  874. sed "s/^X//" >'msdos/cutcp.h' <<'END_OF_FILE'
  875. X/* cutcp.h -- defs for cutcp code */
  876. X
  877. X
  878. Xint         netlisten(unsigned int port);
  879. Xstruct machinfo *Shostlook(char *name);
  880. Xint         Sdomain(char *name);
  881. Xstruct machinfo *Sgethost(char *name);
  882. Xstruct machinfo *Slookip(unsigned long *address);
  883. Xvoid        netgetftp(unsigned int array[], unsigned int port);
  884. Xint         netopen(unsigned long *address, unsigned int port);
  885. Xint         Snetopen(struct machinfo *m, unsigned int port);
  886. Xint        netqlen(int handle);
  887. Xint        netroom(int handle);
  888. Xint        netread(int pnum, unsigned char *buffer, unsigned int n);
  889. Xint        netwrite(int pnum, unsigned char *buffer, unsigned int n);
  890. Xint        netest(int pnum);
  891. Xint        netpush(int pnum);
  892. Xvoid        netulisten(unsigned int portnum);
  893. Xint        netusend(unsigned long *address, unsigned destport, 
  894. X            unsigned sourceport, unsigned char *buffer, int count);
  895. Xint        neturead(unsigned char    *buffer);
  896. Xstruct machinfo *Slooknum(int pnum);
  897. Xint        Snetinit();
  898. Xint        Shostfile(char *name);
  899. Xint        netshut();
  900. Xint        Sgetevent(int classes, int *clss, int *data);
  901. Xint        netclose(int pnum);
  902. Xunsigned int    intswap(unsigned int val);
  903. Xunsigned long    n_clicks(void *p);
  904. Xvoid        Stask();
  905. X
  906. X#define    ntohs(a)    (intswap(a))
  907. X#define    htons(a)    (intswap(a))
  908. END_OF_FILE
  909. if test 1146 -ne `wc -c <'msdos/cutcp.h'`; then
  910.     echo shar: \"'msdos/cutcp.h'\" unpacked with wrong size!
  911. fi
  912. # end of 'msdos/cutcp.h'
  913. fi
  914. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  915.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  916. else
  917. echo shar: Extracting \"'patchlevel.h'\" \(479 characters\)
  918. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  919. X/*
  920. X * Archie v1.3
  921. X *
  922. X * History:
  923. X *
  924. X * 01/10/92 v1.3.1 - Release.
  925. X * 01/09/92 v1.3 - Release.
  926. X * 12/13/91      - added UCX support
  927. X * 12/03/91      - added CUTCP support
  928. X * 11/20/91 v1.2 - Release.
  929. X * 11/18/91      - ported to DOS & OS/2
  930. X * 11/12/91      - finally got to test under Multinet 3.0
  931. X * 10/03/91      - replaced regex.c for oz
  932. X * 09/25/91     - added Wollongong support
  933. X * 08/30/91      - ported to VMS
  934. X * 08/20/91 v1.1 - Major revisions
  935. X * 07/31/91 v1.0 - Original
  936. X */
  937. END_OF_FILE
  938. if test 479 -ne `wc -c <'patchlevel.h'`; then
  939.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  940. fi
  941. # end of 'patchlevel.h'
  942. fi
  943. if test -f 'pauthent.h' -a "${1}" != "-c" ; then 
  944.   echo shar: Will not clobber existing file \"'pauthent.h'\"
  945. else
  946. echo shar: Extracting \"'pauthent.h'\" \(839 characters\)
  947. sed "s/^X//" >'pauthent.h' <<'END_OF_FILE'
  948. X/*
  949. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  950. X *
  951. X * For copying and distribution information, please see the file
  952. X * <copyright.h>.
  953. X */
  954. X
  955. X#include <copyright.h>
  956. X
  957. X#define PFSA_UNAUTHENTICATED        1
  958. X
  959. Xstruct pfs_auth_info {
  960. X    char            auth_type[100];
  961. X    char            authenticator[250];
  962. X};
  963. X
  964. Xtypedef struct pfs_auth_info *PAUTH;
  965. Xtypedef struct pfs_auth_info PAUTH_ST;
  966. X
  967. XPAUTH get_pauth();
  968. X
  969. X#ifndef VMS
  970. X# ifndef IN_H
  971. X#  include <netinet/in.h>
  972. X#  define IN_H
  973. X# endif
  974. X#else
  975. X# ifndef _ARCHIE_VMS
  976. X#  include <vms.h>
  977. X# endif
  978. X#endif
  979. X
  980. Xstruct client_info {
  981. X    int                ainfo_type;
  982. X    char            *auth_type;
  983. X    char            *authenticator;
  984. X    char            *userid;
  985. X    short            port;
  986. X    struct in_addr        haddr;
  987. X    struct pfs_auth_info    *previous;
  988. X    struct pfs_auth_info    *next;
  989. X};
  990. X
  991. Xtypedef struct client_info *CINFO;
  992. Xtypedef struct client_info CINFO_ST;
  993. END_OF_FILE
  994. if test 839 -ne `wc -c <'pauthent.h'`; then
  995.     echo shar: \"'pauthent.h'\" unpacked with wrong size!
  996. fi
  997. # end of 'pauthent.h'
  998. fi
  999. if test -f 'pcompat.h' -a "${1}" != "-c" ; then 
  1000.   echo shar: Will not clobber existing file \"'pcompat.h'\"
  1001. else
  1002. echo shar: Extracting \"'pcompat.h'\" \(1477 characters\)
  1003. sed "s/^X//" >'pcompat.h' <<'END_OF_FILE'
  1004. X/*
  1005. X * Copyright (c) 1989, 1990 by the University of Washington
  1006. X *
  1007. X * For copying and distribution information, please see the file
  1008. X * <copyright.h>.
  1009. X */
  1010. X
  1011. X#include <copyright.h>
  1012. X
  1013. X/* 
  1014. X * pcompat.h - Definitions for compatability library
  1015. X *
  1016. X * This file contains the defintions used by the compatability
  1017. X * library.  Among the definitions are the possible values for
  1018. X * pfs_disable_flag.  This file also contains the external 
  1019. X * declaration of that variable.  Note, however that the 
  1020. X * the module pfs_disable_flag.o is included in libpfs.a
  1021. X * because some of the routines in that library set it.
  1022. X * The only place it is checked, however, is in pfs_access, 
  1023. X * found in libpcompat.a
  1024. X *
  1025. X */
  1026. X
  1027. Xextern    int        pfs_default;
  1028. Xextern    int        pfs_enable;
  1029. X
  1030. X/* Definitions for values of pfs_enable */
  1031. X#define PMAP_DISABLE      0
  1032. X#define PMAP_ENABLE       1
  1033. X#define PMAP_COLON      2
  1034. X#define PMAP_ATSIGN_NF      3
  1035. X#define PMAP_ATSIGN      4
  1036. X
  1037. X#define DISABLE_PFS(stmt) {int DpfStmp; DpfStmp = pfs_enable;\
  1038. X               pfs_enable = PMAP_DISABLE; \
  1039. X               stmt; \
  1040. X               pfs_enable = DpfStmp;}
  1041. X
  1042. X/* Definitions for PFS_ACCESS */
  1043. X#define PFA_MAP           0  /* Map the file name only                       */
  1044. X#define PFA_CREATE        1  /* Create file if not found                     */
  1045. X#define PFA_CRMAP         2  /* Map file name.  Map to new name if not found */
  1046. X#define PFA_RO            4  /* Access to file is read only                  */
  1047. X
  1048. X#define check_pfs_default() if(pfs_default == -1) get_pfs_default()
  1049. END_OF_FILE
  1050. if test 1477 -ne `wc -c <'pcompat.h'`; then
  1051.     echo shar: \"'pcompat.h'\" unpacked with wrong size!
  1052. fi
  1053. # end of 'pcompat.h'
  1054. fi
  1055. if test -f 'pmachine.h' -a "${1}" != "-c" ; then 
  1056.   echo shar: Will not clobber existing file \"'pmachine.h'\"
  1057. else
  1058. echo shar: Extracting \"'pmachine.h'\" \(2197 characters\)
  1059. sed "s/^X//" >'pmachine.h' <<'END_OF_FILE'
  1060. X/*
  1061. X * Miscellaneous system dependencies.
  1062. X *
  1063. X * I kept the name pmachine.h because it was already in all of the files...this
  1064. X * barely resembles the pmachine.h that comes with the real Prospero, tho.
  1065. X *
  1066. X * v1.2.1 - 12/13/91 (bpk) - added 3b2
  1067. X * v1.2.0 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
  1068. X */
  1069. X
  1070. X#ifdef u3b2
  1071. X# define USG
  1072. X# define NOREGEX
  1073. X# define MAXPATHLEN 1024    /* There's no maxpathlen in any 3b2 .h file.  */
  1074. X#endif
  1075. X
  1076. X#ifdef hpux
  1077. X# ifndef bcopy
  1078. X#  define FUNCS            /* HP/UX 8.0 has the fns.  */
  1079. X# endif
  1080. X# define NOREGEX
  1081. X# define NEED_STRING_H
  1082. X#endif
  1083. X
  1084. X#if defined(USG) || defined(SYSV)
  1085. X# define FUNCS
  1086. X#endif
  1087. X
  1088. X#ifdef ISC
  1089. X# define FUNCS
  1090. X# define STRSPN
  1091. X# define NOREGEX
  1092. X#endif
  1093. X
  1094. X#ifdef CUTCP
  1095. X# define FUNCS
  1096. X# define NOREGEX
  1097. X# define NEED_STRING_H
  1098. X# define SELECTARG int
  1099. X# define MSDOS
  1100. X#endif
  1101. X
  1102. X#ifdef OS2
  1103. X# define NOREGEX
  1104. X# include <pctcp.h>
  1105. X#endif
  1106. X#ifdef MSDOS
  1107. X# define USG
  1108. X# define NOREGEX
  1109. X# include <string.h>
  1110. X# include <stdlib.h>
  1111. X#endif
  1112. X
  1113. X#ifdef _AIX
  1114. X# ifdef u370
  1115. X#  define FUNCS
  1116. X# endif /* AIX/370 */
  1117. X# define _NONSTD_TYPES
  1118. X# define _BSD_INCLUDES
  1119. X# define NEED_STRING_H
  1120. X# define NEED_SELECT_H
  1121. X# define NEED_TIME_H
  1122. X#endif
  1123. X
  1124. X/* ==== */
  1125. X#ifdef FUNCS
  1126. X# define index        strchr
  1127. X/* According to mycroft. */
  1128. X# ifdef _IBMR2
  1129. Xchar *strchr();
  1130. X# endif
  1131. X# define rindex        strrchr
  1132. X# ifndef AUX
  1133. X#  define bcopy(a,b,n)    memcpy(b,a,n)
  1134. X#  define bzero(a,n)    memset(a,0,n)
  1135. X# ifdef _IBMR2
  1136. Xchar *memset();
  1137. X# endif
  1138. X# endif
  1139. X#endif
  1140. X
  1141. X#if defined(_IBMR2) || defined(_BULL_SOURCE)
  1142. X# define NEED_SELECT_H
  1143. X#endif
  1144. X#if defined(USG) || defined(UTS)
  1145. X# define NEED_STRING_H
  1146. X#endif
  1147. X#if defined(USG) || defined(UTS) || defined(AUX)
  1148. X# define NEED_TIME_H
  1149. X#endif
  1150. X
  1151. X#ifdef VMS
  1152. X/* Get the system status stuff.  */
  1153. X# include <ssdef.h>
  1154. X#endif /* VMS */
  1155. X
  1156. X/*
  1157. X * FD_SET: lib/pfs/dirsend.c, user/vget/ftp.c
  1158. X */
  1159. X#ifndef CUTCP
  1160. X
  1161. X#define SELECTARG fd_set
  1162. X#if !defined(FD_SET) && !defined(VMS) && !defined(NEED_SELECT_H)
  1163. X#define    FD_SETSIZE    32
  1164. X#define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  1165. X#define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  1166. X#define    FD_ISSET(n, p)    ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  1167. X#define FD_ZERO(p)    bzero((char *)(p), sizeof(*(p)))
  1168. X#endif
  1169. X
  1170. X#endif /* not CUTCP */
  1171. END_OF_FILE
  1172. if test 2197 -ne `wc -c <'pmachine.h'`; then
  1173.     echo shar: \"'pmachine.h'\" unpacked with wrong size!
  1174. fi
  1175. # end of 'pmachine.h'
  1176. fi
  1177. if test -f 'pprot.h' -a "${1}" != "-c" ; then 
  1178.   echo shar: Will not clobber existing file \"'pprot.h'\"
  1179. else
  1180. echo shar: Extracting \"'pprot.h'\" \(1934 characters\)
  1181. sed "s/^X//" >'pprot.h' <<'END_OF_FILE'
  1182. X/*
  1183. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  1184. X *
  1185. X * For copying and distribution information, please see the file
  1186. X * <copyright.h>.
  1187. X *
  1188. X * v1.2.0 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
  1189. X */
  1190. X
  1191. X#include <copyright.h>
  1192. X
  1193. X#ifndef MAXPATHLEN
  1194. X# ifdef VMS
  1195. X#  define MAXPATHLEN 32
  1196. X# else /* not VMS */
  1197. X#  if defined(MSDOS) && !defined(OS2)
  1198. X#   define MAXPATHLEN 255
  1199. X#  else /* not MSDOS */
  1200. X#   ifdef ISC
  1201. X#    define MAXPATHLEN 512
  1202. X#   else /* not Interactive..normal! (gasp) */
  1203. X#    include <sys/param.h>
  1204. X#   endif /* ISC */
  1205. X#  endif /* MSDOS && !OS2 */
  1206. X# endif /* VMS */
  1207. X#endif
  1208. X
  1209. X/* Protocol Definitions */
  1210. X
  1211. X#define           VFPROT_VNO    1      /* Protocol Version Number           */
  1212. X
  1213. X#define           DIRSRV_PORT      1525   /* Server port used if not in srvtab */
  1214. X#define        PROSPERO_PORT    191    /* Officially assigned prived port   */
  1215. X#define           PROS_FIRST_PRIVP 901    /* First privileged port to try      */
  1216. X#define        PROS_NUM_PRIVP   20     /* Number of privileged ports to try */
  1217. X
  1218. X#define           MAXPKT            1024   /* Max size of response from server  */
  1219. X#define           SEQ_SIZE        32     /* Max size of sequence text in resp */ 
  1220. X#define           MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */
  1221. X
  1222. X#define           MAX_FWD_DEPTH    20     /* Max fwd pointers to follow        */
  1223. X
  1224. X#define S_AD_SZ        sizeof(struct sockaddr_in)
  1225. X
  1226. X/* Replacement for strtok that doesn't keep state.  Both the variable  */
  1227. X/* S and the variable S_next must be defined.  To initialize, assign   */
  1228. X/* the string to be stepped through to S_next, then call get_token on  */
  1229. X/* S.  The first token will be in S, and S_next will point to the next */
  1230. X/* token.  Like strtok, this macro does modify the string passed to it */
  1231. X#define get_token(S,C) \
  1232. X    S = S/**/_next; \
  1233. X    if(S) { \
  1234. X     while(*S == C) S++; \
  1235. X     S/**/_next = index(S,C); \
  1236. X     if(S/**/_next) *(S/**/_next++) = '\0'; \
  1237. X     if(!*S) S = NULL; \
  1238. X    }
  1239. X
  1240. X
  1241. END_OF_FILE
  1242. if test 1934 -ne `wc -c <'pprot.h'`; then
  1243.     echo shar: \"'pprot.h'\" unpacked with wrong size!
  1244. fi
  1245. # end of 'pprot.h'
  1246. fi
  1247. if test -f 'ptalloc.c' -a "${1}" != "-c" ; then 
  1248.   echo shar: Will not clobber existing file \"'ptalloc.c'\"
  1249. else
  1250. echo shar: Extracting \"'ptalloc.c'\" \(1680 characters\)
  1251. sed "s/^X//" >'ptalloc.c' <<'END_OF_FILE'
  1252. X/*
  1253. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  1254. X *
  1255. X * For copying and distribution information, please see the file
  1256. X * <copyright.h>.
  1257. X *
  1258. X * v1.2.0 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
  1259. X */
  1260. X
  1261. X#include <copyright.h>
  1262. X#include <stdio.h>
  1263. X
  1264. X#include <pfs.h>
  1265. X#include <pmachine.h> /* for correct definition of ZERO */
  1266. X#ifdef MSDOS
  1267. X# define free _pfree   /* otherwise we get conflicts with free() */
  1268. X#endif
  1269. X
  1270. Xstatic PTEXT    free = NULL;
  1271. Xint         ptext_count = 0;
  1272. Xint        ptext_max = 0;
  1273. X
  1274. X/*
  1275. X * ptalloc - allocate and initialize ptext structure
  1276. X *
  1277. X *    PTALLOC returns a pointer to an initialized structure of type
  1278. X *    PTEXT.  If it is unable to allocate such a structure, it
  1279. X *    returns NULL.
  1280. X */
  1281. XPTEXT
  1282. Xptalloc()
  1283. X    {
  1284. X    PTEXT    vt;
  1285. X    if(free) {
  1286. X        vt = free;
  1287. X        free = free->next;
  1288. X    }
  1289. X    else {
  1290. X        vt = (PTEXT) malloc(sizeof(PTEXT_ST));
  1291. X        if (!vt) return(NULL);
  1292. X        ptext_max++;
  1293. X    }
  1294. X    ptext_count++;
  1295. X
  1296. X    /* nearly all parts are 0 [or NULL] */
  1297. X    ZERO(vt);
  1298. X    /* The offset is to leave room for additional headers */
  1299. X    vt->start = vt->dat + MAX_PTXT_HDR;
  1300. X
  1301. X    return(vt);
  1302. X    }
  1303. X
  1304. X/*
  1305. X * ptfree - free a VTEXT structure
  1306. X *
  1307. X *    VTFREE takes a pointer to a VTEXT structure and adds it to
  1308. X *    the free list for later reuse.
  1309. X */
  1310. Xvoid
  1311. Xptfree(vt)
  1312. X    PTEXT    vt;
  1313. X    {
  1314. X    vt->next = free;
  1315. X    vt->previous = NULL;
  1316. X    free = vt;
  1317. X    ptext_count--;
  1318. X    }
  1319. X
  1320. X/*
  1321. X * ptlfree - free a VTEXT structure
  1322. X *
  1323. X *    VTLFREE takes a pointer to a VTEXT structure frees it and any linked
  1324. X *    VTEXT structures.  It is used to free an entrie list of VTEXT
  1325. X *    structures.
  1326. X */
  1327. Xvoid
  1328. Xptlfree(vt)
  1329. X    PTEXT    vt;
  1330. X    {
  1331. X    PTEXT    nxt;
  1332. X
  1333. X    while(vt != NULL) {
  1334. X        nxt = vt->next;
  1335. X        ptfree(vt);
  1336. X        vt = nxt;
  1337. X    }
  1338. X    }
  1339. X
  1340. END_OF_FILE
  1341. if test 1680 -ne `wc -c <'ptalloc.c'`; then
  1342.     echo shar: \"'ptalloc.c'\" unpacked with wrong size!
  1343. fi
  1344. # end of 'ptalloc.c'
  1345. fi
  1346. if test -f 'rdgram.h' -a "${1}" != "-c" ; then 
  1347.   echo shar: Will not clobber existing file \"'rdgram.h'\"
  1348. else
  1349. echo shar: Extracting \"'rdgram.h'\" \(545 characters\)
  1350. sed "s/^X//" >'rdgram.h' <<'END_OF_FILE'
  1351. X/*
  1352. X * Copyright (c) 1991 by the University of Washington
  1353. X *
  1354. X * For copying and distribution information, please see the file
  1355. X * <copyright.h>.
  1356. X */
  1357. X
  1358. X#include <copyright.h>
  1359. X
  1360. X/* Queuing priorities for datagrams */
  1361. X#define           RDGRAM_MAX_PRI   32765  /* Maximum user proiority          */
  1362. X#define           RDGRAM_MAX_SPRI  32767  /* Maximum priority for system use */
  1363. X#define           RDGRAM_MIN_PRI  -32765  /* Maximum user proiority          */
  1364. X#define           RDGRAM_MIN_SPRI -32768  /* Maximum priority for system use */
  1365. X
  1366. Xint    rdgram_priority = 0;
  1367. END_OF_FILE
  1368. if test 545 -ne `wc -c <'rdgram.h'`; then
  1369.     echo shar: \"'rdgram.h'\" unpacked with wrong size!
  1370. fi
  1371. # end of 'rdgram.h'
  1372. fi
  1373. if test -f 'regex.h' -a "${1}" != "-c" ; then 
  1374.   echo shar: Will not clobber existing file \"'regex.h'\"
  1375. else
  1376. echo shar: Extracting \"'regex.h'\" \(616 characters\)
  1377. sed "s/^X//" >'regex.h' <<'END_OF_FILE'
  1378. X/*
  1379. X * regex.h : External defs for Ozan Yigit's regex functions, for systems
  1380. X *    that don't have them builtin. See regex.c for copyright and other
  1381. X *    details.
  1382. X *
  1383. X * Note that this file can be included even if we're linking against the
  1384. X * system routines, since the interface is (deliberately) identical.
  1385. X *
  1386. X * George Ferguson, ferguson@cs.rochester.edu, 11 Sep 1991.
  1387. X */
  1388. X
  1389. X#if defined(AUX) || defined(USG)
  1390. X/* Let them use ours if they wish.  */
  1391. X# ifndef NOREGEX
  1392. Xextern char *regcmp();
  1393. Xextern char *regex();
  1394. X#define re_comp regcmp
  1395. X#define re_exec regex
  1396. X# endif
  1397. X#else
  1398. Xextern char *re_comp();
  1399. Xextern int re_exec();
  1400. X#endif
  1401. END_OF_FILE
  1402. if test 616 -ne `wc -c <'regex.h'`; then
  1403.     echo shar: \"'regex.h'\" unpacked with wrong size!
  1404. fi
  1405. # end of 'regex.h'
  1406. fi
  1407. if test -f 'stcopy.c' -a "${1}" != "-c" ; then 
  1408.   echo shar: Will not clobber existing file \"'stcopy.c'\"
  1409. else
  1410. echo shar: Extracting \"'stcopy.c'\" \(2207 characters\)
  1411. sed "s/^X//" >'stcopy.c' <<'END_OF_FILE'
  1412. X/*
  1413. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  1414. X *
  1415. X * For copying and distribution information, please see the file
  1416. X * <copyright.h>.
  1417. X *
  1418. X * v1.2.1 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
  1419. X * v1.2.0 - 09/17/91 (bpk) - added BULL & USG stuff, thanks to Jim Sillas
  1420. X */
  1421. X
  1422. X#include <copyright.h>
  1423. X#include <stdio.h>
  1424. X#include <pmachine.h>
  1425. X
  1426. X#ifdef NEED_STRING_H
  1427. X# include <string.h>
  1428. X#else
  1429. X# include <strings.h>
  1430. X#endif
  1431. X
  1432. X#if defined(MSDOS)
  1433. X# include <stdlib.h>
  1434. X#endif
  1435. X
  1436. Xchar    *stcopyr();
  1437. X
  1438. Xint    string_count = 0;
  1439. Xint    string_max = 0;
  1440. X
  1441. X/*
  1442. X * stcopy - allocate space for and copy a string
  1443. X *
  1444. X *     STCOPY takes a string as an argument, allocates space for
  1445. X *     a copy of the string, copies the string to the allocated space,
  1446. X *     and returns a pointer to the copy.
  1447. X */
  1448. X
  1449. Xchar *
  1450. Xstcopy(st)
  1451. X    char    *st;
  1452. X    {
  1453. X      if (!st) return(NULL);
  1454. X      if (string_max < ++string_count) string_max = string_count;
  1455. X
  1456. X      return strcpy((char *)malloc(strlen(st) + 1), st);
  1457. X    }
  1458. X
  1459. X/*
  1460. X * stcopyr - copy a string allocating space if necessary
  1461. X *
  1462. X *     STCOPYR takes a string, S, as an argument, and a pointer to a second
  1463. X *     string, R, which is to be replaced by S.  If R is long enough to
  1464. X *     hold S, S is copied.  Otherwise, new space is allocated, and R is
  1465. X *     freed.  S is then copied to the newly allocated space.  If S is
  1466. X *     NULL, then R is freed and NULL is returned.
  1467. X *
  1468. X *     In any event, STCOPYR returns a pointer to the new copy of S,
  1469. X *     or a NULL pointer.
  1470. X */
  1471. Xchar *
  1472. Xstcopyr(s,r)
  1473. X    char    *s;
  1474. X    char    *r;
  1475. X    {
  1476. X    int    sl;
  1477. X
  1478. X    if(!s && r) {
  1479. X        free(r);
  1480. X        string_count--;
  1481. X        return(NULL);
  1482. X    }
  1483. X    else if (!s) return(NULL);
  1484. X
  1485. X    sl = strlen(s) + 1;
  1486. X
  1487. X    if(r) {
  1488. X        if ((strlen(r) + 1) < sl) {
  1489. X        free(r);
  1490. X        r = (char *) malloc(sl);
  1491. X        }
  1492. X    }
  1493. X    else {
  1494. X        r = (char *) malloc(sl);
  1495. X        string_count++;
  1496. X        if(string_max < string_count) string_max = string_count;
  1497. X    }
  1498. X        
  1499. X    return strcpy(r,s);
  1500. X    }
  1501. X
  1502. X/*
  1503. X * stfree - free space allocated by stcopy or stalloc
  1504. X *
  1505. X *     STFREE takes a string that was returned by stcopy or stalloc 
  1506. X *     and frees the space that was allocated for the string.
  1507. X */
  1508. Xvoid
  1509. Xstfree(st)
  1510. X    char *st;
  1511. X    {
  1512. X    if(st) {
  1513. X        free(st);
  1514. X        string_count--;
  1515. X    }
  1516. X    }
  1517. X
  1518. X
  1519. END_OF_FILE
  1520. if test 2207 -ne `wc -c <'stcopy.c'`; then
  1521.     echo shar: \"'stcopy.c'\" unpacked with wrong size!
  1522. fi
  1523. # end of 'stcopy.c'
  1524. fi
  1525. if test -f 'udp.c' -a "${1}" != "-c" ; then 
  1526.   echo shar: Will not clobber existing file \"'udp.c'\"
  1527. else
  1528. echo shar: Extracting \"'udp.c'\" \(2234 characters\)
  1529. sed "s/^X//" >'udp.c' <<'END_OF_FILE'
  1530. X/*
  1531. X * udp - Check if UDP traffic is allowed on this host; we open port 1527 on
  1532. X *       a system (default of cs.widener.edu), which is expecting it; the
  1533. X *       date is output (e.g. very similar to the daytime service).  This
  1534. X *       will conclusively tell us if UDP traffic on ports > 1000 is allowed.
  1535. X *
  1536. X *    It should print out the date if UDP traffic's not blocked on your
  1537. X *    system.  If it just hangs, try these tests too:
  1538. X *      a. run it with -d  (e.g. "udp -d"); that goes to the normal UDP port
  1539. X *         to print the date.  If it works, then you can be sure that any
  1540. X *         UDP traffic > port 1000 is blocked on your system.
  1541. X *      b. if it hangs too, try "telnet 147.31.254.130 13" and see if
  1542. X *         _that_ prints the date; if it doesn't, it's another problem (your
  1543. X *         network can't get to me, e.g.).
  1544. X *
  1545. X * Compile by: cc -o udp udp.c
  1546. X *
  1547. X * Brendan Kehoe, brendan@cs.widener.edu, Oct 1991.
  1548. X */
  1549. X
  1550. X#include <stdio.h>
  1551. X#include <sys/types.h>
  1552. X#include <sys/socket.h>
  1553. X#include <netinet/in.h>
  1554. X#ifndef hpux
  1555. X# include <arpa/inet.h>
  1556. X#endif
  1557. X
  1558. X#define    SIZE    2048
  1559. X#define    HOST    "147.31.254.130"    /* cs.widener.edu */
  1560. X#define PORT    1527
  1561. X
  1562. Xmain (argc, argv)
  1563. X     int argc;
  1564. X     char **argv;
  1565. X{
  1566. X  int s, len;
  1567. X  struct sockaddr_in server, sa;
  1568. X  char buf[SIZE];
  1569. X
  1570. X  if ((s = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
  1571. X    {
  1572. X      perror ("socket()");
  1573. X      exit (1);
  1574. X    }
  1575. X
  1576. X  bzero ((char *) &sa, sizeof (sa));
  1577. X  sa.sin_family = AF_INET;
  1578. X  sa.sin_addr.s_addr = htonl (INADDR_ANY);
  1579. X  sa.sin_port = htons (0);
  1580. X
  1581. X  if (bind (s, (struct sockaddr *) &sa, sizeof (sa)) < 0)
  1582. X    {
  1583. X      perror ("bind()");
  1584. X      exit (1);
  1585. X    }
  1586. X
  1587. X  bzero ((char *) &server, sizeof (server));
  1588. X  server.sin_family = AF_INET;
  1589. X  server.sin_addr.s_addr = inet_addr (HOST);
  1590. X  if (argc > 1 && strcmp(*(argv + 1), "-d") == 0)
  1591. X    server.sin_port = htons ((unsigned short) 13);
  1592. X  else
  1593. X    server.sin_port = htons ((unsigned short) PORT);
  1594. X
  1595. X  /* yoo hoo, we're here .. */
  1596. X  if (sendto (s, "\n", 1, 0, &server, sizeof (server)) < 0)
  1597. X    {
  1598. X      perror ("sendto()");
  1599. X      exit (1);
  1600. X    }
  1601. X
  1602. X  /* slurp */
  1603. X  len = sizeof (server);
  1604. X  if (recvfrom (s, buf, sizeof (buf), 0, &server, &len) < 0)
  1605. X    {
  1606. X      perror ("recvfrom");
  1607. X      exit (1);
  1608. X    }
  1609. X
  1610. X  printf ("%s", buf);
  1611. X  close (s);
  1612. X}
  1613. END_OF_FILE
  1614. if test 2234 -ne `wc -c <'udp.c'`; then
  1615.     echo shar: \"'udp.c'\" unpacked with wrong size!
  1616. fi
  1617. # end of 'udp.c'
  1618. fi
  1619. if test -f 'vl_comp.c' -a "${1}" != "-c" ; then 
  1620.   echo shar: Will not clobber existing file \"'vl_comp.c'\"
  1621. else
  1622. echo shar: Extracting \"'vl_comp.c'\" \(2137 characters\)
  1623. sed "s/^X//" >'vl_comp.c' <<'END_OF_FILE'
  1624. X/*
  1625. X * Copyright (c) 1989, 1990, 1991 by the University of Washington
  1626. X *
  1627. X * For copying and distribution information, please see the file
  1628. X * <copyright.h>.
  1629. X */
  1630. X
  1631. X#include <copyright.h>
  1632. X#include <pfs.h>
  1633. X
  1634. X/*
  1635. X * vl_comp - compare the names of two virtual links
  1636. X *
  1637. X *           VL_COMP compares the names of two links.  It returns
  1638. X *           0 if they are equal, negative if vl1 < vl2, and positive if
  1639. X *           vl1 > vl2.
  1640. X *
  1641. X *    ARGS:  vl1,vl2 - Virtual links to be compared
  1642. X * 
  1643. X * RETURNS:  0 if equal, + is vl1 > vl2, - if vl1 < vl2
  1644. X *
  1645. X *   NOTES:  Order of significance is as follows.  Existence,
  1646. X *           name.  If names do not exist, then hosttype, host,
  1647. X *           native filenametype, native filename.  The only time
  1648. X *           the name will not exist if if the link is a union link.
  1649. X */
  1650. Xint
  1651. Xvl_comp(vl1,vl2)
  1652. X    VLINK    vl1;
  1653. X    VLINK    vl2;
  1654. X    {
  1655. X    int    retval;
  1656. X
  1657. X    if(vl1->name && !vl2->name) return(1);
  1658. X    if(!vl1->name && vl2->name) return(-1);
  1659. X    if(vl1->name && vl2->name && (*(vl1->name) || *(vl2->name)))
  1660. X        return(strcmp(vl1->name,vl2->name));
  1661. X
  1662. X    retval = strcmp(vl1->hosttype,vl2->hosttype);
  1663. X    if(!retval) retval = strcmp(vl1->host,vl2->host);
  1664. X    if(!retval) retval = strcmp(vl1->nametype,vl2->nametype);
  1665. X    if(!retval) retval = strcmp(vl1->filename,vl2->filename);
  1666. X    return(retval);
  1667. X    }
  1668. X
  1669. X/*
  1670. X * vl_equal - compare the values of two virtual links
  1671. X *
  1672. X *           VL_EQUAL compares the values of two links.  It returns
  1673. X *           1 if all important fields are the same, and 0 otherwise.
  1674. X *
  1675. X *    ARGS:  vl1,vl2 - Virtual links to be compared
  1676. X * 
  1677. X * RETURNS:  1 if equal, 0 if not equal
  1678. X *
  1679. X */
  1680. Xint
  1681. Xvl_equal(vl1,vl2)
  1682. X    VLINK    vl1;
  1683. X    VLINK    vl2;
  1684. X    {
  1685. X      return strcmp(vl1->name, vl2->name) == 0         &&
  1686. X         vl1->linktype == vl2->linktype            &&
  1687. X         strcmp(vl1->type, vl2->type) == 0         &&
  1688. X         strcmp(vl1->hosttype, vl2->hosttype) == 0 &&
  1689. X         strcmp(vl1->host, vl2->host) == 0         &&
  1690. X         strcmp(vl1->nametype, vl2->nametype) == 0 &&
  1691. X         strcmp(vl1->filename, vl2->filename) == 0 &&
  1692. X         vl1->version == vl2->version              &&
  1693. X         vl1->f_magic_no == vl2->f_magic_no        ;
  1694. X
  1695. X    }
  1696. X
  1697. END_OF_FILE
  1698. if test 2137 -ne `wc -c <'vl_comp.c'`; then
  1699.     echo shar: \"'vl_comp.c'\" unpacked with wrong size!
  1700. fi
  1701. # end of 'vl_comp.c'
  1702. fi
  1703. if test ! -d 'vms' ; then
  1704.     echo shar: Creating directory \"'vms'\"
  1705.     mkdir 'vms'
  1706. fi
  1707. if test -f 'vms.h' -a "${1}" != "-c" ; then 
  1708.   echo shar: Will not clobber existing file \"'vms.h'\"
  1709. else
  1710. echo shar: Extracting \"'vms.h'\" \(1159 characters\)
  1711. sed "s/^X//" >'vms.h' <<'END_OF_FILE'
  1712. X#ifndef _ARCHIE_VMS
  1713. X#define _ARCHIE_VMS
  1714. X#include <pmachine.h>
  1715. X
  1716. X#if !defined(MULTINET_30) && !defined(WOLLONGONG) && !defined(UCX)
  1717. X#include "[.vms]pseudos.h"
  1718. X#include "[.vms]types.h"
  1719. X#include "[.vms]in.h"
  1720. X#include "[.vms]signal.h"
  1721. X#include "[.vms]socket.h"
  1722. X#include "[.vms]time.h"
  1723. X
  1724. X#else
  1725. X
  1726. X/* time_t gets multiply defined <ekup> */
  1727. X#ifndef __TYPES
  1728. X#define __TYPES
  1729. X#endif
  1730. X#ifdef MULTINET_30
  1731. X# include "multinet_root:[multinet.include.sys]types.h"
  1732. X# include "multinet_root:[multinet.include.netinet]in.h"
  1733. X# include "multinet_root:[multinet.include.sys]socket.h"
  1734. X# include "multinet_root:[multinet.include.sys]time.h"
  1735. X#endif /* MULTINET_30 */
  1736. X
  1737. X#ifdef WOLLONGONG
  1738. X/* We don't want size_t defined.  */
  1739. X# ifndef __STDDEF
  1740. X#  define __STDDEF
  1741. X# endif
  1742. X# include "twg$tcp:[netdist.include.sys]types.h"
  1743. X# include "twg$tcp:[netdist.include.netinet]in.h"
  1744. X# include "twg$tcp:[netdist.include.sys]socket.h"
  1745. X# include "twg$tcp:[netdist.include.sys]time.h"
  1746. X#endif /* WOLLONGONG */
  1747. X
  1748. X#ifdef UCX
  1749. X# include <types.h>
  1750. X# include <in.h>
  1751. X# include <socket.h>
  1752. X# include <time.h>
  1753. X# include "[.vms]fd.h"
  1754. X#endif /* UCX */
  1755. X
  1756. X#endif /* Multinet or Wallongong or UCX */
  1757. X
  1758. X#endif /* _ARCHIE_VMS */
  1759. END_OF_FILE
  1760. if test 1159 -ne `wc -c <'vms.h'`; then
  1761.     echo shar: \"'vms.h'\" unpacked with wrong size!
  1762. fi
  1763. # end of 'vms.h'
  1764. fi
  1765. if test -f 'vms/fd.h' -a "${1}" != "-c" ; then 
  1766.   echo shar: Will not clobber existing file \"'vms/fd.h'\"
  1767. else
  1768. echo shar: Extracting \"'vms/fd.h'\" \(393 characters\)
  1769. sed "s/^X//" >'vms/fd.h' <<'END_OF_FILE'
  1770. X#ifndef _VMS_FD
  1771. X#define _VMS_FD
  1772. X
  1773. Xtypedef struct fd_set
  1774. X{
  1775. X  int fds_bits[1];
  1776. X} fd_set;
  1777. X
  1778. X#define FD_SETSIZE          (sizeof (fd_set) * 8)
  1779. X#define FD_SET(f,s)         ((s)->fds_bits[0] |= (1 << (f)))
  1780. X#define FD_CLR(f,s)         ((s)->fds_bits[0] &= ~(1 << (f)))
  1781. X#define FD_ISSET(f,s)       ((s)->fds_bits[0] & (1 << (f)))
  1782. X#define FD_ZERO(s)          ((s)->fds_bits[0] = 0)
  1783. X
  1784. X#endif /* _VMS_FD */
  1785. END_OF_FILE
  1786. if test 393 -ne `wc -c <'vms/fd.h'`; then
  1787.     echo shar: \"'vms/fd.h'\" unpacked with wrong size!
  1788. fi
  1789. # end of 'vms/fd.h'
  1790. fi
  1791. if test -f 'vms/in.h' -a "${1}" != "-c" ; then 
  1792.   echo shar: Will not clobber existing file \"'vms/in.h'\"
  1793. else
  1794. echo shar: Extracting \"'vms/in.h'\" \(1418 characters\)
  1795. sed "s/^X//" >'vms/in.h' <<'END_OF_FILE'
  1796. X/* netinet/in.h */
  1797. Xstruct in_addr
  1798. X{
  1799. X  union
  1800. X  {
  1801. X    struct
  1802. X    {
  1803. X      unsigned char s_b1, s_b2, s_b3, s_b4;
  1804. X    } S_un_b;
  1805. X    struct
  1806. X    {
  1807. X      unsigned short s_w1, s_w2;
  1808. X    } S_un_w;
  1809. X    unsigned long S_addr;
  1810. X  } S_un;
  1811. X#define   s_addr S_un.S_addr
  1812. X#define   s_host S_un.S_un_b.s_b2
  1813. X#define   s_net  S_un.S_un_b.s_b1
  1814. X#define   s_imp  S_un.S_un_w.s_w2
  1815. X#define   s_impno S_un.S_un_b.s_b4
  1816. X#define   s_lh   S_un.S_un_b.s_b3
  1817. X};
  1818. X
  1819. X#define INADDR_ANY 0x00000000
  1820. X#define INADDR_BROADCAST 0xffffffff
  1821. X#define INADDR_LOOPBACK 0x7f000001
  1822. X
  1823. Xstruct sockaddr_in
  1824. X{
  1825. X  short sin_family;
  1826. X  unsigned short sin_port;
  1827. X  struct in_addr sin_addr;
  1828. X  char sin_zero[8];
  1829. X};
  1830. X
  1831. X#define ntohl(x) (( (((unsigned long) x) >> 24)& 0x000000ff ) |\
  1832. X                  ( (((unsigned long) x) >> 8) & 0x0000ff00 ) |\
  1833. X                  ( (((unsigned long) x) << 8) & 0x00ff0000 ) |\
  1834. X                  ( (((unsigned long) x) << 24)& 0xff000000 ))
  1835. X#define ntohs(x) (( (((unsigned short) x) >> 8) |\
  1836. X                  ( (((unsigned short) x) << 8)) & 0xffff ))
  1837. X#define htonl(x) (( (((unsigned long) x) >> 24)& 0x000000ff ) |\
  1838. X                  ( (((unsigned long) x) >> 8) & 0x0000ff00 ) |\
  1839. X                  ( (((unsigned long) x) << 8) & 0x00ff0000 ) |\
  1840. X                  ( (((unsigned long) x) << 24)& 0xff000000 ))
  1841. X#define htons(x) (( (((unsigned short) x) >> 8) |\
  1842. X                  ( (((unsigned short) x) << 8)) & 0xffff ))
  1843. X
  1844. X#define IPPORT_RESERVED 1024
  1845. END_OF_FILE
  1846. if test 1418 -ne `wc -c <'vms/in.h'`; then
  1847.     echo shar: \"'vms/in.h'\" unpacked with wrong size!
  1848. fi
  1849. # end of 'vms/in.h'
  1850. fi
  1851. if test -f 'vms/multi.opt' -a "${1}" != "-c" ; then 
  1852.   echo shar: Will not clobber existing file \"'vms/multi.opt'\"
  1853. else
  1854. echo shar: Extracting \"'vms/multi.opt'\" \(73 characters\)
  1855. sed "s/^X//" >'vms/multi.opt' <<'END_OF_FILE'
  1856. Xsys$library:vaxcrtl.exe/share
  1857. Xmultinet:multinet_socket_library.exe/share
  1858. END_OF_FILE
  1859. if test 73 -ne `wc -c <'vms/multi.opt'`; then
  1860.     echo shar: \"'vms/multi.opt'\" unpacked with wrong size!
  1861. fi
  1862. # end of 'vms/multi.opt'
  1863. fi
  1864. if test -f 'vms/pseudos.h' -a "${1}" != "-c" ; then 
  1865.   echo shar: Will not clobber existing file \"'vms/pseudos.h'\"
  1866. else
  1867. echo shar: Extracting \"'vms/pseudos.h'\" \(439 characters\)
  1868. sed "s/^X//" >'vms/pseudos.h' <<'END_OF_FILE'
  1869. X/* These are so we don't end up using the MultiNet versions.  */
  1870. X#define socket    VMSsocket
  1871. X#define bind    VMSbind
  1872. X#define connect    VMSconnect
  1873. X#define listen    VMSlisten
  1874. X#define accept    VMSaccept
  1875. X#define select    VMSselect
  1876. X#define recv    VMSrecv
  1877. X#define recvfrom    VMSrecvfrom
  1878. X#define send    VMSsend
  1879. X#define sendto    VMSsendto
  1880. X#define getsockname    VMSgetsockname
  1881. X#define shutdown    VMSshutdown
  1882. X#define getsockopt    VMSgetsockopt
  1883. X#define setsockopt    VMSsetsockopt
  1884. END_OF_FILE
  1885. if test 439 -ne `wc -c <'vms/pseudos.h'`; then
  1886.     echo shar: \"'vms/pseudos.h'\" unpacked with wrong size!
  1887. fi
  1888. # end of 'vms/pseudos.h'
  1889. fi
  1890. if test -f 'vms/signal.h' -a "${1}" != "-c" ; then 
  1891.   echo shar: Will not clobber existing file \"'vms/signal.h'\"
  1892. else
  1893. echo shar: Extracting \"'vms/signal.h'\" \(261 characters\)
  1894. sed "s/^X//" >'vms/signal.h' <<'END_OF_FILE'
  1895. X/* signal.h */
  1896. X#define SIGURG  16
  1897. X#define SIGTSTP 18
  1898. X#define SIGCHLD 20
  1899. X#define SIGIO   23
  1900. X#define sigmask(m) (1 << ((m)-1))
  1901. X
  1902. X#ifndef __GNUC__
  1903. X# include <sys$library:signal.h>
  1904. X#else /* Gnu C */
  1905. X# include <gnu_cc_include:[000000]signal.h>
  1906. X#endif /* not Gnu C */
  1907. END_OF_FILE
  1908. if test 261 -ne `wc -c <'vms/signal.h'`; then
  1909.     echo shar: \"'vms/signal.h'\" unpacked with wrong size!
  1910. fi
  1911. # end of 'vms/signal.h'
  1912. fi
  1913. if test -f 'vms/socket.h' -a "${1}" != "-c" ; then 
  1914.   echo shar: Will not clobber existing file \"'vms/socket.h'\"
  1915. else
  1916. echo shar: Extracting \"'vms/socket.h'\" \(527 characters\)
  1917. sed "s/^X//" >'vms/socket.h' <<'END_OF_FILE'
  1918. X/* sys/socket.h */
  1919. X#define SOCK_STREAM     1
  1920. X#define SOCK_DGRAM      2
  1921. X
  1922. X#define SO_DEBUG        0x01
  1923. X#define SO_ACCEPTCONN   0x02
  1924. X#define SO_REUSEADDR    0x04
  1925. X#define SO_KEEPALIVE    0x08
  1926. X#define SO_LINGER       0x80
  1927. X#define SO_DONTLINGER   (~SO_LINGER)
  1928. X
  1929. X#define AF_UNSPEC       0
  1930. X#define AF_ERROR        0
  1931. X#define AF_INET         2
  1932. X#define AF_CCITT        10
  1933. X#define AF_X25          10
  1934. X
  1935. Xstruct sockaddr
  1936. X{
  1937. X  unsigned short sa_family;
  1938. X  char sa_data[14];
  1939. X};
  1940. X
  1941. X#define SOL_SOCKET      0xffff
  1942. X
  1943. X#define MSG_OOB 1
  1944. X#define MSG_PEEK 2
  1945. END_OF_FILE
  1946. if test 527 -ne `wc -c <'vms/socket.h'`; then
  1947.     echo shar: \"'vms/socket.h'\" unpacked with wrong size!
  1948. fi
  1949. # end of 'vms/socket.h'
  1950. fi
  1951. if test -f 'vms/time.h' -a "${1}" != "-c" ; then 
  1952.   echo shar: Will not clobber existing file \"'vms/time.h'\"
  1953. else
  1954. echo shar: Extracting \"'vms/time.h'\" \(459 characters\)
  1955. sed "s/^X//" >'vms/time.h' <<'END_OF_FILE'
  1956. X#ifndef __PKTIME
  1957. X#define __PKTIME
  1958. X
  1959. Xstruct timeval
  1960. X{
  1961. X  long tv_sec;
  1962. X  long tv_usec;
  1963. X};
  1964. X
  1965. Xstruct timezone
  1966. X{
  1967. X  int tz_minuteswest;
  1968. X  int tz_dsttime;
  1969. X};
  1970. X
  1971. Xstruct itimerval
  1972. X{
  1973. X  struct timeval it_interval;
  1974. X  struct timeval it_value;
  1975. X};
  1976. X
  1977. X#define ITIMER_REAL 0
  1978. X#define timerclear(x) (x)->tv_sec = (x)->tv_usec = 0
  1979. X
  1980. X#ifndef __GNUC__
  1981. X# include <sys$library:time.h>
  1982. X#else /* not Gnu C */
  1983. X# include <gnu_cc_include:[000000]time.h>
  1984. X#endif /* Gnu C */
  1985. X
  1986. X#endif /* __PKTIME */
  1987. END_OF_FILE
  1988. if test 459 -ne `wc -c <'vms/time.h'`; then
  1989.     echo shar: \"'vms/time.h'\" unpacked with wrong size!
  1990. fi
  1991. # end of 'vms/time.h'
  1992. fi
  1993. if test -f 'vms/types.h' -a "${1}" != "-c" ; then 
  1994.   echo shar: Will not clobber existing file \"'vms/types.h'\"
  1995. else
  1996. echo shar: Extracting \"'vms/types.h'\" \(467 characters\)
  1997. sed "s/^X//" >'vms/types.h' <<'END_OF_FILE'
  1998. X/* sys/types.h */
  1999. X#ifndef _types_
  2000. X#define _types_
  2001. X
  2002. X#ifndef __GNUC__
  2003. X# include <sys$library:stddef.h>
  2004. X#endif /* not Gnu C */
  2005. X
  2006. Xtypedef unsigned char u_char;
  2007. Xtypedef unsigned short u_short;
  2008. Xtypedef unsigned int u_int;
  2009. Xtypedef unsigned long u_long;
  2010. X
  2011. Xtypedef long daddr_t;
  2012. Xtypedef char *caddr_t;
  2013. X
  2014. X#include <sys$library:types.h>
  2015. X
  2016. Xtypedef unsigned short ino_t;
  2017. Xtypedef char *dev_t;
  2018. Xtypedef unsigned int off_t;
  2019. Xtypedef long key_t;
  2020. X
  2021. X#include "[.vms]fd.h"
  2022. X
  2023. X#endif /* _types */
  2024. END_OF_FILE
  2025. if test 467 -ne `wc -c <'vms/types.h'`; then
  2026.     echo shar: \"'vms/types.h'\" unpacked with wrong size!
  2027. fi
  2028. # end of 'vms/types.h'
  2029. fi
  2030. if test -f 'vms/ucx.opt' -a "${1}" != "-c" ; then 
  2031.   echo shar: Will not clobber existing file \"'vms/ucx.opt'\"
  2032. else
  2033. echo shar: Extracting \"'vms/ucx.opt'\" \(54 characters\)
  2034. sed "s/^X//" >'vms/ucx.opt' <<'END_OF_FILE'
  2035. Xsys$library:vaxcrtl.exe/share
  2036. Xsys$library:ucx$ipc/lib
  2037. END_OF_FILE
  2038. if test 54 -ne `wc -c <'vms/ucx.opt'`; then
  2039.     echo shar: \"'vms/ucx.opt'\" unpacked with wrong size!
  2040. fi
  2041. # end of 'vms/ucx.opt'
  2042. fi
  2043. if test -f 'vms/woll.opt' -a "${1}" != "-c" ; then 
  2044.   echo shar: Will not clobber existing file \"'vms/woll.opt'\"
  2045. else
  2046. echo shar: Extracting \"'vms/woll.opt'\" \(66 characters\)
  2047. sed "s/^X//" >'vms/woll.opt' <<'END_OF_FILE'
  2048. Xsys$library:vaxcrtl.exe/share
  2049. Xtwg$tcp:[netdist.lib]twglib.olb/lib
  2050. END_OF_FILE
  2051. if test 66 -ne `wc -c <'vms/woll.opt'`; then
  2052.     echo shar: \"'vms/woll.opt'\" unpacked with wrong size!
  2053. fi
  2054. # end of 'vms/woll.opt'
  2055. fi
  2056. echo shar: End of archive 1 \(of 6\).
  2057. cp /dev/null ark1isdone
  2058. MISSING=""
  2059. for I in 1 2 3 4 5 6 ; do
  2060.     if test ! -f ark${I}isdone ; then
  2061.     MISSING="${MISSING} ${I}"
  2062.     fi
  2063. done
  2064. if test "${MISSING}" = "" ; then
  2065.     echo You have unpacked all 6 archives.
  2066.     rm -f ark[1-9]isdone
  2067. else
  2068.     echo You still need to unpack the following archives:
  2069.     echo "        " ${MISSING}
  2070. fi
  2071. ##  End of shell archive.
  2072. exit 0
  2073.  
  2074. exit 0 # Just in case...
  2075.