home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-23 | 34.5 KB | 1,230 lines |
- Newsgroups: comp.sources.misc
- From: brendan@cs.widener.edu (Brendan Kehoe)
- Subject: v26i050: archie - A Prospero client for Archie, v1.2, Part05/05
- Message-ID: <1991Nov24.045501.4971@sparky.imd.sterling.com>
- X-Md4-Signature: cf680b55964741ba1390bca357edc585
- Date: Sun, 24 Nov 1991 04:55:01 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: brendan@cs.widener.edu (Brendan Kehoe)
- Posting-number: Volume 26, Issue 50
- Archive-name: archie/part05
- Environment: UNIX, VMS
- Supersedes: archie: Volume 22, Issue 35-39
-
- #! /bin/sh
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: ./Prospero ./archie.h ./archie.lnk ./atalloc.c
- # ./copyright.h ./makefile.dos ./makefile.os2 ./patchlevel.h
- # ./pauthent.h ./pcompat.h ./pmachine.h ./pprot.h ./ptalloc.c
- # ./rdgram.h ./regex.h ./vl_comp.c ./vms.h ./vms/in.h
- # ./vms/pseudos.h ./vms/signal.h ./vms/socket.h ./vms/time.h
- # ./vms/types.h ./vms/wall.opt
- # Wrapped by kent@sparky on Wed Nov 20 18:23:45 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 5 (of 5)."'
- if test -f './Prospero' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./Prospero'\"
- else
- echo shar: Extracting \"'./Prospero'\" \(1409 characters\)
- sed "s/^X//" >'./Prospero' <<'END_OF_FILE'
- XProspero also allows users to access Archie as if it were part of a
- Xfile system. Here is an example of how Prospero can be used to access
- XArchie in this manner.
- X
- X Script started on Mon Jul 1 22:36:42 1991
- X % source /home/ftp/archie/pfs/bin/vfsetup.source
- X % vfsetup guest
- X % venable
- X % cd /archive-sites/archie/regex
- X % cd prospero (This command specifies the query)
- X % ls -l
- X total 0
- X -r--r--r-- 0 - 0 - info-prospero.arc
- X dr-xr-xr-x 0 - 0 - prospero
- X dr-xr-xr-x 0 - 0 - prospero-papers
- X -r--r--r-- 0 - 0 - prospero.arc
- X -r--r--r-- 0 - 0 - prospero.tar.Z
- X (Note that the "vls" command could have been used)
- X (to show where the files were actually stored )
- X % ls prospero (list a result if it is a directory)
- X prog.tar.Z prospero.tar.Z
- X % cat info-prospero.arc (The file is automatically retrieved and displayed)
- X >From bcn@n1dmm Tue Dec 4 02:33:36 1990
- X Received: from n1dmm.cs.washington.edu by june.cs.washington.edu (5.64/7.0jh)
- X id AA24763; Tue, 4 Dec 90 02:33:36 -0800
- X Received: by n1dmm.cs.washington.edu (5.64/7.0h)
- X id AA08497; Tue, 4 Dec 90 02:33:31 -0800
- X Date: Tue, 4 Dec 90 02:33:31 -0800
- X From: bcn@cs.washington.edu (Clifford Neuman)
- X ...
- X % vdisable
- X % exit
- X script done on Mon Jul 1 22:39:33 1991
- END_OF_FILE
- if test 1409 -ne `wc -c <'./Prospero'`; then
- echo shar: \"'./Prospero'\" unpacked with wrong size!
- fi
- # end of './Prospero'
- fi
- if test -f './archie.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./archie.h'\"
- else
- echo shar: Extracting \"'./archie.h'\" \(2199 characters\)
- sed "s/^X//" >'./archie.h' <<'END_OF_FILE'
- X/*
- X * archie.h : Definitions for the programmatic Prospero interface to Archie
- X *
- X * Written by Brendan Kehoe (brendan@cs.widener.edu),
- X * George Ferguson (ferguson@cs.rochester.edu), and
- X * Clifford Neuman (bcn@isi.edu).
- X */
- X
- X/*
- X * Archie server (one of): archie.sura.net
- X * archie.mcgill.ca
- X * archie.funet.fi
- X * archie.au
- X * archie.doc.ic.ac.uk
- X */
- X#define ARCHIE_HOST "ARCHIE.SURA.NET"
- X
- X/* You don't wanna touch this. */
- X#ifndef XARCHIE
- X# define ARCHIES "archie.sura.net (USA, Mexico, etc)","archie.mcgill.ca (Canada)","archie.funet.fi (Finland/Mainland Europe)","archie.au (Australia/New Zealand)","archie.doc.ic.ac.uk (Great Britain/Ireland)"
- X# define NARCHIES 5
- X#endif
- X
- X/*
- X * Default value for max hits. Note that this is normally different
- X * for different client implementations. Doing so makes it easier to
- X * collect statistics on the use of the various clients.
- X */
- X#ifdef VMS
- X# define MAX_HITS 98 /* VMS Client */
- X#else
- X# ifdef XARCHIE
- X# define MAX_HITS 99 /* X Client */
- X# else
- X# define MAX_HITS 95 /* Normal client */
- X# endif
- X#endif
- X
- X/*
- X * CLIENT_VERSION may be used to identify the version of the client if
- X * distributed separately from the Prospero distribution. The version
- X * command should then identify both the client version and the Prospero
- X * version identifiers.
- X */
- X#ifdef XARCHIE
- X# define CLIENT_VERSION "1.3-X"
- X#else
- X# define CLIENT_VERSION "1.2"
- X#endif
- X
- X/* Procedures from user/aquery.c */
- X
- X/* archie_query(host,string,max_hits,offset,query_type,cmp_proc,flags) */
- Xextern VLINK archie_query();
- X
- X/* defcmplink(p,q) and invdatecmplink(p,q) */
- Xextern int defcmplink(); /* Compare by host then by filename */
- Xextern int invdatecmplink(); /* Compare links inverted by date */
- X
- X/* Definitions for the comparison procedures */
- X#define AQ_DEFCMP defcmplink
- X#define AQ_INVDATECMP invdatecmplink
- X
- X/* Flags */
- X#define AQ_NOSORT 0x01 /* Don't sort */
- X#define AQ_NOTRANS 0x02 /* Don't translate Archie responses */
- END_OF_FILE
- if test 2199 -ne `wc -c <'./archie.h'`; then
- echo shar: \"'./archie.h'\" unpacked with wrong size!
- fi
- # end of './archie.h'
- fi
- if test -f './archie.lnk' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./archie.lnk'\"
- else
- echo shar: Extracting \"'./archie.lnk'\" \(237 characters\)
- sed "s/^X//" >'./archie.lnk' <<'END_OF_FILE'
- Xaquery.lo archie.lo atalloc.lo dirsend.lo+
- XGet_pauth.lo get_vdir.lo perrmesg.lo procquery.lo+
- Xptalloc.lo regex.lo stcopy.lo support.lo+
- Xvlalloc.lo vl_comp.lo
- Xarchie.unp
- Xarchie/map/noi/co/li/stack:45000
- Xlsocket lnetlib lconfig lpc llibce
- END_OF_FILE
- if test 237 -ne `wc -c <'./archie.lnk'`; then
- echo shar: \"'./archie.lnk'\" unpacked with wrong size!
- fi
- # end of './archie.lnk'
- fi
- if test -f './atalloc.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./atalloc.c'\"
- else
- echo shar: Extracting \"'./atalloc.c'\" \(1819 characters\)
- sed "s/^X//" >'./atalloc.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1989, 1990 by the University of Washington
- X *
- X * For copying and distribution information, please see the file
- X * <copyright.h>.
- X */
- X
- X#include <copyright.h>
- X#include <stdio.h>
- X
- X#include <pfs.h>
- X#include <pmachine.h> /* for correct definition of ZERO */
- X
- Xstatic PATTRIB lfree = NULL;
- Xint pattrib_count = 0;
- Xint pattrib_max = 0;
- X
- X/*
- X * atalloc - allocate and initialize vlink structure
- X *
- X * ATALLOC returns a pointer to an initialized structure of type
- X * PATTRIB. If it is unable to allocate such a structure, it
- X * returns NULL.
- X */
- XPATTRIB
- Xatalloc()
- X {
- X PATTRIB at;
- X if(lfree) {
- X at = lfree;
- X lfree = lfree->next;
- X }
- X else {
- X at = (PATTRIB) malloc(sizeof(PATTRIB_ST));
- X if (!at) return(NULL);
- X pattrib_max++;
- X }
- X
- X pattrib_count++;
- X
- X ZERO(at);
- X /* Initialize and fill in default values; all items are
- X 0 [or NULL] save precedence */
- X at->precedence = ATR_PREC_OBJECT;
- X
- X return(at);
- X }
- X
- X/*
- X * atfree - free a PATTRIB structure
- X *
- X * ATFREE takes a pointer to a PATTRRIB structure and adds it to
- X * the free list for later reuse.
- X */
- Xvoid
- Xatfree(at)
- X PATTRIB at;
- X {
- X if(at->aname) stfree(at->aname);
- X
- X if((strcmp(at->avtype,"ASCII") == 0) && at->value.ascii)
- X stfree(at->value.ascii);
- X if((strcmp(at->avtype,"LINK") == 0) && at->value.link)
- X vlfree(at->value.link);
- X
- X if(at->avtype) stfree(at->avtype);
- X
- X at->next = lfree;
- X at->previous = NULL;
- X lfree = at;
- X pattrib_count--;
- X }
- X
- X/*
- X * atlfree - free a PATTRIB structure
- X *
- X * ATLFREE takes a pointer to a PATTRIB structure frees it and any linked
- X * PATTRIB structures. It is used to free an entrie list of PATTRIB
- X * structures.
- X */
- Xvoid
- Xatlfree(at)
- X PATTRIB at;
- X {
- X PATTRIB nxt;
- X
- X while(at != NULL) {
- X nxt = at->next;
- X atfree(at);
- X at = nxt;
- X }
- X }
- X
- END_OF_FILE
- if test 1819 -ne `wc -c <'./atalloc.c'`; then
- echo shar: \"'./atalloc.c'\" unpacked with wrong size!
- fi
- # end of './atalloc.c'
- fi
- if test -f './copyright.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./copyright.h'\"
- else
- echo shar: Extracting \"'./copyright.h'\" \(896 characters\)
- sed "s/^X//" >'./copyright.h' <<'END_OF_FILE'
- X/*
- X Copyright (c) 1989, 1990, 1991 by the University of Washington
- X
- X Permission to use, copy, modify, and distribute this software and its
- X documentation for non-commercial purposes and without fee is hereby
- X granted, provided that the above copyright notice appear in all copies
- X and that both the copyright notice and this permission notice appear in
- X supporting documentation, and that the name of the University of
- X Washington not be used in advertising or publicity pertaining to
- X distribution of the software without specific, written prior
- X permission. The University of Washington makes no representations
- X about the suitability of this software for any purpose. It is
- X provided "as is" without express or implied warranty.
- X
- X Prospero was written by Clifford Neuman (bcn@isi.edu).
- X
- X Questions concerning this software should be directed to
- X info-prospero@isi.edu.
- X
- X */
- END_OF_FILE
- if test 896 -ne `wc -c <'./copyright.h'`; then
- echo shar: \"'./copyright.h'\" unpacked with wrong size!
- fi
- # end of './copyright.h'
- fi
- if test -f './makefile.dos' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./makefile.dos'\"
- else
- echo shar: Extracting \"'./makefile.dos'\" \(592 characters\)
- sed "s/^X//" >'./makefile.dos' <<'END_OF_FILE'
- X#
- X# Last changed: 11/20/91, v1.2
- X#
- X# Makefile for the minimal build for an archie Prospero client.
- X#.INCLUDE ../../../builtins
- X
- XOBJS = aquery.lo archie.lo atalloc.lo dirsend.lo \
- X get_pauth.lo get_vdir.lo perrmesg.lo procquery.lo \
- X ptalloc.lo regex.lo stcopy.lo support.lo \
- X vlalloc.lo vl_comp.lo
- XHDRS = archie.h pmachine.h pcompat.h
- X
- XDEFINES = -DDEBUG -DNOREGEX -DUSG
- X
- XCFLAGS = -Oeclgsz -Gs -Zi -W4 -I. $(DEFINES)
- X
- XEXE = archie.exe
- X
- Xall: $(EXE)
- X
- X$(OBJS): $(HDRS)
- X
- X$(EXE): $(OBJS) Makefile archie.lnk
- X link @archie.lnk
- X exepack archie.unp archie.exe
- X
- Xclean:
- X +-del *.lo
- X +-del *.exe
- X
- END_OF_FILE
- if test 592 -ne `wc -c <'./makefile.dos'`; then
- echo shar: \"'./makefile.dos'\" unpacked with wrong size!
- fi
- # end of './makefile.dos'
- fi
- if test -f './makefile.os2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./makefile.os2'\"
- else
- echo shar: Extracting \"'./makefile.os2'\" \(800 characters\)
- sed "s/^X//" >'./makefile.os2' <<'END_OF_FILE'
- X#
- X# Last changed: 11/20/91, v1.2
- X#
- X# Makefile for the minimal build for an archie Prospero client.
- X.INCLUDE ../../../builtins
- X
- XOBJS = aquery.obj archie.obj atalloc.obj dirsend.obj \
- X get_pauth.obj get_vdir.obj perrmesg.obj procquery.obj \
- X ptalloc.obj regex.obj stcopy.obj support.obj \
- X vlalloc.obj vl_comp.obj
- XHDRS = archie.h pmachine.h pcompat.h
- X
- XDEFINES = -DDEBUG -DNOREGEX
- X
- XIFLAGS = -I. -I../../../include $(DEFINES)
- X
- XLFLAGS = /stack:30000/nod/noe/noi/map/CO
- XLIBS = pctcp bsd ftpcrt socket os2
- XEXE = archie.exe
- X
- Xall: $(EXE)
- X
- Xinstall: $(EXE)
- X cp $[m,*.exe,$**] ..\..\..\bin
- X @touch install
- X
- X$(OBJS): $(HDRS)
- X
- X$(EXE): $(OBJS) Makefile
- X $(LD) $(LFLAGS) $(L_DEBUG) <@<
- X$[s,"+ \n",$[m,*.obj,$**]]
- X$*
- X$*
- X$(LIBS)
- X
- X<
- X +markexe lfns $@
- X +markexe windowcompat $@
- X
- Xclean:
- X +-del *.obj
- X +-del *.exe
- X
- END_OF_FILE
- if test 800 -ne `wc -c <'./makefile.os2'`; then
- echo shar: \"'./makefile.os2'\" unpacked with wrong size!
- fi
- # end of './makefile.os2'
- fi
- if test -f './patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./patchlevel.h'\"
- else
- echo shar: Extracting \"'./patchlevel.h'\" \(345 characters\)
- sed "s/^X//" >'./patchlevel.h' <<'END_OF_FILE'
- X/*
- X * Archie v1.2
- X *
- X * History:
- X *
- X * 11/20/91 v1.2 - Release.
- X * 11/18/91 - ported to DOS & OS/2
- X * 11/12/91 - finally got to test under Multinet 3.0
- X * 10/03/91 - replaced regex.c for oz
- X * 09/25/91 - added Wallongong support
- X * 08/30/91 - ported to VMS
- X * 08/20/91 v1.1 - Major revisions
- X * 07/31/91 v1.0 - Original
- X */
- END_OF_FILE
- if test 345 -ne `wc -c <'./patchlevel.h'`; then
- echo shar: \"'./patchlevel.h'\" unpacked with wrong size!
- fi
- # end of './patchlevel.h'
- fi
- if test -f './pauthent.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./pauthent.h'\"
- else
- echo shar: Extracting \"'./pauthent.h'\" \(839 characters\)
- sed "s/^X//" >'./pauthent.h' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1989, 1990, 1991 by the University of Washington
- X *
- X * For copying and distribution information, please see the file
- X * <copyright.h>.
- X */
- X
- X#include <copyright.h>
- X
- X#define PFSA_UNAUTHENTICATED 1
- X
- Xstruct pfs_auth_info {
- X char auth_type[100];
- X char authenticator[250];
- X};
- X
- Xtypedef struct pfs_auth_info *PAUTH;
- Xtypedef struct pfs_auth_info PAUTH_ST;
- X
- XPAUTH get_pauth();
- X
- X#ifndef VMS
- X# ifndef IN_H
- X# include <netinet/in.h>
- X# define IN_H
- X# endif
- X#else
- X# ifndef _ARCHIE_VMS
- X# include <vms.h>
- X# endif
- X#endif
- X
- Xstruct client_info {
- X int ainfo_type;
- X char *auth_type;
- X char *authenticator;
- X char *userid;
- X short port;
- X struct in_addr haddr;
- X struct pfs_auth_info *previous;
- X struct pfs_auth_info *next;
- X};
- X
- Xtypedef struct client_info *CINFO;
- Xtypedef struct client_info CINFO_ST;
- END_OF_FILE
- if test 839 -ne `wc -c <'./pauthent.h'`; then
- echo shar: \"'./pauthent.h'\" unpacked with wrong size!
- fi
- # end of './pauthent.h'
- fi
- if test -f './pcompat.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./pcompat.h'\"
- else
- echo shar: Extracting \"'./pcompat.h'\" \(1477 characters\)
- sed "s/^X//" >'./pcompat.h' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1989, 1990 by the University of Washington
- X *
- X * For copying and distribution information, please see the file
- X * <copyright.h>.
- X */
- X
- X#include <copyright.h>
- X
- X/*
- X * pcompat.h - Definitions for compatability library
- X *
- X * This file contains the defintions used by the compatability
- X * library. Among the definitions are the possible values for
- X * pfs_disable_flag. This file also contains the external
- X * declaration of that variable. Note, however that the
- X * the module pfs_disable_flag.o is included in libpfs.a
- X * because some of the routines in that library set it.
- X * The only place it is checked, however, is in pfs_access,
- X * found in libpcompat.a
- X *
- X */
- X
- Xextern int pfs_default;
- Xextern int pfs_enable;
- X
- X/* Definitions for values of pfs_enable */
- X#define PMAP_DISABLE 0
- X#define PMAP_ENABLE 1
- X#define PMAP_COLON 2
- X#define PMAP_ATSIGN_NF 3
- X#define PMAP_ATSIGN 4
- X
- X#define DISABLE_PFS(stmt) {int DpfStmp; DpfStmp = pfs_enable;\
- X pfs_enable = PMAP_DISABLE; \
- X stmt; \
- X pfs_enable = DpfStmp;}
- X
- X/* Definitions for PFS_ACCESS */
- X#define PFA_MAP 0 /* Map the file name only */
- X#define PFA_CREATE 1 /* Create file if not found */
- X#define PFA_CRMAP 2 /* Map file name. Map to new name if not found */
- X#define PFA_RO 4 /* Access to file is read only */
- X
- X#define check_pfs_default() if(pfs_default == -1) get_pfs_default()
- END_OF_FILE
- if test 1477 -ne `wc -c <'./pcompat.h'`; then
- echo shar: \"'./pcompat.h'\" unpacked with wrong size!
- fi
- # end of './pcompat.h'
- fi
- if test -f './pmachine.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./pmachine.h'\"
- else
- echo shar: Extracting \"'./pmachine.h'\" \(1454 characters\)
- sed "s/^X//" >'./pmachine.h' <<'END_OF_FILE'
- X/*
- X * Miscellaneous system dependencies.
- X *
- X * I kept the name pmachine.h because it was already in all of the files...this
- X * barely resembles the pmachine.h that comes with the real Prospero, tho.
- X *
- X * v1.2.0 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
- X */
- X
- X#ifdef hpux
- X# define FUNCS
- X# define NOREGEX
- X#endif
- X
- X#if defined(USG) || defined(SYSV)
- X# define FUNCS
- X#endif
- X
- X#ifdef OS2
- X# include <pctcp.h>
- X#endif
- X#ifdef MSDOS
- X# include <string.h>
- X# include <stdlib.h>
- X#endif
- X
- X#ifdef _AIX
- X#define _NONSTD_TYPES
- X#define _BSD_INCLUDES
- X#endif
- X
- X/* ==== */
- X#ifdef FUNCS
- X# define index strchr
- X# define rindex strrchr
- X# ifndef AUX
- X# define bcopy(a,b,n) memcpy(b,a,n)
- X# define bzero(a,n) memset(a,0,n)
- X# endif
- X#endif
- X
- X#if defined(BULL) || defined(_AIX)
- X# define NEED_SELECT_H
- X#endif
- X#if defined(USG) || defined(UTS) || defined(_AIX)
- X# define NEED_STRING_H
- X#endif
- X#if defined(USG) || defined(UTS) || defined(_AIX) || defined(AUX)
- X# define NEED_TIME_H
- X#endif
- X
- X#ifdef VMS
- X/* Get the system status stuff. */
- X# include <ssdef.h>
- X#endif /* VMS */
- X
- X/*
- X * FD_SET: lib/pfs/dirsend.c, user/vget/ftp.c
- X */
- X#if !defined(FD_SET) && !defined(VMS)
- X#define NFDBITS 32
- X#define FD_SETSIZE 32
- X#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
- X#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
- X#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
- X#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
- X#endif
- END_OF_FILE
- if test 1454 -ne `wc -c <'./pmachine.h'`; then
- echo shar: \"'./pmachine.h'\" unpacked with wrong size!
- fi
- # end of './pmachine.h'
- fi
- if test -f './pprot.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./pprot.h'\"
- else
- echo shar: Extracting \"'./pprot.h'\" \(1825 characters\)
- sed "s/^X//" >'./pprot.h' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1989, 1990, 1991 by the University of Washington
- X *
- X * For copying and distribution information, please see the file
- X * <copyright.h>.
- X *
- X * v1.2.0 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
- X */
- X
- X#include <copyright.h>
- X
- X#ifndef MAXPATHLEN
- X# ifdef VMS
- X# define MAXPATHLEN 32
- X# else /* not VMS */
- X# if defined(MSDOS) && !defined(OS2)
- X# define MAXPATHLEN 255
- X# else /* not MSDOS */
- X# include <sys/param.h>
- X# endif /* MSDOS && !OS2 */
- X# endif /* VMS */
- X#endif
- X
- X/* Protocol Definitions */
- X
- X#define VFPROT_VNO 1 /* Protocol Version Number */
- X
- X#define DIRSRV_PORT 1525 /* Server port used if not in srvtab */
- X#define PROSPERO_PORT 191 /* Officially assigned prived port */
- X#define PROS_FIRST_PRIVP 901 /* First privileged port to try */
- X#define PROS_NUM_PRIVP 20 /* Number of privileged ports to try */
- X
- X#define MAXPKT 1024 /* Max size of response from server */
- X#define SEQ_SIZE 32 /* Max size of sequence text in resp */
- X#define MAX_DIR_LINESIZE 160+MAXPATHLEN /* Max linesize in directory */
- X
- X#define MAX_FWD_DEPTH 20 /* Max fwd pointers to follow */
- X
- X#define S_AD_SZ sizeof(struct sockaddr_in)
- X
- X/* Replacement for strtok that doesn't keep state. Both the variable */
- X/* S and the variable S_next must be defined. To initialize, assign */
- X/* the string to be stepped through to S_next, then call get_token on */
- X/* S. The first token will be in S, and S_next will point to the next */
- X/* token. Like strtok, this macro does modify the string passed to it */
- X#define get_token(S,C) \
- X S = S/**/_next; \
- X if(S) { \
- X while(*S == C) S++; \
- X S/**/_next = index(S,C); \
- X if(S/**/_next) *(S/**/_next++) = '\0'; \
- X if(!*S) S = NULL; \
- X }
- X
- X
- END_OF_FILE
- if test 1825 -ne `wc -c <'./pprot.h'`; then
- echo shar: \"'./pprot.h'\" unpacked with wrong size!
- fi
- # end of './pprot.h'
- fi
- if test -f './ptalloc.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./ptalloc.c'\"
- else
- echo shar: Extracting \"'./ptalloc.c'\" \(1680 characters\)
- sed "s/^X//" >'./ptalloc.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1989, 1990, 1991 by the University of Washington
- X *
- X * For copying and distribution information, please see the file
- X * <copyright.h>.
- X *
- X * v1.2.0 - 11/19/91 (mmt) - added MSDOS & OS2 stuff
- X */
- X
- X#include <copyright.h>
- X#include <stdio.h>
- X
- X#include <pfs.h>
- X#include <pmachine.h> /* for correct definition of ZERO */
- X#ifdef MSDOS
- X# define free _pfree /* otherwise we get conflicts with free() */
- X#endif
- X
- Xstatic PTEXT free = NULL;
- Xint ptext_count = 0;
- Xint ptext_max = 0;
- X
- X/*
- X * ptalloc - allocate and initialize ptext structure
- X *
- X * PTALLOC returns a pointer to an initialized structure of type
- X * PTEXT. If it is unable to allocate such a structure, it
- X * returns NULL.
- X */
- XPTEXT
- Xptalloc()
- X {
- X PTEXT vt;
- X if(free) {
- X vt = free;
- X free = free->next;
- X }
- X else {
- X vt = (PTEXT) malloc(sizeof(PTEXT_ST));
- X if (!vt) return(NULL);
- X ptext_max++;
- X }
- X ptext_count++;
- X
- X /* nearly all parts are 0 [or NULL] */
- X ZERO(vt);
- X /* The offset is to leave room for additional headers */
- X vt->start = vt->dat + MAX_PTXT_HDR;
- X
- X return(vt);
- X }
- X
- X/*
- X * ptfree - free a VTEXT structure
- X *
- X * VTFREE takes a pointer to a VTEXT structure and adds it to
- X * the free list for later reuse.
- X */
- Xvoid
- Xptfree(vt)
- X PTEXT vt;
- X {
- X vt->next = free;
- X vt->previous = NULL;
- X free = vt;
- X ptext_count--;
- X }
- X
- X/*
- X * ptlfree - free a VTEXT structure
- X *
- X * VTLFREE takes a pointer to a VTEXT structure frees it and any linked
- X * VTEXT structures. It is used to free an entrie list of VTEXT
- X * structures.
- X */
- Xvoid
- Xptlfree(vt)
- X PTEXT vt;
- X {
- X PTEXT nxt;
- X
- X while(vt != NULL) {
- X nxt = vt->next;
- X ptfree(vt);
- X vt = nxt;
- X }
- X }
- X
- END_OF_FILE
- if test 1680 -ne `wc -c <'./ptalloc.c'`; then
- echo shar: \"'./ptalloc.c'\" unpacked with wrong size!
- fi
- # end of './ptalloc.c'
- fi
- if test -f './rdgram.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./rdgram.h'\"
- else
- echo shar: Extracting \"'./rdgram.h'\" \(545 characters\)
- sed "s/^X//" >'./rdgram.h' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1991 by the University of Washington
- X *
- X * For copying and distribution information, please see the file
- X * <copyright.h>.
- X */
- X
- X#include <copyright.h>
- X
- X/* Queuing priorities for datagrams */
- X#define RDGRAM_MAX_PRI 32765 /* Maximum user proiority */
- X#define RDGRAM_MAX_SPRI 32767 /* Maximum priority for system use */
- X#define RDGRAM_MIN_PRI -32765 /* Maximum user proiority */
- X#define RDGRAM_MIN_SPRI -32768 /* Maximum priority for system use */
- X
- Xint rdgram_priority = 0;
- END_OF_FILE
- if test 545 -ne `wc -c <'./rdgram.h'`; then
- echo shar: \"'./rdgram.h'\" unpacked with wrong size!
- fi
- # end of './rdgram.h'
- fi
- if test -f './regex.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./regex.h'\"
- else
- echo shar: Extracting \"'./regex.h'\" \(616 characters\)
- sed "s/^X//" >'./regex.h' <<'END_OF_FILE'
- X/*
- X * regex.h : External defs for Ozan Yigit's regex functions, for systems
- X * that don't have them builtin. See regex.c for copyright and other
- X * details.
- X *
- X * Note that this file can be included even if we're linking against the
- X * system routines, since the interface is (deliberately) identical.
- X *
- X * George Ferguson, ferguson@cs.rochester.edu, 11 Sep 1991.
- X */
- X
- X#if defined(AUX) || defined(USG)
- X/* Let them use ours if they wish. */
- X# ifndef NOREGEX
- Xextern char *regcmp();
- Xextern char *regex();
- X#define re_comp regcmp
- X#define re_exec regex
- X# endif
- X#else
- Xextern char *re_comp();
- Xextern int re_exec();
- X#endif
- END_OF_FILE
- if test 616 -ne `wc -c <'./regex.h'`; then
- echo shar: \"'./regex.h'\" unpacked with wrong size!
- fi
- # end of './regex.h'
- fi
- if test -f './vl_comp.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vl_comp.c'\"
- else
- echo shar: Extracting \"'./vl_comp.c'\" \(2137 characters\)
- sed "s/^X//" >'./vl_comp.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1989, 1990, 1991 by the University of Washington
- X *
- X * For copying and distribution information, please see the file
- X * <copyright.h>.
- X */
- X
- X#include <copyright.h>
- X#include <pfs.h>
- X
- X/*
- X * vl_comp - compare the names of two virtual links
- X *
- X * VL_COMP compares the names of two links. It returns
- X * 0 if they are equal, negative if vl1 < vl2, and positive if
- X * vl1 > vl2.
- X *
- X * ARGS: vl1,vl2 - Virtual links to be compared
- X *
- X * RETURNS: 0 if equal, + is vl1 > vl2, - if vl1 < vl2
- X *
- X * NOTES: Order of significance is as follows. Existence,
- X * name. If names do not exist, then hosttype, host,
- X * native filenametype, native filename. The only time
- X * the name will not exist if if the link is a union link.
- X */
- Xint
- Xvl_comp(vl1,vl2)
- X VLINK vl1;
- X VLINK vl2;
- X {
- X int retval;
- X
- X if(vl1->name && !vl2->name) return(1);
- X if(!vl1->name && vl2->name) return(-1);
- X if(vl1->name && vl2->name && (*(vl1->name) || *(vl2->name)))
- X return(strcmp(vl1->name,vl2->name));
- X
- X retval = strcmp(vl1->hosttype,vl2->hosttype);
- X if(!retval) retval = strcmp(vl1->host,vl2->host);
- X if(!retval) retval = strcmp(vl1->nametype,vl2->nametype);
- X if(!retval) retval = strcmp(vl1->filename,vl2->filename);
- X return(retval);
- X }
- X
- X/*
- X * vl_equal - compare the values of two virtual links
- X *
- X * VL_EQUAL compares the values of two links. It returns
- X * 1 if all important fields are the same, and 0 otherwise.
- X *
- X * ARGS: vl1,vl2 - Virtual links to be compared
- X *
- X * RETURNS: 1 if equal, 0 if not equal
- X *
- X */
- Xint
- Xvl_equal(vl1,vl2)
- X VLINK vl1;
- X VLINK vl2;
- X {
- X return strcmp(vl1->name, vl2->name) == 0 &&
- X vl1->linktype == vl2->linktype &&
- X strcmp(vl1->type, vl2->type) == 0 &&
- X strcmp(vl1->hosttype, vl2->hosttype) == 0 &&
- X strcmp(vl1->host, vl2->host) == 0 &&
- X strcmp(vl1->nametype, vl2->nametype) == 0 &&
- X strcmp(vl1->filename, vl2->filename) == 0 &&
- X vl1->version == vl2->version &&
- X vl1->f_magic_no == vl2->f_magic_no ;
- X
- X }
- X
- END_OF_FILE
- if test 2137 -ne `wc -c <'./vl_comp.c'`; then
- echo shar: \"'./vl_comp.c'\" unpacked with wrong size!
- fi
- # end of './vl_comp.c'
- fi
- if test -f './vms.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms.h'\"
- else
- echo shar: Extracting \"'./vms.h'\" \(1009 characters\)
- sed "s/^X//" >'./vms.h' <<'END_OF_FILE'
- X#ifndef _ARCHIE_VMS
- X#define _ARCHIE_VMS
- X#include <pmachine.h>
- X
- X#if !defined(MULTINET_30) && !defined(WALLONGONG)
- X#include "[.vms]pseudos.h"
- X#include "[.vms]types.h"
- X#include "[.vms]in.h"
- X#include "[.vms]signal.h"
- X#include "[.vms]socket.h"
- X#include "[.vms]time.h"
- X
- X#else
- X
- X/* time_t gets multiply defined <ekup> */
- X#ifndef __TYPES
- X#define __TYPES
- X#endif
- X#ifdef MULTINET_30
- X# include "multinet_root:[multinet.include.sys]types.h"
- X# include "multinet_root:[multinet.include.netinet]in.h"
- X# include "multinet_root:[multinet.include.sys]socket.h"
- X# include "multinet_root:[multinet.include.sys]time.h"
- X#endif /* MULTINET_30 */
- X
- X#ifdef WALLONGONG
- X/* We don't want size_t defined. */
- X# ifndef __STDDEF
- X# define __STDDEF
- X# endif
- X# include "twg$tcp:[netdist.include.sys]types.h"
- X# include "twg$tcp:[netdist.include.netinet]in.h"
- X# include "twg$tcp:[netdist.include.sys]socket.h"
- X# include "twg$tcp:[netdist.include.sys]time.h"
- X#endif /* WALLONGONG */
- X
- X#endif /* !MULTINET and !WALLONGONG */
- X
- X#endif /* _ARCHIE_VMS */
- END_OF_FILE
- if test 1009 -ne `wc -c <'./vms.h'`; then
- echo shar: \"'./vms.h'\" unpacked with wrong size!
- fi
- # end of './vms.h'
- fi
- if test -f './vms/in.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms/in.h'\"
- else
- echo shar: Extracting \"'./vms/in.h'\" \(1418 characters\)
- sed "s/^X//" >'./vms/in.h' <<'END_OF_FILE'
- X/* netinet/in.h */
- Xstruct in_addr
- X{
- X union
- X {
- X struct
- X {
- X unsigned char s_b1, s_b2, s_b3, s_b4;
- X } S_un_b;
- X struct
- X {
- X unsigned short s_w1, s_w2;
- X } S_un_w;
- X unsigned long S_addr;
- X } S_un;
- X#define s_addr S_un.S_addr
- X#define s_host S_un.S_un_b.s_b2
- X#define s_net S_un.S_un_b.s_b1
- X#define s_imp S_un.S_un_w.s_w2
- X#define s_impno S_un.S_un_b.s_b4
- X#define s_lh S_un.S_un_b.s_b3
- X};
- X
- X#define INADDR_ANY 0x00000000
- X#define INADDR_BROADCAST 0xffffffff
- X#define INADDR_LOOPBACK 0x7f000001
- X
- Xstruct sockaddr_in
- X{
- X short sin_family;
- X unsigned short sin_port;
- X struct in_addr sin_addr;
- X char sin_zero[8];
- X};
- X
- X#define ntohl(x) (( (((unsigned long) x) >> 24)& 0x000000ff ) |\
- X ( (((unsigned long) x) >> 8) & 0x0000ff00 ) |\
- X ( (((unsigned long) x) << 8) & 0x00ff0000 ) |\
- X ( (((unsigned long) x) << 24)& 0xff000000 ))
- X#define ntohs(x) (( (((unsigned short) x) >> 8) |\
- X ( (((unsigned short) x) << 8)) & 0xffff ))
- X#define htonl(x) (( (((unsigned long) x) >> 24)& 0x000000ff ) |\
- X ( (((unsigned long) x) >> 8) & 0x0000ff00 ) |\
- X ( (((unsigned long) x) << 8) & 0x00ff0000 ) |\
- X ( (((unsigned long) x) << 24)& 0xff000000 ))
- X#define htons(x) (( (((unsigned short) x) >> 8) |\
- X ( (((unsigned short) x) << 8)) & 0xffff ))
- X
- X#define IPPORT_RESERVED 1024
- END_OF_FILE
- if test 1418 -ne `wc -c <'./vms/in.h'`; then
- echo shar: \"'./vms/in.h'\" unpacked with wrong size!
- fi
- # end of './vms/in.h'
- fi
- if test -f './vms/pseudos.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms/pseudos.h'\"
- else
- echo shar: Extracting \"'./vms/pseudos.h'\" \(439 characters\)
- sed "s/^X//" >'./vms/pseudos.h' <<'END_OF_FILE'
- X/* These are so we don't end up using the MultiNet versions. */
- X#define socket VMSsocket
- X#define bind VMSbind
- X#define connect VMSconnect
- X#define listen VMSlisten
- X#define accept VMSaccept
- X#define select VMSselect
- X#define recv VMSrecv
- X#define recvfrom VMSrecvfrom
- X#define send VMSsend
- X#define sendto VMSsendto
- X#define getsockname VMSgetsockname
- X#define shutdown VMSshutdown
- X#define getsockopt VMSgetsockopt
- X#define setsockopt VMSsetsockopt
- END_OF_FILE
- if test 439 -ne `wc -c <'./vms/pseudos.h'`; then
- echo shar: \"'./vms/pseudos.h'\" unpacked with wrong size!
- fi
- # end of './vms/pseudos.h'
- fi
- if test -f './vms/signal.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms/signal.h'\"
- else
- echo shar: Extracting \"'./vms/signal.h'\" \(261 characters\)
- sed "s/^X//" >'./vms/signal.h' <<'END_OF_FILE'
- X/* signal.h */
- X#define SIGURG 16
- X#define SIGTSTP 18
- X#define SIGCHLD 20
- X#define SIGIO 23
- X#define sigmask(m) (1 << ((m)-1))
- X
- X#ifndef __GNUC__
- X# include <sys$library:signal.h>
- X#else /* Gnu C */
- X# include <gnu_cc_include:[000000]signal.h>
- X#endif /* not Gnu C */
- END_OF_FILE
- if test 261 -ne `wc -c <'./vms/signal.h'`; then
- echo shar: \"'./vms/signal.h'\" unpacked with wrong size!
- fi
- # end of './vms/signal.h'
- fi
- if test -f './vms/socket.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms/socket.h'\"
- else
- echo shar: Extracting \"'./vms/socket.h'\" \(527 characters\)
- sed "s/^X//" >'./vms/socket.h' <<'END_OF_FILE'
- X/* sys/socket.h */
- X#define SOCK_STREAM 1
- X#define SOCK_DGRAM 2
- X
- X#define SO_DEBUG 0x01
- X#define SO_ACCEPTCONN 0x02
- X#define SO_REUSEADDR 0x04
- X#define SO_KEEPALIVE 0x08
- X#define SO_LINGER 0x80
- X#define SO_DONTLINGER (~SO_LINGER)
- X
- X#define AF_UNSPEC 0
- X#define AF_ERROR 0
- X#define AF_INET 2
- X#define AF_CCITT 10
- X#define AF_X25 10
- X
- Xstruct sockaddr
- X{
- X unsigned short sa_family;
- X char sa_data[14];
- X};
- X
- X#define SOL_SOCKET 0xffff
- X
- X#define MSG_OOB 1
- X#define MSG_PEEK 2
- END_OF_FILE
- if test 527 -ne `wc -c <'./vms/socket.h'`; then
- echo shar: \"'./vms/socket.h'\" unpacked with wrong size!
- fi
- # end of './vms/socket.h'
- fi
- if test -f './vms/time.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms/time.h'\"
- else
- echo shar: Extracting \"'./vms/time.h'\" \(459 characters\)
- sed "s/^X//" >'./vms/time.h' <<'END_OF_FILE'
- X#ifndef __PKTIME
- X#define __PKTIME
- X
- Xstruct timeval
- X{
- X long tv_sec;
- X long tv_usec;
- X};
- X
- Xstruct timezone
- X{
- X int tz_minuteswest;
- X int tz_dsttime;
- X};
- X
- Xstruct itimerval
- X{
- X struct timeval it_interval;
- X struct timeval it_value;
- X};
- X
- X#define ITIMER_REAL 0
- X#define timerclear(x) (x)->tv_sec = (x)->tv_usec = 0
- X
- X#ifndef __GNUC__
- X# include <sys$library:time.h>
- X#else /* not Gnu C */
- X# include <gnu_cc_include:[000000]time.h>
- X#endif /* Gnu C */
- X
- X#endif /* __PKTIME */
- END_OF_FILE
- if test 459 -ne `wc -c <'./vms/time.h'`; then
- echo shar: \"'./vms/time.h'\" unpacked with wrong size!
- fi
- # end of './vms/time.h'
- fi
- if test -f './vms/types.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms/types.h'\"
- else
- echo shar: Extracting \"'./vms/types.h'\" \(467 characters\)
- sed "s/^X//" >'./vms/types.h' <<'END_OF_FILE'
- X/* sys/types.h */
- X#ifndef _types_
- X#define _types_
- X
- X#ifndef __GNUC__
- X# include <sys$library:stddef.h>
- X#endif /* not Gnu C */
- X
- Xtypedef unsigned char u_char;
- Xtypedef unsigned short u_short;
- Xtypedef unsigned int u_int;
- Xtypedef unsigned long u_long;
- X
- Xtypedef long daddr_t;
- Xtypedef char *caddr_t;
- X
- X#include <sys$library:types.h>
- X
- Xtypedef unsigned short ino_t;
- Xtypedef char *dev_t;
- Xtypedef unsigned int off_t;
- Xtypedef long key_t;
- X
- X#include "[.vms]fd.h"
- X
- X#endif /* _types */
- END_OF_FILE
- if test 467 -ne `wc -c <'./vms/types.h'`; then
- echo shar: \"'./vms/types.h'\" unpacked with wrong size!
- fi
- # end of './vms/types.h'
- fi
- if test -f './vms/wall.opt' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'./vms/wall.opt'\"
- else
- echo shar: Extracting \"'./vms/wall.opt'\" \(66 characters\)
- sed "s/^X//" >'./vms/wall.opt' <<'END_OF_FILE'
- Xsys$library:vaxcrtl.exe/share
- Xtwg$tcp:[netdist.lib]twglib.olb/lib
- END_OF_FILE
- if test 66 -ne `wc -c <'./vms/wall.opt'`; then
- echo shar: \"'./vms/wall.opt'\" unpacked with wrong size!
- fi
- # end of './vms/wall.opt'
- fi
- echo shar: End of archive 5 \(of 5\).
- cp /dev/null ark5isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-