home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume41 / wwfs / part17 < prev    next >
Encoding:
Text File  |  1994-01-17  |  89.2 KB  |  3,061 lines

  1. Newsgroups: comp.sources.misc
  2. From: youki-k@is.aist-nara.ac.jp (Youki Kadobayashi)
  3. Subject: v41i102:  wwfs - WorldWide File System, Part17/22
  4. Message-ID: <1994Jan17.202504.20436@sparky.sterling.com>
  5. X-Md4-Signature: d96e2809df0a93766cf13d738c852a9f
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Nara Institute of Science and Technology, Japan
  8. Date: Mon, 17 Jan 1994 20:25:04 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: youki-k@is.aist-nara.ac.jp (Youki Kadobayashi)
  12. Posting-number: Volume 41, Issue 102
  13. Archive-name: wwfs/part17
  14. Environment: UNIX, inet
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  config/arch.sh config/mount_aix.c config/os-bsd44.h
  21. #   config/os-defaults.h config/os-hpux.h config/os-irix4.h
  22. #   config/os-type.sh config/os-u2_2.h config/os-u3_0.h
  23. #   config/os-u4_0.h config/os-u4_2.h csd/Makefile.build csd/parse.c
  24. #   csd/ufs.c gtr/draft-youki-gtr-00.txt gtr/gtr.pl rpc/cs_prot_clnt.c
  25. #   saps/csd-nanny.pl
  26. # Wrapped by kent@sparky on Sun Jan 16 17:48:38 1994
  27. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  28. echo If this archive is complete, you will see the following message:
  29. echo '          "shar: End of archive 17 (of 22)."'
  30. if test -f 'config/arch.sh' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'config/arch.sh'\"
  32. else
  33.   echo shar: Extracting \"'config/arch.sh'\" \(4021 characters\)
  34.   sed "s/^X//" >'config/arch.sh' <<'END_OF_FILE'
  35. X#! /bin/sh
  36. X#
  37. X# Copyright (c) 1989 Jan-Simon Pendry
  38. X# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  39. X# Copyright (c) 1989 The Regents of the University of California.
  40. X# All rights reserved.
  41. X#
  42. X# This code is derived from software contributed to Berkeley by
  43. X# Jan-Simon Pendry at Imperial College, London.
  44. X#
  45. X# Redistribution and use in source and binary forms, with or without
  46. X# modification, are permitted provided that the following conditions
  47. X# are met:
  48. X# 1. Redistributions of source code must retain the above copyright
  49. X#    notice, this list of conditions and the following disclaimer.
  50. X# 2. Redistributions in binary form must reproduce the above copyright
  51. X#    notice, this list of conditions and the following disclaimer in the
  52. X#    documentation and/or other materials provided with the distribution.
  53. X# 3. All advertising materials mentioning features or use of this software
  54. X#    must display the following acknowledgement:
  55. X#      This product includes software developed by the University of
  56. X#      California, Berkeley and its contributors.
  57. X# 4. Neither the name of the University nor the names of its contributors
  58. X#    may be used to endorse or promote products derived from this software
  59. X#    without specific prior written permission.
  60. X#
  61. X# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  62. X# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  63. X# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  64. X# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  65. X# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  66. X# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  67. X# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  68. X# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  69. X# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  70. X# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  71. X# SUCH DAMAGE.
  72. X#
  73. X#    %W% (Berkeley) %G%
  74. X#
  75. X# $Id: arch,v 5.2.2.2 1992/05/31 16:45:35 jsp Exp $
  76. X#
  77. X# Figure out machine architecture
  78. X#
  79. X
  80. XPATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/local/bin:${PATH} export PATH
  81. X
  82. X#
  83. X# First try to find a standard command
  84. X#
  85. Xa=arch        # Sun compat
  86. Xm=machine    # BSD compat
  87. Xu=uname        # Sys5 compat
  88. X
  89. Xif [ -f /etc/$a -o -f /bin/$a -o -f /usr/bin/$a -o -f /usr/local/bin/$a ]
  90. Xthen
  91. X    exec $a
  92. Xelif [ -f /etc/$m -o -f /bin/$m -o -f /usr/bin/$m -o -f /usr/ucb/$m -o -f /usr/local/bin/$m ]
  93. Xthen
  94. X    exec $m
  95. Xelif [ -f /etc/$u -o -f /bin/$u -o -f /usr/bin/$u -o -f /usr/local/bin/$u ]
  96. Xthen
  97. X    ARCH="`uname`"
  98. X    case "$ARCH" in
  99. X        "HP-UX") echo hp9000; exit 0;;
  100. X        AIX*) MACH="`uname -m`"
  101. X            case "$MACH" in
  102. X            00*) echo ibm6000; exit 0;;
  103. X            10*) echo ibm032; exit 0;;
  104. X            20*) echo ibm032; exit 0;;
  105. X            esac
  106. X            ;;
  107. X        A/UX) echo macII ; exit 0 ;;
  108. X        dgux) MACH="`uname -m`"
  109. X            case "$MACH" in
  110. X            AViiON) echo aviion; exit 0;;
  111. X            esac
  112. X            ;;
  113. X        *) MACH="`uname -m`"
  114. X            case "$MACH" in
  115. X            IP6) echo mips; exit 0;;
  116. X            IP7) echo mips; exit 0;;
  117. X            IP20) echo mips; exit 0;;
  118. X            *) ;;
  119. X            esac
  120. X            ;;
  121. X    esac
  122. Xfi
  123. X
  124. X#
  125. X# Take a pot-shot at your machine architecture
  126. X#
  127. Xecho "#    ... No ARCH= option specified; dynamically determining architecture" >&2
  128. X
  129. Xcase "`exec 2>/dev/null; head -2 /etc/motd`" in
  130. X*"HP-UX"*)        ARCH=hp9000;;
  131. X*"Iris"*)        ARCH=iris4d;;
  132. X*"Ultrix"*)        ARCH=vax;;
  133. X*"RISC iX"*)        ARCH=arm;;
  134. X*"Umax 4.2"*)        ARCH=encore;;
  135. X*"Alliant Concentrix"*)    ARCH=alliant;;
  136. X*"FPS Model 500"*)    ARCH=fps500;;
  137. X*"HCX/UX"*)        ARCH=harris;;
  138. X*"UNIOS-B"*)        ARCH=luna;;
  139. X*"LUNA-88K Mach 2.5"*)    ARCH=luna88k;;
  140. X*"LUNA-II Mach 2.5"*)    ARCH=luna2;;
  141. X*)            ARCH=unknown;
  142. X            if [ -d /usr/include/caif ]; then
  143. X                ARCH=ibm032
  144. X            elif [ -f /bin/pyr ]; then
  145. X                if /bin/pyr; then
  146. X                    ARCH=pyr
  147. X                fi
  148. X            elif [ -d /NextApps ]; then
  149. X                ARCH=next
  150. X            elif [ -f /etc/comply ]; then
  151. X                # Tex 4300 is essentially a sun 3.
  152. X                ARCH=sun3
  153. X            fi
  154. X            ;;
  155. Xesac
  156. X
  157. Xecho "#    ... architecture appears to be \"${ARCH}\"" >&2
  158. Xecho $ARCH
  159. X
  160. Xcase "$ARCH" in
  161. Xunknown) exit 1
  162. Xesac
  163. X
  164. Xexit 0
  165. END_OF_FILE
  166.   if test 4021 -ne `wc -c <'config/arch.sh'`; then
  167.     echo shar: \"'config/arch.sh'\" unpacked with wrong size!
  168.   fi
  169.   chmod +x 'config/arch.sh'
  170.   # end of 'config/arch.sh'
  171. fi
  172. if test -f 'config/mount_aix.c' -a "${1}" != "-c" ; then 
  173.   echo shar: Will not clobber existing file \"'config/mount_aix.c'\"
  174. else
  175.   echo shar: Extracting \"'config/mount_aix.c'\" \(4390 characters\)
  176.   sed "s/^X//" >'config/mount_aix.c' <<'END_OF_FILE'
  177. X/*
  178. X * Copyright (c) 1990 Jan-Simon Pendry
  179. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  180. X * Copyright (c) 1990 The Regents of the University of California.
  181. X * All rights reserved.
  182. X *
  183. X * This code is derived from software contributed to Berkeley by
  184. X * Jan-Simon Pendry at Imperial College, London.
  185. X *
  186. X * Redistribution and use in source and binary forms, with or without
  187. X * modification, are permitted provided that the following conditions
  188. X * are met:
  189. X * 1. Redistributions of source code must retain the above copyright
  190. X *    notice, this list of conditions and the following disclaimer.
  191. X * 2. Redistributions in binary form must reproduce the above copyright
  192. X *    notice, this list of conditions and the following disclaimer in the
  193. X *    documentation and/or other materials provided with the distribution.
  194. X * 3. All advertising materials mentioning features or use of this software
  195. X *    must display the following acknowledgement:
  196. X *      This product includes software developed by the University of
  197. X *      California, Berkeley and its contributors.
  198. X * 4. Neither the name of the University nor the names of its contributors
  199. X *    may be used to endorse or promote products derived from this software
  200. X *    without specific prior written permission.
  201. X *
  202. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  203. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  204. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  205. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  206. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  207. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  208. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  209. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  210. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  211. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  212. X * SUCH DAMAGE.
  213. X *
  214. X *    %W% (Berkeley) %G%
  215. X *
  216. X * $Id: mount_aix.c,v 5.2.2.1 1992/02/09 15:10:08 jsp beta $
  217. X *
  218. X */
  219. X
  220. X
  221. X/*
  222. X * AIX 3 Mount helper
  223. X */
  224. X
  225. X#include "misc-aix3.h"
  226. X
  227. Xstatic int aix3_mkvp(p, gfstype, flags, object, stub, host, info, info_size, args)
  228. Xchar *p;
  229. Xint gfstype;
  230. Xint flags;
  231. Xchar *object;
  232. Xchar *stub;
  233. Xchar *host;
  234. Xchar *info;
  235. Xint info_size;
  236. Xchar *args;
  237. X{
  238. X    struct vmount *vp = (struct vmount *) p;
  239. X    bzero((voidp) vp, sizeof(*vp));
  240. X    /*
  241. X     * Fill in standard fields
  242. X     */
  243. X    vp->vmt_revision = VMT_REVISION;
  244. X    vp->vmt_flags = flags;
  245. X    vp->vmt_gfstype = gfstype;
  246. X
  247. X#define    VMT_ROUNDUP(len) (4 * ((len + 3) / 4))
  248. X#define VMT_ASSIGN(vp, idx, data, size) \
  249. X    vp->vmt_data[idx].vmt_off = p - (char *) vp; \
  250. X    vp->vmt_data[idx].vmt_size = size; \
  251. X    bcopy(data, p, size); \
  252. X    p += VMT_ROUNDUP(size);
  253. X
  254. X    /*
  255. X     * Fill in all variable length data
  256. X     */
  257. X    p += sizeof(*vp);
  258. X
  259. X    VMT_ASSIGN(vp, VMT_OBJECT, object, strlen(object) + 1);
  260. X    VMT_ASSIGN(vp, VMT_STUB, stub, strlen(stub) + 1);
  261. X    VMT_ASSIGN(vp, VMT_HOST, host, strlen(host) + 1);
  262. X    VMT_ASSIGN(vp, VMT_HOSTNAME, host, strlen(host) + 1);
  263. X    VMT_ASSIGN(vp, VMT_INFO, info, info_size);
  264. X    VMT_ASSIGN(vp, VMT_ARGS, args, strlen(args) + 1);
  265. X
  266. X#undef VMT_ASSIGN
  267. X#undef VMT_ROUNDUP
  268. X
  269. X    /*
  270. X     * Return length
  271. X     */
  272. X    return vp->vmt_length = p - (char *) vp;
  273. X}
  274. X
  275. X/*
  276. X * Map from conventional mount arguments
  277. X * to AIX 3-style arguments.
  278. X */
  279. Xaix3_mount(fsname, dir, flags, type, data, args)
  280. Xchar *fsname;
  281. Xchar *dir;
  282. Xint flags;
  283. Xint type;
  284. Xvoid *data;
  285. Xchar *args;
  286. X{
  287. X    char buf[4096];
  288. X    int size;
  289. X
  290. X#ifdef DEBUG
  291. X    dlog("aix3_mount: fsname %s, dir %s, type %d", fsname, dir, type);
  292. X#endif /* DEBUG */
  293. X
  294. X/* aix3_mkvp(p, gfstype, flags, object, stub, host, info, info_size, args) */
  295. X
  296. X    switch (type) {
  297. X
  298. X    case MOUNT_TYPE_NFS: {
  299. X        char *host = strdup(fsname);
  300. X        char *rfs = strchr(host, ':');
  301. X        int free_rfs = 0;
  302. X        if (rfs) {
  303. X            *rfs++ = '\0';
  304. X        } else {
  305. X            rfs = host;
  306. X            free_rfs = 1;
  307. X            host = strdup(hostname);
  308. X        }
  309. X
  310. X        size = aix3_mkvp(buf, type, flags, rfs, dir, host, data, sizeof(struct nfs_args), args);
  311. X        if (free_rfs)
  312. X            free((voidp) rfs);
  313. X        free(host);
  314. X
  315. X        } break;
  316. X
  317. X    case MOUNT_TYPE_UFS:
  318. X        /* Need to open block device and extract log device info from sblk. */
  319. X        return EINVAL;
  320. X
  321. X    default:
  322. X        return EINVAL;
  323. X    }
  324. X#ifdef DEBUG
  325. X    /*dlog("aix3_mkvp: flags %#x, size %d, args %s", flags, size, args);*/
  326. X#endif /* DEBUG */
  327. X
  328. X    return vmount(buf, size);
  329. X}
  330. END_OF_FILE
  331.   if test 4390 -ne `wc -c <'config/mount_aix.c'`; then
  332.     echo shar: \"'config/mount_aix.c'\" unpacked with wrong size!
  333.   fi
  334.   # end of 'config/mount_aix.c'
  335. fi
  336. if test -f 'config/os-bsd44.h' -a "${1}" != "-c" ; then 
  337.   echo shar: Will not clobber existing file \"'config/os-bsd44.h'\"
  338. else
  339.   echo shar: Extracting \"'config/os-bsd44.h'\" \(5150 characters\)
  340.   sed "s/^X//" >'config/os-bsd44.h' <<'END_OF_FILE'
  341. X/*
  342. X * Copyright (c) 1990 Jan-Simon Pendry
  343. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  344. X * Copyright (c) 1990 The Regents of the University of California.
  345. X * All rights reserved.
  346. X *
  347. X * This code is derived from software contributed to Berkeley by
  348. X * Jan-Simon Pendry at Imperial College, London.
  349. X *
  350. X * Redistribution and use in source and binary forms, with or without
  351. X * modification, are permitted provided that the following conditions
  352. X * are met:
  353. X * 1. Redistributions of source code must retain the above copyright
  354. X *    notice, this list of conditions and the following disclaimer.
  355. X * 2. Redistributions in binary form must reproduce the above copyright
  356. X *    notice, this list of conditions and the following disclaimer in the
  357. X *    documentation and/or other materials provided with the distribution.
  358. X * 3. All advertising materials mentioning features or use of this software
  359. X *    must display the following acknowledgement:
  360. X *      This product includes software developed by the University of
  361. X *      California, Berkeley and its contributors.
  362. X * 4. Neither the name of the University nor the names of its contributors
  363. X *    may be used to endorse or promote products derived from this software
  364. X *    without specific prior written permission.
  365. X *
  366. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  367. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  368. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  369. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  370. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  371. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  372. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  373. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  374. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  375. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  376. X * SUCH DAMAGE.
  377. X *
  378. X *    %W% (Berkeley) %G%
  379. X *
  380. X * $Id: os-bsd44.h,v 5.2.2.1 1992/02/09 15:10:11 jsp beta $
  381. X *
  382. X * 4.4 BSD definitions for Amd (automounter)
  383. X */
  384. X
  385. X/*
  386. X * Does the compiler grok void *
  387. X */
  388. X#define    VOIDP
  389. X
  390. X/*
  391. X * Which version of the Sun RPC library we are using
  392. X * This is the implementation release number, not
  393. X * the protocol revision number.
  394. X */
  395. X#define    RPC_4
  396. X
  397. X/*
  398. X * Which version of the NFS interface are we using.
  399. X * This is the implementation release number, not
  400. X * the protocol revision number.
  401. X */
  402. X#define    NFS_44
  403. X#define HAS_TCP_NFS
  404. X
  405. X/*
  406. X * Does this OS have NDBM support?
  407. X */
  408. X#define OS_HAS_NDBM
  409. X
  410. X/*
  411. X * 4.4 doesn't provide NIS.
  412. X */
  413. X#undef HAS_NIS_MAPS
  414. X
  415. X/*
  416. X * The mount table is obtained from the kernel
  417. X */
  418. X#undef    UPDATE_MTAB
  419. X
  420. X/*
  421. X * No mntent info on 4.4 BSD
  422. X */
  423. X#undef    MNTENT_HDR
  424. X
  425. X/*
  426. X * Name of filesystem types
  427. X */
  428. X#define    MOUNT_TYPE_NFS    MOUNT_NFS
  429. X#define    MOUNT_TYPE_UFS    MOUNT_UFS
  430. X#undef MTAB_TYPE_UFS
  431. X#define    MTAB_TYPE_UFS    "ufs"
  432. X#define    MTAB_TYPE_MFS    "mfs"
  433. X
  434. X/*
  435. X * How to unmount filesystems
  436. X */
  437. X#undef UNMOUNT_TRAP
  438. X#undef    NEED_UMOUNT_FS
  439. X#define    NEED_UMOUNT_BSD
  440. X
  441. X/*
  442. X * How to copy an address into an NFS filehandle
  443. X */
  444. X#undef NFS_SA_DREF
  445. X#define    NFS_SA_DREF(dst, src) { \
  446. X        (dst).addr = (struct sockaddr *) (src); \
  447. X        (dst).addrlen = sizeof(*src); \
  448. X        (dst).sotype = SOCK_DGRAM; \
  449. X        (dst).proto = 0; \
  450. X    }
  451. X
  452. X/*
  453. X * Byte ordering
  454. X */
  455. X#ifndef BYTE_ORDER
  456. X#include <machine/endian.h>
  457. X#endif /* BYTE_ORDER */
  458. X
  459. X#undef ARCH_ENDIAN
  460. X#if BYTE_ORDER == LITTLE_ENDIAN
  461. X#define ARCH_ENDIAN "little"
  462. X#else
  463. X#if BYTE_ORDER == BIG_ENDIAN
  464. X#define ARCH_ENDIAN "big"
  465. X#else
  466. XXXX - Probably no hope of running Amd on this machine!
  467. X#endif /* BIG */
  468. X#endif /* LITTLE */
  469. X
  470. X/*
  471. X * Miscellaneous 4.4 BSD bits
  472. X */
  473. X#define    NEED_MNTOPT_PARSER
  474. X#define    SHORT_MOUNT_NAME
  475. X
  476. X#define    MNTMAXSTR       128
  477. X
  478. X#define    MNTTYPE_UFS    "ufs"        /* Un*x file system */
  479. X#define    MNTTYPE_NFS    "nfs"        /* network file system */
  480. X#define    MNTTYPE_MFS    "mfs"        /* memory file system */
  481. X#define    MNTTYPE_IGNORE    "ignore"    /* No type specified, ignore this entry */
  482. X
  483. X#define    M_RDONLY    MNT_RDONLY
  484. X#define    M_SYNC        MNT_SYNCHRONOUS
  485. X#define    M_NOEXEC    MNT_NOEXEC
  486. X#define    M_NOSUID    MNT_NOSUID
  487. X#define    M_NODEV        MNT_NODEV
  488. X
  489. X#define    MNTOPT_SOFT    "soft"        /* soft mount */
  490. X#define    MNTOPT_INTR    "intr"        /* interrupts allowed */
  491. X
  492. X#define NFSMNT_HOSTNAME    0        /* hostname on 4.4 is not optional */
  493. X
  494. Xstruct mntent {
  495. X    char    *mnt_fsname;    /* name of mounted file system */
  496. X    char    *mnt_dir;    /* file system path prefix */
  497. X    char    *mnt_type;    /* MNTTYPE_* */
  498. X    char    *mnt_opts;    /* MNTOPT* */
  499. X    int    mnt_freq;    /* dump frequency, in days */
  500. X    int    mnt_passno;    /* pass number on parallel fsck */
  501. X};
  502. X
  503. X/*
  504. X * Type of a file handle
  505. X */
  506. X#undef NFS_FH_TYPE
  507. X#define    NFS_FH_TYPE    nfsv2fh_t *
  508. X
  509. X/*
  510. X * How to get a mount list
  511. X */
  512. X#undef    READ_MTAB_FROM_FILE
  513. X#define    READ_MTAB_BSD_STYLE
  514. X
  515. X/*
  516. X * The data for the mount syscall needs the path in addition to the
  517. X * host name since that is the only source of information about the
  518. X * mounted filesystem.
  519. X */
  520. X#define    NFS_ARGS_NEEDS_PATH
  521. X
  522. X/*
  523. X * struct statfs is in <sys/mount.h>
  524. X */
  525. X#undef STATFS_HDR
  526. X
  527. X/*
  528. X * 4.4 has RE support built in
  529. X */
  530. X#undef RE_HDR
  531. X#define RE_HDR <regexp.h>
  532. END_OF_FILE
  533.   if test 5150 -ne `wc -c <'config/os-bsd44.h'`; then
  534.     echo shar: \"'config/os-bsd44.h'\" unpacked with wrong size!
  535.   fi
  536.   # end of 'config/os-bsd44.h'
  537. fi
  538. if test -f 'config/os-defaults.h' -a "${1}" != "-c" ; then 
  539.   echo shar: Will not clobber existing file \"'config/os-defaults.h'\"
  540. else
  541.   echo shar: Extracting \"'config/os-defaults.h'\" \(4166 characters\)
  542.   sed "s/^X//" >'config/os-defaults.h' <<'END_OF_FILE'
  543. X/*
  544. X * Copyright (c) 1989 Jan-Simon Pendry
  545. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  546. X * Copyright (c) 1989 The Regents of the University of California.
  547. X * All rights reserved.
  548. X *
  549. X * This code is derived from software contributed to Berkeley by
  550. X * Jan-Simon Pendry at Imperial College, London.
  551. X *
  552. X * Redistribution and use in source and binary forms, with or without
  553. X * modification, are permitted provided that the following conditions
  554. X * are met:
  555. X * 1. Redistributions of source code must retain the above copyright
  556. X *    notice, this list of conditions and the following disclaimer.
  557. X * 2. Redistributions in binary form must reproduce the above copyright
  558. X *    notice, this list of conditions and the following disclaimer in the
  559. X *    documentation and/or other materials provided with the distribution.
  560. X * 3. All advertising materials mentioning features or use of this software
  561. X *    must display the following acknowledgement:
  562. X *      This product includes software developed by the University of
  563. X *      California, Berkeley and its contributors.
  564. X * 4. Neither the name of the University nor the names of its contributors
  565. X *    may be used to endorse or promote products derived from this software
  566. X *    without specific prior written permission.
  567. X *
  568. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  569. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  570. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  571. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  572. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  573. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  574. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  575. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  576. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  577. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  578. X * SUCH DAMAGE.
  579. X *
  580. X *    %W% (Berkeley) %G%
  581. X *
  582. X * $Id: os-defaults.h,v 5.2.2.1 1992/02/09 15:10:17 jsp beta $
  583. X *
  584. X * Common OS definitions.  These may be overridden in
  585. X * the OS specific files ("os-foo.h").
  586. X */
  587. X
  588. X/*
  589. X * What level of AMD are we backward compatible with?
  590. X * This only applies to externally visible characteristics.
  591. X * Rev.Minor.Branch.Patch (2 digits each)
  592. X */
  593. X#define    AMD_COMPAT    5000000        /* 5.0 */
  594. X
  595. X/*
  596. X * What type is free(void*) returning?
  597. X */
  598. X#define FREE_RETURN_TYPE    void
  599. X
  600. X/*
  601. X * Is the mount table mirrored in software
  602. X */
  603. X#define    UPDATE_MTAB
  604. X
  605. X/*
  606. X * Where to get union wait
  607. X */
  608. X#define    WAIT    <sys/wait.h>
  609. X
  610. X/*
  611. X * Where to get mount entry info
  612. X */
  613. X#define    MNTENT_HDR    <mntent.h>
  614. X
  615. X/*
  616. X * struct statfs
  617. X */
  618. X#define STATFS_HDR <sys/vfs.h>
  619. X
  620. X/*
  621. X * Include support for syslog()
  622. X */
  623. X#define    HAS_SYSLOG
  624. X
  625. X/*
  626. X * Byte ordering
  627. X */
  628. X#define    ARCH_ENDIAN    "unknown"
  629. X
  630. X/*
  631. X * Name of filesystem types
  632. X */
  633. X#define    MTAB_TYPE_NFS    "nfs"
  634. X#define    MTAB_TYPE_UFS    "4.2"
  635. X
  636. X/*
  637. X * Name of mount & unmount system calls
  638. X *
  639. X * NOTE:
  640. X *  UNMOUNT_TRAP takes a struct mntent *
  641. X */
  642. X#define    MOUNT_TRAP(type, mnt, flags, mnt_data) \
  643. X    mount(type, mnt->mnt_dir, flags, mnt_data)
  644. X#define    UNMOUNT_TRAP(mnt)    unmount(mnt->mnt_dir)
  645. X
  646. X/*
  647. X * How to unmount filesystems.
  648. X * NEED_UMOUNT_FS includes code to scan the mount table
  649. X * to find the correct information for the unmount system
  650. X * call.  Some systems, such as 4.4bsd, do not require
  651. X * this - they can just do an unmount system call directly.
  652. X */
  653. X#define    NEED_UMOUNT_FS
  654. X#define    UMOUNT_FS(dir)    umount_fs(dir)
  655. X
  656. X/*
  657. X * Type of a file handle
  658. X */
  659. X#define    NFS_FH_TYPE    fhandle_t *
  660. X#define    NFS_FH_DREF(dst, src) { (dst) = (src); }
  661. X
  662. X/*
  663. X * How to copy an address into an NFS filehandle
  664. X */
  665. X#define    NFS_SA_DREF(dst, src) { (dst).addr = (src); }
  666. X
  667. X/*
  668. X * Type of filesystem type
  669. X */
  670. X#define    MTYPE_TYPE    int
  671. X
  672. X/*
  673. X * How to get a mount list
  674. X */
  675. X#define    READ_MTAB_FROM_FILE
  676. X
  677. X/*
  678. X * Make Amd automount points appear
  679. X * to be zero sized.  undef this
  680. X * if the O/S has a divide by zero
  681. X * problem in df et al.
  682. X */
  683. X#define    HAS_EMPTY_AUTOMOUNTS
  684. X
  685. X/*
  686. X * For the RE matcher
  687. X */
  688. X#define    CHARBITS 0377
  689. X#define STRCSPN
  690. X#define RE_HDR "re.h"
  691. END_OF_FILE
  692.   if test 4166 -ne `wc -c <'config/os-defaults.h'`; then
  693.     echo shar: \"'config/os-defaults.h'\" unpacked with wrong size!
  694.   fi
  695.   # end of 'config/os-defaults.h'
  696. fi
  697. if test -f 'config/os-hpux.h' -a "${1}" != "-c" ; then 
  698.   echo shar: Will not clobber existing file \"'config/os-hpux.h'\"
  699. else
  700.   echo shar: Extracting \"'config/os-hpux.h'\" \(4105 characters\)
  701.   sed "s/^X//" >'config/os-hpux.h' <<'END_OF_FILE'
  702. X/*
  703. X * Copyright (c) 1989 Jan-Simon Pendry
  704. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  705. X * Copyright (c) 1989 The Regents of the University of California.
  706. X * All rights reserved.
  707. X *
  708. X * This code is derived from software contributed to Berkeley by
  709. X * Jan-Simon Pendry at Imperial College, London.
  710. X *
  711. X * Redistribution and use in source and binary forms, with or without
  712. X * modification, are permitted provided that the following conditions
  713. X * are met:
  714. X * 1. Redistributions of source code must retain the above copyright
  715. X *    notice, this list of conditions and the following disclaimer.
  716. X * 2. Redistributions in binary form must reproduce the above copyright
  717. X *    notice, this list of conditions and the following disclaimer in the
  718. X *    documentation and/or other materials provided with the distribution.
  719. X * 3. All advertising materials mentioning features or use of this software
  720. X *    must display the following acknowledgement:
  721. X *      This product includes software developed by the University of
  722. X *      California, Berkeley and its contributors.
  723. X * 4. Neither the name of the University nor the names of its contributors
  724. X *    may be used to endorse or promote products derived from this software
  725. X *    without specific prior written permission.
  726. X *
  727. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  728. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  729. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  730. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  731. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  732. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  733. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  734. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  735. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  736. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  737. X * SUCH DAMAGE.
  738. X *
  739. X *    %W% (Berkeley) %G%
  740. X *
  741. X * $Id: os-hpux.h,v 5.2.2.1 1992/02/09 15:10:23 jsp beta $
  742. X *
  743. X * HP/9000 HP-UX definitions for Amd (automounter)
  744. X */
  745. X
  746. X/*
  747. X * Does the compiler grok void *
  748. X */
  749. X#ifdef __GNUC__
  750. X#define    VOIDP
  751. X#endif
  752. X
  753. X/*
  754. X * Which version of the Sun RPC library we are using
  755. X * This is the implementation release number, not
  756. X * the protocol revision number.
  757. X */
  758. X#define    RPC_3
  759. X
  760. X/*
  761. X * Which version of the NFS interface are we using.
  762. X * This is the implementation release number, not
  763. X * the protocol revision number.
  764. X */
  765. X#define    NFS_3
  766. X
  767. X/*
  768. X * Byte ordering
  769. X */
  770. X#undef ARCH_ENDIAN
  771. X#if defined(hp9000s200) || defined(hp9000s300) || defined(hp9000s800)
  772. X#define    ARCH_ENDIAN    "big"
  773. X#endif
  774. X
  775. X#ifndef __hpux
  776. X#define    HPUX_VERSION_6
  777. X#endif
  778. X
  779. X/*
  780. X * No support for syslog() prior to 7.0
  781. X */
  782. X#ifdef HPUX_VERSION_6
  783. X#undef HAS_SYSLOG
  784. X#endif
  785. X
  786. X/*
  787. X * No support for ndbm
  788. X */
  789. X#undef OS_HAS_NDBM
  790. X
  791. X/*
  792. X * Name of filesystem types
  793. X */
  794. X#define    MOUNT_TYPE_UFS    MOUNT_UFS
  795. X#define MOUNT_TYPE_NFS MOUNT_NFS
  796. X#undef MTAB_TYPE_UFS
  797. X#define    MTAB_TYPE_UFS    "hfs"
  798. X
  799. X/*
  800. X * Where to get NFS definitions
  801. X */
  802. X#define    NFS_HDR "misc-hpux.h"
  803. X
  804. X/*
  805. X * Where to get union wait
  806. X */
  807. X#undef WAIT
  808. X#define    WAIT    "uwait.h"
  809. X#ifdef HPUX_VERSION_6
  810. X#define SIGCHLD    SIGCLD
  811. X#endif
  812. X#define    SYS5_SIGNALS
  813. X
  814. X/*
  815. X * Miscellaneous HP-UX definitions
  816. X */
  817. X
  818. X#define NEED_XDR_POINTER
  819. X#define    NEED_CLNT_SPERRNO
  820. X
  821. X/*
  822. X * Use <fcntl.h> rather than <sys/file.h>
  823. X */
  824. X#define USE_FCNTL
  825. X
  826. X/*
  827. X * Use fcntl() rather than flock()
  828. X */
  829. X#define LOCK_FCNTL
  830. X
  831. X/*
  832. X * Additional fields in struct mntent
  833. X * are fixed up here
  834. X */
  835. X#define FIXUP_MNTENT(mntp) { \
  836. X    (mntp)->mnt_time = time(NULL); \
  837. X}
  838. X#define FIXUP_MNTENT_DUP(mntp, mp) { \
  839. X    (mntp)->mnt_time = (mp)->mnt_time; \
  840. X}
  841. X
  842. X#define    bzero(ptr, len)    memset(ptr, 0, len)
  843. X#define bcopy(from, to, len) memcpy(to, from, len)
  844. X#define getpagesize() (2048)
  845. X#undef MOUNT_TRAP
  846. X#define MOUNT_TRAP(type, mnt, flags, mnt_data) \
  847. X    vfsmount(type, mnt->mnt_dir, flags, mnt_data)
  848. X#undef UNMOUNT_TRAP
  849. X#define    UNMOUNT_TRAP(mnt)    umount(mnt->mnt_dir)
  850. X#define NFDS    30    /* conservative */
  851. X#define    MOUNTED MNT_MNTTAB
  852. END_OF_FILE
  853.   if test 4105 -ne `wc -c <'config/os-hpux.h'`; then
  854.     echo shar: \"'config/os-hpux.h'\" unpacked with wrong size!
  855.   fi
  856.   # end of 'config/os-hpux.h'
  857. fi
  858. if test -f 'config/os-irix4.h' -a "${1}" != "-c" ; then 
  859.   echo shar: Will not clobber existing file \"'config/os-irix4.h'\"
  860. else
  861.   echo shar: Extracting \"'config/os-irix4.h'\" \(4523 characters\)
  862.   sed "s/^X//" >'config/os-irix4.h' <<'END_OF_FILE'
  863. X/*
  864. X * Copyright (c) 1990 Jan-Simon Pendry
  865. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  866. X * Copyright (c) 1990 The Regents of the University of California.
  867. X * All rights reserved.
  868. X *
  869. X * This code is derived from software contributed to Berkeley by
  870. X * Jan-Simon Pendry at Imperial College, London.
  871. X *
  872. X * Redistribution and use in source and binary forms, with or without
  873. X * modification, are permitted provided that the following conditions
  874. X * are met:
  875. X * 1. Redistributions of source code must retain the above copyright
  876. X *    notice, this list of conditions and the following disclaimer.
  877. X * 2. Redistributions in binary form must reproduce the above copyright
  878. X *    notice, this list of conditions and the following disclaimer in the
  879. X *    documentation and/or other materials provided with the distribution.
  880. X * 3. All advertising materials mentioning features or use of this software
  881. X *    must display the following acknowledgement:
  882. X *      This product includes software developed by the University of
  883. X *      California, Berkeley and its contributors.
  884. X * 4. Neither the name of the University nor the names of its contributors
  885. X *    may be used to endorse or promote products derived from this software
  886. X *    without specific prior written permission.
  887. X *
  888. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  889. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  890. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  891. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  892. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  893. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  894. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  895. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  896. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  897. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  898. X * SUCH DAMAGE.
  899. X *
  900. X *    %W% (Berkeley) %G%
  901. X *
  902. X * $Id: os-irix4.h,v 5.2 1992/05/31 16:40:22 jsp Exp $
  903. X *
  904. X * IRIX 4.0.X definitions for Amd (automounter)
  905. X * Contributed by Scott R. Presnell <srp@cgl.ucsf.edu>
  906. X */
  907. X
  908. X/*
  909. X * Does the compiler grok void *
  910. X */
  911. X#define VOIDP
  912. X
  913. X/*
  914. X * Which version of the Sun RPC library we are using
  915. X * This is the implementation release number, not
  916. X * the protocol revision number.
  917. X */
  918. X#define RPC_3
  919. X
  920. X/*
  921. X * Which version of the NFS interface are we using.
  922. X * This is the implementation release number, not
  923. X * the protocol revision number.
  924. X */
  925. X#define NFS_3
  926. X
  927. X/*
  928. X * Byte ordering
  929. X */
  930. X#undef ARCH_ENDIAN
  931. X#define ARCH_ENDIAN    "big"
  932. X
  933. X/*
  934. X * Has support for syslog()
  935. X */
  936. X#define HAS_SYSLOG
  937. X
  938. X#define M_RDONLY    MS_RDONLY
  939. X#define M_GRPID        MS_GRPID
  940. X#define M_NOSUID    MS_NOSUID
  941. X#define M_NONDEV    MS_NODEV
  942. X
  943. X/*
  944. X * Support for ndbm
  945. X */
  946. X#define OS_HAS_NDBM
  947. X
  948. X#define UPDATE_MTAB
  949. X
  950. X#undef    MTAB_TYPE_NFS
  951. X#define MTAB_TYPE_NFS    "nfs"
  952. X
  953. X#undef    MTAB_TYPE_UFS
  954. X#define MTAB_TYPE_UFS    "efs"
  955. X
  956. X#define NMOUNT    40    /* The std sun value */
  957. X/*
  958. X * Name of filesystem types
  959. X */
  960. X#define MOUNT_TYPE_UFS    sysfs(GETFSIND, FSID_EFS)
  961. X#define MOUNT_TYPE_NFS    sysfs(GETFSIND, FSID_NFS)
  962. X
  963. X#define SYS5_SIGNALS
  964. X
  965. X/*
  966. X * Use <fcntl.h> rather than <sys/file.h>
  967. X */
  968. X/*#define USE_FCNTL*/
  969. X
  970. X/*
  971. X * struct statfs
  972. X */
  973. X#undef STATFS_HDR
  974. X#define STATFS_HDR <sys/statfs.h>
  975. X
  976. X/*
  977. X * Use fcntl() rather than flock()
  978. X */
  979. X/*#define LOCK_FCNTL*/
  980. X
  981. X#ifdef __GNUC__
  982. X#define alloca(sz) __builtin_alloca(sz)
  983. X#endif
  984. X
  985. X#define bzero(ptr, len) memset(ptr, 0, len)
  986. X#define bcopy(from, to, len) memcpy(to, from, len)
  987. X
  988. X#undef MOUNT_TRAP
  989. X#define MOUNT_TRAP(type, mnt, flags, mnt_data) \
  990. X    irix_mount(mnt->mnt_fsname, mnt->mnt_dir,flags, type, mnt_data)
  991. X#undef UNMOUNT_TRAP
  992. X#define UNMOUNT_TRAP(mnt)    umount(mnt->mnt_dir)
  993. X#define NFDS    30    /* conservative */
  994. X
  995. X#define NFS_HDR "misc-irix.h"
  996. X#define UFS_HDR "misc-irix.h"
  997. X
  998. X/* not included in sys/param.h */
  999. X#include <sys/types.h>
  1000. X
  1001. X#define MOUNT_HELPER_SOURCE "mount_irix.c"
  1002. X
  1003. X/*
  1004. X * Under 4.0.X this information is in /usr/include/mntent.h
  1005. X * Below is what is used to be for Irix 3.3.X.
  1006. X */
  1007. X/*#define    MNTINFO_DEV    "fsid"*/
  1008. X/*#define    MNTINFO_PREF    "0x"*/
  1009. X
  1010. X#define    MNTINFO_PREF    ""
  1011. X
  1012. X/*
  1013. X * Under Irix, mount type "auto" is probed by statfs() in df.  A statfs() of
  1014. X * a direct mount causes that mount to fire.  So change the  mount type in
  1015. X * /etc/mtab to "ignore" to stop that (this is what SGI does for their 
  1016. X * automounter.  Use the old FASCIST define for this.
  1017. X */
  1018. X#define FASCIST_DF_COMMAND MNTTYPE_IGNORE
  1019. END_OF_FILE
  1020.   if test 4523 -ne `wc -c <'config/os-irix4.h'`; then
  1021.     echo shar: \"'config/os-irix4.h'\" unpacked with wrong size!
  1022.   fi
  1023.   # end of 'config/os-irix4.h'
  1024. fi
  1025. if test -f 'config/os-type.sh' -a "${1}" != "-c" ; then 
  1026.   echo shar: Will not clobber existing file \"'config/os-type.sh'\"
  1027. else
  1028.   echo shar: Extracting \"'config/os-type.sh'\" \(4660 characters\)
  1029.   sed "s/^X//" >'config/os-type.sh' <<'END_OF_FILE'
  1030. X#!/bin/sh
  1031. X#
  1032. X# Copyright (c) 1989 Jan-Simon Pendry
  1033. X# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1034. X# Copyright (c) 1989 The Regents of the University of California.
  1035. X# All rights reserved.
  1036. X#
  1037. X# This code is derived from software contributed to Berkeley by
  1038. X# Jan-Simon Pendry at Imperial College, London.
  1039. X#
  1040. X# Redistribution and use in source and binary forms, with or without
  1041. X# modification, are permitted provided that the following conditions
  1042. X# are met:
  1043. X# 1. Redistributions of source code must retain the above copyright
  1044. X#    notice, this list of conditions and the following disclaimer.
  1045. X# 2. Redistributions in binary form must reproduce the above copyright
  1046. X#    notice, this list of conditions and the following disclaimer in the
  1047. X#    documentation and/or other materials provided with the distribution.
  1048. X# 3. All advertising materials mentioning features or use of this software
  1049. X#    must display the following acknowledgement:
  1050. X#      This product includes software developed by the University of
  1051. X#      California, Berkeley and its contributors.
  1052. X# 4. Neither the name of the University nor the names of its contributors
  1053. X#    may be used to endorse or promote products derived from this software
  1054. X#    without specific prior written permission.
  1055. X#
  1056. X# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1057. X# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1058. X# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1059. X# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1060. X# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1061. X# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1062. X# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1063. X# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1064. X# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1065. X# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1066. X# SUCH DAMAGE.
  1067. X#
  1068. X#    %W% (Berkeley) %G%
  1069. X#
  1070. X# $Id: os-type,v 5.2.2.2 1992/05/31 16:45:46 jsp Exp $
  1071. X#
  1072. X
  1073. X#
  1074. X# Take a pot-shot at your os type
  1075. X#
  1076. Xecho "#    ... No OS= option specified; dynamically determining OS type" >&2
  1077. X
  1078. X#
  1079. X# First try poking around in /etc/motd
  1080. X#
  1081. X
  1082. Xcase "`exec 2>/dev/null; head -2 /etc/motd`" in
  1083. X*"Sun UNIX 4.2 Release 3."*)    OS=sos3;;
  1084. X*"SunOS Release 4."*)        OS=sos4;;
  1085. X*"HP-UX on the HP"*)        OS=hpux;;
  1086. X*"Ultrix V2."*)            OS=u2_2;;
  1087. X*"Ultrix V3."*)            OS=u3_0;;
  1088. X*"Ultrix-32 V3."*)        OS=u3_0;;
  1089. X*"Ultrix Worksystem V2."*)    OS=u3_0;;
  1090. X*"ULTRIX V4.3"*)        OS=u4_2;;
  1091. X*"ULTRIX V4.2"*)        OS=u4_2;;
  1092. X*"ULTRIX V4."*)            OS=u4_0;;
  1093. X*"DEC OSF/1"*)            OS=osf1;;
  1094. X*"HLH OTS Version 1."*)        OS=hlh42;;
  1095. X*"RISC iX release 1."*)        OS=riscix;;
  1096. X*"FPX 4."*)            OS=fpx4;;
  1097. X*"HCX/UX"*)            OS=hcx;;
  1098. X*"4.4 BSD UNIX"*)        OS=bsd44;;
  1099. X*"4.3 BSD Reno UNIX"*)        OS=bsd44;;
  1100. X*"4.3 BSD UNIX"*)        if [ -f /etc/minidisk ]; then
  1101. X                    OS=acis43
  1102. X                elif [ -f /sbin/nfsiod ]; then
  1103. X                    OS=bsd44    # prototype
  1104. X                else
  1105. X                    OS=xinu43
  1106. X                fi;;
  1107. X*"Alliant Concentrix"*)        OS=concentrix;;
  1108. X*"Umax 4.3"*)            OS=umax43;;
  1109. X*"BSDI BSD/386"*)        OS=bsd386;;
  1110. X*"NEWS-OS Release 4"*)        OS=newsos4;;
  1111. X*"SEIUX"*)            OS=riscos4;;
  1112. X*"UNIOS-B"*)            OS=uniosb;;
  1113. X*"LUNA-88K Mach 2.5"*)        OS=luna88k;;
  1114. X*"LUNA-II Mach 2.5"*)        OS=luna2M;;
  1115. X*)
  1116. X#
  1117. X# Well, that didn't work so apply some heuristics
  1118. X# to the filesystem name space...
  1119. X#
  1120. X                echo "#    ... inspecting File system ..." >&2
  1121. X                if [ -f /bsd43 ]; then
  1122. X                    OS=riscos4
  1123. X                elif [ -f /etc/comply ]; then
  1124. X                    OS=utek
  1125. X                elif [ -d /usr/lib/methods -o -d /etc/methods ]; then
  1126. X                    OS=aix3
  1127. X                elif [ -f /osf_boot ]; then
  1128. X                    OS=osf1
  1129. X                elif [ -f /usr/bin/cat ]; then
  1130. X                    OS=sos4
  1131. X                elif [ -f /etc/nd ]; then
  1132. X                    OS=sos3
  1133. X                elif [ -f /etc/elcsd ]; then
  1134. X                    echo "#    ... Ultrix - assuming U4.3 ..." >&2
  1135. X                    OS=u4_2
  1136. X                elif [ -f /hp-ux ]; then
  1137. X                    OS=hpux
  1138. X                elif [ -f /etc/ttylocal ]; then
  1139. X                    OS=xinu43
  1140. X                elif [ -f /etc/minidisk ]; then
  1141. X                    OS=acis43
  1142. X                elif [ -f /etc/toolboxdaemon ]; then
  1143. X                    OS=aux
  1144. X                elif [ -f /usr/bin/rundos ]; then
  1145. X                    OS=bsd386
  1146. X                elif [ -f /sbin/nfsiod ]; then
  1147. X                    OS=bsd44
  1148. X                elif [ -d /vrm ]; then
  1149. X                    OS=aix2
  1150. X                elif [ -f /bin/pyr ] && /bin/pyr; then
  1151. X                    OS=pyrOSx
  1152. X                elif [ -d /NextApps ]; then
  1153. X                    OS=next
  1154. X                elif [ -f /etc/gl/ucode ]; then
  1155. X                    OS=irix3
  1156. X                elif [ -d /usr/gfx/ucode ]; then
  1157. X                    OS=irix4
  1158. X                elif [ -f /stellix ]; then
  1159. X                    OS=stellix
  1160. X                elif [ -f /usr/sony ]; then
  1161. X                    OS=newsos4
  1162. X                else
  1163. X                    case "`(sh ../config/arch.sh)2>/dev/null`" in
  1164. X                    ibm032)    OS=acis43;;
  1165. X                    aviion)    OS=dgux;;
  1166. X                    *)       OS=unknown;;
  1167. X                    esac
  1168. X                fi;;
  1169. Xesac
  1170. X
  1171. Xecho "#    ... OS appears to be \"${OS}\"" >&2
  1172. Xecho "${OS}"
  1173. Xexit 0
  1174. END_OF_FILE
  1175.   if test 4660 -ne `wc -c <'config/os-type.sh'`; then
  1176.     echo shar: \"'config/os-type.sh'\" unpacked with wrong size!
  1177.   fi
  1178.   chmod +x 'config/os-type.sh'
  1179.   # end of 'config/os-type.sh'
  1180. fi
  1181. if test -f 'config/os-u2_2.h' -a "${1}" != "-c" ; then 
  1182.   echo shar: Will not clobber existing file \"'config/os-u2_2.h'\"
  1183. else
  1184.   echo shar: Extracting \"'config/os-u2_2.h'\" \(4666 characters\)
  1185.   sed "s/^X//" >'config/os-u2_2.h' <<'END_OF_FILE'
  1186. X/*
  1187. X * Copyright (c) 1990 Jan-Simon Pendry
  1188. X * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  1189. X * Copyright (c) 1990 The Regents of the University of California.
  1190. X * All rights reserved.
  1191. X *
  1192. X * This code is derived from software contributed to Berkeley by
  1193. X * Jan-Simon Pendry at Imperial College, London.
  1194. X *
  1195. X * Redistribution and use in source and binary forms, with or without
  1196. X * modification, are permitted provided that the following conditions
  1197. X * are met:
  1198. X * 1. Redistributions of source code must retain the above copyright
  1199. X *    notice, this list of conditions and the following disclaimer.
  1200. X * 2. Redistributions in binary form must reproduce the above copyright
  1201. X *    notice, this list of conditions and the following disclaimer in the
  1202. X *    documentation and/or other materials provided with the distribution.
  1203. X * 3. All advertising materials mentioning features or use of this software
  1204. X *    must display the following acknowledgement:
  1205. X *      This product includes software developed by the University of
  1206. X *      California, Berkeley and its contributors.
  1207. X * 4. Neither the name of the University nor the names of its contributors
  1208. X *    may be used to endorse or promote products derived from this software
  1209. X *    without specific prior written permission.
  1210. X *
  1211. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1212. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1213. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1214. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1215. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1216. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1217. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1218. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1219. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1220. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1221. X * SUCH DAMAGE.
  1222. X *
  1223. X *    %W% (Berkeley) %G%
  1224. X *
  1225. X * $Id: os-u2_2.h,v 5.2.2.1 1992/02/09 15:10:48 jsp beta $
  1226. X *
  1227. X * Ultrix 2.2 definitions for Amd (automounter)
  1228. X */
  1229. X
  1230. X/*
  1231. X * Does the compiler grok void *
  1232. X */
  1233. X#undef    VOIDP
  1234. X
  1235. X/*
  1236. X * Which version of the Sun RPC library we are using
  1237. X * This is the implementation release number, not
  1238. X * the protocol revision number.
  1239. X */
  1240. X#define    RPC_3
  1241. X
  1242. X/*
  1243. X * Which version of the NFS interface are we using.
  1244. X * This is the implementation release number, not
  1245. X * the protocol revision number.
  1246. X */
  1247. X#define    NFS_3
  1248. X
  1249. X/*
  1250. X * Byte ordering
  1251. X */
  1252. X#undef    ARCH_ENDIAN
  1253. X#if defined(vax)
  1254. X#define    ARCH_ENDIAN "little"
  1255. X#endif
  1256. X
  1257. X/*
  1258. X * The mount table is obtained from the kernel
  1259. X */
  1260. X#undef    UPDATE_MTAB
  1261. X
  1262. X/*
  1263. X * No mntent info on Ultrix
  1264. X  */
  1265. X#undef    MNTENT_HDR
  1266. X
  1267. X/*
  1268. X * No support for syslog()
  1269. X */
  1270. X#undef    HAS_SYSLOG
  1271. X
  1272. X/*
  1273. X * No support for ndbm
  1274. X */
  1275. X#undef    HAS_NDBM_MAPS
  1276. X
  1277. X/*
  1278. X * Name of filesystem types
  1279. X */
  1280. X#define    MOUNT_TYPE_NFS    GT_NFS
  1281. X#define    MOUNT_TYPE_UFS    GT_ULTRIX
  1282. X#undef    MTAB_TYPE_UFS
  1283. X#define    MTAB_TYPE_UFS    "ufs"
  1284. X
  1285. X/*
  1286. X * Name of mount & unmount system calls
  1287. X */
  1288. X#undef    MOUNT_TRAP
  1289. X#define    MOUNT_TRAP(type, mnt, flag, mnt_data) \
  1290. X    mount(mnt->mnt_fsname, mnt->mnt_dir, flag, type, mnt_data)
  1291. X#undef    UNMOUNT_TRAP
  1292. X#define    UNMOUNT_TRAP(mnt)    umount(mnt->mnt_passno)
  1293. X
  1294. X/*
  1295. X * Miscellaneous Ultrix bits
  1296. X */
  1297. X#define    M_RDONLY    M_RONLY
  1298. X
  1299. X#ifndef MNTMAXSTR
  1300. X#define    MNTMAXSTR       128
  1301. X#endif
  1302. X
  1303. X#define    MNTTYPE_UFS    "ufs"        /* Un*x file system */
  1304. X#define    MNTTYPE_NFS    "nfs"        /* network file system */
  1305. X#define    MNTTYPE_IGNORE    "ignore"    /* No type specified, ignore this entry */
  1306. X
  1307. X#define    MNTOPT_RO    "ro"        /* read only */
  1308. X#define    MNTOPT_RW    "rw"        /* read/write */
  1309. X#define    MNTOPT_QUOTA    "quota"        /* quotas */
  1310. X#define    MNTOPT_NOQUOTA    "noquota"    /* no quotas */
  1311. X#define    MNTOPT_HARD    "hard"        /* hard mount */
  1312. X#define    MNTOPT_SOFT    "soft"        /* soft mount */
  1313. X#define    MNTOPT_INTR    "intr"        /* interrupts allowed */
  1314. X
  1315. X#define    MNTOPT_NOSUID    "nosuid"    /* no set uid allowed */
  1316. X
  1317. Xstruct mntent {
  1318. X    char    *mnt_fsname;    /* name of mounted file system */
  1319. X    char    *mnt_dir;    /* file system path prefix */
  1320. X    char    *mnt_type;    /* MNTTYPE_* */
  1321. X    char    *mnt_opts;    /* MNTOPT* */
  1322. X    int    mnt_freq;    /* dump frequency, in days */
  1323. X    int    mnt_passno;    /* pass number on parallel fsck */
  1324. X};
  1325. X#define    MOUNTED        "/etc/mtab"
  1326. X
  1327. X#define    NFS_HDR    "misc-ultrix.h"
  1328. X#define    UFS_HDR    "misc-ultrix.h"
  1329. X
  1330. X#define NEED_XDR_POINTER
  1331. X#define    NEED_CLNT_SPERRNO
  1332. X
  1333. X#define    nfs_args    nfs_gfs_mount
  1334. X#define    ULTRIX_HACK    /* Should be handled better than this !! */
  1335. X#define    NEED_MNTOPT_PARSER
  1336. X
  1337. X/*
  1338. X * How to get a mount list
  1339. X */
  1340. X#undef    READ_MTAB_FROM_FILE
  1341. X#define    READ_MTAB_ULTRIX_STYLE
  1342. X
  1343. X/*
  1344. X * Need precise length links
  1345. X */
  1346. X#define    PRECISE_SYMLINKS
  1347. END_OF_FILE
  1348.   if test 4666 -ne `wc -c <'config/os-u2_2.h'`; then
  1349.     echo shar: \"'config/os-u2_2.h'\" unpacked with wrong size!
  1350.   fi
  1351.   # end of 'config/os-u2_2.h'
  1352. fi
  1353. if test -f 'config/os-u3_0.h' -a "${1}" != "-c" ; then 
  1354.   echo shar: Will not clobber existing file \"'config/os-u3_0.h'\"
  1355. else
  1356.   echo shar: Extracting \"'config/os-u3_0.h'\" \(4600 characters\)
  1357.   sed "s/^X//" >'config/os-u3_0.h' <<'END_OF_FILE'
  1358. X/*
  1359. X * Copyright (c) 1989 Jan-Simon Pendry
  1360. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1361. X * Copyright (c) 1989 The Regents of the University of California.
  1362. X * All rights reserved.
  1363. X *
  1364. X * This code is derived from software contributed to Berkeley by
  1365. X * Jan-Simon Pendry at Imperial College, London.
  1366. X *
  1367. X * Redistribution and use in source and binary forms, with or without
  1368. X * modification, are permitted provided that the following conditions
  1369. X * are met:
  1370. X * 1. Redistributions of source code must retain the above copyright
  1371. X *    notice, this list of conditions and the following disclaimer.
  1372. X * 2. Redistributions in binary form must reproduce the above copyright
  1373. X *    notice, this list of conditions and the following disclaimer in the
  1374. X *    documentation and/or other materials provided with the distribution.
  1375. X * 3. All advertising materials mentioning features or use of this software
  1376. X *    must display the following acknowledgement:
  1377. X *      This product includes software developed by the University of
  1378. X *      California, Berkeley and its contributors.
  1379. X * 4. Neither the name of the University nor the names of its contributors
  1380. X *    may be used to endorse or promote products derived from this software
  1381. X *    without specific prior written permission.
  1382. X *
  1383. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1384. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1385. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1386. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1387. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1388. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1389. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1390. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1391. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1392. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1393. X * SUCH DAMAGE.
  1394. X *
  1395. X *    %W% (Berkeley) %G%
  1396. X *
  1397. X * $Id: os-u3_0.h,v 5.2.2.1 1992/02/09 15:10:52 jsp beta $
  1398. X *
  1399. X * Ultrix 3.0 definitions for Amd (automounter)
  1400. X */
  1401. X
  1402. X/*
  1403. X * Does the compiler grok void *
  1404. X */
  1405. X#undef    VOIDP
  1406. X
  1407. X/*
  1408. X * Which version of the Sun RPC library we are using
  1409. X * This is the implementation release number, not
  1410. X * the protocol revision number.
  1411. X */
  1412. X#define    RPC_3
  1413. X
  1414. X/*
  1415. X * Which version of the NFS interface are we using.
  1416. X * This is the implementation release number, not
  1417. X * the protocol revision number.
  1418. X */
  1419. X#define    NFS_3
  1420. X
  1421. X/*
  1422. X * Byte ordering
  1423. X */
  1424. X#undef ARCH_ENDIAN
  1425. X#if defined(vax) || defined(mips)
  1426. X#define    ARCH_ENDIAN "little"
  1427. X#endif
  1428. X
  1429. X/*
  1430. X * The mount table is obtained from the kernel
  1431. X */
  1432. X#undef    UPDATE_MTAB
  1433. X
  1434. X/*
  1435. X * No mntent info on Ultrix
  1436. X  */
  1437. X#undef    MNTENT_HDR
  1438. X
  1439. X/*
  1440. X * No support for syslog()
  1441. X */
  1442. X#undef    HAS_SYSLOG
  1443. X
  1444. X/*
  1445. X * Name of filesystem types
  1446. X */
  1447. X#define    MOUNT_TYPE_NFS    GT_NFS
  1448. X#define    MOUNT_TYPE_UFS    GT_ULTRIX
  1449. X#undef    MTAB_TYPE_UFS
  1450. X#define    MTAB_TYPE_UFS    "ufs"
  1451. X
  1452. X/*
  1453. X * Name of mount & unmount system calls
  1454. X */
  1455. X#undef    MOUNT_TRAP
  1456. X#define    MOUNT_TRAP(type, mnt, flag, mnt_data) \
  1457. X    mount(mnt->mnt_fsname, mnt->mnt_dir, flag, type, mnt_data)
  1458. X#undef    UNMOUNT_TRAP
  1459. X#define    UNMOUNT_TRAP(mnt)    umount(mnt->mnt_passno)
  1460. X
  1461. X/*
  1462. X * Miscellaneous Ultrix bits
  1463. X */
  1464. X#define    M_RDONLY    M_RONLY
  1465. X
  1466. X#define    MNTMAXSTR    128
  1467. X
  1468. X#define    MNTTYPE_UFS    "ufs"        /* Un*x file system */
  1469. X#define    MNTTYPE_NFS    "nfs"        /* network file system */
  1470. X#define    MNTTYPE_IGNORE    "ignore"    /* No type specified, ignore this entry */
  1471. X
  1472. X#define    MNTOPT_RO    "ro"        /* read only */
  1473. X#define    MNTOPT_RW    "rw"        /* read/write */
  1474. X#define    MNTOPT_QUOTA    "quota"        /* quotas */
  1475. X#define    MNTOPT_NOQUOTA    "noquota"    /* no quotas */
  1476. X#define    MNTOPT_HARD    "hard"        /* hard mount */
  1477. X#define    MNTOPT_SOFT    "soft"        /* soft mount */
  1478. X#define    MNTOPT_INTR    "intr"        /* interrupts allowed */
  1479. X
  1480. X#define    MNTOPT_NOSUID    "nosuid"    /* no set uid allowed */
  1481. X
  1482. Xstruct mntent {
  1483. X    char    *mnt_fsname;    /* name of mounted file system */
  1484. X    char    *mnt_dir;    /* file system path prefix */
  1485. X    char    *mnt_type;    /* MNTTYPE_* */
  1486. X    char    *mnt_opts;    /* MNTOPT* */
  1487. X    int    mnt_freq;    /* dump frequency, in days */
  1488. X    int    mnt_passno;    /* pass number on parallel fsck */
  1489. X};
  1490. X#define    MOUNTED        "/etc/mtab"
  1491. X
  1492. X#define    NFS_HDR    "misc-ultrix.h"
  1493. X#define    UFS_HDR    "misc-ultrix.h"
  1494. X
  1495. X#define NEED_XDR_POINTER
  1496. X#define    NEED_CLNT_SPERRNO
  1497. X
  1498. X#define    nfs_args    nfs_gfs_mount
  1499. X#define    ULTRIX_HACK    /* Should be handled better than this !! */
  1500. X#define    NEED_MNTOPT_PARSER
  1501. X
  1502. X/*
  1503. X * How to get a mount list
  1504. X */
  1505. X#undef    READ_MTAB_FROM_FILE
  1506. X#define    READ_MTAB_ULTRIX_STYLE
  1507. X
  1508. X/*
  1509. X * Need precise length links
  1510. X */
  1511. X#define    PRECISE_SYMLINKS
  1512. END_OF_FILE
  1513.   if test 4600 -ne `wc -c <'config/os-u3_0.h'`; then
  1514.     echo shar: \"'config/os-u3_0.h'\" unpacked with wrong size!
  1515.   fi
  1516.   # end of 'config/os-u3_0.h'
  1517. fi
  1518. if test -f 'config/os-u4_0.h' -a "${1}" != "-c" ; then 
  1519.   echo shar: Will not clobber existing file \"'config/os-u4_0.h'\"
  1520. else
  1521.   echo shar: Extracting \"'config/os-u4_0.h'\" \(4660 characters\)
  1522.   sed "s/^X//" >'config/os-u4_0.h' <<'END_OF_FILE'
  1523. X/*
  1524. X * Copyright (c) 1989 Jan-Simon Pendry
  1525. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1526. X * Copyright (c) 1989 The Regents of the University of California.
  1527. X * All rights reserved.
  1528. X *
  1529. X * This code is derived from software contributed to Berkeley by
  1530. X * Jan-Simon Pendry at Imperial College, London.
  1531. X *
  1532. X * Redistribution and use in source and binary forms, with or without
  1533. X * modification, are permitted provided that the following conditions
  1534. X * are met:
  1535. X * 1. Redistributions of source code must retain the above copyright
  1536. X *    notice, this list of conditions and the following disclaimer.
  1537. X * 2. Redistributions in binary form must reproduce the above copyright
  1538. X *    notice, this list of conditions and the following disclaimer in the
  1539. X *    documentation and/or other materials provided with the distribution.
  1540. X * 3. All advertising materials mentioning features or use of this software
  1541. X *    must display the following acknowledgement:
  1542. X *      This product includes software developed by the University of
  1543. X *      California, Berkeley and its contributors.
  1544. X * 4. Neither the name of the University nor the names of its contributors
  1545. X *    may be used to endorse or promote products derived from this software
  1546. X *    without specific prior written permission.
  1547. X *
  1548. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1549. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1550. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1551. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1552. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1553. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1554. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1555. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1556. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1557. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1558. X * SUCH DAMAGE.
  1559. X *
  1560. X *    %W% (Berkeley) %G%
  1561. X *
  1562. X * $Id: os-u4_0.h,v 5.2.2.1 1992/02/09 15:10:53 jsp beta $
  1563. X *
  1564. X * Ultrix 4.0 definitions for Amd (automounter)
  1565. X *        from Chris Lindblad <cjl@ai.mit.edu>
  1566. X */
  1567. X
  1568. X/*
  1569. X * Does the compiler grok void *
  1570. X */
  1571. X#ifdef __STDC__
  1572. X#define VOIDP
  1573. X#else
  1574. X#undef VOIDP
  1575. X#endif
  1576. X
  1577. X/*
  1578. X * Which version of the Sun RPC library we are using
  1579. X * This is the implementation release number, not
  1580. X * the protocol revision number.
  1581. X */
  1582. X#define    RPC_3
  1583. X
  1584. X/*
  1585. X * Which version of the NFS interface are we using.
  1586. X * This is the implementation release number, not
  1587. X * the protocol revision number.
  1588. X */
  1589. X#define    NFS_3
  1590. X
  1591. X/*
  1592. X * Byte ordering
  1593. X */
  1594. X#undef ARCH_ENDIAN
  1595. X#if defined(vax) || defined(mips)
  1596. X#define    ARCH_ENDIAN "little"
  1597. X#endif
  1598. X
  1599. X/*
  1600. X * The mount table is obtained from the kernel
  1601. X */
  1602. X#undef    UPDATE_MTAB
  1603. X
  1604. X/*
  1605. X * No mntent info on Ultrix
  1606. X  */
  1607. X#undef    MNTENT_HDR
  1608. X
  1609. X/*
  1610. X * No support for syslog()
  1611. X */
  1612. X#define    HAS_SYSLOG
  1613. X
  1614. X/*
  1615. X * Name of filesystem types
  1616. X */
  1617. X#define    MOUNT_TYPE_NFS    GT_NFS
  1618. X#define    MOUNT_TYPE_UFS    GT_ULTRIX
  1619. X#undef    MTAB_TYPE_UFS
  1620. X#define    MTAB_TYPE_UFS    "ufs"
  1621. X
  1622. X/*
  1623. X * Name of mount & unmount system calls
  1624. X */
  1625. X#undef    MOUNT_TRAP
  1626. X#define    MOUNT_TRAP(type, mnt, flag, mnt_data) \
  1627. X    mount(mnt->mnt_fsname, mnt->mnt_dir, flag, type, mnt_data)
  1628. X#undef    UNMOUNT_TRAP
  1629. X#define    UNMOUNT_TRAP(mnt)    umount(mnt->mnt_passno)
  1630. X
  1631. X/*
  1632. X * Miscellaneous Ultrix bits
  1633. X */
  1634. X#define    M_RDONLY    M_RONLY
  1635. X
  1636. X#define    MNTMAXSTR    128
  1637. X
  1638. X#define    MNTTYPE_UFS    "ufs"        /* Un*x file system */
  1639. X#define    MNTTYPE_NFS    "nfs"        /* network file system */
  1640. X#define    MNTTYPE_IGNORE    "ignore"    /* No type specified, ignore this entry */
  1641. X
  1642. X#define    MNTOPT_RO    "ro"        /* read only */
  1643. X#define    MNTOPT_RW    "rw"        /* read/write */
  1644. X#define    MNTOPT_QUOTA    "quota"        /* quotas */
  1645. X#define    MNTOPT_NOQUOTA    "noquota"    /* no quotas */
  1646. X#define    MNTOPT_HARD    "hard"        /* hard mount */
  1647. X#define    MNTOPT_SOFT    "soft"        /* soft mount */
  1648. X#define    MNTOPT_INTR    "intr"        /* interrupts allowed */
  1649. X
  1650. X#define    MNTOPT_NOSUID    "nosuid"    /* no set uid allowed */
  1651. X
  1652. Xstruct mntent {
  1653. X    char    *mnt_fsname;    /* name of mounted file system */
  1654. X    char    *mnt_dir;    /* file system path prefix */
  1655. X    char    *mnt_type;    /* MNTTYPE_* */
  1656. X    char    *mnt_opts;    /* MNTOPT* */
  1657. X    int    mnt_freq;    /* dump frequency, in days */
  1658. X    int    mnt_passno;    /* pass number on parallel fsck */
  1659. X};
  1660. X#define    MOUNTED        "/etc/mtab"
  1661. X
  1662. X#define    NFS_HDR    "misc-ultrix.h"
  1663. X#define    UFS_HDR    "misc-ultrix.h"
  1664. X
  1665. X#define    NEED_CLNT_SPERRNO
  1666. X
  1667. X#define    nfs_args    nfs_gfs_mount
  1668. X#define    ULTRIX_HACK    /* Should be handled better than this !! */
  1669. X#define    NEED_MNTOPT_PARSER
  1670. X
  1671. X/*
  1672. X * How to get a mount list
  1673. X */
  1674. X#undef    READ_MTAB_FROM_FILE
  1675. X#define    READ_MTAB_ULTRIX_STYLE
  1676. X
  1677. X/*
  1678. X * Need precise length links
  1679. X */
  1680. X#define    PRECISE_SYMLINKS
  1681. END_OF_FILE
  1682.   if test 4660 -ne `wc -c <'config/os-u4_0.h'`; then
  1683.     echo shar: \"'config/os-u4_0.h'\" unpacked with wrong size!
  1684.   fi
  1685.   # end of 'config/os-u4_0.h'
  1686. fi
  1687. if test -f 'config/os-u4_2.h' -a "${1}" != "-c" ; then 
  1688.   echo shar: Will not clobber existing file \"'config/os-u4_2.h'\"
  1689. else
  1690.   echo shar: Extracting \"'config/os-u4_2.h'\" \(4734 characters\)
  1691.   sed "s/^X//" >'config/os-u4_2.h' <<'END_OF_FILE'
  1692. X/*
  1693. X * Copyright (c) 1989 Jan-Simon Pendry
  1694. X * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  1695. X * Copyright (c) 1989 The Regents of the University of California.
  1696. X * All rights reserved.
  1697. X *
  1698. X * This code is derived from software contributed to Berkeley by
  1699. X * Jan-Simon Pendry at Imperial College, London.
  1700. X *
  1701. X * Redistribution and use in source and binary forms, with or without
  1702. X * modification, are permitted provided that the following conditions
  1703. X * are met:
  1704. X * 1. Redistributions of source code must retain the above copyright
  1705. X *    notice, this list of conditions and the following disclaimer.
  1706. X * 2. Redistributions in binary form must reproduce the above copyright
  1707. X *    notice, this list of conditions and the following disclaimer in the
  1708. X *    documentation and/or other materials provided with the distribution.
  1709. X * 3. All advertising materials mentioning features or use of this software
  1710. X *    must display the following acknowledgement:
  1711. X *      This product includes software developed by the University of
  1712. X *      California, Berkeley and its contributors.
  1713. X * 4. Neither the name of the University nor the names of its contributors
  1714. X *    may be used to endorse or promote products derived from this software
  1715. X *    without specific prior written permission.
  1716. X *
  1717. X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1718. X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1719. X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1720. X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1721. X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1722. X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1723. X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1724. X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1725. X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1726. X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1727. X * SUCH DAMAGE.
  1728. X *
  1729. X *    %W% (Berkeley) %G%
  1730. X *
  1731. X * $Id: os-u4_2.h,v 5.2.2.1 1992/02/09 15:10:54 jsp beta $
  1732. X *
  1733. X * Ultrix 4.2 definitions for Amd (automounter)
  1734. X *        from Chris Lindblad <cjl@ai.mit.edu>
  1735. X *        and Chris Metcalf <metcalf@lcs.mit.edu>
  1736. X */
  1737. X
  1738. X/*
  1739. X * Does the compiler grok void *
  1740. X */
  1741. X#define VOIDP
  1742. X
  1743. X/*
  1744. X * Which version of the Sun RPC library we are using
  1745. X * This is the implementation release number, not
  1746. X * the protocol revision number.
  1747. X */
  1748. X#define    RPC_4
  1749. X
  1750. X/*
  1751. X * Which version of the NFS interface are we using.
  1752. X * This is the implementation release number, not
  1753. X * the protocol revision number.
  1754. X */
  1755. X#define    NFS_3
  1756. X
  1757. X/*
  1758. X * Byte ordering
  1759. X */
  1760. X#undef ARCH_ENDIAN
  1761. X#if defined(vax) || defined(mips)
  1762. X#define    ARCH_ENDIAN "little"
  1763. X#endif
  1764. X
  1765. X/*
  1766. X * The mount table is obtained from the kernel
  1767. X */
  1768. X#undef    UPDATE_MTAB
  1769. X
  1770. X/*
  1771. X * No mntent info on Ultrix
  1772. X */
  1773. X#undef    MNTENT_HDR
  1774. X
  1775. X/*
  1776. X * struct statfs is no longer used in Ultrix. Use struct fs_data instead.
  1777. X */
  1778. X#undef STATFS_HDR
  1779. X
  1780. X/*
  1781. X * No support for syslog()
  1782. X */
  1783. X#define    HAS_SYSLOG
  1784. X
  1785. X/*
  1786. X * Name of filesystem types
  1787. X */
  1788. X#define    MOUNT_TYPE_NFS    GT_NFS
  1789. X#define    MOUNT_TYPE_UFS    GT_ULTRIX
  1790. X#undef    MTAB_TYPE_UFS
  1791. X#define    MTAB_TYPE_UFS    "ufs"
  1792. X
  1793. X/*
  1794. X * Name of mount & unmount system calls
  1795. X */
  1796. X#undef    MOUNT_TRAP
  1797. X#define    MOUNT_TRAP(type, mnt, flag, mnt_data) \
  1798. X    mount(mnt->mnt_fsname, mnt->mnt_dir, flag, type, mnt_data)
  1799. X#undef    UNMOUNT_TRAP
  1800. X#define    UNMOUNT_TRAP(mnt)    umount(mnt->mnt_passno)
  1801. X
  1802. X/*
  1803. X * Miscellaneous Ultrix bits
  1804. X */
  1805. X#define    M_RDONLY    M_RONLY
  1806. X
  1807. X#define    MNTMAXSTR    128
  1808. X
  1809. X#define    MNTTYPE_UFS    "ufs"        /* Un*x file system */
  1810. X#define    MNTTYPE_NFS    "nfs"        /* network file system */
  1811. X#define    MNTTYPE_IGNORE    "ignore"    /* No type specified, ignore this entry */
  1812. X
  1813. X#define    MNTOPT_RO    "ro"        /* read only */
  1814. X#define    MNTOPT_RW    "rw"        /* read/write */
  1815. X#define    MNTOPT_QUOTA    "quota"        /* quotas */
  1816. X#define    MNTOPT_NOQUOTA    "noquota"    /* no quotas */
  1817. X#define    MNTOPT_HARD    "hard"        /* hard mount */
  1818. X#define    MNTOPT_SOFT    "soft"        /* soft mount */
  1819. X#define    MNTOPT_INTR    "intr"        /* interrupts allowed */
  1820. X
  1821. X#define    MNTOPT_NOSUID    "nosuid"    /* no set uid allowed */
  1822. X
  1823. Xstruct mntent {
  1824. X    char    *mnt_fsname;    /* name of mounted file system */
  1825. X    char    *mnt_dir;    /* file system path prefix */
  1826. X    char    *mnt_type;    /* MNTTYPE_* */
  1827. X    char    *mnt_opts;    /* MNTOPT* */
  1828. X    int    mnt_freq;    /* dump frequency, in days */
  1829. X    int    mnt_passno;    /* pass number on parallel fsck */
  1830. X};
  1831. X#define    MOUNTED        "/etc/mtab"
  1832. X
  1833. X#define    NFS_HDR    "misc-ultrix.h"
  1834. X#define    UFS_HDR    "misc-ultrix.h"
  1835. X
  1836. X#define    nfs_args    nfs_gfs_mount
  1837. X#define    ULTRIX_HACK    /* Should be handled better than this !! */
  1838. X#define    NEED_MNTOPT_PARSER
  1839. X
  1840. X/*
  1841. X * How to get a mount list
  1842. X */
  1843. X#undef    READ_MTAB_FROM_FILE
  1844. X#define    READ_MTAB_ULTRIX_STYLE
  1845. X
  1846. X/*
  1847. X * Need precise length links
  1848. X */
  1849. X#define    PRECISE_SYMLINKS
  1850. END_OF_FILE
  1851.   if test 4734 -ne `wc -c <'config/os-u4_2.h'`; then
  1852.     echo shar: \"'config/os-u4_2.h'\" unpacked with wrong size!
  1853.   fi
  1854.   # end of 'config/os-u4_2.h'
  1855. fi
  1856. if test -f 'csd/Makefile.build' -a "${1}" != "-c" ; then 
  1857.   echo shar: Will not clobber existing file \"'csd/Makefile.build'\"
  1858. else
  1859.   echo shar: Extracting \"'csd/Makefile.build'\" \(4348 characters\)
  1860.   sed "s/^X//" >'csd/Makefile.build' <<'END_OF_FILE'
  1861. X#
  1862. X# Makefile.build for csd (Cluster Server); part of Worldwide File System.
  1863. X#
  1864. X# Author:    Youki Kadobayashi, Osaka University, Japan
  1865. X#        E-mail: <youki@wide.ad.jp>
  1866. X#
  1867. X# 
  1868. X# WorldWide File System
  1869. X# Copyright (c) 1992,1993 Youki Kadobayashi
  1870. X# Copyright (c) 1992,1993 Osaka University
  1871. X# All rights reserved.
  1872. X#
  1873. X# Permission to use, copy, modify and distribute this software and its
  1874. X# documentation is hereby granted, provided that the following conditions
  1875. X# are met:
  1876. X# 1. Both the copyright notice and this permission notice appear in
  1877. X#    all copies of the software, derivative works or modified versions,
  1878. X#    and any portions thereof, and that both notices appear in
  1879. X#    supporting documentation.
  1880. X# 2. All advertising materials mentioning features or use of this software
  1881. X#    must display the following acknowledgement:
  1882. X#      This product includes software developed by the Osaka University
  1883. X#      and its contributors.
  1884. X# 3. Neither the name of the University nor the names of its contributors
  1885. X#    may be used to endorse or promote products derived from this software
  1886. X#    without specific prior written permission.
  1887. X#
  1888. X# THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  1889. X# UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  1890. X# WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  1891. X#
  1892. X# Osaka University requests users of this software to return to
  1893. X#
  1894. X#  Youki Kadobayashi
  1895. X#  Department of Information and Computer Sciences
  1896. X#  Osaka University, Toyonaka 560, Osaka, Japan
  1897. X#
  1898. X# any improvements or extensions that they make and grant Osaka
  1899. X# University the rights to redistribute these changes.
  1900. X
  1901. X# $Header: Makefile.build[109.0] Wed Nov 24 03:47:21 1993 youki-k@is.aist-nara.ac.jp saved $
  1902. X#
  1903. X
  1904. X# -------- YOU SHOULD NOT NEED TO CHANGE ANYTHING BELOW THIS LINE --------
  1905. X
  1906. XCSSRC_H=    auto.h global.h cs_prot.h nfs_prot.h util.h wfs.h
  1907. X
  1908. XCSSRC_C=    acc.c bfs.c callout.c cmfs.c conn.c crc32.c cs.c cs_subr.c \
  1909. X        dir.c dumpvar.c err.c file.c ftp.c ftp_list.c ftp_retr.c \
  1910. X        icmp.c log.c main.c nfs_reply.c nfs_start.c \
  1911. X        nfs_subr.c parse.c pol.c proto.c root.c sched.c srv.c \
  1912. X        thrd.c trace.c ufs.c uip.c util.c vol.c
  1913. X
  1914. XCSSVC=        cs_prot_svc.c nfs_prot_svc.c
  1915. X
  1916. XCSXDR=        cs_prot_xdr.c nfs_prot_xdr.c
  1917. X
  1918. XCSOBJS=        $(CSSRC_C:.c=.o) $(CSSVC:.c=.o) $(CSXDR:.c=.o)
  1919. X
  1920. XXDRS=        cs_prot.x nfs_prot.x
  1921. X
  1922. XSRCS=        $(CSSRC_H) $(CSSRC_C) $(CSSVC) $(CSXDR)
  1923. X
  1924. XAUX=        $(XDRS) Makefile Makefile.build
  1925. X
  1926. Xcsd:    $(CSOBJS)
  1927. X    $(CC) -o csd $(CSOBJS) $(RPCLIB) $(RESOLV) $(SYSLIB)
  1928. X
  1929. Xinstall-server:    csd ../config/csd.conf
  1930. X    @if [ -d $(WWFSDIR)/usr ]; then \
  1931. X        echo "WWFSDIR should be correctly set"; \
  1932. X        exit 1; \
  1933. X    else \
  1934. X        exit 0; \
  1935. X    fi
  1936. X    $(INSTBIN) csd $(WWFSDIR)/bin
  1937. X
  1938. Xclean::
  1939. X    -rm -f csd
  1940. X
  1941. X## TARGET FOR DEVELOPERS
  1942. X
  1943. X# 'apply' kind of macro; e.g., "make doit CMD=wc"
  1944. Xdoit:
  1945. X    $(CMD) $(SRCS)
  1946. X
  1947. Xauto.h:        $(CSSRC_C)
  1948. X    cextract +PE -D__STDC__ $(CXOPTS) -o auto.h $(CSSRC_C)
  1949. X
  1950. Xoverview:       $(CSJUNK) $(CSSRC_C)
  1951. X    rm -f overview
  1952. X    for i in $(CSJUNK) $(CSSRC_C); do \
  1953. X        echo "// $$i" >> overview ;\
  1954. X        cextract -PE +ps $$i >> overview ;\
  1955. X    done
  1956. X
  1957. Xabbrevs:    overview
  1958. X    ../misc/mkabbrev.pl < overview > abbrevs
  1959. X
  1960. X# makedepend?
  1961. X# .c files
  1962. Xacc.o:        acc.c wfs.h util.h global.h
  1963. Xbfs.o:        bfs.c wfs.h util.h global.h
  1964. Xcallout.o:    callout.c wfs.h util.h global.h
  1965. Xcmfs.o:        cmfs.c wfs.h util.h global.h
  1966. Xconn.o:        conn.c wfs.h util.h global.h
  1967. Xcrc32.o:    crc32.c
  1968. Xcs.o:        cs.c cs_prot.h wfs.h util.h global.h
  1969. Xcs_subr.o:    cs_subr.c cs_prot.h wfs.h util.h global.h
  1970. Xdir.o:        dir.c wfs.h util.h global.h
  1971. Xdumpvar.o:    dumpvar.c wfs.h util.h global.h
  1972. Xerr.o:        err.c wfs.h util.h global.h
  1973. Xfile.o:        file.c wfs.h util.h global.h
  1974. Xftp.o:        ftp.c wfs.h util.h global.h
  1975. Xftp_list.o:    ftp_list.c wfs.h util.h global.h
  1976. Xftp_retr.o:    ftp_retr.c wfs.h util.h global.h
  1977. Xicmp.o:        icmp.c wfs.h util.h global.h
  1978. Xlog.o:        log.c wfs.h util.h global.h
  1979. Xmain.o:        main.c wfs.h util.h global.h
  1980. Xnfs_reply.o:    nfs_reply.c wfs.h util.h
  1981. Xnfs_start.o:    nfs_start.c wfs.h util.h global.h
  1982. Xnfs_subr.o:    nfs_subr.c nfs_prot.h wfs.h util.h global.h
  1983. Xparse.o:    parse.c wfs.h util.h global.h
  1984. Xpol.o:        pol.c wfs.h util.h global.h
  1985. Xproto.o:    proto.c wfs.h util.h global.h
  1986. Xroot.o:        root.c wfs.h util.h global.h
  1987. Xsched.o:    sched.c util.h
  1988. Xsrv.o:        srv.c wfs.h util.h global.h
  1989. Xthrd.o:        thrd.c wfs.h util.h global.h
  1990. Xtrace.o:    trace.c wfs.h util.h global.h
  1991. Xufs.o:        ufs.c wfs.h util.h global.h
  1992. Xuip.o:        uip.c wfs.h util.h global.h
  1993. Xutil.o:        util.c wfs.h util.h global.h
  1994. Xvol.o:        vol.c wfs.h util.h global.h
  1995. END_OF_FILE
  1996.   if test 4348 -ne `wc -c <'csd/Makefile.build'`; then
  1997.     echo shar: \"'csd/Makefile.build'\" unpacked with wrong size!
  1998.   fi
  1999.   # end of 'csd/Makefile.build'
  2000. fi
  2001. if test -f 'csd/parse.c' -a "${1}" != "-c" ; then 
  2002.   echo shar: Will not clobber existing file \"'csd/parse.c'\"
  2003. else
  2004.   echo shar: Extracting \"'csd/parse.c'\" \(4120 characters\)
  2005.   sed "s/^X//" >'csd/parse.c' <<'END_OF_FILE'
  2006. X/* 
  2007. X * WorldWide File System
  2008. X * Copyright (c) 1992,1993 Youki Kadobayashi
  2009. X * Copyright (c) 1992,1993 Osaka University
  2010. X * All rights reserved.
  2011. X *
  2012. X * Permission to use, copy, modify and distribute this software and its
  2013. X * documentation is hereby granted, provided that the following conditions
  2014. X * are met:
  2015. X * 1. Both the copyright notice and this permission notice appear in
  2016. X *    all copies of the software, derivative works or modified versions,
  2017. X *    and any portions thereof, and that both notices appear in
  2018. X *    supporting documentation.
  2019. X * 2. All advertising materials mentioning features or use of this software
  2020. X *    must display the following acknowledgement:
  2021. X *      This product includes software developed by the Osaka University
  2022. X *      and its contributors.
  2023. X * 3. Neither the name of the University nor the names of its contributors
  2024. X *    may be used to endorse or promote products derived from this software
  2025. X *    without specific prior written permission.
  2026. X *
  2027. X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  2028. X * UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  2029. X * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  2030. X *
  2031. X * Osaka University requests users of this software to return to
  2032. X *
  2033. X *  Youki Kadobayashi
  2034. X *  Department of Information and Computer Sciences
  2035. X *  Osaka University, Toyonaka 560, Osaka, Japan
  2036. X *
  2037. X * any improvements or extensions that they make and grant Osaka
  2038. X * University the rights to redistribute these changes.
  2039. X */
  2040. X/* Read configuration files */
  2041. Xstatic char *AtFSid = "$Header: parse.c[109.0] Wed Nov 24 03:47:14 1993 youki-k@is.aist-nara.ac.jp saved $";
  2042. X
  2043. X#include <ctype.h>
  2044. X#include <stdio.h>
  2045. X#include <string.h>        /* for strchr */
  2046. X#include "parse.h"
  2047. X
  2048. X/* Debugging malloc library of Conor P. Cahill */
  2049. X#ifdef DEBUG_MALLOC
  2050. X#include "/usr/local/include/dbmalloc/malloc.h"
  2051. X#endif
  2052. X
  2053. X/*
  2054. X * Loosely based on STIF (structured text interchange format), which is
  2055. X * currently an Internet Draft.
  2056. X * We will eventually adopt STIF when RFC comes out.
  2057. X */
  2058. Xint
  2059. Xparse_conf(conf, bind_func)
  2060. Xchar *conf;
  2061. Xint (*bind_func)();
  2062. X{
  2063. X    char line[256];
  2064. X    int linenum = 0, nerr = 0;
  2065. X    FILE *fp;
  2066. X    char *p, *eq;
  2067. X    char *name, *value;
  2068. X
  2069. X    fp = fopen(conf, "r");
  2070. X    if (fp == NULL)
  2071. X        return -1;
  2072. X
  2073. X    while (fgets(line, sizeof(line), fp) != NULL) {
  2074. X        ++linenum;
  2075. X        if ((p = strchr(line, '\n')) != NULL) {
  2076. X            *p = '\0';
  2077. X        } else {
  2078. X            dlog("%s:%d: line too long", conf, linenum);
  2079. X            ++nerr;
  2080. X        }
  2081. X        if ((p = strchr(line, '#')) || (p = strchr(line, ';')))
  2082. X            *p = '\0';
  2083. X        if (*line == '\0')
  2084. X            continue;
  2085. X
  2086. X#define SKIP_SPACE(p, start) \
  2087. X        for ((p) = (start); *(p) && isspace(*(p)); ++(p))    \
  2088. X            ;
  2089. X#define TRIM_SPACE(p, start) \
  2090. X        for ((p) = (start) + strlen(start) - 1;            \
  2091. X             (p) >= (start); --(p)) {                \
  2092. X            if (isspace(*(p)))                \
  2093. X                *(p) = '\0';                \
  2094. X        }
  2095. X
  2096. X        if ((eq = strchr(line, '=')) || (eq = strchr(line, ':'))
  2097. X            || (eq = strchr(line, '\t'))) {
  2098. X            *eq = '\0';
  2099. X            SKIP_SPACE(p, line);
  2100. X            name = p;
  2101. X            TRIM_SPACE(p, name);
  2102. X            SKIP_SPACE(p, eq+1);
  2103. X            value = p;
  2104. X            TRIM_SPACE(p, value);
  2105. X            if ((*bind_func)(name, value) < 0) {
  2106. X                dlog("%s:%d: invalid assignment \"%s=%s\"", conf, linenum, name, value);
  2107. X                ++nerr;
  2108. X            }
  2109. X        } else {
  2110. X            dlog("%s:%d: parse error", conf, linenum);
  2111. X            ++nerr;
  2112. X        }
  2113. X    }
  2114. X    fclose(fp);
  2115. X    if (nerr)
  2116. X        return -1;
  2117. X    return 0;
  2118. X}
  2119. X
  2120. Xint
  2121. Xparse_tailor(tailor, name, value)
  2122. Xwf_tailor *tailor;
  2123. Xchar *name;
  2124. Xchar *value;
  2125. X{
  2126. X    int i, found = 0, ret, len;
  2127. X    char *p;
  2128. X
  2129. X    for (i = 0; tailor[i].name; ++i) {
  2130. X        if (strcasecmp(tailor[i].name, name) == 0) {
  2131. X            len = strlen(value)+1;
  2132. X            p = malloc(len);
  2133. X            bcopy(value, p, len);
  2134. X            ret = (*tailor[i].assign)(p);
  2135. X            if (ret < 0) break;    /* invalid parameter */
  2136. X            found = 1;
  2137. X            break;
  2138. X        }
  2139. X    }
  2140. X    if (! found) return -1;
  2141. X    return 0;
  2142. X}
  2143. X
  2144. Xlong
  2145. Xparse_cap(cap, str)        /* comma-separated list of capabilities */
  2146. Xwf_cap *cap;
  2147. Xchar *str;
  2148. X{
  2149. X    char *p, *p2;
  2150. X    int i;
  2151. X    long value = 0;
  2152. X
  2153. X    p = str;
  2154. X    do {
  2155. X        while (isspace(*p)) ++p;
  2156. X        p2 = strchr(p, ',');
  2157. X        if (p2) *p2 = '\0';
  2158. X        for (i = 0; cap[i].name; ++i) {
  2159. X            if (strcasecmp(cap[i].name, p) == 0) {
  2160. X                value |= cap[i].value;
  2161. X                break;
  2162. X            }
  2163. X        }
  2164. X        if (p2) *p2 = ',';
  2165. X    } while (p2 && (p = p2+1));
  2166. X    return value;
  2167. X}
  2168. X
  2169. END_OF_FILE
  2170.   if test 4120 -ne `wc -c <'csd/parse.c'`; then
  2171.     echo shar: \"'csd/parse.c'\" unpacked with wrong size!
  2172.   fi
  2173.   # end of 'csd/parse.c'
  2174. fi
  2175. if test -f 'csd/ufs.c' -a "${1}" != "-c" ; then 
  2176.   echo shar: Will not clobber existing file \"'csd/ufs.c'\"
  2177. else
  2178.   echo shar: Extracting \"'csd/ufs.c'\" \(4546 characters\)
  2179.   sed "s/^X//" >'csd/ufs.c' <<'END_OF_FILE'
  2180. X/* 
  2181. X * WorldWide File System
  2182. X * Copyright (c) 1992,1993 Youki Kadobayashi
  2183. X * Copyright (c) 1992,1993 Osaka University
  2184. X * All rights reserved.
  2185. X *
  2186. X * Permission to use, copy, modify and distribute this software and its
  2187. X * documentation is hereby granted, provided that the following conditions
  2188. X * are met:
  2189. X * 1. Both the copyright notice and this permission notice appear in
  2190. X *    all copies of the software, derivative works or modified versions,
  2191. X *    and any portions thereof, and that both notices appear in
  2192. X *    supporting documentation.
  2193. X * 2. All advertising materials mentioning features or use of this software
  2194. X *    must display the following acknowledgement:
  2195. X *      This product includes software developed by the Osaka University
  2196. X *      and its contributors.
  2197. X * 3. Neither the name of the University nor the names of its contributors
  2198. X *    may be used to endorse or promote products derived from this software
  2199. X *    without specific prior written permission.
  2200. X *
  2201. X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  2202. X * UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  2203. X * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  2204. X *
  2205. X * Osaka University requests users of this software to return to
  2206. X *
  2207. X *  Youki Kadobayashi
  2208. X *  Department of Information and Computer Sciences
  2209. X *  Osaka University, Toyonaka 560, Osaka, Japan
  2210. X *
  2211. X * any improvements or extensions that they make and grant Osaka
  2212. X * University the rights to redistribute these changes.
  2213. X */
  2214. X/* cached local filesystem */
  2215. Xstatic char *AtFSid = "$Header: ufs.c[109.0] Wed Nov 24 03:47:18 1993 youki-k@is.aist-nara.ac.jp saved $";
  2216. X
  2217. X#include <sys/types.h>
  2218. X#ifdef _POSIX_SOURCE
  2219. X#include <dirent.h>
  2220. X#define    DIRENT    struct dirent
  2221. X#else
  2222. X#include <sys/dir.h>
  2223. X#define    DIRENT    struct direct
  2224. X#endif
  2225. X
  2226. X#include <sys/stat.h>
  2227. X#include <fcntl.h>        /* for O_WRONLY etc. */
  2228. X#include "wfs.h"
  2229. X#include "util.h"
  2230. X#include "global.h"
  2231. X
  2232. X/* public functions  */
  2233. Xvoid ufs_read_miss(), ufs_readdir_miss();
  2234. X
  2235. Xwf_proto proto_ufs = {
  2236. X    "UFS", cmfs_getattr, err_getattr_miss,
  2237. X    cmfs_lookup, err_lookup_miss, cmfs_readlink,
  2238. X    cmfs_read, ufs_read_miss, cmfs_readdir, ufs_readdir_miss,
  2239. X    err_getuda, err_keepalive, err_close, err_shutdown, 0
  2240. X};
  2241. X
  2242. Xvoid
  2243. Xufs_read_miss(c)
  2244. Xwf_thrd *c;
  2245. X/* in: rqstp, volp, offset, count, totalcount, dirp, filep */
  2246. X/* out: */
  2247. X{
  2248. X    dlog("ufs_read_miss: should not be called...");
  2249. X}
  2250. X
  2251. Xvoid
  2252. Xufs_readdir_miss(c)
  2253. Xwf_thrd *c;
  2254. X/* in: rqstp, volp, filep, fhp, cookie, count, dotdotp, olddirp */
  2255. X/* out: */
  2256. X{
  2257. X    DIR *dp;
  2258. X    struct direct *p;
  2259. X    struct stat s;
  2260. X    wf_file *f;
  2261. X    ftype f_type;
  2262. X    u_int f_id, namelen;
  2263. X    char *f_name, *f_link, link[MAXPATHLEN];
  2264. X    char path[MAXPATHLEN], path2[MAXPATHLEN];
  2265. X    char *topdir = c->child_volp->topdir;
  2266. X
  2267. X    /*
  2268. X     * create the missing directory first
  2269. X     */
  2270. X    if (c->fhp->child_dir > WF_VOL_BASE) {
  2271. X        if (c->olddirp) {
  2272. X            c->dirp = dir_new(c->child_volp, c->fhp->child_dir,
  2273. X                      c->dotdotp->name, "");
  2274. X        } else {
  2275. X            c->dirp = vol_newroot(c->child_volp);
  2276. X        }
  2277. X    } else {
  2278. X        c->dirp = dir_new(c->child_volp, c->fhp->child_dir,
  2279. X                  c->dotdotp->name, c->filep->name);
  2280. X    }
  2281. X    f = dir_adddir(c->dirp, ".", c->child_volp->id, c->dirp->id);
  2282. X    attr_touch(&f->fattr);
  2283. X    f = dir_adddir(c->dirp, "..", c->parent_volp->id, c->dotdotp->id);
  2284. X    attr_touch(&f->fattr);
  2285. X    /*
  2286. X     * read the corresponding UFS directory...
  2287. X     */
  2288. X    sprintf(path, "%s%s", topdir, c->dirp->name);
  2289. X    dp = opendir(path);
  2290. X    if (! dp) {
  2291. X        dlog("could not opendir \"%s\"", path);
  2292. X        return;
  2293. X    }
  2294. X    while (p = readdir(dp)) {
  2295. X        f_name = strdup(p->d_name);
  2296. X        f_link = NULL;
  2297. X        if (strcmp(f_name, ".") == 0 || strcmp(f_name, "..") == 0)
  2298. X            continue;    /* ignore "." and ".." */
  2299. X        sprintf(path2, "%s/%s", path, f_name);
  2300. X        lstat(path2, &s);
  2301. X        /*
  2302. X         * compute attributes for each cached directory entry
  2303. X         */
  2304. X        f_id = 0;
  2305. X        if (s.st_mode & S_IFREG) {
  2306. X            f_type = NFREG;
  2307. X        } else if (s.st_mode & S_IFLNK) {
  2308. X            f_type = NFLNK;
  2309. X            namelen = readlink(path2, link, MAXPATHLEN);
  2310. X            if (namelen > 0) {
  2311. X                link[namelen-1] = '\0';
  2312. X                f_link = strdup(link);
  2313. X            } else {
  2314. X                /* could not stat it; return fake entry */
  2315. X                f_link = strdup("/???");
  2316. X            }
  2317. X        } else if (s.st_mode & S_IFDIR) {
  2318. X            f_type = NFDIR;
  2319. X            if (c->olddirp &&
  2320. X                (f = file_findname(c->olddirp, f_name))) {
  2321. X                f_id = f->id;
  2322. X            } else {
  2323. X                f_id = vol_allocid(c->child_volp);
  2324. X            }
  2325. X        }
  2326. X        /*
  2327. X         * append it to the newly created directory
  2328. X         */
  2329. X        f = file_new(f_name, f_link, f_type,
  2330. X             s.st_nlink, s.st_mode, s.st_uid, s.st_gid,
  2331. X             s.st_size, s.st_mtime, f_id, c->child_volp->id);
  2332. X        dir_addfile(c->dirp, f);
  2333. X    }
  2334. X    closedir(dp);
  2335. X    dir_save(c->child_volp, c->dirp, c->olddirp);
  2336. X}
  2337. END_OF_FILE
  2338.   if test 4546 -ne `wc -c <'csd/ufs.c'`; then
  2339.     echo shar: \"'csd/ufs.c'\" unpacked with wrong size!
  2340.   fi
  2341.   # end of 'csd/ufs.c'
  2342. fi
  2343. if test -f 'gtr/draft-youki-gtr-00.txt' -a "${1}" != "-c" ; then 
  2344.   echo shar: Will not clobber existing file \"'gtr/draft-youki-gtr-00.txt'\"
  2345. else
  2346.   echo shar: Extracting \"'gtr/draft-youki-gtr-00.txt'\" \(4021 characters\)
  2347.   sed "s/^X//" >'gtr/draft-youki-gtr-00.txt' <<'END_OF_FILE'
  2348. X      Using DNS To Store Geographical / Topological Information
  2349. X                DRAFT
  2350. X        Youki Kadobayashi <youki-k@is.aist-nara.ac.jp>
  2351. X                 Nov 3, 1993
  2352. X
  2353. X1. INTRODUCTION
  2354. X
  2355. XToday's digital media exhibits strong commonality among Internauts.
  2356. XThey can be found on dozens of file servers in the Internet; the
  2357. Xauthor would like to invent another buzzword for this phenomena:
  2358. X"information ubiquity".
  2359. X
  2360. XIncrease in information ubiquity directly affects information services
  2361. Xin several ways: improved response time, higher availability and
  2362. Xreduced load on servers and networks.
  2363. X
  2364. XTo exploit these desirable aspects, information retrieval systems
  2365. Xrequires high-level semantics of underlying networks, such as network
  2366. Xtopology and geographical location.
  2367. X
  2368. XWhile traditional DNS resource records provide vital information for
  2369. Xdecentralized operation of the Internet, they do not provide
  2370. Xhigh-level semantics that can exploit information ubiquity.
  2371. X
  2372. XWe hereby define a new attribute "GTR" (which stands for geographical
  2373. X/ topological region) in the DNS TXT resource record, that encourages
  2374. Xinformation retrieval systems to exploit information ubiquity.
  2375. X
  2376. X2. The TXT GTR RR
  2377. X
  2378. XThe TXT GTR RR is defined with the scheme proposed in [3].
  2379. X
  2380. XTXT GTR has the following format:
  2381. X
  2382. X    <reversed-host-zero-number> <ttl> <class> TXT "GTR=<region>"
  2383. X
  2384. XAll fields are required.
  2385. X
  2386. X<reversed-host-zero-number> represents host or network address encoded
  2387. Xusing the scheme proposed in [2].
  2388. X
  2389. X<region> consists of the following three components, each separated by
  2390. Xa dash:
  2391. X    g:    geographical information
  2392. X    n:    topology (e.g., network body or service provider)
  2393. X    c:    country
  2394. Xcase is not significant.
  2395. X
  2396. XTXT GTR record is designed to be used in conjunction with network name
  2397. Xmapping scheme proposed in Section 4 of [2].  However, TXT GTR record
  2398. Xdoes not mandate deployment of the mapping scheme whatsoever.
  2399. X
  2400. XSimplest Example:
  2401. X    0.0.221.163.in-addr.arpa.    TXT    "GTR=Nara-SENTAN-JP"
  2402. X
  2403. XComplex Example:
  2404. X    0.0.1.133.in-addr.arpa.        PTR    osaka-u.ac.jp
  2405. X                    A    255.255.255.0
  2406. X                    TXT    "GTR=Osaka-WIDE-JP"
  2407. X    0.192.1.133.in-addr.arpa.    TXT    "GTR=Osaka-SENTAN-JP"
  2408. X    0.12.1.133.in-addr.arpa.    TXT    "GTR=Osaka-SINET-JP"
  2409. X
  2410. XIn general, this information will be added to an existing master file
  2411. Xfor some IN-ADDR.ARPA domain for each network involved.  
  2412. X
  2413. X3. DISCUSSION
  2414. X
  2415. XGeographical information can be useful only if regional internet
  2416. Xexchange exists.  Similarly, country code will not make sense if
  2417. Xnational internet exchange does not exist.  We could generalize these
  2418. Xconcepts and devise a scheme for representing routing architecture and
  2419. Xnetwork topology, at an abstract level, in a human-readable octect
  2420. Xstream.
  2421. X
  2422. XReferences
  2423. X  [1] Mockapetris, P., "Domain Names - Implementation and Specification",
  2424. X      RFC 1035.
  2425. X
  2426. X  [2] Mockapetris, P., "DNS Encoding of Network Names and Other Types",
  2427. X      RFC 1101.
  2428. X
  2429. X  [3] Rosenbaum, R., "Using the Domain Name System To Store Arbitrary String
  2430. X      Attributes", RFC 1464.
  2431. X
  2432. XDeployment guideline
  2433. X
  2434. X- Do not encode redundant information -- minimize administrative overhead
  2435. X
  2436. X- Allow gradual change --   server selection should work without TXT GTR record
  2437. X
  2438. X- Sort servers by:
  2439. X    region
  2440. X    domain name?
  2441. X    other information via other protocols?
  2442. X
  2443. XImplementation details
  2444. X
  2445. X- Sort-by-gtr configuration file (/etc/gtr.conf)
  2446. X
  2447. X    region Osaka-OUATM-JP        # Osaka-U ATM BB
  2448. X    region Osaka-SENTAN-JP        # 768K local
  2449. X    region *-SENTAN-JP        # 768K / T1 BB
  2450. X    region *-WIDE-JP        # slow
  2451. X    region *-ORIONS-JP        # slower
  2452. X    region *-JP            # domestic
  2453. X    region *-BARRNET-USA        # west coast
  2454. X    region *-JVNCNET-USA        # west coast via GIX
  2455. X    region *-NSFNET-USA        # prefer T3 BB
  2456. X
  2457. X- short-term implementation (for gradual transition while in operation)
  2458. X  prepare /etc/gtr.txt which enumerates all GTR records
  2459. X  (analogous to host.txt in pre-DNS era)
  2460. X
  2461. X    getgtrbyhost(hostname) -> (char *) region
  2462. X
  2463. X- GTR mapping table (/etc/gtr.txt)
  2464. X
  2465. X    163.221        Nara-SENTAN-JP
  2466. X    133.1.4        Osaka-OUATM-JP
  2467. X    133.4        WIDE-JP
  2468. X  CIDR ready.
  2469. X
  2470. X- Implementation in WWFS
  2471. X    static server selection at volume file
  2472. X        -- sortvol.pl
  2473. X    "make sort" target at $WWFSDIR/Makefile
  2474. END_OF_FILE
  2475.   if test 4021 -ne `wc -c <'gtr/draft-youki-gtr-00.txt'`; then
  2476.     echo shar: \"'gtr/draft-youki-gtr-00.txt'\" unpacked with wrong size!
  2477.   fi
  2478.   # end of 'gtr/draft-youki-gtr-00.txt'
  2479. fi
  2480. if test -f 'gtr/gtr.pl' -a "${1}" != "-c" ; then 
  2481.   echo shar: Will not clobber existing file \"'gtr/gtr.pl'\"
  2482. else
  2483.   echo shar: Extracting \"'gtr/gtr.pl'\" \(3895 characters\)
  2484.   sed "s/^X//" >'gtr/gtr.pl' <<'END_OF_FILE'
  2485. X#!/usr/local/bin/perl
  2486. X#
  2487. X# gtr.pl -- GTR library.  GTR stands for geographical / topological region.
  2488. X# Author: Youki Kadobayashi <youki@wide.ad.jp>
  2489. X# This file is part of WWFS.
  2490. X#
  2491. Xpackage gtr;
  2492. X
  2493. X# configuration parameters:
  2494. X# $gtr'dir    gtr directory; "/etc" by default.
  2495. X# $gtr'conf    configuration file. "/etc/gtr.conf" by default.
  2496. X# $gtr'txt    address-to-GTR mapping table. "/etc/gtr.txt" by default.
  2497. X
  2498. X$conf = $dir ? "$dir/gtr.conf" : "/etc/gtr.conf";
  2499. X$txt = $dir ? "$dir/gtr.txt" : "/etc/gtr.txt";
  2500. X
  2501. X#
  2502. X# @sorted_hostnames = gtr'sort(@hostnames);
  2503. X# get a list of hostnames and sort them according to /etc/gtr.*
  2504. X#
  2505. Xsub sort {
  2506. X    local (@hosts) = @_;
  2507. X    local (@hostlist, @sorted, @gtrs, @addrs, @list);
  2508. X    local ($name, $aliases, $addrtype, $length);
  2509. X    local ($host, $ip, $rating, $entry);
  2510. X
  2511. X    foreach $host (@hosts) {
  2512. X    ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname($host);
  2513. X    @gtrs = ();
  2514. X    # each host may have multiple interfaces...
  2515. X    foreach $addr (@addrs) {
  2516. X        # For now, assume IPv4 address and bypass checking.
  2517. X        # need to adapt to IPv7 in near future.
  2518. X        $ip = join('.', unpack('C4', $addr));
  2519. X        push(@gtrs, >r'byaddr($ip));
  2520. X    }
  2521. X    $rating = >r'select(@gtrs);
  2522. X    $list[$rating] .= "$host:";
  2523. X    }
  2524. X
  2525. X    foreach $entry (@list) {
  2526. X    chop $entry;        # trailing colon
  2527. X    @hostlist = split(/:/, $entry);
  2528. X    if ($#hostlist >= 0) {
  2529. X        push(@sorted, @hostlist);
  2530. X        #  print join(' ', @hostlist), "\n";
  2531. X    }
  2532. X    }
  2533. X    return @sorted;
  2534. X}
  2535. X
  2536. Xsub ip2long {
  2537. X    local ($str) = @_;
  2538. X    local (@a);
  2539. X    # ip address to long conversion.
  2540. X
  2541. X    @a = split(/\./, $str);
  2542. X    push(@a, (0, 0, 0));    # permit "133.1" style of abbreviation
  2543. X    return $a[0] * 0x01000000 + $a[1] * 0x010000 + $a[2] * 0x0100 + $a[3];
  2544. X}
  2545. X
  2546. X#
  2547. X# @gtrs = gtr'byaddr($ip_addr_string);
  2548. X# get a list of GTR from an IP address.
  2549. X#
  2550. Xsub byaddr {
  2551. X    local ($addr_string) = @_;
  2552. X    local ($addr, @gtrs, @line);
  2553. X    local ($gtr_addr, $gtr_mask, $gtr_name);
  2554. X
  2555. X    $addr = &ip2long($addr_string);
  2556. X    open(GTR, $txt) || return undef;
  2557. X    while (<GTR>) {
  2558. X    chop;
  2559. X    s/#.*$//;        # ignore comments
  2560. X    next if /^\s*$/;
  2561. X    @line = split(/\s+/, $_);
  2562. X
  2563. X    if ($line[0] =~ /^[0-9.]+$/) {
  2564. X        $gtr_addr = &ip2long($line[0]);
  2565. X    } else {
  2566. X        warn "$txt line $.: IP address expected.\n";
  2567. X        next;
  2568. X    }
  2569. X
  2570. X    # for abbreviation & fool-proof purpose.
  2571. X    if ($#line >= 2) {
  2572. X        if ($line[1] =~ /^255/) {
  2573. X        $gtr_mask = &ip2long($line[1]);
  2574. X        } else {
  2575. X        warn "$txt line $.: address mask expected.\n";
  2576. X        next;
  2577. X        }
  2578. X        $gtr_name = $line[2];
  2579. X    } elsif ($#line == 1) {
  2580. X        if ($line[1] =~ /^[0-9.]+$/) {
  2581. X        # you nuts!
  2582. X        warn "$txt line $.: GTR expected.\n";
  2583. X        next;
  2584. X        }
  2585. X        $gtr_name = $line[1];
  2586. X        # assume implicit address mask.
  2587. X        ($gtr_addr & 0x80000000) == 0 && do {
  2588. X        $gtr_mask = &ip2long("255.0.0.0");
  2589. X        };
  2590. X        ($gtr_addr & 0xc0000000) == 0x80000000 && do {
  2591. X        $gtr_mask = &ip2long("255.255.0.0");
  2592. X        };
  2593. X        ($gtr_addr & 0xe0000000) == 0xc0000000 && do {
  2594. X        $gtr_mask = &ip2long("255.255.255.0");
  2595. X        }
  2596. X    } else {
  2597. X        warn "$txt line $.: syntax error.\n";
  2598. X    }
  2599. X
  2600. X    # test if this GTR matches specified IP address & mask.
  2601. X    if (($addr & $gtr_mask) == $gtr_addr) {
  2602. X        push(@gtrs, $gtr_name);
  2603. X    }
  2604. X    }
  2605. X    close(GTR);
  2606. X    return (@gtrs);
  2607. X
  2608. X# Example of /etc/gtr.txt:
  2609. X#    133.1.192    255.255.255.0    Osaka-ODINS-JP
  2610. X#    133.1        255.255.0.0    Osaka-WIDE-JP
  2611. X#    133.4        255.255.0.0    Japan-WIDE-JP
  2612. X#    192.1.192    255.255.192.0    Foo-Bar-JP
  2613. X}
  2614. X
  2615. X#
  2616. X# $rating = gtr'select(@gtrs)
  2617. X# select a best-maching GTR (wrt /etc/gtr.conf) from a list of GTRs.
  2618. X# return a preference value in integer; smaller is better.
  2619. X#
  2620. Xsub select {
  2621. X    local (@gtrs) = @_;
  2622. X    local ($i, $region, $gtr);
  2623. X
  2624. X    open(CONF, $conf) || return 1000;
  2625. X    $i = 0;
  2626. X    while (<CONF>) {
  2627. X    chop;
  2628. X    /region\s+/ && do {
  2629. X        $region = $';
  2630. X        ++$i;
  2631. X
  2632. X        foreach $gtr (@gtrs) {
  2633. X        if ($gtr =~ /$region/) {
  2634. X            close(CONF);
  2635. X            return $i;
  2636. X        }
  2637. X        }
  2638. X    };
  2639. X    # otherwise ignore lines for now.
  2640. X    }
  2641. X    close(CONF);
  2642. X    return 1000;
  2643. X}
  2644. X
  2645. X1;
  2646. END_OF_FILE
  2647.   if test 3895 -ne `wc -c <'gtr/gtr.pl'`; then
  2648.     echo shar: \"'gtr/gtr.pl'\" unpacked with wrong size!
  2649.   fi
  2650.   # end of 'gtr/gtr.pl'
  2651. fi
  2652. if test -f 'rpc/cs_prot_clnt.c' -a "${1}" != "-c" ; then 
  2653.   echo shar: Will not clobber existing file \"'rpc/cs_prot_clnt.c'\"
  2654. else
  2655.   echo shar: Extracting \"'rpc/cs_prot_clnt.c'\" \(3888 characters\)
  2656.   sed "s/^X//" >'rpc/cs_prot_clnt.c' <<'END_OF_FILE'
  2657. X/*
  2658. X * Please do not edit this file.
  2659. X * It was generated using rpcgen.
  2660. X */
  2661. X
  2662. X#include <rpc/rpc.h>
  2663. X#include "cs_prot.h"
  2664. X#ifndef NFS_FH_DEFINED
  2665. X#define NFS_FH_DEFINED
  2666. X#endif
  2667. X
  2668. X/* Default timeout can be changed using clnt_control() */
  2669. Xstatic struct timeval TIMEOUT = { 25, 0 };
  2670. X
  2671. Xvoid *
  2672. Xcs_proc_null_1(argp, clnt)
  2673. X    void *argp;
  2674. X    CLIENT *clnt;
  2675. X{
  2676. X    static char res;
  2677. X
  2678. X    bzero((char *)&res, sizeof(res));
  2679. X    if (clnt_call(clnt, CS_PROC_NULL, xdr_void, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) {
  2680. X        return (NULL);
  2681. X    }
  2682. X    return ((void *)&res);
  2683. X}
  2684. X
  2685. Xint *
  2686. Xcs_proc_getport_1(argp, clnt)
  2687. X    void *argp;
  2688. X    CLIENT *clnt;
  2689. X{
  2690. X    static int res;
  2691. X
  2692. X    bzero((char *)&res, sizeof(res));
  2693. X    if (clnt_call(clnt, CS_PROC_GETPORT, xdr_void, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
  2694. X        return (NULL);
  2695. X    }
  2696. X    return (&res);
  2697. X}
  2698. X
  2699. Xcs_fhres *
  2700. Xcs_proc_register_1(argp, clnt)
  2701. X    void *argp;
  2702. X    CLIENT *clnt;
  2703. X{
  2704. X    static cs_fhres res;
  2705. X
  2706. X    bzero((char *)&res, sizeof(res));
  2707. X    if (clnt_call(clnt, CS_PROC_REGISTER, xdr_void, argp, xdr_cs_fhres, &res, TIMEOUT) != RPC_SUCCESS) {
  2708. X        return (NULL);
  2709. X    }
  2710. X    return (&res);
  2711. X}
  2712. X
  2713. Xcs_res *
  2714. Xcs_proc_unregister_1(argp, clnt)
  2715. X    void *argp;
  2716. X    CLIENT *clnt;
  2717. X{
  2718. X    static cs_res res;
  2719. X
  2720. X    bzero((char *)&res, sizeof(res));
  2721. X    if (clnt_call(clnt, CS_PROC_UNREGISTER, xdr_void, argp, xdr_cs_res, &res, TIMEOUT) != RPC_SUCCESS) {
  2722. X        return (NULL);
  2723. X    }
  2724. X    return (&res);
  2725. X}
  2726. X
  2727. Xcs_res *
  2728. Xcs_proc_mount_1(argp, clnt)
  2729. X    cs_volargs *argp;
  2730. X    CLIENT *clnt;
  2731. X{
  2732. X    static cs_res res;
  2733. X
  2734. X    bzero((char *)&res, sizeof(res));
  2735. X    if (clnt_call(clnt, CS_PROC_MOUNT, xdr_cs_volargs, argp, xdr_cs_res, &res, TIMEOUT) != RPC_SUCCESS) {
  2736. X        return (NULL);
  2737. X    }
  2738. X    return (&res);
  2739. X}
  2740. X
  2741. Xcs_res *
  2742. Xcs_proc_umount_1(argp, clnt)
  2743. X    cs_volargs *argp;
  2744. X    CLIENT *clnt;
  2745. X{
  2746. X    static cs_res res;
  2747. X
  2748. X    bzero((char *)&res, sizeof(res));
  2749. X    if (clnt_call(clnt, CS_PROC_UMOUNT, xdr_cs_volargs, argp, xdr_cs_res, &res, TIMEOUT) != RPC_SUCCESS) {
  2750. X        return (NULL);
  2751. X    }
  2752. X    return (&res);
  2753. X}
  2754. X
  2755. Xcs_diropres *
  2756. Xcs_proc_lookup_1(argp, clnt)
  2757. X    cs_diropargs *argp;
  2758. X    CLIENT *clnt;
  2759. X{
  2760. X    static cs_diropres res;
  2761. X
  2762. X    bzero((char *)&res, sizeof(res));
  2763. X    if (clnt_call(clnt, CS_PROC_LOOKUP, xdr_cs_diropargs, argp, xdr_cs_diropres, &res, TIMEOUT) != RPC_SUCCESS) {
  2764. X        return (NULL);
  2765. X    }
  2766. X    return (&res);
  2767. X}
  2768. X
  2769. Xcs_readdirres *
  2770. Xcs_proc_readdir_1(argp, clnt)
  2771. X    cs_readdirargs *argp;
  2772. X    CLIENT *clnt;
  2773. X{
  2774. X    static cs_readdirres res;
  2775. X
  2776. X    bzero((char *)&res, sizeof(res));
  2777. X    if (clnt_call(clnt, CS_PROC_READDIR, xdr_cs_readdirargs, argp, xdr_cs_readdirres, &res, TIMEOUT) != RPC_SUCCESS) {
  2778. X        return (NULL);
  2779. X    }
  2780. X    return (&res);
  2781. X}
  2782. X
  2783. Xcs_readres *
  2784. Xcs_proc_read_1(argp, clnt)
  2785. X    cs_readargs *argp;
  2786. X    CLIENT *clnt;
  2787. X{
  2788. X    static cs_readres res;
  2789. X
  2790. X    bzero((char *)&res, sizeof(res));
  2791. X    if (clnt_call(clnt, CS_PROC_READ, xdr_cs_readargs, argp, xdr_cs_readres, &res, TIMEOUT) != RPC_SUCCESS) {
  2792. X        return (NULL);
  2793. X    }
  2794. X    return (&res);
  2795. X}
  2796. X
  2797. Xcs_volres *
  2798. Xcs_proc_getvol_1(argp, clnt)
  2799. X    cs_volargs *argp;
  2800. X    CLIENT *clnt;
  2801. X{
  2802. X    static cs_volres res;
  2803. X
  2804. X    bzero((char *)&res, sizeof(res));
  2805. X    if (clnt_call(clnt, CS_PROC_GETVOL, xdr_cs_volargs, argp, xdr_cs_volres, &res, TIMEOUT) != RPC_SUCCESS) {
  2806. X        return (NULL);
  2807. X    }
  2808. X    return (&res);
  2809. X}
  2810. X
  2811. Xcs_xferres *
  2812. Xcs_proc_getxfer_1(argp, clnt)
  2813. X    nfs_fh *argp;
  2814. X    CLIENT *clnt;
  2815. X{
  2816. X    static cs_xferres res;
  2817. X
  2818. X    bzero((char *)&res, sizeof(res));
  2819. X    if (clnt_call(clnt, CS_PROC_GETXFER, xdr_nfs_fh, argp, xdr_cs_xferres, &res, TIMEOUT) != RPC_SUCCESS) {
  2820. X        return (NULL);
  2821. X    }
  2822. X    return (&res);
  2823. X}
  2824. X
  2825. Xcs_udares *
  2826. Xcs_proc_getuda_1(argp, clnt)
  2827. X    cs_udaargs *argp;
  2828. X    CLIENT *clnt;
  2829. X{
  2830. X    static cs_udares res;
  2831. X
  2832. X    bzero((char *)&res, sizeof(res));
  2833. X    if (clnt_call(clnt, CS_PROC_GETUDA, xdr_cs_udaargs, argp, xdr_cs_udares, &res, TIMEOUT) != RPC_SUCCESS) {
  2834. X        return (NULL);
  2835. X    }
  2836. X    return (&res);
  2837. X}
  2838. X
  2839. Xcs_geterrres *
  2840. Xcs_proc_geterr_1(argp, clnt)
  2841. X    cs_geterrargs *argp;
  2842. X    CLIENT *clnt;
  2843. X{
  2844. X    static cs_geterrres res;
  2845. X
  2846. X    bzero((char *)&res, sizeof(res));
  2847. X    if (clnt_call(clnt, CS_PROC_GETERR, xdr_cs_geterrargs, argp, xdr_cs_geterrres, &res, TIMEOUT) != RPC_SUCCESS) {
  2848. X        return (NULL);
  2849. X    }
  2850. X    return (&res);
  2851. X}
  2852. END_OF_FILE
  2853.   if test 3888 -ne `wc -c <'rpc/cs_prot_clnt.c'`; then
  2854.     echo shar: \"'rpc/cs_prot_clnt.c'\" unpacked with wrong size!
  2855.   fi
  2856.   # end of 'rpc/cs_prot_clnt.c'
  2857. fi
  2858. if test -f 'saps/csd-nanny.pl' -a "${1}" != "-c" ; then 
  2859.   echo shar: Will not clobber existing file \"'saps/csd-nanny.pl'\"
  2860. else
  2861.   echo shar: Extracting \"'saps/csd-nanny.pl'\" \(4704 characters\)
  2862.   sed "s/^X//" >'saps/csd-nanny.pl' <<'END_OF_FILE'
  2863. X#! /usr/local/bin/perl
  2864. X#
  2865. X#    csd-nanny --- csd OKIAGARI KOBOUSHI Project   Version 1.4
  2866. X#
  2867. X# Author: DEMIZU Noritoshi <demizu@nff.ncl.omron.co.jp>
  2868. X#
  2869. X# People trying to port csd to new platforms will find this script
  2870. X# extremely useful --- it was originally written to port csd on
  2871. X# Luna-II/Mach at OMRON Corporation.
  2872. X#
  2873. X# This perl script does the following things:
  2874. X# 1. If csd ran already, just quit.
  2875. X# 2. Start csd.
  2876. X# 3. Wait for the csd to core dump.
  2877. X# 4. Inspects core file and then takes snapshot of the debug session.
  2878. X# 5. Send resulting report mail to $csd_admmin.
  2879. X# 6. goto 2
  2880. X#
  2881. X# Debug session consists of: 1) stack trace using gdb, 2) last some lines
  2882. X# of wwfs.log.  Site administrators might want to insert dlog() around
  2883. X# the source code so that internal status can be obtained from wwfs.log.
  2884. X
  2885. Xrequire '/etc/csd.pl';
  2886. X
  2887. X
  2888. X# site configuration part
  2889. X$csd_path    = "$WWFSDIR/bin/csd";        # path of csd
  2890. X$csd_log    = "$WWFSDIR/log/wwfs.log";    # log of csd
  2891. X$csd_core    = "$WWFSDIR/core";        # core of csd
  2892. X$csd_uip_port    = 8002;                # csd UIP port number
  2893. X$csd_tmp    = "/tmp/csd-nanny-work$$";    # working file to report
  2894. X$csd_admin    = "wwfs";            # e-mail address of admin
  2895. X
  2896. X$log_lines    = 200;                # reported lines from wwfs.log
  2897. X$log_expired    = 28;                # older files will be expired
  2898. X
  2899. X$dbg_path    = "/usr/local/bin/gdb";        # debugger name
  2900. X$dbg_options    = "-q";                # options for the debugger
  2901. X$dbg_command    = "where\nquit\n";        # commands to the debugger
  2902. X$dbg_prompt    = "\\(gdb\\)";            # prompt of the debugger
  2903. X
  2904. X
  2905. X# check whether csd runs already or not.
  2906. Xif (&check_csd) {
  2907. X    print STDERR "csd is already running.\n";
  2908. X    exit 1;
  2909. X}
  2910. X
  2911. X# become daemon
  2912. X$nanny_pid = fork;
  2913. Xif ($nanny_pid < 0) {
  2914. X    die "can't fork $!, stopped";
  2915. X} elsif ($nanny_pid > 0) {
  2916. X    exit 0;
  2917. X}
  2918. Xclose(STDIN); close(STDOUT); close(STDERR);
  2919. X
  2920. X
  2921. X# infinite loop to keep csd running.
  2922. Xfor (;;) {
  2923. X    &launch;    # launch csd
  2924. X    ¬ify;    # notify this accident to csd admin.
  2925. X    &clean;    # remove old logs and cores
  2926. X    sleep 3;    # notify this accident to wwfs user :-)
  2927. X}
  2928. X
  2929. Xexit 1;        # will never reach.
  2930. X
  2931. X
  2932. X# launch csd and probe it periodically.
  2933. Xsub launch {
  2934. X    local($pid);
  2935. X
  2936. X    # check whether csd runs already or not.
  2937. X    if (&check_csd) {
  2938. X    print STDERR "csd is already running.\n";
  2939. X    exit 1;
  2940. X    }
  2941. X
  2942. X    # launch csd and wait for the csd to core dump.
  2943. X    $pid = fork;
  2944. X    die "can't fork $!, stopped" if ($pid < 0);
  2945. X    if ($pid == 0) {
  2946. X    # child process
  2947. X    exec $csd_path, "foreground";
  2948. X    die "can't exec $csd_path: $!, stopped";    # will never reach
  2949. X    } else {
  2950. X    # parent process
  2951. X    waitpid($pid, 0);                # wait for child
  2952. X    #&probe;
  2953. X    }
  2954. X}
  2955. X
  2956. X
  2957. X# notify this accident to csd administrator
  2958. X# by sending report on csd stack trace and tailing $log_lines lines of wwfs.log
  2959. Xsub notify {
  2960. X    local($year, $mon, $day, $hour, $min, $sec)
  2961. X                    = (localtime(time))[5,4,3,2,1,0];
  2962. X    local($date) = sprintf("%02d%02d%02d-%02d%02d%02d",
  2963. X            $year, $mon+1, $day, $hour, $min, $sec);
  2964. X
  2965. X    &dbg_info($date);
  2966. X    system("tail -$log_lines $csd_log >> $csd_tmp");
  2967. X    system("/usr/ucb/mail -s csd-down-info.$date $csd_admin < $csd_tmp");
  2968. X    unlink($csd_tmp);
  2969. X
  2970. X    rename($csd_log, "$csd_log.$date")   if (-f $csd_log);
  2971. X    rename($csd_core,"$csd_core.$date")  if (-f $csd_core);
  2972. X}
  2973. X
  2974. X
  2975. X
  2976. X# save debugging information into a file "$csd_tmp",
  2977. X# if core and debugger were available.
  2978. Xsub dbg_info {
  2979. X    local($id) = @_;
  2980. X    local(@cmds, $cmd);
  2981. X
  2982. X    return if (!-r $csd_core || !-x $dbg_path);
  2983. X    open(DEBUG, "| $dbg_path $dbg_options $csd_path $csd_core > $csd_tmp-d")
  2984. X                                || return;
  2985. X    print DEBUG $dbg_command;
  2986. X    close(DEBUG);
  2987. X
  2988. X    if (!defined($dbg_prompt) || $dbg_prompt eq "") {
  2989. X    rename("$csd_tmp-d", $csd_tmp);
  2990. X    return;
  2991. X    }
  2992. X
  2993. X    @cmds = split(/\n/, $dbg_command);
  2994. X    open(TMPD, "$csd_tmp-d") || return;
  2995. X    open(TMP, ">$csd_tmp") || return;
  2996. X    print TMP "% $dbg_path $dbg_options $csd_path $csd_core.$id\n";
  2997. X    while (<TMPD>) {
  2998. X    if (/($dbg_prompt)/i) {
  2999. X        # replace prompt with prompt+command
  3000. X        $cmd = shift(@cmds);
  3001. X        s/($dbg_prompt)\s+/$1 $cmd\n/i;
  3002. X    }
  3003. X    print TMP;
  3004. X    }
  3005. X    print TMP "\n\n\n";
  3006. X    print TMP "---- $csd_log.$id\n";
  3007. X    close(TMPD);
  3008. X    close(TMP);
  3009. X    unlink("$csd_tmp-d");
  3010. X}
  3011. X
  3012. X
  3013. X# checks whether csd is already running or not.
  3014. X# return code means:
  3015. X#    1: csd is running already
  3016. X#    0: csd isn't running yet.
  3017. Xsub check_csd {
  3018. X    require "sys/socket.ph";
  3019. X    socket(SOCK, &AF_INET, &SOCK_STREAM, 0) || die "socket: $!";
  3020. X    $dstaddr = pack('S n a4 x8', &AF_INET,
  3021. X        $csd_uip_port, (gethostbyname("localhost"))[4]);
  3022. X    $result = connect(SOCK, $dstaddr);
  3023. X    print SOCK "QUIT\n" if ($result);
  3024. X    close(SOCK);
  3025. X    return $result;
  3026. X}
  3027. X
  3028. X
  3029. Xsub clean {
  3030. X    while (<$csd_log.*>) {
  3031. X    unlink if (-M $_ > $log_expired);
  3032. X    }
  3033. X    while (<$csd_core.*>) {
  3034. X    unlink if (-M $_ > $log_expired);
  3035. X    }
  3036. X}
  3037. END_OF_FILE
  3038.   if test 4704 -ne `wc -c <'saps/csd-nanny.pl'`; then
  3039.     echo shar: \"'saps/csd-nanny.pl'\" unpacked with wrong size!
  3040.   fi
  3041.   chmod +x 'saps/csd-nanny.pl'
  3042.   # end of 'saps/csd-nanny.pl'
  3043. fi
  3044. echo shar: End of archive 17 \(of 22\).
  3045. cp /dev/null ark17isdone
  3046. MISSING=""
  3047. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ; do
  3048.     if test ! -f ark${I}isdone ; then
  3049.     MISSING="${MISSING} ${I}"
  3050.     fi
  3051. done
  3052. if test "${MISSING}" = "" ; then
  3053.     echo You have unpacked all 22 archives.
  3054.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  3055. else
  3056.     echo You still must unpack the following archives:
  3057.     echo "        " ${MISSING}
  3058. fi
  3059. exit 0
  3060. exit 0 # Just in case...
  3061.